Skip to content

Commit 8213504

Browse files
committed
Discourage use of version epochs
Add a note discouraging use of epochs in version specifiers, and update the versioning discussion accordingly. While at it, suggest using two-digit years for CalVer, as mentioned in the discussion thread. Discussion: https://discuss.python.org/t/discouraging-use-of-epoch-segments-in-versions/105811/1 Signed-off-by: Michał Górny <mgorny@quansight.com>
1 parent 11477a6 commit 8213504

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
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/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)