pyamrex icon indicating copy to clipboard operation
pyamrex copied to clipboard

PyPI package?

Open BenWibking opened this issue 4 months ago • 3 comments

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.

BenWibking avatar Aug 10 '25 16:08 BenWibking

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...

ax3l avatar Aug 28 '25 07:08 ax3l

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.

BenWibking avatar Sep 02 '25 00:09 BenWibking

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).

ax3l avatar Sep 16 '25 20:09 ax3l