Show the detailed error when facing invalid requirements
Description
From https://github.com/pypa/pip/issues/12691#issuecomment-2120014310
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
- [X] I agree to follow the PSF Code of Conduct.
@stonebig as for a solution, you'll need to update the requirement to not include the +dummy part.
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
so me puting only the first line of the error miss-leaded you. you may close this one
@stonebig what command did you use precisely? Because when I tried, the pip install command above did not report the error details.
... 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
Ok, thanks. I created #12715 to improve the error message.