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
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

Tools like airflow has some constraints that need be respected, for example, when are adding dependencies in a docker image.

This project could add constraints that accept a list of FQDN with all constraints. For example:

contrains = [
  "https://raw.githubusercontent.com/apache/airflow/constraints-1.10.12/constraints-3.7.txt",
  "file://{CWD}/constraints.txt"
]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:17
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
potiukcommented, Dec 22, 2020

Just a comment here as the original author of the Airflow constraints.idea and CI behind it. The constraints are very different from lock files of poetry as far as I understand it. They are a simple snapshot of all dependencies that are ‘guaranteed’ to work. But you are still free to use other versions if you want and by specifying constraint you do not fix the version, you merely set a 'starting point for your installation.

The thing is that airflow is both application and library - we want to be able to provide to our users an installation method that works and produces ‘working set of non-conflicting dependencies’ as well as enable the user to upgrade the library if needed after airflow is installed (as long as this upgrade is ok for airflow). Airflow has many extras and some users install just one or two extras which can easily get latest versions of dependent libraries.

But when you combine it with other extras which have different requirements it might be that latest version of the common dependency is not good. Constraints is the way to say ‘with those constraints you can install any combination of extras’ and not only they will cleanly install but also all 4000+ tests of Airflow pass. Yeah we run all the possible tests automatically before we (automatically) upgrade the constraints - and it is our CI that takes care of it.

5reactions
honnixcommented, Apr 29, 2021

Took a stab at this.

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 >
Support for pip --constraint · Issue #4464 · pypa/pipenv - GitHub
@uranusjr a case in which a constraint should not be placed in the Pipfile is when the constraint is intended to be relative...
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 >

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