Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions source/discussions/versioning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ examples of version numbers [#version-examples]_:
- A post-release of an alpha release (possible, but discouraged): ``1.2.0a1.post1``
- A simple version with only two components: ``23.12``
- A simple version with just one component: ``42``
- A version with an epoch: ``1!1.0``
- A version with an epoch (discouraged): ``1!1.0``

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

Finally, epochs, a rarely used feature, serve to fix the sorting order when
changing the versioning scheme. For example, if a project is using calendar
versioning, with versions like 23.12, and switches to semantic versioning, with
versions like 1.0, the comparison between 1.0 and 23.12 will go the wrong way.
To correct this, the new version numbers should have an explicit epoch, as in
"1!1.0", in order to be treated as more recent than the old version numbers.

Finally, epochs were intended to fix the sorting order when changing the
versioning scheme. For example, if a project was using calendar versioning, with
versions like ``23.12``, and switched to semantic versioning, with versions like
``1.0``, the comparison between ``1.0`` and ``23.12`` would go the wrong way. To
correct this, the new version numbers would have an explicit epoch, as in
``1!1.0``, in order to be treated as more recent than the old version numbers.
However, this is discouraged, and it is preferable to use a higher version
number that is unlikely to cause user confusion, such as ``100.0``.


Semantic versioning vs. calendar versioning
Expand Down
16 changes: 16 additions & 0 deletions source/specifications/version-specifiers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,21 @@ from an earlier epoch::
1!1.1
1!2.0

.. note::

Use of nonzero epochs is discouraged. They are often not supported or
discouraged by downstream packaging where Python packages may need to be
consumed, and due to their scarce use they may also not be well supported by
Python packaging tools.

When version scheme needs to be changed, it is preferable to continue with
monotonically increasing numbers in epoch zero. For example, the version
2026.x could be unambiguously followed by 3000.x.

See `Discouraging use of epoch segments in versions
<https://discuss.python.org/t/discouraging-use-of-epoch-segments-in-versions/105811>`__
for the relevant discussion.


.. _version-specifiers-normalization:

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