diff --git a/src/poetry/core/masonry/builders/wheel.py b/src/poetry/core/masonry/builders/wheel.py index a97709151..9d641acaa 100644 --- a/src/poetry/core/masonry/builders/wheel.py +++ b/src/poetry/core/masonry/builders/wheel.py @@ -324,7 +324,8 @@ def dist_info(self) -> str: @property def wheel_data_folder(self) -> str: - return f"{self._package.name}-{self._meta.version}.data" + name = distribution_name(self._package.name) + return f"{name}-{self._meta.version}.data" @property def wheel_filename(self) -> str: diff --git a/tests/masonry/builders/test_complete.py b/tests/masonry/builders/test_complete.py index c93ec3801..9e4b27abc 100644 --- a/tests/masonry/builders/test_complete.py +++ b/tests/masonry/builders/test_complete.py @@ -223,10 +223,10 @@ def test_complete() -> None: try: assert "my_package/sub_pgk1/extra_file.xml" not in zip.namelist() - assert "my-package-1.2.3.data/scripts/script.sh" in zip.namelist() + assert "my_package-1.2.3.data/scripts/script.sh" in zip.namelist() assert ( "Hello World" - in zip.read("my-package-1.2.3.data/scripts/script.sh").decode() + in zip.read("my_package-1.2.3.data/scripts/script.sh").decode() ) entry_points = zip.read("my_package-1.2.3.dist-info/entry_points.txt") @@ -342,7 +342,7 @@ def test_complete_no_vcs() -> None: "my_package/sub_pkg1/__init__.py", "my_package/sub_pkg2/__init__.py", "my_package/sub_pkg2/data2/data.json", - "my-package-1.2.3.data/scripts/script.sh", + "my_package-1.2.3.data/scripts/script.sh", "my_package/sub_pkg3/foo.py", "my_package-1.2.3.dist-info/entry_points.txt", "my_package-1.2.3.dist-info/LICENSE",