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 constraint files? #224

Open
webknjaz opened this issue Aug 1, 2023 · 4 comments · May be fixed by #225
Open

Support constraint files? #224

webknjaz opened this issue Aug 1, 2023 · 4 comments · May be fixed by #225

Comments

@webknjaz
Copy link

webknjaz commented Aug 1, 2023

It'd be nice to have an equivalent of pip install -r requirements.txt -c constraints.txt. This would especially benefit projects that use pip-tools.

@chrissimpkins
Copy link
Contributor

chrissimpkins commented Aug 2, 2023

docs for the constraints file to support this request: https://pip.pypa.io/en/stable/user_guide/#constraints-files

@chrissimpkins chrissimpkins changed the title Support constaint files? Support constraint files? Aug 2, 2023
@chrissimpkins chrissimpkins linked a pull request Aug 2, 2023 that will close this issue
@chrissimpkins
Copy link
Contributor

chrissimpkins commented Aug 2, 2023

Mind testing the implementation in #225 @ commit 6423874?

You'll need to use the following GHA workflow configuration:

uses: py-actions/py-dependency-install@642387473628e92c4b9ac198b5ba51b9102d3f08

If you use a custom requirements.txt path, the input field name changed to requirements-path. You can now define a constraints file with the input field name: constraints-path. In the current implementation, constraints files are an off by default option that must be explicitly defined with a path to a constraints file. Requirements file installs remain in use by default and defined at requirements.txt by default.

Let me know if that works for you. If that does the trick, I'll update the docs, merge, and cut a new major release (the path to requirements-path change is backwards incompatible).

Ty!

@chrissimpkins
Copy link
Contributor

Still haven't received feedback here to confirm that this addresses the issue. Can anyone confirm so that we can land this if it is important to anyone out there?

@webknjaz
Copy link
Author

@chrissimpkins I made some notes on your PR. I don't use the action personally, but some projects I contribute to, do. So they'll get the update upon release. In general, what you did will work. Though, with my suggestions, the things will go smoother. Especially, the recommendation to use the env var, which is going to be even more useful as we've merged a PR in pip-tools that allows generating constraints for PEP 517 build deps.

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

Successfully merging a pull request may close this issue.

2 participants