| 1 |
======================== |
| 2 |
Sphinx's release process |
| 3 |
======================== |
| 4 |
|
| 5 |
Versioning |
| 6 |
---------- |
| 7 |
|
| 8 |
Sphinx adheres to :pep:`440` versions, with a ``major.minor.micro`` scheme for |
| 9 |
the *release segment* (e.g. 1.2.3). |
| 10 |
The major, minor, and micro version parts should be altered as follows: |
| 11 |
|
| 12 |
* The major version part should be incremented for incompatible behavior change and |
| 13 |
public API updates. |
| 14 |
|
| 15 |
* The minor version part should be incremented for most releases of Sphinx, where |
| 16 |
backwards-compatibility of API and features are preserves. |
| 17 |
|
| 18 |
* The micro version part should only be incremented for urgent bugfix-only releases. |
| 19 |
|
| 20 |
When the major version part is incremented, the minor and micro version parts |
| 21 |
must be set to ``0``. |
| 22 |
When the minor version part is incremented, the micro version part must be set |
| 23 |
to ``0``. |
| 24 |
|
| 25 |
New major versions should come with a beta-testing period before the final |
| 26 |
release. |
| 27 |
|
| 28 |
|
| 29 |
Deprecating a feature |
| 30 |
--------------------- |
| 31 |
|
| 32 |
There are a couple reasons that code in Sphinx might be deprecated: |
| 33 |
|
| 34 |
* If a feature has been improved or modified in a backwards-incompatible way, |
| 35 |
the old feature or behavior will be deprecated. |
| 36 |
|
| 37 |
* Sometimes Sphinx will include a backport of a Python library that's not |
| 38 |
included in a version of Python that Sphinx currently supports. When Sphinx |
| 39 |
no longer needs to support the older version of Python that doesn't include |
| 40 |
the library, the library will be deprecated in Sphinx. |
| 41 |
|
| 42 |
As the :ref:`deprecation-policy` describes, the first release of Sphinx that |
| 43 |
deprecates a feature (``A.B``) should raise a ``RemovedInSphinxXXWarning`` |
| 44 |
(where ``XX`` is the Sphinx version where the feature will be removed) when the |
| 45 |
deprecated feature is invoked. Assuming we have good test coverage, these |
| 46 |
warnings are converted to errors when running the test suite with warnings |
| 47 |
enabled:: |
| 48 |
|
| 49 |
pytest -Wall |
| 50 |
|
| 51 |
Thus, when adding a ``RemovedInSphinxXXWarning`` you need to eliminate or |
| 52 |
silence any warnings generated when running the tests. |
| 53 |
|
| 54 |
|
| 55 |
.. _deprecation-policy: |
| 56 |
|
| 57 |
Deprecation policy |
| 58 |
------------------ |
| 59 |
|
| 60 |
MAJOR and MINOR releases may deprecate certain features from previous |
| 61 |
releases. If a feature is deprecated in a release A.x, it will continue to |
| 62 |
work in all A.x.x versions (for all versions of x). It will continue to work |
| 63 |
in all B.x.x versions but raise deprecation warnings. Deprecated features |
| 64 |
will be removed at the C.0.0. It means the deprecated feature will work during |
| 65 |
2 MAJOR releases at least. |
| 66 |
|
| 67 |
So, for example, if we decided to start the deprecation of a function in |
| 68 |
Sphinx 2.x: |
| 69 |
|
| 70 |
* Sphinx 2.x will contain a backwards-compatible replica of the function |
| 71 |
which will raise a ``RemovedInSphinx40Warning``. |
| 72 |
This is a subclass of :exc:`python:PendingDeprecationWarning`, i.e. it |
| 73 |
will not get displayed by default. |
| 74 |
|
| 75 |
* Sphinx 3.x will still contain the backwards-compatible replica, but |
| 76 |
``RemovedInSphinx40Warning`` will be a subclass of |
| 77 |
:exc:`python:DeprecationWarning` then, and gets displayed by default. |
| 78 |
|
| 79 |
* Sphinx 4.0 will remove the feature outright. |
| 80 |
|
| 81 |
Deprecation warnings |
| 82 |
~~~~~~~~~~~~~~~~~~~~ |
| 83 |
|
| 84 |
Sphinx will enable its ``RemovedInNextVersionWarning`` warnings by default, if |
| 85 |
:envvar:`python:PYTHONWARNINGS` is not set. Therefore you can disable them |
| 86 |
using: |
| 87 |
|
| 88 |
* ``PYTHONWARNINGS= make html`` (Linux/Mac) |
| 89 |
* ``export PYTHONWARNINGS=`` and do ``make html`` (Linux/Mac) |
| 90 |
* ``set PYTHONWARNINGS=`` and do ``make html`` (Windows) |
| 91 |
|
| 92 |
But you can also explicitly enable the pending ones using e.g. |
| 93 |
``PYTHONWARNINGS=default`` (see the :ref:`Python docs on configuring warnings |
| 94 |
<python:describing-warning-filters>`) for more details. |
| 95 |
|
| 96 |
Python version support policy |
| 97 |
----------------------------- |
| 98 |
|
| 99 |
Sphinx supports at all minor versions of Python released in the past 3 years |
| 100 |
from the anticipated release date with a minimum of 3 minor versions of Python. |
| 101 |
This policy is derived from `SPEC 0`_, a scientific Python domain standard. |
| 102 |
|
| 103 |
.. _SPEC 0: https://scientific-python.org/specs/spec-0000/ |
| 104 |
|
| 105 |
For example, a version of Sphinx released in May 2025 would support Python 3.11, |
| 106 |
3.12, and 3.13. |
| 107 |
|
| 108 |
This is a summary table with the current policy: |
| 109 |
|
| 110 |
=========== ====== |
| 111 |
Date Python |
| 112 |
=========== ====== |
| 113 |
05 Oct 2023 3.10+ |
| 114 |
----------- ------ |
| 115 |
04 Oct 2024 3.11+ |
| 116 |
----------- ------ |
| 117 |
24 Oct 2025 3.12+ |
| 118 |
----------- ------ |
| 119 |
01 Oct 2026 3.13+ |
| 120 |
----------- ------ |
| 121 |
01 Oct 2027 3.14+ |
| 122 |
=========== ====== |
| 123 |
|
| 124 |
Release procedures |
| 125 |
------------------ |
| 126 |
|
| 127 |
The release procedures are listed in :file:`utils/release-checklist.rst`. |