Merge pull request #8005 from uranusjr/candidate-from-link-retains-specifier

New resolver: Use requirement line to populate LinkCandidate._ireq
This commit is contained in:
Paul Moore 2020-05-03 09:59:50 +01:00 committed by GitHub
commit 79a0afb79a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -41,8 +41,12 @@ logger = logging.getLogger(__name__)
def make_install_req_from_link(link, parent):
# type: (Link, InstallRequirement) -> InstallRequirement
assert not parent.editable, "parent is editable"
return install_req_from_line(
link.url,
if parent.req:
line = str(parent.req)
else:
line = link.url
ireq = install_req_from_line(
line,
comes_from=parent.comes_from,
use_pep517=parent.use_pep517,
isolated=parent.isolated,
@ -53,6 +57,10 @@ def make_install_req_from_link(link, parent):
hashes=parent.hash_options
),
)
if ireq.link is None:
ireq.link = link
# TODO: Handle wheel cache resolution.
return ireq
def make_install_req_from_editable(link, parent):