PyPI package?
What would be required to make a CPU-only PyPI package available to users?
A lot of Python users have fully switched from conda/mambda to uv (https://docs.astral.sh/uv/), since it's orders of magnitude faster. However, uv doesn't work with conda packages, so there is no way to uv pip install pyamrex yet.
An alternative to uv that is also very fast and works with conda packages is pixi
I have experimented with pip packages for pyAMReX for ImpactX here: https://github.com/BLAST-ImpactX/impactx-wheels
The trick to make this useful as a standalone AMReX package is to likely also include at least the header files, but likely all the build install artifacts (including CMake modules), so that dependent PyPI packages can build against it.
We also need to limit ourselves to things one can easily support, e.g., no random OpenMP libs linked, etc. All in all the only safe thing to publish is a fully un-accelerated AMReX build with regards to PyPI. One can publish more sophisticated backends, but that needs a ton of documentation to not create an ABI mess. PyPI is just extremely limited for anything not pure Python...
Most of our users use single-core yt to analyze the simulations outputs, so the primary use case for us is to provide a painless on-ramp to use pyAMReX for those analysis tasks. So a single CPU core pyAMReX build on PyPI would still be very useful for a lot of our pyAMReX use cases.
Agreed, we do the same for ImpactX:
- https://impactx.readthedocs.io/en/latest/install/users.html#using-the-pypi-package
- https://pypi.org/project/impactx-noacc
- https://github.com/BLAST-ImpactX/impactx-wheels
More generally, we could explore WheelNext:
- https://discuss.python.org/t/wheelnext-wheel-variants-an-update-and-a-request-for-feedback/102383
- https://wheelnext.dev/how_to_participate/
- https://wheelnext.dev/proposals/pepxxx_wheel_variant_support/
- https://astral.sh/blog/wheel-variants
Like in other package managers, this could also help to actually depend on a pyAMReX package (and AMReX so/dll).