deadsnakes / issues

Issues for https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
86 stars 6 forks source link

Cross-post `poetry` can't use 3.11 nightly #233

Closed dimaqq closed 1 year ago

dimaqq commented 1 year ago

https://github.com/python-poetry/poetry/issues/6925

I'v just installed Python3.11 from deadsnakes/nightly.

Poetry can't use it, because the Python version has a + in it.

Invalid PEP 440 version: '3.11.0+' is all I get 😭

As a mere mortal, I'm not sure who's wrong, dead snakes or poetry

asottile commented 1 year ago

poetry is wrong (lol as usual)

asottile commented 1 year ago

https://github.com/python-poetry/poetry/issues/6334 is a dupe -- the maintainers assumed it was a packaging version -- but it's the value from sys.version which doesn't have anything to do with PEP 440

radoering commented 1 year ago

The issue is about python_full_version, which according to PEP 508 is equal to platform.python_version(), which is '3.11.0+' in this case. Although I could not find a direct reference, the sample values for python_full_version in PEP 508 seem to indicate that it should be PEP 440 compliant.

However, there is an escape hatch for non-compliant versions:

The operators use the PEP 440 version comparison rules when those are defined (that is when both sides have a valid version specifier). If there is no defined PEP 440 behaviour and the operator exists in Python, then the operator falls back to the Python behaviour.

So far, so good.

However, if I'm right that implies a marker like python_full_version >= "3.9" is fulfilled for Python 3.11, but not for deadsnakes Python 3.11+. (IIUC, a version comparison should be used for the first one and a string comparison for the second one.) Wouldn't it be better to use a PEP 440 compliant version or am I wrong?

asottile commented 1 year ago

I don't choose the version string -- that's just how compiling python from source at a non-tag works