Skip to content

Conversation

@uranusjr
Copy link
Member

@uranusjr uranusjr commented Feb 7, 2019

Fix #6239. I added a unit test based on the issue to reflect the situation, so this can be caught if we fail to implement this in the new resolver.

Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

This would merge extras from constraints too, IIUC.

Could you fix that (by moving it under the conditional) and add a unit test to ensure that doesn't happen in the future?

@uranusjr
Copy link
Member Author

Could you fix that (by moving it under the conditional)

That’s exactly the old code 😛 I think the conditional needs to be split to make this work.

@uranusjr
Copy link
Member Author

I’ve updated the code to not merge extras from an incoming constraint, and add cases to cover variants.

Please help me make sure the new comments about early returns make sense.

Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

Logic change and comments look good to me; though I haven't actually rigorously tested this.

@pradyunsg
Copy link
Member

I think the conditional needs to be split to make this work.

Ah well. Sorry, I reviewed this on the web UI which is pretty bad for showing such things.


Does this fix the test in yaml/install/extras[3]? I think it would but again, haven't taken a good look yet.

@uranusjr
Copy link
Member Author

Let’s give it a shot.

@uranusjr
Copy link
Member Author

OK I get the test still fails… but why does it pass sometimes?

@cjerdonek
Copy link
Member

I only glanced at this, but could it be because existing_req.extras isn't sorted in this line if new_extras != existing_req.extras:?

@uranusjr
Copy link
Member Author

Not likely since new_extras is always a superset of existing_req.extras. But the current code is unnecessarily confusing, I’ll update it a bit to make intentions clear.

@uranusjr
Copy link
Member Author

Hmmm getting the same failure, but from different environments. Interesting.

@uranusjr uranusjr force-pushed the resolver-extra-dup branch 4 times, most recently from 4af4dcc to 7c1151b Compare February 25, 2019 09:10
@pradyunsg
Copy link
Member

the current code is unnecessarily confusing

I have confirmed this finding independently. 😉

@pradyunsg
Copy link
Member

See also #3878.

@pradyunsg
Copy link
Member

More specifically: #3878 (comment)

This seems clean enough but this would (if I'm not mistakenà merge a pkg[extra1]<1 and a pkg[extra2]>=2 into a pkg[extra1,extra2]<1 (or >=2 depending on the resolution order).

Which is a good point. ;)

@pradyunsg
Copy link
Member

@uranusjr Did you find the time to take a look at this?

@uranusjr
Copy link
Member Author

Sorry, I’ve been caught up at work recently, and not found much energy to work on this.

The problem this PR faces is that merging extras is messy without a proper resolver. It is mot difficult to solve the original issue (#6239), but merging in general (say merging A[x] with A[y] with different constraint combination) is difficult to get right. I’m sure there is a way, but don’t have the energy at the moment to really dive into the logic and investigate. Maybe it would be better to just solve the problem mentioned in the issue, and leave the general solution until the resolver is swapped out?

@pradyunsg
Copy link
Member

Closing this, since well, none of us have the bandwidth to tackle this right now AFAICT.

@pradyunsg pradyunsg closed this Sep 30, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Oct 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 2019
@brainwane
Copy link
Contributor

Let's reopen this now since we do have bandwidth now. :-)

@brainwane brainwane reopened this Jun 11, 2020
@pypa-bot
Copy link

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will eligible for code review and hopefully merging!

@pypa-bot pypa-bot added the needs rebase or merge PR has conflicts with current master label Jun 11, 2020
@pradyunsg
Copy link
Member

@brainwane This is a PR for pip's current "legacy" resolver. This specific behavior that this PR is for, has been fixed with the new resolver.

I don't think this should be revisited since we don't want to be trying to fix such bugs in the old resolver (it's painfully difficult, and that's why we're writing a new one!). I really think that we should leave this bug alone for now, letting it die along with the old resolver code.

@pradyunsg pradyunsg removed the auto-locked Outdated issues that have been locked by automation label Jun 11, 2020
@pypa pypa unlocked this conversation Jun 11, 2020
@pradyunsg
Copy link
Member

@pypa/pip-team Please make sure to unlock old issues/PRs when you re-open them, since we have @lock[bot] that automatically locks old+closed issues.

@uranusjr
Copy link
Member Author

uranusjr commented Jun 11, 2020

Maybe we should have the bot do that for us automatically. Where should I contribute to the bot?

@pradyunsg
Copy link
Member

@brainwane
Copy link
Contributor

Sorry for misunderstanding, and thanks for the clarification and moving it to the right place, Pradyun!

@pradyunsg
Copy link
Member

I don't think this should be revisited since we don't want to be trying to fix such bugs in the old resolver (it's painfully difficult, and that's why we're writing a new one!). I really think that we should leave this bug alone for now, letting it die along with the old resolver code.

Re-closing based on this rationale. :)

@pradyunsg pradyunsg closed this Jun 30, 2020
@uranusjr uranusjr deleted the resolver-extra-dup branch September 28, 2020 14:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs rebase or merge PR has conflicts with current master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

package[extra] not installed when duplicating package

5 participants