diff --git a/setuptools/dist.py b/setuptools/dist.py index 886e1e6c831..118198d0b07 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -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 diff --git a/setuptools/tests/test_bdist_wheel.py b/setuptools/tests/test_bdist_wheel.py index b88b2e51fc8..0f2e6ce136d 100644 --- a/setuptools/tests/test_bdist_wheel.py +++ b/setuptools/tests/test_bdist_wheel.py @@ -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): @@ -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):