Test the next Python¶
To evolve and remain relevant, incompatible changes must happen in Python. Theproblem is how to migrate existing code to the “next” Python with theseincompatible changes.
Deprecation warnings¶
DeprecationWarning and PendingDeprecationWarning warnings are hidden bydefault, to not bother users. Developers can use-Wd
(-Wdefault
)command line option on Python which displays these warnings.
What’s New in Python 3.9:You should check for DeprecationWarning in your codesection.
Top 5000 PyPI packages¶
Download sdist and code search¶
Run the search in parallel on all CPUs
Ignore C files generated by Cython
Ignore file extensions (programs, archives, HTML, etc.)
JSON¶
You candownload a list of top 5000 PyPI packages in JSON format from hugovksite.
INADA-san’s script to download sdist packages from the JSON file:download_sdist.py.
Note that this script doesn’t download packages without sdist (e.g. onlyuniversal wheel). It is because INADA-san has searched Python/C API. The painof the removal can be reduced by fixing most of top 4000 packages.
HPy project¶
top4000-pypi-packages: Dump of Python/C APIusage in the top 4000 Python packages. Created in June 2021.
You can use GitHub search in this repository to search for a code pattern.
Searching deprecated API usage¶
Sourcegraph¶
GitHub code search is not powerful enough and there is a lot of noise. (e.g.many people copy CPython source code). On the other hand, Sourcegraph onlysearches from major repositories, and has powerful filtering. Example:search PyEval_ReleaseLock.
Fedora COPR¶
Test Rawhide (future Fedora 33) with Python 3.9 as the “system Python”:https://copr.fedorainfracloud.org/coprs/g/python/python3.9/
pythonci project¶
Docker images¶
Barry Warsaw maintainsCI Images for Python. Example:.gitlab-ci.yml of flufl.lock.