Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ END_UNRELEASED_TEMPLATE
* (pypi) Support `requirements.txt` files that use different versions of the same
package targeting different target platforms.
([#2797](https://github.com/bazel-contrib/rules_python/issues/2797)).
* (py_wheel) Add directories in deterministic order.

{#v0-0-0-added}
### Added
Expand Down
2 changes: 1 addition & 1 deletion tools/wheelmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def add_file(self, package_filename, real_filename):
"""Add given file to the distribution."""

if os.path.isdir(real_filename):
directory_contents = os.listdir(real_filename)
directory_contents = sorted(os.listdir(real_filename))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
directory_contents = sorted(os.listdir(real_filename))
# listdir() results are unordered; sort for determinism.
directory_contents = sorted(os.listdir(real_filename))

for file_ in directory_contents:
self.add_file(
"{}/{}".format(package_filename, file_),
Expand Down