The sdist for 0.21 release is versioned "0.21.post1" but the directory inside it is "0.21". Therefore, it is not installable:
$ pip install --no-binary docutils docutils
Collecting docutils
Downloading docutils-0.21.post1.tar.gz (2.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.2/2.2 MB 6.1 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Discarding https://files.pythonhosted.org/packages/67/9a/ff2ff8e922f3b97c4b4864ca6c78d76ca5969bd730560001167b7054ac48/docutils-0.21.post1.tar.gz (from https://pypi.org/simple/docutils/) (requires-python:>=3.9): Requested docutils from https://files.pythonhosted.org/packages/67/9a/ff2ff8e922f3b97c4b4864ca6c78d76ca5969bd730560001167b7054ac48/docutils-0.21.post1.tar.gz has inconsistent version: expected '0.21.post1', but metadata has '0.21'
Downloading docutils-0.20.1.tar.gz (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 9.4 MB/s eta 0:00:00
[
+1 for this bug.
It looks like we need a 0.21.post2 asap.
Sorry for the hassle.
Not trying to pass the buck here but it seems like this is an edge case in handling post-release version specifiers which are allowed and are not technically a new release.It would be good if pip properly allowed the metadata.
https://packaging.python.org/en/latest/specifications/version-specifiers/#post-releaseshttps://github.com/python-poetry/poetry/issues/9293#issuecomment-2048205226
Okay re-reading the version specifiers and the core metadata requirements, I think it was just botched as the PGK-INFO should match the real version.
https://packaging.python.org/en/latest/specifications/core-metadata/#version
Last edit: Joe 2024-04-10
not the directory is wrong but
the release .post# is for small changes, in this case no change to the code
but if the metadata
but i guess pypi makes it a new release if the metadata version is different
i tried 0.21.post2 on testpypi ... it is a new release marked as micro(bial) different
but maybe it helps some people and hopefully does not break other places
asap
that's fair. a new release would smooth things over.
+1
C:>
C:>pip install docutils
Defaulting to user installation because normal site-packages is not writeable
Collecting docutils
Using cached docutils-0.21.post1.tar.gz (2.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Discarding https://files.pythonhosted.org/packages/67/9a/ff2ff8e922f3b97c4b4864ca6c78d76ca5969bd730560001167b7054ac48/docutils-0.21.post1.tar.gz (from https://pypi.org/simple/docutils/) (requires-python:>=3.9): Requested docutils from https://files.pythonhosted.org/packages/67/9a/ff2ff8e922f3b97c4b4864ca6c78d76ca5969bd730560001167b7054ac48/docutils-0.21.post1.tar.gz has inconsistent version: expected '0.21.post1', but metadata has '0.21'
Using cached docutils-0.21-py3-none-any.whl.metadata (2.7 kB)
Using cached docutils-0.21-py3-none-any.whl (587 kB)
Installing collected packages: docutils
Successfully installed docutils-0.21
C:>
0.21.1 is out.
Just for the record, doing
.postreleases is fine but you need to make sure to update the version string in metadata, and then create and upload new sdists and all wheels. You can't use.postto replace a subset of files.Currently, the Docutils version policy does not provide for a "post" element in
docutils.:__version_info__.Is there an advantage in using "post1" over increasing the "minor" number that makes it worth changing the policy?
Not, in my opinion. In fact, I personally prefer regular point versions, as they are shorter to type ;-).