Skip to content

Commit

Permalink
Update to delocate 0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jvolkman committed Jun 12, 2024
1 parent 14106dc commit 367dcb0
Show file tree
Hide file tree
Showing 19 changed files with 514 additions and 139 deletions.
2 changes: 1 addition & 1 deletion src/repairwheel/_vendor/delocate/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2023, Matthew Brett and the Delocate contributors.
Copyright (c) 2014-2024, Matthew Brett and the Delocate contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/repairwheel/_vendor/delocate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Init for delocate package
"""Delocate package."""

import warnings

Expand Down
4 changes: 2 additions & 2 deletions src/repairwheel/_vendor/delocate/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '0.10.7'
__version_tuple__ = version_tuple = (0, 10, 7)
__version__ = version = '0.11.0'
__version_tuple__ = version_tuple = (0, 11, 0)
1 change: 1 addition & 0 deletions src/repairwheel/_vendor/delocate/cmd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Delocate commands package."""
6 changes: 3 additions & 3 deletions src/repairwheel/_vendor/delocate/cmd/common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
""" Code shared among multiple commands.
"""Code shared among multiple commands.
All functions in this module are private.
"""

from __future__ import annotations

import glob
Expand Down Expand Up @@ -94,11 +95,10 @@ class DelocateArgs(TypedDict):

def delocate_values(args: Namespace) -> DelocateArgs:
"""Return the common kwargs for delocate_path and delocate_wheel."""

exclude_files: List[str] = args.exclude

def copy_filter_exclude(name: str) -> bool:
"""Returns False if name is excluded, uses normal rules otherwise."""
"""Return False if name is excluded, uses normal rules otherwise."""
for exclude_str in exclude_files:
if exclude_str in name:
logger.info(
Expand Down
5 changes: 3 additions & 2 deletions src/repairwheel/_vendor/delocate/cmd/delocate_addplat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
""" Add platform tags to wheel filename(s) and WHEEL file in wheel
"""Add platform tags to wheel filename(s) and WHEEL file in wheel.
Example:
Expand All @@ -13,6 +13,7 @@
delocate-addplat -x 10_9 -x 10_10 *.whl
"""

# vim: ft=python
from __future__ import absolute_import, division, print_function

Expand Down Expand Up @@ -91,7 +92,7 @@
)


def main() -> None:
def main() -> None: # noqa: D103
args = parser.parse_args()
verbosity_config(args)
wheels = list(glob_paths(args.wheels))
Expand Down
7 changes: 4 additions & 3 deletions src/repairwheel/_vendor/delocate/cmd/delocate_fuse.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
""" Fuse two (probably delocated) wheels
"""Fuse two (probably delocated) wheels.
Overwrites the first wheel in-place by default
Overwrites the first wheel in-place by default.
"""

# vim: ft=python
from __future__ import absolute_import, division, print_function

Expand All @@ -27,7 +28,7 @@
)


def main() -> None:
def main() -> None: # noqa: D103
args = parser.parse_args()
verbosity_config(args)
wheel1, wheel2 = [abspath(expanduser(wheel)) for wheel in args.wheels]
Expand Down
6 changes: 3 additions & 3 deletions src/repairwheel/_vendor/delocate/cmd/delocate_listdeps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
""" List library dependencies for libraries in path or wheel
"""
"""List library dependencies for libraries in path or wheel."""

# vim: ft=python
from __future__ import absolute_import, division, print_function

Expand Down Expand Up @@ -37,7 +37,7 @@
)


def main() -> None:
def main() -> None: # noqa: D103
args = parser.parse_args()
verbosity_config(args)
paths = list(glob_paths(args.paths))
Expand Down
7 changes: 4 additions & 3 deletions src/repairwheel/_vendor/delocate/cmd/delocate_patch.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
""" Apply patch to tree stored in wheel
"""Apply patch to tree stored in wheel.
Overwrites the wheel in-place by default
Overwrites the wheel in-place by default.
"""

# vim: ft=python
from __future__ import absolute_import, division, print_function

Expand Down Expand Up @@ -30,7 +31,7 @@
)


def main() -> None:
def main() -> None: # noqa: D103
args = parser.parse_args()
verbosity_config(args)
if args.wheel_dir:
Expand Down
6 changes: 3 additions & 3 deletions src/repairwheel/_vendor/delocate/cmd/delocate_path.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
""" Copy, relink library dependencies for libraries in path
"""
"""Copy, relink library dependencies for libraries in path."""

# vim: ft=python
from __future__ import absolute_import, division, print_function

Expand Down Expand Up @@ -36,7 +36,7 @@
)


def main() -> None:
def main() -> None: # noqa: D103
args = parser.parse_args()
verbosity_config(args)
paths = list(glob_paths(args.paths))
Expand Down
25 changes: 22 additions & 3 deletions src/repairwheel/_vendor/delocate/cmd/delocate_wheel.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
""" Copy, relink library dependencies for wheel
"""Copy, relink library dependencies for wheel.
Overwrites the wheel in-place by default
Overwrites the wheel in-place by default.
"""

# vim: ft=python
from __future__ import annotations

Expand All @@ -12,6 +13,8 @@
from os.path import join as pjoin
from typing import List, Optional, Text

from packaging.version import Version

from repairwheel._vendor.delocate import delocate_wheel
from repairwheel._vendor.delocate.cmd.common import (
common_parser,
Expand Down Expand Up @@ -61,9 +64,15 @@
" (from 'intel', 'i386', 'x86_64', 'i386,x86_64', 'universal2',"
" 'x86_64,arm64')",
)
parser.add_argument(
"--require-target-macos-version",
type=Version,
help="Verify if platform tag in wheel name is proper",
default=None,
)


def main() -> None:
def main() -> None: # noqa: D103
args = parser.parse_args()
verbosity_config(args)
wheels = list(glob_paths(args.wheels))
Expand All @@ -82,6 +91,15 @@ def main() -> None:
else:
require_archs = args.require_archs

require_target_macos_version = args.require_target_macos_version
if (
require_target_macos_version is None
and "MACOSX_DEPLOYMENT_TARGET" in os.environ
):
require_target_macos_version = Version(
os.environ["MACOSX_DEPLOYMENT_TARGET"]
)

for wheel in wheels:
if multi or args.verbose:
print("Fixing: " + wheel)
Expand All @@ -94,6 +112,7 @@ def main() -> None:
out_wheel,
lib_sdir=args.lib_sdir,
require_archs=require_archs,
require_target_macos_version=require_target_macos_version,
**delocate_values(args),
)
if args.verbose and len(copied):
Expand Down
Loading

0 comments on commit 367dcb0

Please sign in to comment.