Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

packaging/piptool: sort wheels and extras for deterministic output #279

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

Merged
merged 2 commits into from
Mar 4, 2020
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
8 changes: 6 additions & 2 deletions 8 packaging/piptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ def pip_main(argv):
parser.add_argument('--extra_pip_args', action='store',
help=('Extra arguments to pass down to pip.'))

def sort_wheels(whls):
"""Sorts a list of wheels deterministically."""
return sorted(whls, key=lambda w: w.distribution() + '_' + w.version())

def determine_possible_extras(whls):
"""Determines the list of possible "extras" for each .whl

Expand Down Expand Up @@ -153,7 +157,7 @@ def is_possible(distro, extra):
return {
whl: [
extra
for extra in whl.extras()
for extra in sorted(whl.extras())
if is_possible(whl.distribution(), extra)
]
for whl in whls
Expand All @@ -177,7 +181,7 @@ def list_whls():
if fname.endswith('.whl'):
yield os.path.join(root, fname)

whls = [Wheel(path) for path in list_whls()]
whls = sort_wheels(Wheel(path) for path in list_whls())
possible_extras = determine_possible_extras(whls)

def repository_name(wheel):
Expand Down
Binary file modified BIN +334 Bytes (100%) tools/piptool.par
Binary file not shown.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.