Skip to content

Commit c5b2ce8

Browse files
authored
Merge branch 'main' into bot/update-uv-build-version
2 parents 1212a11 + 95b5ae4 commit c5b2ce8

File tree

5 files changed

+43
-26
lines changed

5 files changed

+43
-26
lines changed

source/discussions/versioning.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ examples of version numbers [#version-examples]_:
2727
- A post-release of an alpha release (possible, but discouraged): ``1.2.0a1.post1``
2828
- A simple version with only two components: ``23.12``
2929
- A simple version with just one component: ``42``
30-
- A version with an epoch: ``1!1.0``
30+
- A version with an epoch (discouraged): ``1!1.0``
3131

3232
Projects can use a cycle of pre-releases to support testing by their users
3333
before a final release. In order, the steps are: alpha releases, beta releases,
@@ -46,13 +46,14 @@ notes. They should not be used for bug fixes; these should be done with a new
4646
final release (e.g., incrementing the third component when using semantic
4747
versioning).
4848

49-
Finally, epochs, a rarely used feature, serve to fix the sorting order when
50-
changing the versioning scheme. For example, if a project is using calendar
51-
versioning, with versions like 23.12, and switches to semantic versioning, with
52-
versions like 1.0, the comparison between 1.0 and 23.12 will go the wrong way.
53-
To correct this, the new version numbers should have an explicit epoch, as in
54-
"1!1.0", in order to be treated as more recent than the old version numbers.
55-
49+
Finally, epochs were intended to fix the sorting order when changing the
50+
versioning scheme. For example, if a project was using calendar versioning, with
51+
versions like ``23.12``, and switched to semantic versioning, with versions like
52+
``1.0``, the comparison between ``1.0`` and ``23.12`` would go the wrong way. To
53+
correct this, the new version numbers would have an explicit epoch, as in
54+
``1!1.0``, in order to be treated as more recent than the old version numbers.
55+
However, this is discouraged, and it is preferable to use a higher version
56+
number that is unlikely to cause user confusion, such as ``100.0``.
5657

5758

5859
Semantic versioning vs. calendar versioning

source/guides/multi-version-installs.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,3 @@ time, but that approach does mean that standard command line invocations of
3737
the affected tools can't be used - it's necessary to write a custom
3838
wrapper script or use ``python3 -c '<command>'`` to invoke the application's
3939
main entry point directly.
40-
41-
Refer to the `pkg_resources documentation
42-
<https://setuptools.readthedocs.io/en/latest/pkg_resources.html#workingset-objects>`__
43-
for more details.

source/guides/packaging-namespace-packages.rst

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ Legacy namespace packages
159159

160160
These two methods, that were used to create namespace packages prior to :pep:`420`,
161161
are now considered to be obsolete and should not be used unless you need compatibility
162-
with packages already using this method. Also, :doc:`pkg_resources <setuptools:pkg_resources>`
163-
has been deprecated.
162+
with packages already using one of these methods.
164163

165164
To migrate an existing package, all packages sharing the namespace must be migrated simultaneously.
166165

@@ -176,7 +175,7 @@ pkgutil-style namespace packages
176175
Python 2.3 introduced the :doc:`pkgutil <python:library/pkgutil>` module and the
177176
:py:func:`python:pkgutil.extend_path` function. This can be used to declare namespace
178177
packages that need to be compatible with both Python 2.3+ and Python 3. This
179-
is the recommended approach for the highest level of compatibility.
178+
was the recommended approach for the highest level of compatibility.
180179

181180
To create a pkgutil-style namespace package, you need to provide an
182181
:file:`__init__.py` file for the namespace package:
@@ -216,10 +215,18 @@ in the `pkgutil namespace example project`_.
216215
pkg_resources-style namespace packages
217216
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
218217

219-
:doc:`Setuptools <setuptools:index>` provides the `pkg_resources.declare_namespace`_ function and
218+
.. warning::
219+
220+
The information in this section is obsolete and is no longer functional
221+
(as of Setuptools 82.0.0). It is only retained for historical reference.
222+
223+
``pkg_resources`` has been deprecated and was fully removed in Setuptools 82.0.0.
224+
225+
:doc:`Setuptools <setuptools:index>` previously provided the ``pkg_resources.declare_namespace`` function and
220226
the ``namespace_packages`` argument to :func:`~setuptools.setup`. Together
221-
these can be used to declare namespace packages. While this approach is no
222-
longer recommended, it is widely present in most existing namespace packages.
227+
these could be used to declare namespace packages. While this approach is no
228+
longer supported, it may still be encountered in environments using older
229+
``setuptools`` versions.
223230
If you are creating a new distribution within an existing namespace package that
224231
uses this method then it's recommended to continue using this as the different
225232
methods are not cross-compatible and it's not advisable to try to migrate an
@@ -281,11 +288,3 @@ to :func:`~setuptools.setup` in :file:`setup.py`. For example:
281288
packages=find_packages()
282289
namespace_packages=['mynamespace']
283290
)
284-
285-
A complete working example of two pkg_resources-style namespace packages can be found
286-
in the `pkg_resources namespace example project`_.
287-
288-
.. _pkg_resources.declare_namespace:
289-
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#namespace-package-support
290-
.. _pkg_resources namespace example project:
291-
https://github.com/pypa/sample-namespace-packages/tree/master/pkg_resources

source/specifications/pypirc.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ indexes <Package Index>` (referred to here as "repositories"), so that you don't
1010
have to enter the URL, username, or password whenever you upload a package with
1111
:ref:`twine` or :ref:`flit`.
1212

13+
The :file:`.pypirc` file **SHOULD** be UTF-8 encoded.
14+
15+
Tools that read or write :file:`.pypirc` files may not function correctly
16+
if another character encoding is used.
17+
1318
The format (originally defined by the :ref:`distutils` package) is:
1419

1520
.. code-block:: ini

source/specifications/version-specifiers.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,21 @@ from an earlier epoch::
394394
1!1.1
395395
1!2.0
396396

397+
.. note::
398+
399+
Use of nonzero epochs is discouraged. They are often not supported or
400+
discouraged by downstream packaging where Python packages may need to be
401+
consumed, and due to their scarce use they may also not be well supported by
402+
Python packaging tools.
403+
404+
When version scheme needs to be changed, it is preferable to continue with
405+
monotonically increasing numbers in epoch zero. For example, the version
406+
2026.x could be unambiguously followed by 3000.x.
407+
408+
See `Discouraging use of epoch segments in versions
409+
<https://discuss.python.org/t/discouraging-use-of-epoch-segments-in-versions/105811>`__
410+
for the relevant discussion.
411+
397412

398413
.. _version-specifiers-normalization:
399414

@@ -1273,3 +1288,4 @@ History
12731288
- May 2025: Clarify that development releases are a form of pre-release when
12741289
they are handled.
12751290
- Nov 2025: Make arbitrary equality case insensitivity explicit.
1291+
- Jan 2026: The use of epochs was discouraged.

0 commit comments

Comments
 (0)