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

Support for --contstraint file #2896

Open
prudnikov opened this issue May 22, 2024 · 1 comment
Open

Support for --contstraint file #2896

prudnikov opened this issue May 22, 2024 · 1 comment
Labels
⭐ enhancement Improvements for existing features

Comments

@prudnikov
Copy link

prudnikov commented May 22, 2024

Is your feature/enhancement proposal related to a problem? Please describe.

PIP allows the use of constraint files. You can find more about it here https://pip.pypa.io/en/stable/user_guide/#constraints-files
Apache Airflow is one of the projects that heavily relies on the constraints file. We are having many problems with not being able to use the constraint file. We have to export dependencies to requirements.txt, add this constraint file location, and use PIP to install dependencies instead of using pdm install and leveraging pdm.lock.

I know PDM has a similar feature, but it is not usable with Apache Airflow. Here is an example of it https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.11.txt. As you can see it is over 700 lines, moving all of them to the pyproject.toml is a huge mess.

Another advantage of being able to specify constraint file is being able to host this file at some centralized location like Apache Airflow does.

It should be nice if PDM supports it. This is a blocker for us and I believe for many teams.

Describe the solution you'd like

Similar to resolution overrides, I can think of something like this

[tool.pdm.resolution]
constraint-file = "https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.11.txt"
@prudnikov prudnikov added the ⭐ enhancement Improvements for existing features label May 22, 2024
@prudnikov prudnikov changed the title Support for --contstraint file Support for --contstraint file May 22, 2024
@huxuan
Copy link
Contributor

huxuan commented May 22, 2024

pdm also supports reuse-installed update strategy. So if you just want to lock the versions according to the constraints, A potential workaround may be installing them before running pdm lock with --update-reuse-installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features
Projects
None yet
Development

No branches or pull requests

2 participants