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

Improve error message for when a MacOS target version is not met #212

Merged
merged 2 commits into from
Mar 26, 2024
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
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ rules on making a good Changelog.

## [Unreleased]

### Changed

- Improved error message for when a MacOS target version is not met.
[#211](https://github.com/matthew-brett/delocate/issues/211)

## [0.11.0] - 2024-03-22

### Added
Expand Down
7 changes: 7 additions & 0 deletions delocate/delocating.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,17 @@ def _check_and_update_wheel_name(
f"{lib_path} has a minimum target of {lib_macos_version}"
for lib_path, lib_macos_version in problematic_files
)
min_valid_version = max(
lib_macos_version for _, lib_macos_version in problematic_files
)
raise DelocationError(
"Library dependencies do not satisfy target MacOS"
f" version {require_target_macos_version}:\n"
f"{problematic_files_str}"
f"\nUse '--require-target-macos-version {min_valid_version}'"
" or set the environment variable"
f" 'MACOSX_DEPLOYMENT_TARGET={min_valid_version}'"
" to update minimum supported macOS for this wheel."
)
if new_name != wheel_name:
wheel_path = wheel_path.parent / new_name
Expand Down
4 changes: 4 additions & 0 deletions delocate/tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ def test_delocate_wheel_verify_name_universal2_verify_crash(
assert result.returncode != 0
assert "Library dependencies do not satisfy target MacOS" in result.stderr
assert "libam1.dylib has a minimum target of 12.0" in result.stderr
assert "MACOSX_DEPLOYMENT_TARGET=12.0" in result.stderr
assert "--require-target-macos-version 12.0" in result.stderr


@pytest.mark.xfail( # type: ignore[misc]
Expand Down Expand Up @@ -833,3 +835,5 @@ def test_delocate_wheel_verify_name_universal2_verify_crash_env_var(
assert "Library dependencies do not satisfy target MacOS" in result.stderr
assert "libam1.dylib has a minimum target of 12.0" in result.stderr
assert "module2.abi3.so has a minimum target of 11.0" not in result.stderr
assert "MACOSX_DEPLOYMENT_TARGET=12.0" in result.stderr
assert "--require-target-macos-version 12.0" in result.stderr
Loading