mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #7983 from uranusjr/install-req-editable-type-fix
Accept InstallRequirement as comes_from
This commit is contained in:
commit
2b3d0a5cc0
2 changed files with 5 additions and 6 deletions
|
@ -218,7 +218,7 @@ def parse_req_from_editable(editable_req):
|
||||||
|
|
||||||
def install_req_from_editable(
|
def install_req_from_editable(
|
||||||
editable_req, # type: str
|
editable_req, # type: str
|
||||||
comes_from=None, # type: Optional[str]
|
comes_from=None, # type: Optional[Union[InstallRequirement, str]]
|
||||||
use_pep517=None, # type: Optional[bool]
|
use_pep517=None, # type: Optional[bool]
|
||||||
isolated=False, # type: bool
|
isolated=False, # type: bool
|
||||||
options=None, # type: Optional[Dict[str, Any]]
|
options=None, # type: Optional[Dict[str, Any]]
|
||||||
|
@ -231,7 +231,9 @@ def install_req_from_editable(
|
||||||
source_dir = parts.link.file_path if parts.link.scheme == 'file' else None
|
source_dir = parts.link.file_path if parts.link.scheme == 'file' else None
|
||||||
|
|
||||||
return InstallRequirement(
|
return InstallRequirement(
|
||||||
parts.requirement, comes_from, source_dir=source_dir,
|
parts.requirement,
|
||||||
|
comes_from=comes_from,
|
||||||
|
source_dir=source_dir,
|
||||||
editable=True,
|
editable=True,
|
||||||
link=parts.link,
|
link=parts.link,
|
||||||
constraint=constraint,
|
constraint=constraint,
|
||||||
|
|
|
@ -60,10 +60,7 @@ def make_install_req_from_editable(link, parent):
|
||||||
assert parent.editable, "parent not editable"
|
assert parent.editable, "parent not editable"
|
||||||
return install_req_from_editable(
|
return install_req_from_editable(
|
||||||
link.url,
|
link.url,
|
||||||
# HACK: install_req_from_editable accepts Optional[str] here, but
|
comes_from=parent.comes_from,
|
||||||
# parent.comes_from is Union[str, InstallRequirement, None]. How do
|
|
||||||
# we fix the type hint conflicts?
|
|
||||||
comes_from=parent.comes_from, # type: ignore
|
|
||||||
use_pep517=parent.use_pep517,
|
use_pep517=parent.use_pep517,
|
||||||
isolated=parent.isolated,
|
isolated=parent.isolated,
|
||||||
constraint=parent.constraint,
|
constraint=parent.constraint,
|
||||||
|
|
Loading…
Reference in a new issue