From 9eede7168c6b0041ba33660adb08dfa227e00df3 Mon Sep 17 00:00:00 2001 From: layday Date: Thu, 4 Apr 2024 10:50:50 +0300 Subject: [PATCH] build: add `editable` to dist type (#764) * build: add `editable` to dist type Closes #763. * Merge literals --- src/build/_builder.py | 10 ++++++++-- src/build/_types.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/build/_builder.py b/src/build/_builder.py index cfd7a5ef..857a8b08 100644 --- a/src/build/_builder.py +++ b/src/build/_builder.py @@ -203,7 +203,11 @@ def build_system_requires(self) -> set[str]: """ return set(self._build_system['requires']) - def get_requires_for_build(self, distribution: Distribution, config_settings: ConfigSettings | None = None) -> set[str]: + def get_requires_for_build( + self, + distribution: Distribution, + config_settings: ConfigSettings | None = None, + ) -> set[str]: """ Return the dependencies defined by the backend in addition to :attr:`build_system_requires` for a given distribution. @@ -220,7 +224,9 @@ def get_requires_for_build(self, distribution: Distribution, config_settings: Co return set(get_requires(config_settings)) def check_dependencies( - self, distribution: Distribution, config_settings: ConfigSettings | None = None + self, + distribution: Distribution, + config_settings: ConfigSettings | None = None, ) -> set[tuple[str, ...]]: """ Return the dependencies which are not satisfied from the combined set of diff --git a/src/build/_types.py b/src/build/_types.py index f1568bc8..1f2be1b8 100644 --- a/src/build/_types.py +++ b/src/build/_types.py @@ -5,7 +5,7 @@ ConfigSettings = typing.Mapping[str, typing.Union[str, typing.Sequence[str]]] -Distribution = typing.Literal['sdist', 'wheel'] +Distribution = typing.Literal['sdist', 'wheel', 'editable'] StrPath = typing.Union[str, 'os.PathLike[str]'] SubprocessRunner = typing.Callable[ [typing.Sequence[str], typing.Optional[str], typing.Optional[typing.Mapping[str, str]]], None