-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Upgrade ResolveLib to 0.4.0 and implement the new Provider.find_matches() interface #8267
Conversation
c07fb42
to
0a675ba
Compare
Alright, I think this is ready. I’m leaving out the |
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.
I can't see anything wrong with the implementation, and the tests pass, so let's go for it. I'm not a fan of get_candidate_lookup
but to be honest, I don't know how to write it differently (at least, not without checking for explicit types, or something else that is even uglier than get_candidate_lookup
). Let's worry about this in a follow-up PR (why do I think that we won't get round to that follow-up...? 🙄)
I suspect @pradyunsg may be too busy to review this, but I'll leave it a day or so to give him a chance before merging. |
I probably wrote too much Rust and was wishing for pattern-matching in Python, it would have made the implementation much easier. Maybe I should go read some Martin Fowler books to learn more OOP tricks. (I won’t) |
lol, yeah, I'm trying to use more Rust and the pattern matching is awesome. What worries me about the current code is that some bright spark will decide that returning both a candidate and an |
I'll probably take a look later today, after I get tired of explaining every possible phrase in writing, like "package manager" and "dependency". :) Feel free to merge without me taking a look though -- I'd done a quick-skim yesterday, and didn't really have much to say TBH. |
259603e
to
d2da7fb
Compare
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 |
Note: Delaying this since #8066 (wheel cache) will cause a conflict. Both PRs are approved, but the other one can be merged as-is right now, so I’ll rebase this one later. |
Note for self: Since #8319 makes the result of The easiest solution would be |
d2da7fb
to
ec3c409
Compare
5491021
to
4425a34
Compare
Gosh, I’ll need to rethink the candidate ordering. This will take a while. |
4425a34
to
f2339e3
Compare
I hope so much this will work. |
f2339e3
to
9ee19a1
Compare
Hey Travis, report your flipping status when you complete! |
Looks like we have a regression.
|
Uh, wait, that was passing…? It’s literally testing that pip should install a package that’s specified with the wrong project name: def test_install_editable_with_wrong_egg_name(script):
script.scratch_path.joinpath("pkga").mkdir()
pkga_path = script.scratch_path / 'pkga'
pkga_path.joinpath("setup.py").write_text(textwrap.dedent("""
from setuptools import setup
setup(name='pkga',
version='0.1')
"""))
result = script.pip(
'install', '--editable',
'file://{pkga_path}#egg=pkgb'.format(**locals()),
)
assert ("Generating metadata for package pkgb produced metadata "
"for project name pkga. Fix your #egg=pkgb "
"fragments.") in result.stderr
assert "Successfully installed pkga" in str(result), str(result) |
I think we should get this in first and figure out the test config mess later, to not block this any longer 🙁 |
This, is why it was demoted to no-longer being a required status. |
Yea, we can start making that error out, with a faster-than-usual deprecation cycle (deprecate in 20.2, drop in 20.3). :) I'm pretty sure it exists because people make mistakes and we didn't want to break workflows for users back then. |
I'm happy with that. |
Yeah, it's basically saying that we ignore every bit of metadata we could use because it might be wrong 🙁 That's a philosophy that we need to stop - unless we start saying that people need to not lie to pip (intentionally or accidentally), we're never going to be able to get anywhere. |
OK, pushing the button. Let the merge conflicts begin! |
I think I get the logic right (or at least mostly), but the implementation probably looks a bit messy. Recommendations most definitely welcomed :)
Note that ResolveLib 0.4.0 requires the candidates to be returned in reverse order, so I added
reverse=True
toProvider._sort_matches()
.I’ll probably need to add a test based on #8249.