Skip to content

Commit a22fe8f

Browse files
authored
Fix type-checking (#3260)
Update test typing for build 1.2.0 which has an explicit Distribution type.
1 parent 08223fc commit a22fe8f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/changelog/3260.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update test typing for build 1.2.0, which has an explicit ``Distribution`` type - by :user:`stefanor`.

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from tox.tox_env.python.virtual_env.api import VirtualEnv
2020

2121
if TYPE_CHECKING:
22+
from build import DistributionType
2223
from pytest_mock import MockerFixture
2324

2425
from tox.config.loader.api import Override
@@ -135,13 +136,13 @@ def demo_pkg_inline_wheel(tmp_path_factory: pytest.TempPathFactory, demo_pkg_inl
135136
return build_pkg(tmp_path_factory.mktemp("dist"), demo_pkg_inline, ["wheel"])
136137

137138

138-
def build_pkg(dist_dir: Path, of: Path, distributions: list[str], isolation: bool = True) -> Path:
139+
def build_pkg(dist_dir: Path, of: Path, distributions: Sequence[DistributionType], isolation: bool = True) -> Path:
139140
from build.__main__ import build_package # noqa: PLC0415,PLC2701
140141

141142
build_package(str(of), str(dist_dir), distributions=distributions, isolation=isolation)
142143
return next(dist_dir.iterdir())
143144

144145

145146
@pytest.fixture(scope="session")
146-
def pkg_builder() -> Callable[[Path, Path, list[str], bool], Path]:
147+
def pkg_builder() -> Callable[[Path, Path, Sequence[DistributionType], bool], Path]:
147148
return build_pkg

0 commit comments

Comments
 (0)