Skip to content
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

Show the detailed error when facing invalid requirements #12713

Closed
1 task done
sbidoul opened this issue May 20, 2024 · 6 comments · Fixed by #12715
Closed
1 task done

Show the detailed error when facing invalid requirements #12713

sbidoul opened this issue May 20, 2024 · 6 comments · Fixed by #12715
Labels
type: enhancement Improvements to functionality
Milestone

Comments

@sbidoul
Copy link
Member

sbidoul commented May 20, 2024

Description

From #12691 (comment)

pip install --dry-run "python-hdf4>=0.10.0+dummy" prints ERROR: Invalid requirement: 'python-hdf4>=0.10.0+dummy'.

Expected behavior

The detailed, more informative error should be printed:

InvalidRequirement: Local version label can only be used with `==` or `!=` operators
    python-hdf4>=0.10.0+dummy
               ~~~~~~~~^

pip version

24.1b1

Python version

any

OS

any

How to Reproduce

pip install --dry-run "python-hdf4>=0.10.0+dummy"

Output

No response

Code of Conduct

@sbidoul sbidoul added type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels May 20, 2024
@sbidoul
Copy link
Member Author

sbidoul commented May 20, 2024

@stonebig as for a solution, you'll need to update the requirement to not include the +dummy part.

@sbidoul sbidoul added this to the 24.1 milestone May 20, 2024
@stonebig
Copy link
Contributor

stonebig commented May 20, 2024

I did it. I had the precise error message with the position.
Just reported the "+" no more tolerated in case it was to consider a bug

@sbidoul sbidoul added type: enhancement Improvements to functionality and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels May 20, 2024
@stonebig
Copy link
Contributor

so me puting only the first line of the error miss-leaded you. you may close this one

@sbidoul
Copy link
Member Author

sbidoul commented May 20, 2024

@stonebig what command did you use precisely? Because when I tried, the pip install command above did not report the error details.

@stonebig
Copy link
Contributor

stonebig commented May 20, 2024

... time to figure out I had temporarly fell back to pip-24.0. so with Pip-24.1b1, the method is

...WPy64-31300b1b\scripts>python -m pip install --pre  --no-index --trusted-host=None  --find-links=...\packages.srcreq -c ...\constraints.txt six

generating:

ERROR: Invalid requirement: 'python-hdf4>=0.10.0+dummy' (from line 437 of ...\constraints.txt)`

and no line below.
you are right: I allucinated the "detailed" error message, I don't see it either

@sbidoul
Copy link
Member Author

sbidoul commented May 20, 2024

Ok, thanks. I created #12715 to improve the error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants