-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Ensure pip-tools
unions dependencies of multiple declarations of a package with different extras
#1486
Conversation
c30cd2b
to
a04f0fe
Compare
a04f0fe
to
a23ec03
Compare
I'm not sure if it would be expected, but I notice that this does not resolve #852, which is reproducible as (courtesy of @atugushev): $ printf '%s\n' '-e git+https://github.com/edx/django-rest-framework-oauth.git@0a43e8525f1e3048efe4bc70c03de308a277197c#egg=djangorestframework-oauth==1.1.1' 'edx-enterprise==1.7.2' >requirements.in
$ seq 1 10 | while read i; do echo "---- $i ----" && pip-compile -rqo- requirements.in | grep '^edx-opaque-keys'; done
---- 1 ----
edx-opaque-keys[django]==1.0.1
---- 2 ----
edx-opaque-keys==1.0.1
---- 3 ----
edx-opaque-keys==1.0.1
---- 4 ----
edx-opaque-keys[django]==1.0.1
---- 5 ----
edx-opaque-keys==1.0.1
---- 6 ----
edx-opaque-keys[django]==1.0.1
---- 7 ----
edx-opaque-keys[django]==1.0.1
---- 8 ----
edx-opaque-keys==1.0.1
---- 9 ----
edx-opaque-keys==1.0.1
---- 10 ----
edx-opaque-keys==1.0.1
|
a23ec03
to
4cf1198
Compare
Ah, interesting! Looks like related code, but a separate issue. I think I have a fix, but it might take a little time to formulate a good unit test (that doesn't require all of django). I can work on another PR for that. |
@AndydeCleyre Since this is still open, I pushed the fix for #852 here. |
Thank you, this is greatly appreciated! |
Can you say whether it would, or why it would not, make sense to integrate the new prep-proxy-to-get-name-to-get-key behavior in our |
3322017
to
d49534d
Compare
Great question. IMO based on the general intent of
Let me know what you think. |
@richafrank Thanks, you've articulated everything perfectly. I'm approving this now. @atugushev When you can please have a look at this and the above comment. |
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.
This is looking great and good to go as far as I'm concerned, with the note that we should figure out what to do about key_from_ireq
as per the discussion, as a follow up task. This is an important fix, thank you!
pip-tools
unions dependencies of multiple declarations of a package with different extras
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.
@richafrank, awesome fix! 🎉
tests/test_resolver.py
Outdated
@@ -299,6 +300,43 @@ def test_combine_install_requirements(repository, from_line): | |||
assert str(combined_all.req.specifier) == "<3.2,==3.1.1,>3.0" | |||
|
|||
|
|||
def test_combine_install_requirements_extras(repository, from_line, make_package): |
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.
Could you split each test block into different tests or parametrize tests if possible?
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.
Sounds good. I split it into two tests.
@AndydeCleyre Nice thoughts about |
@richafrank I've updated the PR's description to link fixed issues. Could you check please if everything is correct? |
with different extras resulted in a non-deterministic choice between the resolved dependencies of the different declared sets of extras.
ac2431c
to
ddb7c3a
Compare
Yep, looks good to me. |
Fixes #1451
Fixes #852
Fix for #1451 that uses the same simplification in #1452 but handles the case of combining editables (that lack names) as well, e.g.
test_editable_package_constraint_without_non_editable_duplicate
.This reverts the original solution for the test case above and replaces it. The original solution was to prepare the nameless ireqs early, so that they have a name. However:
This avoids issues with the ireq instances and the cache needing updates after mutating the
extras
for thecombined_ireq
, specifically #1451 . It means an extra preparation step for ireqs lacking names (preparing the proxy in addition to the ireq itself eventually), but that seems worthwhile (in my opinion).Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.