-
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
Improve error message on PEP 440 constraint parsing failure #4597
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm also hitting this head-on and have to resort to |
You haven't provided sufficient detail to understand your particular scenario, but it sounds like you may be trying to install Poetry and your project both outside a virtual environment. That is full of foot-guns and ill-advised. Use of a virtual environment is strongly suggested and protects you against all manner of surprises. |
I'm not sure I follow. Running Poetry itself is installed in the user space via |
You mentioned manually managing a virtual environment -- without individual steps and command, what workflow you are using/what problem you are running into is unclear. |
I'm still seeing the old error message as of head today: Invalid PEP 440 version: '0.23ubuntu1' |
You're not on a HEAD version of poetry-core. |
ahah, thank you! |
Ok, defintely on head python-core now, Still same behaviour.
|
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. |
Feature Request
Poetry version: 1.2.0a2
Problem
When any dependency in the dependency tree contains an invalid PEP 440 constraint, Poetry fails with the following error:
There is no mention of which package Poetry is attempting to parse the constraint for. This makes it extremely difficult to find out where the problem lies. In a project with even ten dependencies there could be hundreds of derived dependencies, and it could be any one of those which is failing.
I have attempted to increase the verbosity, but it is still rather difficult to work with. One needs to look at the dependencies that appear last in the output and then look for them in the output of
poetry show --tree
and then go looking up thesetup.py
for each of those until you find one with a constraint that matches the error.Proposal
I propose that Poetry add the package name and version being parsed to this error message. eg:
Workaround
You can use pdb to find the package and version causing you problems, though it's non-obvious and has some issues so it's not really a workable solution for most users.
poetry==1.2.0a2
and the constraint exception raises from here:up
andargs
a few times to walk back up the stack, until you see something like this:Voila! This is the package that triggered the constraint exception. Bump it or pin it to a version that has a valid constraint (and if it's the latest release for that package, help out the maintainer with an issue or PR to fix it up!).
7. Send the
q
pdb command twice to exit the interpreter.The text was updated successfully, but these errors were encountered: