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

Convert exported requirements to constraints format #308

Merged
merged 20 commits into from
Mar 14, 2021

Conversation

cjolowicz
Copy link
Owner

@cjolowicz cjolowicz commented Mar 13, 2021

This PR fixes installation errors due to the use of some forms of requirements as constraints that are no longer supported with pip's new dependency resolver:

  • URL requirements
  • Path requirements
  • Requirements with extras
  • Editable requirements

Constraints are now rewritten in the form name==version[; markers], and skipped if either name or version are empty.

This PR adds a dependency on the packaging library.

Fixes #141

@cjolowicz cjolowicz added the bug Something isn't working label Mar 13, 2021
@cjolowicz cjolowicz force-pushed the fix-invalid-constraints branch 6 times, most recently from 85a2577 to 54bec74 Compare March 14, 2021 01:06
Add a failing test for URL dependencies.

Test output below:

  nox > Command python -m pip install
  --constraint=.nox/test/tmp/requirements.txt
  file:///…/url-dependency/dist/url_dependency-0.1.0-py3-none-any.whl failed
  with exit code 1:

  DEPRECATION: Constraints are only allowed to take the form of a package name
  and a version specifier. Other forms were originally permitted as an accident
  of the implementation, but were undocumented. The new implementation of the
  resolver no longer supports these forms. A possible replacement is replacing
  the constraint with a requirement.. You can find discussion regarding this at
  pypa/pip#8210.

  ERROR: Links are not allowed as constraints
@cjolowicz cjolowicz merged commit b2699b5 into main Mar 14, 2021
@cjolowicz cjolowicz deleted the fix-invalid-constraints branch March 14, 2021 01:30
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installation from path or url cannot be constrained to a version
1 participant