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

Fix for --no-clean errors under new resolver #8065

Closed
wants to merge 1 commit into from

Conversation

pfmoore
Copy link
Member

@pfmoore pfmoore commented Apr 16, 2020

Preliminary fix for the --no-clean test error. Before merging this, I'd like to look at whether there is a better way to get the requirement set on the InstallRequirement we create.

We could merge this and refactor later, but I'd rather try to avoid incurring the technical debt of that approach.

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.

A minor unrelated-to-this-change naming comment.

@@ -41,7 +41,7 @@
def make_install_req_from_link(link, parent):
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to rename parent to template/reference/something along those lines? parent sounds like it's related to the graph we're building -- parent child relationship AKA dependent-dependency relationship -- but that's not the case here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think of it as parent in the sense that it's the req we create this one from - but yes, it does get confusing with the dependency graph. I'm happy to change, although I'm not keen on template - we don't take the original and "fill in the blanks" which is how I think of a template.

But a strong +1 on trying to keep addressing thses sorts of peripheral issues as we go along - it would be way too easy to end up with an accumulated pile of slightly-not-ideal decisions, and have another maintenance mess on our hands. (Says the person who inflicted PEP 517 on us 🙂)

@uranusjr
Copy link
Member

uranusjr commented Apr 16, 2020

 # The req attribute needs to be set, as otherwise this looks like an
 # "unnamed requirement" which causes req.ensure_build_location to ignore
 # the build_dir and use a temporary directory.

Does #8005 affect this? It is solving a different issue (direct URL vs specifier), but the solution also involves make_install_req_from_link(), and I think building an InstallRequirement from a requirement string would make it named?

# set by prepare_linked_requirement, they need to be set by the
# caller. See the old resolver's _resolve_one method.
self._ireq.prepared = True
self._ireq.successfully_downloaded = True
Copy link
Member

Choose a reason for hiding this comment

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

InstallRequirement internals are such fun 🤦

@pfmoore
Copy link
Member Author

pfmoore commented Apr 16, 2020

Does #8005 affect this?

I wondered about that (not #8005, but the direct URL syntax). It might well, but I'm honestly not comfortable enough with that syntax to be sure.

I wish I could find a better mental model for all of this, at the moment it feels too much like "set stuff until it works" 🙁

@pfmoore pfmoore added the skip news Does not need a NEWS file entry (eg: trivial changes) label Apr 16, 2020
@uranusjr
Copy link
Member

I ran the test (test_no_clean_option_blocks_cleaning_after_wheel) against #8005, and… it passes. I have no idea what that means exactly, but probably an indication these two are related 🤯

@pfmoore
Copy link
Member Author

pfmoore commented Apr 17, 2020

So I guess we should decide which of #8005 and this to merge? My feeling is that #8005 looks cleaner, although the parts setting prepared and successfully_downloaded from this PR might need adding independently.

Any merges should wait till after the release now, I guess, based on @pradyunsg's comment. So there's no rush to decide, but we should keep track of stuff awaiting merge as we work through the errors.

@uranusjr
Copy link
Member

So I guess we should decide which of #8005 and this to merge?

That’s a good idea. My work in #8066 also ends up interlocking with #8005, so getting it in first would definitely help.

I guess we should avoid anything related to InstallRequirement for now, and try to work on other (easier?) stuff like refining the error message, until the release is out.

@pfmoore
Copy link
Member Author

pfmoore commented Apr 17, 2020

OK, I'm fine with going for #8005

I've not found a case where we need prepared and successfully_downloaded to be set yet. Do we want to do this "for completeness", or take a YAGNI approach and wait for a test to fail before we do it?

Also - "(easier?) stuff like refining the error message" lol, "easier" isn't the word I'd use! I'll put my thoughts on error messages into Zulip, though, as it's too much for here.

@uranusjr
Copy link
Member

uranusjr commented May 3, 2020

Seems like #8005 fixes all the failures identified by --no-clean tests. I’ll close this for now; we can revisit this if needed.

@uranusjr uranusjr closed this May 3, 2020
@pfmoore pfmoore deleted the no_clean_fix branch January 24, 2021 11:14
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants