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

pip currently supports invalid PEP-508 specifiers #11746

Closed
1 task done
pelson opened this issue Jan 24, 2023 · 4 comments
Closed
1 task done

pip currently supports invalid PEP-508 specifiers #11746

pelson opened this issue Jan 24, 2023 · 4 comments
Labels
type: bug A confirmed bug or unintended behavior

Comments

@pelson
Copy link
Contributor

pelson commented Jan 24, 2023

Description

As mentioned in https://discuss.python.org/t/pip-supporting-non-pep508-dependency-specifiers/23107, pip currently supports a specifier such as numpy>='1.20', but this is not supported in PEP-508, nor is it supported in packaging.requirements.

Expected behavior

pip should not install such invalid version specifiers - it should follow the specs that have been formalised. Since this would be a breaking change, I suspect we would want to raise a good exception, but have a feature flag to re-enable the existing behaviour.

Unfortunately, it is not clear to me whether that feature flag can ever be removed, as this would prohibit existing packages (e.g. flox) from being installed.

pip version

all

Python version

all

OS

all

How to Reproduce

python -m pip install flox==0.6.7

Output

It installs just fine, despite having invalid specifiers.

Code of Conduct

@pelson pelson added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 24, 2023
@pradyunsg
Copy link
Member

Consolidating into #11715

@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Jan 24, 2023
@merwok
Copy link

merwok commented Jan 24, 2023

Would help if the specific invalid specifiers would be noted in the ticket! 🙂

@pradyunsg
Copy link
Member

They are? (the numpy one)

@merwok
Copy link

merwok commented Jan 24, 2023

Ah right, missed it in the first line!

Is the problem with the quotes?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants