diff --git a/src/pdm/backend/wheel.py b/src/pdm/backend/wheel.py index 7828ffd..0c38eec 100644 --- a/src/pdm/backend/wheel.py +++ b/src/pdm/backend/wheel.py @@ -81,7 +81,9 @@ def scheme_path(self, name: str, relative: str) -> str: ) return f"{self.name_version}.data/{name}/{relative}" - def _get_platform_tags(self) -> tuple[str | None, str | None, str | None]: + def _get_platform_tags( + self, + ) -> tuple[str | None, str | None, list[str] | str | None]: python_tag: str | None = None py_limited_api: str | None = None plat_name: str | None = None @@ -219,9 +221,14 @@ def _get_tag(self) -> str: else: impl = "py3" - platform = platform.lower().replace("-", "_").replace(".", "_") # type: ignore + if isinstance(platform, str): + platform = [platform] + + platform = ".".join( + x.lower().replace("-", "_").replace(".", "_") for x in platform + ) tag = (impl, abi, platform) - return "-".join(tag) # type: ignore[arg-type] + return "-".join(tag) def _write_dist_info(self, parent: Path) -> Path: """write the dist-info directory and return the path to it""" diff --git a/tests/test_wheel.py b/tests/test_wheel.py index 9ad6907..f10cf7d 100644 --- a/tests/test_wheel.py +++ b/tests/test_wheel.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import sys from pathlib import Path @@ -13,10 +15,16 @@ [ ("cp36", "abi3", "win_amd64", "cp36-abi3-win_amd64"), ("py3", "none", "win_amd64", "py3-none-win_amd64"), + ( + "py3", + "none", + ["manylinux_2_12_x86", "musllinux_1_1_x86"], + "py3-none-manylinux_2_12_x86.musllinux_1_1_x86", + ), ], ) def test_override_tags_in_wheel_filename( - python_tag: str, py_limited_api: str, plat_name: str, tag: str + python_tag: str, py_limited_api: str, plat_name: str | list[str], tag: str ) -> None: project = FIXTURES / "projects/demo-cextension" with wheel.WheelBuilder(