Block a Python release until a compatible version of selected projectsis available.
The Python release manager can decide to release Python even if aproject is not compatible, if they decide that the project is going tobe fixed soon enough, or if the issue severity is low enough.
The PEP involves maintainers of the selected projects in the Pythonrelease cycle. There are multiple benefit:
Currently, Python beta versions are available four months before thefinal 3.x.0 release.
Bugs reported during the beta phase can be easily fixed and can block arelease if they are serious enough.
Incompatible changes are discussed during the beta phase: enhancedocumentation explaining how to update code, or consider to revert thesechanges.
Even if more and more projects are tested on the master branch of Pythonin their CI, too many projects of the top 50 PyPI projects are onlycompatible with the new Python a few weeks, or even months, after thefinal Python release.
Python has well defined process to deprecate features. ADeprecationWarning must be emitted during at least one Python release,before a feature can be removed.
In practice, DeprecationWarning warnings are ignored for years in majorPython projects. Usually, maintainers explain that there are too manywarnings and so they simply ignore warnings. Moreover, DeprecationWarningis silent by default (except in the__main__ module:PEP 565).
Even if more and more projects are running their test suite withwarnings treated as errors (-Werror), Python core developers stillhave no idea how many projects are broken when a feature is removed.
When issues and incompatible changes are discovered and discussed afterthe final Python release, it becomes way more complicated and expensiveto fix Python. Once an API is part of an official final release, Pythonshould provide backward compatibility for the whole 3.x releaselifetime. Some operating systems can be shipped with the buggy finalrelease and can take several months before being updated.
Too many projects are only updated to the new Python after the finalPython release, which makes this new Python version barely usable to runlarge applications when Python is released.
It is proposed to block a Python release until a compatible version ofall selected projects is available.
ThePEP 602: Annual Release Cycle for Python and thePEP 605: Arolling feature release stream for CPython would like to releasePython more often to ship new features more quickly.
The problem is that each Python3.x release breaks many projects.
Coordinated Python releases reduces the number of broken projects andmakes new Python release more usable.
By default, a Python release is blocked until a compatible version ofall selected projects is available.
Before releasing the final Python version, the Python release manager isresponsible to send a report of the compatibility status of each projectof the selected projects. It is recommended to send such report ateach beta release to see the evolution and detects issues as soon aspossible.
The Python release manager can decide to release Python even if aproject is not compatible, if they decide that the project is going tobe fixed soon enough, or if the issue severity is low enough.
After each Python release, the project list can be updated to removeprojects and add new ones. For example, to remove old unuseddependencies and add new ones. The list can grow if the whole processdoesn’t block Python releases for too long.
When a build or test issue with the next Python version is reported to aproject, maintainers have one month to answer. With no answer, theproject can be excluded from the list of projects blocking the Pythonrelease.
Multiple projects are already tested on the master branch of Python in aCI. Problems can be detected very early in a Python release which shouldprovide enough time to handle them. More CI can be added for projectswhich are not tested on the next Python yet.
Once selected projects issues are known, exceptions can be discussedbetween the Python release manager and involved project maintainers on acase-by-case basis. Not all issues deserve to block a Python release.
List of projects blocking a Python release (total: 27):
Projects used by to build Python should be in the list, like Sphinx.
Most popular projects are picked from the most downloaded PyPI projects.
Most of project dependencies are included in the list as well, since asingle incompatible dependency can block a whole project. Somedependencies are excluded to reduce the list length.
Test dependencies as pytest and tox should be included as well. If aproject cannot be tested, a new version cannot be shipped neither.
The list should be long enough to have a good idea of the cost ofporting a project to the next Python, but small enough to not block aPython release for too long.
Obviously, projects which are not part of the list also are encouragedto report issues with the next Python and to have a CI running on thenext Python version.
The definition here is large: any Python change which cause an issuewhen building or testing a project.
See also thePEP 606: Python Compatibility Version for more examples ofincompatible changes.
There are different kinds of incompatible changes:
'm'(which stands for pymalloc) fromsys.abiflags which impacts Pythonvendors like Linux distributions.os.errno alias to theerrno module.int,rejectfloat).interp->modules (PyImport_GetModuleDict() should be usedinstead).One of theZen of Python (PEP 20) motto is:
There should be one– and preferably only one –obvious way to doit.
When Python evolves, new ways emerge inevitably.DeprecationWarningare emitted to suggest to use the new way, but many developers ignorethese warnings which are silent by default.
Sometimes, supporting both ways has a minor maintenance cost, but Pythoncore developers prefer to drop the old way to clean up the Python codebase and standard library. Such kind of change is backward incompatible.
More incompatible changes than usual should be expected with the end ofthe Python 2 support which is a good opportunity to cleaning up oldPython code.
Checking if selected projects are compatible with the master branchof Python can be automated using a distributed CI.
Existing CIs can be reused.
New CIs can be added for projects which are not tested on the nextPython yet.
It is recommended to treat DeprecationWarning warnings as errors whentesting on the next Python.
A job testing a project on the next Python doesn’t have to be“mandatory” (block the whole CI). It is fine to have failures during thebeta phase of a Python release. The job only has to pass for the finalPython release.
This document is placed in the public domain or under theCC0-1.0-Universal license, whichever is more permissive.
Source:https://github.com/python/peps/blob/main/peps/pep-0608.rst
Last modified:2025-02-01 08:55:40 GMT