Fix license file duplication in sdists#752
Merged
Conversation
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.
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. |
Contributor
Author
Yeah, I actually wrote the test first. |
Member
|
Great, thank-you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This bug can happen on Windows when the
license-filessetting contains a glob that matches one of the files in the source directory. In this case, the same path can be returned byselect_filesboth in the POSIX format and the Windows format, which makes the deduplication logic inapply_includes_excludesfail.Fix it by making sure that all paths passed to
apply_includes_excludesare in the native OS format.Fixes half of #749.