Movatterモバイル変換


[0]ホーム

URL:


Following system colour schemeSelected dark colour schemeSelected light colour scheme

Python Enhancement Proposals

PEP 608 – Coordinated Python release

PEP 608 – Coordinated Python release

Author:
Miro Hrončok <miro at hroncok.cz>,Victor Stinner <vstinner at python.org>
Status:
Rejected
Type:
Standards Track
Created:
25-Oct-2019
Python-Version:
3.9

Table of Contents

Abstract

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.

Rationale

The PEP involves maintainers of the selected projects in the Pythonrelease cycle. There are multiple benefit:

  • Detect more bugs before a Python final release
  • Discuss and maybe revert incompatible changes before a Python finalrelease
  • Increase the number of compatible projects when the new Python finalversion is released

Too few projects are involved in the Python beta phase

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.

DeprecationWarning is being ignored

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.

Need to coordinate

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.

Shorter Python release schedule

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.

Specification

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.

Limit the delay

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.

Selected projects

List of projects blocking a Python release (total: 27):

  • Projects (13):
    • aiohttp
    • cryptography
    • Cython
    • Django
    • numpy
    • pandas
    • pip
    • requests
    • scipy
    • Sphinx (needed to build Python)
    • sqlalchemy
    • pytest
    • tox
  • Direct and indirect dependencies (14):
    • certifi (needed by urllib3)
    • cffi (needed by cryptography)
    • chardet (needed by Sphinx)
    • colorama (needed by pip)
    • docutils (needed by Sphinx)
    • idna (needed by Sphinx and requests)
    • jinja2 (needed by Sphinx)
    • MarkupSafe (needed by Sphinx)
    • psycopg2 (needed by Django)
    • pycparser (needed by cffi)
    • setuptools (needed by pip and tons of Python projects)
    • six (needed by tons of Python projects)
    • urllib3 (needed by requests)
    • wheel (needed by pip)

How projects are selected

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.

Incompatible changes

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.

Examples

There are different kinds of incompatible changes:

  • Change in the Python build. For example, Python 3.8 removed'm'(which stands for pymalloc) fromsys.abiflags which impacts Pythonvendors like Linux distributions.
  • Change in the C extensions build. For example, Python 3.8 no longerlinks C extensions to libpython, and Python 3.7 removedos.errno alias to theerrno module.
  • Removed function. For example, collections aliases to ABC classeshave been removed in Python 3.9.
  • Changed function signature:
    • Reject a type which was previously accepted (ex: only acceptint,rejectfloat).
    • Add a new mandatory parameter.
    • Convert a positional-or-keyword parameter to positional-only.
  • Behavior change. For example, Python 3.8 now serializes XML attributesin their insertion order, rather than sorting them by name.
  • New warning. Since more and more projects are tested with all warningstreated as errors, any new warning can cause a project test to fail.
  • Function removed from the C API.
  • Structure made opaque in the C API. For example, PyInterpreterStatebecame opaque in Python 3.8 which broke projects accessinginterp->modules (PyImport_GetModuleDict() should be usedinstead).

Cleaning up Python and DeprecationWarning

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.

Distributed CI

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.

Copyright

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


[8]ページ先頭

©2009-2026 Movatter.jp