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

Validate and update macOS platform tag in wheel name #198

Merged
merged 36 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
efa212e
initial implementation
Czaki Feb 4, 2024
c3a35e5
use Path
Czaki Feb 5, 2024
670bb76
change regexp name
Czaki Feb 5, 2024
d242da7
add set type annotation
Czaki Feb 5, 2024
93b17d9
extract logic to separate function, update function names
Czaki Feb 5, 2024
5dad39d
add basic tests
Czaki Feb 5, 2024
3570f59
add test for universal2
Czaki Feb 5, 2024
2078633
apply changes from code review
Czaki Feb 6, 2024
07c3976
fix test part 1
Czaki Feb 6, 2024
6885624
fix mypy
Czaki Feb 6, 2024
a56ec61
update changelog
Czaki Feb 6, 2024
c086486
fix test 2
Czaki Feb 6, 2024
6332cb5
verbose run
Czaki Feb 6, 2024
7726378
change name of wheel
Czaki Feb 6, 2024
0bbbbad
provide flag
Czaki Feb 6, 2024
b109f7b
improve exception
Czaki Feb 7, 2024
6ba5099
fix test
Czaki Feb 7, 2024
d0d99c6
add tests
Czaki Feb 7, 2024
0fd885d
add tests
Czaki Feb 7, 2024
2b6a3e1
fix calling by absolute path
Czaki Feb 7, 2024
fc081af
Apply suggestions from code review
Czaki Feb 7, 2024
b939a1e
add mised type
Czaki Feb 7, 2024
d65946c
remove old wheel
Czaki Feb 7, 2024
046fcab
fix updating metadata and add testing it
Czaki Feb 7, 2024
2486313
add docstrings
Czaki Feb 7, 2024
048b256
fix mypy
Czaki Feb 7, 2024
e972852
fix wrong variable name
Czaki Feb 7, 2024
89871b9
Apply suggestions from code review
Czaki Feb 8, 2024
987dc95
Apply suggestions from code review
Czaki Feb 8, 2024
5ce9344
next fixes from code review
Czaki Feb 8, 2024
2f13b20
fix pre-commit formatting
Czaki Feb 8, 2024
9b8aaca
Update delocate/tests/test_scripts.py
Czaki Feb 10, 2024
bd85986
pre-commit fix
Czaki Feb 10, 2024
222033d
fix reporting problematic libs for x86_64
Czaki Feb 10, 2024
e2979a1
add assetr for testing
Czaki Feb 10, 2024
51f03fc
add comment with explanation
Czaki Feb 10, 2024
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
13 changes: 13 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ rules on making a good Changelog.

## [Unreleased]

### Added

- Use `--require-target-macos-version` or the `MACOSX_DEPLOYMENT_TARGET`
environment variable to ensure that wheels are
compatible with the specified macOS version. #198

### Changed

- Delocate now uses the binaries of the wheel file to determine a more accurate
platform tag, this will rename wheels accordingly. #198
- `delocate-wheel` is now more strict with platform tags and will no longer allow
a wheel to be incompatible with its own tags. #198

## [0.10.7] - 2023-12-12

### Changed
Expand Down
18 changes: 18 additions & 0 deletions delocate/cmd/delocate_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from os.path import join as pjoin
from typing import List, Optional, Text

from packaging.version import Version

from delocate import delocate_wheel
from delocate.cmd.common import (
common_parser,
Expand Down Expand Up @@ -61,6 +63,12 @@
" (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:
Expand All @@ -82,6 +90,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 +111,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
Loading