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

Python: Honour --strip-extras flag of pip-compile #4439

Merged
merged 1 commit into from Nov 23, 2021

Conversation

NicolasT
Copy link
Contributor

The --strip-extras flag of pip-compile is useful to generate
contstraints files (instead of the more traditional requirements files)
from some constraints.in file.

Constraints files can't have extras markers on the packages (this
wouldn't make much sense indeed), hence they need to be stripped. Since
pip-tools 6.2.0 this is supported by using the --strip-extras flag.

This commit adds this as a 'recognized' flag: if it's found in an
existing foo.txt file, it will be passed to pip-compile when some
foo.in file is updated.

See: #3974 (comment)
See: #3974 (comment)
See: jazzband/pip-tools#1300 (comment)

The `--strip-extras` flag of `pip-compile` is useful to generate
contstraints files (instead of the more traditional requirements files)
from some `constraints.in` file.

Constraints files can't have extras markers on the packages (this
wouldn't make much sense indeed), hence they need to be stripped. Since
`pip-tools` 6.2.0 this is supported by using the `--strip-extras` flag.

This commit adds this as a 'recognized' flag: if it's found in an
existing `foo.txt` file, it will be passed to `pip-compile` when some
`foo.in` file is updated.

See: dependabot#3974 (comment)
See: dependabot#3974 (comment)
See: jazzband/pip-tools#1300 (comment)
@NicolasT NicolasT requested a review from a team as a code owner November 22, 2021 23:41
@NicolasT
Copy link
Contributor Author

(Note: I have no clue whether this is the right approach to add tests, and how to actually write proper tests in the given framework. Not a Ruby'ist either. So this is very much hit-and-miss)

@jurre
Copy link
Member

jurre commented Nov 23, 2021

I think this makes sense, letting CI run to make sure there aren't any unexpected side-effects, but thanks for contributing!

@NicolasT
Copy link
Contributor Author

Not sure how this change can cause a Bundler test to fail 🤔

@jurre
Copy link
Member

jurre commented Nov 23, 2021

Not sure how this change can cause a Bundler test to fail 🤔

That's not related, it's a known flaky test unfortunately

@jurre jurre merged commit 4af1cd4 into dependabot:main Nov 23, 2021
@NicolasT
Copy link
Contributor Author

Thanks for merging!

Are there any docs on how one can know whether/when this change landed in the Github-hosted Dependabot service?

@NicolasT
Copy link
Contributor Author

Looks like it's in prod, and it's achieving the desired result: I now get 'correct' (without extras) Dependabot PRs for my constraints.txt. Sweet!

@jurre
Copy link
Member

jurre commented Nov 25, 2021

Are there any docs on how one can know whether/when this change landed in the Github-hosted Dependabot service?

No docs on this currently, but typically once a PR is included in a release (you should get a mention in the release notes), we'll roll that out in production the same or next day.

Thanks again for the contribution!

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 this pull request may close these issues.

None yet

2 participants