question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for pip --constraint

See original GitHub issue

Is your feature request related to a problem? Please describe.

Some projects recommend installing using pip with --constraint: pip install
apache-airflow==1.10.12
–constraint “https://raw.githubusercontent.com/apache/airflow/constraints-1.10.12/constraints-3.7.txt

It would be nice to have an equivalent pipenv command. The idea is that some project already provide all the resolved dependencies (an equivalent of the Pipfile.lock file) that should be input to the dependency resolution step.

Describe the solution you’d like

Add a --constraint parameter to pipenv that behaves as pip --constraint does.

Describe alternatives you’ve considered

I think there is no alternative but to drop the --constraint and hope that the dependencies’ version resolved by pipenv match the ones that in the project’s constraints.

Additional context

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:24
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
seawolf42commented, Apr 19, 2021

@uranusjr a case in which a constraint should not be placed in the Pipfile is when the constraint is intended to be relative to the lock file. In a monorepo situation, it is desireable to have a single Pipfile control dependencies as a whole and then have subsystems each list their own minimal list of requirements… pip --constraints <...> allows you to indicate that for that subsystem, if a dependency is explicitly or implicitly listed as a dependency, then the version used shall be the version in the constraints file, but if it isn’t listed as a dependency then it should not be. It would be very helpful if pipenv supported this as well.

3reactions
uranusjrcommented, Sep 21, 2020

I feel it would be much more explicit (and reproducible) if the constraints are put directly into Pipfile. Maybe what we should do instead is to have a way to sync constraint files and Pipfile, instead

Read more comments on GitHub >

github_iconTop Results From Across the Web

User Guide - pip documentation v22.3.1
Constraints files are requirements files that only control which version of a requirement is installed, not whether it is installed or not. Their...
Read more >
Pip constraints files - Blog | luminousmen
Pip constraints files ... In python, it is common practice to write all the application dependencies that are installed via pip into a...
Read more >
Yes, and in addition to the requirements file, pip supports a ...
Yes, and in addition to the requirements file, pip supports a constraints file, which is the lockfile you describe. It's separate from the...
Read more >
PIP Constraints Files - python - Stack Overflow
Constraints files are requirements files that only control which version of a requirement is installed, not whether it is installed or not.
Read more >
User Guide — pip 10.0.0.dev0 documentation
Constraints files are requirements files that only control which version of a requirement is installed, not whether it is installed or not. Their...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found