-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poetry is incompatible with unstable-tagged Python builds (Invalid PEP 440 version: '3.Y.Z+') #6925
Comments
Hmm, it looks like this could be a parse error with the Python version numbers provided by Deadsnakes? Looking closer at #6334, it looks like this might be a dupe. That issue was closed as a environment issue caused by bad versions in the target environment, but looking closer, that only represents the comments. The issue body, like this one, seems to be about a Python version. Deadsnakes versions tend to be like |
|
PTAL @radoering @dimbleby |
In the stack trace you can see that Stack trace
|
I re-read PEP 508 and there seems to be an escape hatch for non-compliant versions:
However, that implies |
Appending a '+' seems to be the convention in the python source https://github.com/python/cpython/blob/a9a8c8712665377cfa83af4b632b0db529ec1853/Include/patchlevel.h#L26 is presumably the origin of this you could try persuading them that using a PEP440-compatible version would be more sensible |
looks like that became #4021, but the reporter closed it just twenty minutes after opening it... |
I have the same issue using python 3.11 packaged inside the official debian repositories. My |
Btw., My current workaround: And same for 3.11. 🙏🏻 project maintainers, please consider this important 🙏🏻 |
I think it's obvious that deadsnakes in general is broken with Poetry as both 3.11 and 3.10 are GA versions. |
more like: choosing to use the nightly builds for python 3.10 and python 3.11 is the wrong choice for almost everyone at this point, since there are stable releases available. |
@dimaqq, I think you misunderstood my meaning -- if 3.11 is broken, it is reasonably obvious that 3.10 is also broken, as they are both GA versions (so the |
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 |
Ah, that would have been nice to have included in the reproduction and adds important context; the severity of this is much lower than I believed based on that. |
to be fair it is the very first sentence of the very opening of this thread |
The official package from the current Debian Testing and Unstable (https://tracker.debian.org/pkg/python3.11) has this issue, and it is not using nightly builds.
|
um, it obviously is using nightly builds. You can tell by the version number! probably "testing and unstable" is the clue |
Indeed, I am not worried about that case as much:
|
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 |
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. |
Right, but 3.10 is currently the primary Python version, and will be removed if there is a cut-over to 3.11, right?
Is that a statement of intent by Debian? The |
Yes, it'll be removed when possible.
We regularly ship a patch bringing in all the latest commits in the maintenance branch, not just the tagged releases. |
To be clear, I was saying this is now something to be seen, in general. Not specifically in Debian. It's common to be working with Python built out of the source tree (when developing cpython itself, or chasing down bugs in it, for example). I don't think Poetry should restrict itself to functioning correctly on release tags of cPython. |
I don't think anyone disputes that, but this is certainly not as hot a fire as we originally thought. PRs are welcome but this will likely be moderately invasive/painful to fix. |
Hi, what about something like this? (it works in my local tests in Debian)
|
That's far from the only place where we request the full Python version, and we'll still need to create robust tests. It's also very painfully hardcoded and without explanation outside blame; ideally we solve this in the code that actually parses the version. |
I wouldn't strip the "+" in general in the code parsing versions because it's definitively not valid for package versions (and at least a bad choice for the python version). I haven't searched for other places yet but remembering the failure on 3.11+ I think that is at least part of a correct fix. Of course we should add a comment why we are stripping the "+" and a test would be nice. |
My thinking is we should centralize it using a |
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. |
BTW, a simple workaround is to first create the virtualenv using the venv package (from the Python version you want to use), which Poetry will happily use. |
This happens for me if run If I use I have to be in a specific version, patch included, e.g. The workaround for me is
I am on macos |
the same problem happens to me.
|
The same thing on $ poetry run python --version
Python 3.11.2+ |
There is no need to comment with a 'me too' here -- this will be true for any non-release build of Python, so |
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. |
"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 #6925 (comment) and #7462 (comment) 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. |
Sorry for the noise to poetry maintainers, but as a general notice for So if you run |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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.
The text was updated successfully, but these errors were encountered: