mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Fix type of config_settings arguments
This commit is contained in:
parent
5ea358122a
commit
82f1ff0adb
3 changed files with 15 additions and 12 deletions
|
@ -209,7 +209,7 @@ def install_req_from_editable(
|
||||||
constraint: bool = False,
|
constraint: bool = False,
|
||||||
user_supplied: bool = False,
|
user_supplied: bool = False,
|
||||||
permit_editable_wheels: bool = False,
|
permit_editable_wheels: bool = False,
|
||||||
config_settings: Optional[Dict[str, str]] = None,
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
) -> InstallRequirement:
|
) -> InstallRequirement:
|
||||||
|
|
||||||
parts = parse_req_from_editable(editable_req)
|
parts = parse_req_from_editable(editable_req)
|
||||||
|
@ -385,7 +385,7 @@ def install_req_from_line(
|
||||||
constraint: bool = False,
|
constraint: bool = False,
|
||||||
line_source: Optional[str] = None,
|
line_source: Optional[str] = None,
|
||||||
user_supplied: bool = False,
|
user_supplied: bool = False,
|
||||||
config_settings: Optional[Dict[str, str]] = None,
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
) -> InstallRequirement:
|
) -> InstallRequirement:
|
||||||
"""Creates an InstallRequirement from a name, which might be a
|
"""Creates an InstallRequirement from a name, which might be a
|
||||||
requirement, directory containing 'setup.py', filename, or URL.
|
requirement, directory containing 'setup.py', filename, or URL.
|
||||||
|
@ -417,7 +417,7 @@ def install_req_from_req_string(
|
||||||
isolated: bool = False,
|
isolated: bool = False,
|
||||||
use_pep517: Optional[bool] = None,
|
use_pep517: Optional[bool] = None,
|
||||||
user_supplied: bool = False,
|
user_supplied: bool = False,
|
||||||
config_settings: Optional[Dict[str, str]] = None,
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
) -> InstallRequirement:
|
) -> InstallRequirement:
|
||||||
try:
|
try:
|
||||||
req = get_requirement(req_string)
|
req = get_requirement(req_string)
|
||||||
|
|
|
@ -85,7 +85,7 @@ class InstallRequirement:
|
||||||
*,
|
*,
|
||||||
global_options: Optional[List[str]] = None,
|
global_options: Optional[List[str]] = None,
|
||||||
hash_options: Optional[Dict[str, List[str]]] = None,
|
hash_options: Optional[Dict[str, List[str]]] = None,
|
||||||
config_settings: Optional[Dict[str, str]] = None,
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
constraint: bool = False,
|
constraint: bool = False,
|
||||||
extras: Collection[str] = (),
|
extras: Collection[str] = (),
|
||||||
user_supplied: bool = False,
|
user_supplied: bool = False,
|
||||||
|
|
|
@ -32,6 +32,7 @@ from typing import (
|
||||||
Tuple,
|
Tuple,
|
||||||
Type,
|
Type,
|
||||||
TypeVar,
|
TypeVar,
|
||||||
|
Union,
|
||||||
cast,
|
cast,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -669,7 +670,7 @@ class ConfiguredBuildBackendHookCaller(BuildBackendHookCaller):
|
||||||
def build_wheel(
|
def build_wheel(
|
||||||
self,
|
self,
|
||||||
wheel_directory: str,
|
wheel_directory: str,
|
||||||
config_settings: Optional[Dict[str, str]] = None,
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
metadata_directory: Optional[str] = None,
|
metadata_directory: Optional[str] = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
cs = self.config_holder.config_settings
|
cs = self.config_holder.config_settings
|
||||||
|
@ -678,7 +679,9 @@ class ConfiguredBuildBackendHookCaller(BuildBackendHookCaller):
|
||||||
)
|
)
|
||||||
|
|
||||||
def build_sdist(
|
def build_sdist(
|
||||||
self, sdist_directory: str, config_settings: Optional[Dict[str, str]] = None
|
self,
|
||||||
|
sdist_directory: str,
|
||||||
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
cs = self.config_holder.config_settings
|
cs = self.config_holder.config_settings
|
||||||
return super().build_sdist(sdist_directory, config_settings=cs)
|
return super().build_sdist(sdist_directory, config_settings=cs)
|
||||||
|
@ -686,7 +689,7 @@ class ConfiguredBuildBackendHookCaller(BuildBackendHookCaller):
|
||||||
def build_editable(
|
def build_editable(
|
||||||
self,
|
self,
|
||||||
wheel_directory: str,
|
wheel_directory: str,
|
||||||
config_settings: Optional[Dict[str, str]] = None,
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
metadata_directory: Optional[str] = None,
|
metadata_directory: Optional[str] = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
cs = self.config_holder.config_settings
|
cs = self.config_holder.config_settings
|
||||||
|
@ -695,19 +698,19 @@ class ConfiguredBuildBackendHookCaller(BuildBackendHookCaller):
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_requires_for_build_wheel(
|
def get_requires_for_build_wheel(
|
||||||
self, config_settings: Optional[Dict[str, str]] = None
|
self, config_settings: Optional[Dict[str, Union[str, List[str]]]] = None
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
cs = self.config_holder.config_settings
|
cs = self.config_holder.config_settings
|
||||||
return super().get_requires_for_build_wheel(config_settings=cs)
|
return super().get_requires_for_build_wheel(config_settings=cs)
|
||||||
|
|
||||||
def get_requires_for_build_sdist(
|
def get_requires_for_build_sdist(
|
||||||
self, config_settings: Optional[Dict[str, str]] = None
|
self, config_settings: Optional[Dict[str, Union[str, List[str]]]] = None
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
cs = self.config_holder.config_settings
|
cs = self.config_holder.config_settings
|
||||||
return super().get_requires_for_build_sdist(config_settings=cs)
|
return super().get_requires_for_build_sdist(config_settings=cs)
|
||||||
|
|
||||||
def get_requires_for_build_editable(
|
def get_requires_for_build_editable(
|
||||||
self, config_settings: Optional[Dict[str, str]] = None
|
self, config_settings: Optional[Dict[str, Union[str, List[str]]]] = None
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
cs = self.config_holder.config_settings
|
cs = self.config_holder.config_settings
|
||||||
return super().get_requires_for_build_editable(config_settings=cs)
|
return super().get_requires_for_build_editable(config_settings=cs)
|
||||||
|
@ -715,7 +718,7 @@ class ConfiguredBuildBackendHookCaller(BuildBackendHookCaller):
|
||||||
def prepare_metadata_for_build_wheel(
|
def prepare_metadata_for_build_wheel(
|
||||||
self,
|
self,
|
||||||
metadata_directory: str,
|
metadata_directory: str,
|
||||||
config_settings: Optional[Dict[str, str]] = None,
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
_allow_fallback: bool = True,
|
_allow_fallback: bool = True,
|
||||||
) -> str:
|
) -> str:
|
||||||
cs = self.config_holder.config_settings
|
cs = self.config_holder.config_settings
|
||||||
|
@ -728,7 +731,7 @@ class ConfiguredBuildBackendHookCaller(BuildBackendHookCaller):
|
||||||
def prepare_metadata_for_build_editable(
|
def prepare_metadata_for_build_editable(
|
||||||
self,
|
self,
|
||||||
metadata_directory: str,
|
metadata_directory: str,
|
||||||
config_settings: Optional[Dict[str, str]] = None,
|
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
|
||||||
_allow_fallback: bool = True,
|
_allow_fallback: bool = True,
|
||||||
) -> str:
|
) -> str:
|
||||||
cs = self.config_holder.config_settings
|
cs = self.config_holder.config_settings
|
||||||
|
|
Loading…
Reference in a new issue