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

Fix wheel data section to use normalised package name, and test #532

Merged
merged 1 commit into from
Dec 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion src/poetry/core/masonry/builders/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,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:
Expand Down
6 changes: 3 additions & 3 deletions tests/masonry/builders/test_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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",
Expand Down