Skip to content

Commit

Permalink
Store normalized paths
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Nov 24, 2024
1 parent 43b8f59 commit 0bb22ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setuptools/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,10 @@ def _finalize_license_files(self) -> None:
patterns = ['LICEN[CS]E*', 'COPYING*', 'NOTICE*', 'AUTHORS*']

self.metadata.license_files = list(
unique_everseen(self._expand_patterns(patterns))
map(
lambda path: path.replace("\\", "/"),
unique_everseen(self._expand_patterns(patterns)),
)
)

@staticmethod
Expand Down
6 changes: 6 additions & 0 deletions setuptools/tests/test_bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ def test_licenses_override(dummy_dist, monkeypatch, tmp_path, config_file, confi
for fname in {"licenses/DUMMYFILE", "LICENSE"}
}
assert set(wf.namelist()) == DEFAULT_FILES | license_files
metadata = wf.read("dummy_dist-1.0.dist-info/METADATA").decode("utf8")
assert "License-File: licenses/DUMMYFILE" in metadata
assert "License-File: LICENSE" in metadata


def test_licenses_preserve_folder_structure(licenses_dist, monkeypatch, tmp_path):
Expand All @@ -371,6 +374,9 @@ def test_licenses_preserve_folder_structure(licenses_dist, monkeypatch, tmp_path
"licenses_dist-1.0.dist-info/licenses/src/vendor/LICENSE",
}
assert set(wf.namelist()) == default_files | license_files
metadata = wf.read("licenses_dist-1.0.dist-info/METADATA").decode("utf8")
assert "License-File: src/vendor/LICENSE" in metadata
assert "License-File: LICENSE" in metadata


def test_licenses_disabled(dummy_dist, monkeypatch, tmp_path):
Expand Down

0 comments on commit 0bb22ba

Please sign in to comment.