diff --git a/Makefile b/Makefile index a229c13c2..3e2a90c9e 100644 --- a/Makefile +++ b/Makefile @@ -342,7 +342,7 @@ wheel-macos: parakeet-helper ROOT_MAC_WHEEL=$$(ls dist/solstone-*-macosx_14_0_arm64.whl); \ SOURCE_COMMIT=$$(git rev-parse HEAD); \ CORE_LOCK_SHA256=$$(shasum -a 256 core/Cargo.lock | awk '{print $$1}'); \ - python3 scripts/record_macos_native_wheel.py --role root --wheel "$$ROOT_MAC_WHEEL" --signing-facts "$$ROOT_FACTS" --source-commit "$$SOURCE_COMMIT" --core-lock-sha256 "$$CORE_LOCK_SHA256" --out dist/macos-native-root.json + python3 -m scripts.record_macos_native_wheel --role root --wheel "$$ROOT_MAC_WHEEL" --signing-facts "$$ROOT_FACTS" --source-commit "$$SOURCE_COMMIT" --core-lock-sha256 "$$CORE_LOCK_SHA256" --out dist/macos-native-root.json @echo "==> building macosx_14_0_arm64 solstone-core wheel" MACOSX_DEPLOYMENT_TARGET=14.0 MATURIN_PEP517_ARGS="--locked --target aarch64-apple-darwin" $(UV) build --package solstone-core --wheel @echo "==> signing and notarizing solstone-core" @@ -357,7 +357,7 @@ wheel-macos: parakeet-helper python3 scripts/repack_wheel_record.py "$$CORE_TMP" "$$CORE_MAC_WHEEL"; \ SOURCE_COMMIT=$$(git rev-parse HEAD); \ CORE_LOCK_SHA256=$$(shasum -a 256 core/Cargo.lock | awk '{print $$1}'); \ - python3 scripts/record_macos_native_wheel.py --role core --wheel "$$CORE_MAC_WHEEL" --signing-facts "$$CORE_FACTS" --source-commit "$$SOURCE_COMMIT" --core-lock-sha256 "$$CORE_LOCK_SHA256" --out dist/macos-native-core.json + python3 -m scripts.record_macos_native_wheel --role core --wheel "$$CORE_MAC_WHEEL" --signing-facts "$$CORE_FACTS" --source-commit "$$SOURCE_COMMIT" --core-lock-sha256 "$$CORE_LOCK_SHA256" --out dist/macos-native-core.json else wheel-macos: @echo "wheel-macos: only supported on Darwin/arm64 (got $(shell uname -s)/$(shell uname -m))" >&2 diff --git a/tests/test_release_native_records.py b/tests/test_release_native_records.py index 3ebb0307b..3b80516fe 100644 --- a/tests/test_release_native_records.py +++ b/tests/test_release_native_records.py @@ -5,6 +5,8 @@ from __future__ import annotations import hashlib import json +import subprocess +import sys import zipfile from pathlib import Path @@ -61,6 +63,22 @@ def _facts_file(tmp_path: Path, facts: dict) -> Path: return path +def test_native_record_cli_and_makefile_use_package_module() -> None: + root = Path(__file__).resolve().parents[1] + result = subprocess.run( + [sys.executable, "-m", "scripts.record_macos_native_wheel", "--help"], + cwd=root, + check=False, + capture_output=True, + text=True, + ) + + assert result.returncode == 0, result.stderr + makefile = (root / "Makefile").read_text(encoding="utf-8") + assert makefile.count("python3 -m scripts.record_macos_native_wheel") == 2 + assert "python3 scripts/record_macos_native_wheel.py" not in makefile + + def test_exactly_two_role_records_are_written_and_not_interchangeable( tmp_path: Path, ) -> None: