Describe the bug
When trying to install pyAMARES on an Apple Silicon Mac (ARM64) using modern, strict package installers like uv (or pip with certain caching/resolution behaviors), the installation fails. The installer attempts to find an ARM64 wheel for hlsvdpro and crashes when it cannot find one.
Root Cause
In setup.py, the requirement for hlsvdpro is evaluated at build-time rather than install-time:
if platform.machine().lower() in ["x86_64", "amd64"]:
install_requires.append("hlsvdpro>=2.0.0")
Because PyPI wheels are typically built on x86_64 CI/CD servers (like GitHub Actions), this if statement evaluates to True during the build process. As a result, hlsvdpro gets permanently baked into the wheel's static METADATA as a hard dependency for all platforms. When a user on an M-series Mac downloads the wheel, uv reads the static metadata, assumes hlsvdpro is required, and fails because there is no ARM64 wheel available for it.
Proposed Solution
We can fix this by moving the platform logic into a PEP 508 Environment Marker within the install_requires list, ensuring the evaluation happens dynamically on the user's machine at install-time. (This is the same approach pyAMARES is already using for ipywidgets versioning).
Before:
if platform.machine().lower() in ["x86_64", "amd64"]:
install_requires.append("hlsvdpro>=2.0.0")
After:
# Added directly to the install_requires list:
install_requires = [
# ... other dependencies ...
"hlsvdpro>=2.0.0; platform_machine == 'x86_64' or platform_machine == 'amd64'",
]
Next Steps
I already have this running locally and it completely resolves the issue on my Mac. I will submit a PR with this one-line fix shortly!
Describe the bug
When trying to install
pyAMARESon an Apple Silicon Mac (ARM64) using modern, strict package installers likeuv(or pip with certain caching/resolution behaviors), the installation fails. The installer attempts to find an ARM64 wheel forhlsvdproand crashes when it cannot find one.Root Cause
In
setup.py, the requirement forhlsvdprois evaluated at build-time rather than install-time:Because PyPI wheels are typically built on x86_64 CI/CD servers (like GitHub Actions), this
ifstatement evaluates toTrueduring the build process. As a result,hlsvdprogets permanently baked into the wheel's staticMETADATAas a hard dependency for all platforms. When a user on an M-series Mac downloads the wheel,uvreads the static metadata, assumeshlsvdprois required, and fails because there is no ARM64 wheel available for it.Proposed Solution
We can fix this by moving the platform logic into a PEP 508 Environment Marker within the
install_requireslist, ensuring the evaluation happens dynamically on the user's machine at install-time. (This is the same approachpyAMARESis already using foripywidgetsversioning).Before:
After:
Next Steps
I already have this running locally and it completely resolves the issue on my Mac. I will submit a PR with this one-line fix shortly!