Skip to content

Commit

Permalink
Upgrade pyproject-hooks to 1.2.0 (#13125)
Browse files Browse the repository at this point in the history
  • Loading branch information
ichard26 authored Jan 12, 2025
1 parent d2bb8eb commit dafc095
Show file tree
Hide file tree
Showing 11 changed files with 333 additions and 212 deletions.
1 change: 1 addition & 0 deletions news/pyproject-hooks.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade pyproject-hooks to 1.2.0
1 change: 1 addition & 0 deletions src/pip/_internal/operations/build/metadata_editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ def generate_editable_metadata(
except InstallationSubprocessError as error:
raise MetadataGenerationFailed(package_details=details) from error

assert distinfo_dir is not None
return os.path.join(metadata_dir, distinfo_dir)
27 changes: 14 additions & 13 deletions src/pip/_internal/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
Any,
BinaryIO,
Callable,
Dict,
Generator,
Iterable,
Iterator,
List,
Mapping,
Optional,
Sequence,
TextIO,
Tuple,
Type,
Expand Down Expand Up @@ -667,7 +668,7 @@ def __init__(
def build_wheel(
self,
wheel_directory: str,
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
config_settings: Optional[Mapping[str, Any]] = None,
metadata_directory: Optional[str] = None,
) -> str:
cs = self.config_holder.config_settings
Expand All @@ -678,15 +679,15 @@ def build_wheel(
def build_sdist(
self,
sdist_directory: str,
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
config_settings: Optional[Mapping[str, Any]] = None,
) -> str:
cs = self.config_holder.config_settings
return super().build_sdist(sdist_directory, config_settings=cs)

def build_editable(
self,
wheel_directory: str,
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
config_settings: Optional[Mapping[str, Any]] = None,
metadata_directory: Optional[str] = None,
) -> str:
cs = self.config_holder.config_settings
Expand All @@ -695,27 +696,27 @@ def build_editable(
)

def get_requires_for_build_wheel(
self, config_settings: Optional[Dict[str, Union[str, List[str]]]] = None
) -> List[str]:
self, config_settings: Optional[Mapping[str, Any]] = None
) -> Sequence[str]:
cs = self.config_holder.config_settings
return super().get_requires_for_build_wheel(config_settings=cs)

def get_requires_for_build_sdist(
self, config_settings: Optional[Dict[str, Union[str, List[str]]]] = None
) -> List[str]:
self, config_settings: Optional[Mapping[str, Any]] = None
) -> Sequence[str]:
cs = self.config_holder.config_settings
return super().get_requires_for_build_sdist(config_settings=cs)

def get_requires_for_build_editable(
self, config_settings: Optional[Dict[str, Union[str, List[str]]]] = None
) -> List[str]:
self, config_settings: Optional[Mapping[str, Any]] = None
) -> Sequence[str]:
cs = self.config_holder.config_settings
return super().get_requires_for_build_editable(config_settings=cs)

def prepare_metadata_for_build_wheel(
self,
metadata_directory: str,
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
config_settings: Optional[Mapping[str, Any]] = None,
_allow_fallback: bool = True,
) -> str:
cs = self.config_holder.config_settings
Expand All @@ -728,9 +729,9 @@ def prepare_metadata_for_build_wheel(
def prepare_metadata_for_build_editable(
self,
metadata_directory: str,
config_settings: Optional[Dict[str, Union[str, List[str]]]] = None,
config_settings: Optional[Mapping[str, Any]] = None,
_allow_fallback: bool = True,
) -> str:
) -> Optional[str]:
cs = self.config_holder.config_settings
return super().prepare_metadata_for_build_editable(
metadata_directory=metadata_directory,
Expand Down
1 change: 0 additions & 1 deletion src/pip/_vendor/pyproject_hooks.pyi

This file was deleted.

26 changes: 17 additions & 9 deletions src/pip/_vendor/pyproject_hooks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Wrappers to call pyproject.toml-based build backend hooks.
"""

from typing import TYPE_CHECKING

from ._impl import (
BackendInvalid,
BackendUnavailable,
BuildBackendHookCaller,
HookMissing,
Expand All @@ -11,13 +12,20 @@
quiet_subprocess_runner,
)

__version__ = '1.0.0'
__version__ = "1.2.0"
__all__ = [
'BackendUnavailable',
'BackendInvalid',
'HookMissing',
'UnsupportedOperation',
'default_subprocess_runner',
'quiet_subprocess_runner',
'BuildBackendHookCaller',
"BackendUnavailable",
"BackendInvalid",
"HookMissing",
"UnsupportedOperation",
"default_subprocess_runner",
"quiet_subprocess_runner",
"BuildBackendHookCaller",
]

BackendInvalid = BackendUnavailable # Deprecated alias, previously a separate exception

if TYPE_CHECKING:
from ._impl import SubprocessRunner

__all__ += ["SubprocessRunner"]
8 changes: 0 additions & 8 deletions src/pip/_vendor/pyproject_hooks/_compat.py

This file was deleted.

Loading

0 comments on commit dafc095

Please sign in to comment.