poetry: Poetry is incompatible with unstable-tagged Python builds (Invalid PEP 440 version: '3.Y.Z+')
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 😭
P.S. if the wise men declare that deadsnakes is at fault here, I’ll happily bug dead snakes.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 37 (26 by maintainers)
I think it’s obvious that deadsnakes in general is broken with Poetry as both 3.11 and 3.10 are GA versions.
Maybe a ‘me too’ comment is not that useful from a development point of view, but it’ is a way to express that this issue is affecting many users.
I understand that fixing this will be invasive/painful, but I can’t agree that this is so low priority as it seems to be for you: Poetry is a development tool and IMHO it should be expected that users of Poetry use whatsoever Python version.
A quick note on Debian, too. If you want/need an up to date system, 90% of the time you can’t use Debian stable: you want testing, and you’ll probably install selected packages from experimental and/or PPAs. This is physiologically due to the “release when ready” Debian policy. I think the vast majority of Debian users are running testing most of the time (except when just released, obviously).
“Me too” is wholly unproductive – GitHub has 👍 for that, which both is surfaced in the UI as a voting method, and avoids sending unnecessary notifications. Browbeating the volunteer maintainers of a project is not the way to get an issue prioritized; typically the way to do that is by sending a patch.
#7462 is under review as one possible approach; if you want to see things move faster I would suggest sending your own PR with a combination of the feedback from https://github.com/python-poetry/poetry/issues/6925#issuecomment-1333245172 and https://github.com/python-poetry/poetry/pull/7462#discussion_r1096542675 incorporated.
I’m sorry that you feel Poetry is defective for your needs because of this issue; Poetry is not unique here, and as you can see from the linked issues, this is something of an ecosystem-wide problem. Regrettably, there is not infinite time in the day, and no one is paid to work on Poetry or sells you any sort of support. The best we can do is collaborate to improve the tool, and make things as actionable as possible so that maintainer time can be used as efficiently as possible.
Not sure whether it brings anything useful to the table, but the Python 3.12.0a2 ‘release’ (installed using pyenv) also reports its version as 3.12.0a2+ and thus fails to work with Poetry.
Hi, what about something like this? (it works in my local tests in Debian)
My thinking is we should centralize it using a
parse_python_version()variant that encapsulates the stripping of the+so we don’t randomly proliferate it in the codebase and get burned by a future omission. Theparse_python_version()code can just be a preprocessing step before we hand it to our regular version parsing code, and can be unit tested; we should also end-to-end test the main usage (inenv.py).Just checked and you are right. It is not using the actual final but some other commit from the 3.11 branch. Sorry about assuming it was, the packages from debian usually use official released tarballs.
Not really. The name is misleading, but
testingis just an alias to the codename that will become the next stable version, andunstableis where packages get uploaded and automatically get migrated to thetestingone if not issues are found. The debian team doesn’t usually upload nightly versions to any of those repositories (there’s aexperimentalrepository for that there), and those packages will be the ones in the final stable release (just as they are, no repacking or recompiling) as long as no critical issues are found and no new versions are released and packaged.Indeed, I am not worried about that case as much:
python3.11is explicitly experimental in unstable/testing; Debian does not ship Python versions in parallel under normal circumstancesto be fair it is the very first sentence of the very opening of this thread
Sorry for the noise to poetry maintainers, but as a general notice for
pyenvusers finding this issue ( @magniff @yssource @jshwi ): a pyenv python versionX.Y-devmeans development, and will have the+suffix. However, as the readme notes, most commands will auto-resolve to the latest version.So if you run
pyenv install 3.8, pyenv will install the latest3.8.z(no+), and if you runpyenv global 3.8, pyenv will set the latest installed3.8.zas your global. As*-devwill always be the latest if you have it installed, just make sure not to install a-devrelease, and you should be good.This happens for me if run
poetry installwithout an existing environment if i installedpoetryusingcurl -sSL https://install.python-poetry.org | python3 - --forcewhile underpyenv global 3.x-devIf I use
poetry env use 3.ythis works, but as long as3.y-devis not installed underpyenvI have to be in a specific version, patch included, e.g.
3.8.13when runningcurl -sSL https://install.python-poetry.org | python3 - --forcefor my forpoetryto work by default, without needing to usepoetry env use 3.<some_other_minor_version>as long as3.<some_other_minor_version>-devis not installedThe workaround for me is
pyenv install 3.8.13pyenv uninstall 3.8-devpyenv global 3.8.13curl -sSL https://install.python-poetry.org | python3 - --forceI am on macos
Debian Python person here:
It’s in the process of becoming supported. Hopefully for the next stable release, but that depends on how much of the world works with it, and whether we can fix the rest in time.
I wouldn’t really agree with either of these sentiments. But bugs aren’t the place to litigate that. I really don’t think Debian did anything wrong here. Poetry didn’t expect to see a + in a Python version, but they are now something to be expected, since 3.11. That’s about the extent of the issue, here.
the regular 3.10 build is not ‘broken’ and I imagine neither is 3.11, rather folk are choosing to use nightly builds.
I get my 3.10 from deadsnakes myself, and the versioning is completely normal:
that still leaves poetry confused by version numbers from nightly builds: but nearly no-one should have any reason to use those, certainly for pythons 3.10 and 3.11