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

build: add editable to dist type #764

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Changes from 1 commit
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
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