Apply default extras when resolving an already-installed candidate#12
Closed
astrofrog wants to merge 7 commits into
Closed
Apply default extras when resolving an already-installed candidate#12astrofrog wants to merge 7 commits into
astrofrog wants to merge 7 commits into
Conversation
…nt default extras if present and if extras not specified
…ult extras (#1) * Experimental implementation of supporting [] disabling default extras * Fix cases of package[...]==version
_make_candidate_from_link picks up default extras via prepare.py mutating the install requirement's extras during distribution preparation, but the already-installed path went through _make_candidate_from_dist, which read nothing from the dist's Default-Extra metadata. Without the same mutation, the resolvelib _extras sync left the criterion keyed by the bare name, so default-extra dependencies failed the marker check and were dropped. Mirror prepare.py here: when the caller and template specify no extras, read dist.iter_default_extras() and write it back to template.extras and template.req.extras before wrapping the base in an ExtrasCandidate.
default_extras_require is defined on the base Distribution class but reads self._parsed_pkg_info, which is only defined on DistInfoDistribution (the .dist-info subclass). For egg-info-backed distributions the property raised AttributeError; Python then fell through to __getattr__, which delegated to the PathMetadata provider and surfaced a confusing error. Egg-info distributions do not carry PEP 771 metadata, so return an empty list when _parsed_pkg_info is unavailable.
Author
|
Ok so while this fixes the immediate issue, there are actually a number of CI failures being hidden by the fact the base branch here is out of date with main and the CI isn't running. I think a better solution is #13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the following scenario:
with this fix here, the second command installs the default extras (before, there was a warning and the default extras didn't get installed)
This is to address the failure in wheelnext/pep_771-Default-Extras#3