Skip to content

Commit

Permalink
build: add editable to dist type
Browse files Browse the repository at this point in the history
Closes pypa#763.
  • Loading branch information
layday committed Mar 29, 2024
1 parent 1e67c06 commit 0f1f84e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/build/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import zipfile

from collections.abc import Iterator
from typing import Any, Mapping, Sequence, TypeVar
from typing import Any, Literal, Mapping, Sequence, TypeVar

import pyproject_hooks

Expand Down Expand Up @@ -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: Literal[Distribution, 'editable'],
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.
Expand All @@ -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: Literal[Distribution, 'editable'],
config_settings: ConfigSettings | None = None,
) -> set[tuple[str, ...]]:
"""
Return the dependencies which are not satisfied from the combined set of
Expand All @@ -236,7 +242,7 @@ def check_dependencies(

def prepare(
self,
distribution: Distribution,
distribution: Literal[Distribution, 'editable'],
output_directory: StrPath,
config_settings: ConfigSettings | None = None,
) -> str | None:
Expand All @@ -263,7 +269,7 @@ def prepare(

def build(
self,
distribution: Distribution,
distribution: Literal[Distribution, 'editable'],
output_directory: StrPath,
config_settings: ConfigSettings | None = None,
metadata_directory: str | None = None,
Expand Down

0 comments on commit 0f1f84e

Please sign in to comment.