Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pyproject-hooks to 1.2.0 #13125

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be necessary given that prepare_metadata_for_build_editable() on the super class is typed to return str. This seems an oversight when type annotations were added to pyproject-hooks. I've asked around whether this is intentional.

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
Loading