-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Fix collecting deps for all extras in multiple input packages #1981
Conversation
72e84af
to
9024f18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! Could you please add a test that confirms the bug?
Yes 👍 How do you prefer the test to be implemented? I already have an example setup that fails when invoking from the command line. Should I add a test that runs from the command line or rather implement an internal test? |
@dragly I'd prefer a test in |
I have added a test in a fixup commit now. The succeeds now and will fail if you revert the first commit. By the way, I struggled a bit while developing this test because pytest consumed all output written to stdout and stderr. The usual |
I also see that there is a merge conflict now with tests/test_cli_compile.py. I can resolve that. Do you prefer that I do it in a merge commit or that I rebase this branch on main right away? |
I guess that's unimportant. |
4ae48d6
to
5f43741
Compare
Weirdly enough I see the output now. Not sure why it did not work earlier 🤔 |
Head branch was pushed to by a user without write access
@dragly I took a stab at updating the title — it should refer to one high-level effect, not the implementation details. The details/motivation are to be in the description if needed. Otherwise, it just looks like a non-atomic collection of loosely related changes being enumerated. Do you think this is accurate enough? |
Yes, that looks perfect! Thanks for updating it :) I agree with the rationale too 👍 |
@dragly thanks! I noticed, there's a coverage drop in this PR. Could you check it out and compensate for the lost lines? Especially, pay attention to the indirect changes tab in Codecov: https://app.codecov.io/gh/jazzband/pip-tools/pull/1981/indirect-changes. |
Previously, an error would always be thrown when running `compile` with `--all-extras` on multiple source files containing extras. The reason was that the first iteration over the first source file would fill the `extras` variable, which in the second iteration would trigger an error since both `all_extras` and `extras` would be set. This change moves the check outside the loop and early in the script to avoid unnecessary processing before throwing the error.
for more information, see https://pre-commit.ci
dadda63
to
5560ce0
Compare
Can't explain the test failure. It's about a missing
|
Could be an incomplete build deps pin (as in setuptools updated). I suppose using what #1681 addresses in our own tests could make things more stable. Dogfooding FTW! |
I will try, but have to admit I am not too familiar with reading Codecov reports. I looked at the page you linked and the documentation for indirect changes. It seems like it is not hitting a few conditional imports based on Python version. Is it possible that Python or pip versions change between this PR and the previous run that codecov compares to? Do you have other pointers on how you typically dig into a codecov change like this? |
Thank you! |
Sorry, this slipped my attention. If it's conditional imports, depending on the Python version, maybe some of the CI jobs failed to upload coverage (the codecov service can be flaky like that). |
Previously, an error would always be thrown when running
compile
with--all-extras
on multiple source files containing extras. The reason was that the first iteration over the first source file would fill theextras
variable, which in the second iteration would trigger an error since bothall_extras
andextras
would be set.This change moves the check outside the loop and early in the script to avoid unnecessary processing before throwing the error.
Further, only moving the check outside the loop would currently leave us with only the extras from the last
src_file
in the iteration oversrc_files
.This change also ensures all extras are in fact collected from all packages when
--all-extras
is passed as an argument.This fixes #1980
Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.