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

setuptools/dist: Fix reproducibility issue by sorting globbing #2692

Merged
merged 4 commits into from Jul 4, 2021

Conversation

rpurdie
Copy link
Contributor

@rpurdie rpurdie commented May 31, 2021

globbing uses os.listdir() which returns order on disk which is unsorted.
Ultimately this leads to random ordering of License-File entries in PKG-INFO
and means the resulting output isn't deterministic.

Adding a sort fixes that. Switch to glob instead ot iglob since sorted()
removes the benefit of an iterator.

#2691

Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org

Summary of changes

Closes

Pull Request Checklist

globbing uses os.listdir() which returns order on disk which is unsorted.
Ultimately this leads to random ordering of License-File entries in PKG-INFO
and means the resulting output isn't deterministic.

Adding a sort fixes that. Switch to glob instead ot iglob since sorted()
removes the benefit of an iterator.

pypa#2691

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
@jaraco
Copy link
Member

jaraco commented Jun 2, 2021

Switch to glob instead ot iglob since sorted()
removes the benefit of an iterator.

I think I'd still prefer an iterator.

Can you create a test to capture this expectation?

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaraco jaraco merged commit e345d8e into pypa:main Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants