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

Add -c/--constraint option to pip-compile #1936

Merged
merged 5 commits into from
Jul 27, 2023

Conversation

atugushev
Copy link
Member

@atugushev atugushev commented Jul 25, 2023

Contributor checklist
  • Provided the tests for the changes.
  • Assure PR title is short, clear, and good to be included in the user-oriented changelog
Maintainer checklist
  • Assure one of these labels is present: backwards incompatible, feature, enhancement, deprecation, bug, dependency, docs or skip-changelog as they determine changelog listing.
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@atugushev atugushev requested a review from a team July 27, 2023 03:29
multiple=True,
help=(
"Constrain versions using the given constraints file. "
"This option can be used multiple times."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other multiple=True options are using the exact phrase "may be used more than once" 🤷🏼

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Addressed in d5e13f7.

@@ -634,6 +634,7 @@ def test_callback_config_file_defaults(pyproject_param, new_default, make_config
("trusted_host", "not-a-list"),
("annotate", "not-a-bool"),
("max_rounds", "not-an-int"),
("constraint", "not-an-int"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed in d5e13f7.

@atugushev atugushev enabled auto-merge (squash) July 27, 2023 10:01
@atugushev
Copy link
Member Author

Thanks for the review @AndydeCleyre 🙏🏻

@atugushev atugushev merged commit b55abdc into jazzband:main Jul 27, 2023
34 checks passed
@AndydeCleyre
Copy link
Contributor

Not that it matters, but "not-an-list" -> "not-a-list"

@atugushev atugushev deleted the constraints-option branch July 27, 2023 15:23
@atugushev atugushev added this to the 7.2.0 milestone Aug 2, 2023
@honnix
Copy link
Contributor

honnix commented Dec 29, 2023

Thank you so much for adding this command line option! It seems only local file is supported. Is that correct? pip, however can use constraints file from any URL: https://pip.pypa.io/en/stable/user_guide/#constraints-files. Maybe that could be supported as well by pip-compile?

@honnix
Copy link
Contributor

honnix commented Dec 29, 2023

Maybe it could be as simple as removing click.Path type? That would skip local file validation unfortunately.

Updated: I tried that locally and it seems working.

@honnix
Copy link
Contributor

honnix commented Dec 29, 2023

I proposed a change in #2038. We could go extra steps to validate local file and remote file, but it doesn't seem to be absolutely necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to command line interface things feature Request for a new feature
Projects
None yet
4 participants