Dangers when changing versioning system for pypi packages?

Hi Package maintainers.

What are potential dangers when inheriting a repo where the packages are packaged using the date system 2021.6.11.136 and a new release is preferred to use the major.minor.patch system?

What could possibly go wrong?

You’ll want to prepend the new version numbers with an epoch so
they’ll sort correctly and people will be able to install the newest
versions instead of pip and friends thinking the new versions are
older than the date-based versions:

https://peps.python.org/pep-0440/#version-epochs
2 Likes

With no month=13, 2022.13.0 will then be the first major.minor.patch :slight_smile:

Why? I thought you wanted to get rid of the year in the version numbers.

The epoch allows you to change the versioning completely and sort all the new epoch versions after all the previous versions (with the implicit epoch 0).

In the new epoch (1) you can start as you want - for example 1.0:

1!1.0

This version will sort after all the version in the implicit epoch 0.

PS: I am not sure why the link in the post from @fungi is rendered verbatim (i.e. not clickable). Here it is again for easier access:

2 Likes

Interesting! Let me read the PEP and return.