Skip to content

Fix license file duplication in sdists#752

Merged
takluyver merged 1 commit into
pypa:mainfrom
SpecLad:license-dup-sdist
Jul 12, 2025
Merged

Fix license file duplication in sdists#752
takluyver merged 1 commit into
pypa:mainfrom
SpecLad:license-dup-sdist

Conversation

@SpecLad
Copy link
Copy Markdown
Contributor

@SpecLad SpecLad commented Jul 11, 2025

This bug can happen on Windows when the license-files setting contains a glob that matches one of the files in the source directory. In this case, the same path can be returned by select_files both in the POSIX format and the Windows format, which makes the deduplication logic in apply_includes_excludes fail.

Fix it by making sure that all paths passed to apply_includes_excludes are in the native OS format.

Fixes half of #749.

This bug can happen on Windows when the `license-files` setting contains
a glob that matches one of the files in the source directory. In this case,
the same path can be returned by `select_files` both in the POSIX format and
the Windows format, which makes the deduplication logic in
`apply_includes_excludes` fail.

Fix it by making sure that all paths passed to `apply_includes_excludes` are
in the native OS format.
@takluyver takluyver added this to the 3.13 milestone Jul 12, 2025
@takluyver takluyver added the bug label Jul 12, 2025
@takluyver
Copy link
Copy Markdown
Member

Thanks, and in particular thanks for writing a test as well. 👍 Did you check that the test fails on Windows without the fix? If not, I'll make a draft PR reverting the fix to check that in CI.

@SpecLad
Copy link
Copy Markdown
Contributor Author

SpecLad commented Jul 12, 2025

Did you check that the test fails on Windows without the fix?

Yeah, I actually wrote the test first.

@takluyver
Copy link
Copy Markdown
Member

Great, thank-you!

@takluyver takluyver merged commit ef22e46 into pypa:main Jul 12, 2025
16 checks passed
@SpecLad SpecLad deleted the license-dup-sdist branch July 12, 2025 11:25
@takluyver takluyver modified the milestones: 3.13, 4.0 Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants