-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retag wheels automatically when fusing (#215)
* Add '--retag' flag to delocate-fuse command This adds the ability to "retag" a universal2 fused wheel. When running delocate-fuse with this flag, it will update the filename and the dist-info file of the fused wheel to reflect that it is a universal2 wheel. * Update _update_wheelfile to use pkginfo functions * Detect if a wheel's name should use universal2 This updates '_get_archs_and_version_from_wheel_name' to check if both arm64 and x86_64 platform tags are in the wheel's filename. If they are both present, it changes the returned arch to be universal2 with the appropriate version. * Update retagging to use functions from delocating This is now much simpler and more generalized. It first updates the name to contain platform tags from both from_wheel and to_wheel. Next it calls '_check_and_update_wheel_name' which fixes any issues with the name AND will convert it to universal2 if necessary. And finally, it calls '_update_wheelfile' to update the info in the WHEEL file to match the new name. * Simplify set comparison syntax * Make fuse retagging the default behavior This also updates the fuse function to support pathlib paths and updates the retagging function to use pathlib paths. * Update Changelog & README for retagging * Update fuse_trees temp context This also required some typing changes to functions called by fused_trees. * Add another test for universal2 wheel version Depending on the version of each wheel being fused, the universal2 wheel's version can be either the x86_64 or the arm64 wheel's version. The first test for this is testing the scenario where the x86_64 wheel's version should be used. This new test is testing the scenario where the arm64 wheel's version should be used. * Move delocate-fuse functionality to delocate-merge This moves the old 'delocate-fuse' functionality into the new 'delocate-merge' command. Running 'delocate-fuse' will now print a message notifying the user of this change and then exit with an exit code of 1. This also updates relevant tests, the changelog, and the README.
- Loading branch information
1 parent
61fb730
commit 7f46f89
Showing
10 changed files
with
210 additions
and
83 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env python3 | ||
"""Fuse two (probably delocated) wheels. | ||
Writes to a new wheel with an automatically determined name by default. | ||
""" | ||
|
||
# vim: ft=python | ||
from __future__ import annotations | ||
|
||
from argparse import ArgumentParser | ||
from pathlib import Path | ||
|
||
from delocate.cmd.common import common_parser, verbosity_config | ||
from delocate.fuse import fuse_wheels | ||
|
||
parser = ArgumentParser(description=__doc__, parents=[common_parser]) | ||
parser.add_argument( | ||
"wheels", nargs=2, metavar="WHEEL", type=str, help="Wheels to fuse" | ||
) | ||
parser.add_argument( | ||
"-w", | ||
"--wheel-dir", | ||
action="store", | ||
type=str, | ||
help="Directory to store delocated wheels" | ||
" (default is to store in the same directory as the 1st WHEEL with an" | ||
" automatically determined name).", | ||
) | ||
|
||
|
||
def main() -> None: # noqa: D103 | ||
args = parser.parse_args() | ||
verbosity_config(args) | ||
wheel1, wheel2 = [Path(wheel).resolve(strict=True) for wheel in args.wheels] | ||
out_wheel = Path( | ||
args.wheel_dir if args.wheel_dir is not None else wheel1.parent | ||
).resolve() | ||
out_wheel.mkdir(parents=True, exist_ok=True) | ||
fuse_wheels(wheel1, wheel2, out_wheel) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.