xcdat icon indicating copy to clipboard operation
xcdat copied to clipboard

[Enhancement]: Consider distribution on PyPI (`pip`)

Open tomvothecoder opened this issue 11 months ago • 7 comments

Is your feature request related to a problem?

As suggested by @lee1043, distributing xcdat on PyPI can benefit us by adding another way of accessing the package.

We'll need to be aware that all of the dependencies of a package must be available on the distribution platform (e.g., conda package must have all dependencies available on conda).

Describe the solution you'd like

  • [ ] Check if all dependencies are available on PyPI
  • [ ] If yes, learn the process for building the package and distributing it on PyPI
  • [ ] Implement the process

Describe alternatives you've considered

No response

Additional context

No response

tomvothecoder avatar Jan 29 '25 18:01 tomvothecoder

This would be hugely helpful. I'm working on a CLI application where all of the dependencies are available in PyPI except xcdat, which makes packaging and distribution really tricky for me.

I've just run through the dependencies list from the dependencies list linked above, and all of them appear to be available in PyPI.

egargan avatar Mar 27 '25 16:03 egargan

Hi @egargan, thanks for letting us know this would also be helpful to you too. I also appreciate you double-checking that the dependencies are available on PyPI. I will make this a higher priority item and keep you posted once it is done!

tomvothecoder avatar Mar 27 '25 16:03 tomvothecoder

Unfortunately, esmpy is not hosted on PyPI, which complicates things. xcdat depends on xesmf, which depends on esmpy.

ESMpy must be installed through Conda or compiled manually; it is not available through PyPI. When installing xESMF with pip, the ESMpy package must be manually installed first. -- Source: https://xesmf.readthedocs.io/en/stable/installation.html#notes-about-esmpy

@xylar @jasonb5 Any thoughts on how we should proceed here? Is it still a good idea to try to get xcdat distributed on PyPI? I think the pip/PyPI environment setup might get overly complicated since the user needs to manually install esmpy first, then install xcdat (with xesmf).

We originally made xESMF an optional dependency, but changed it to a required dependency because it is the default horizontal regridding tool that is bundled with the core capabilities of xCDAT.

tomvothecoder avatar Mar 27 '25 20:03 tomvothecoder

I talked with the ESMF developers and they're interested in looking into ESMPy distribution on PyPI but to me it seems like a really heavy lift. I wouldn't count on that happening. Without that, I don't think having xcdat on PyPI is worth the bother.

xylar avatar Mar 27 '25 20:03 xylar

I talked with the ESMF developers and they're interested in looking into ESMPy distribution on PyPI but to me it seems like a really heavy lift. I wouldn't count on that happening. Without that, I don't think having xcdat on PyPI is worth the bother.

Thanks @xylar! I found the related GitHub issues: https://github.com/esmf-org/esmf/issues/256 and https://github.com/conda-forge/esmpy-feedstock/issues/72.

Unfortunately, we'll need to wait for this to be done (if ever) for a clean distribution of xcdat on PyPI.

tomvothecoder avatar Mar 27 '25 21:03 tomvothecoder

Thank you both for looking into this! I'll cross my fingers that the ESMPy devs manage to come up with a solution. I'll keep an eye on those issues you linked @tomvothecoder, thanks for digging those out.

Even without xcdat in PyPI, it sounds like finding a way to bundle ESMPy into this app I'm building is going to be the real challange 😨

egargan avatar Mar 31 '25 16:03 egargan

Thank you both for looking into this! I'll cross my fingers that the ESMPy devs manage to come up with a solution. I'll keep an eye on those issues you linked @tomvothecoder, thanks for digging those out.

Even without xcdat in PyPI, it sounds like finding a way to bundle ESMPy into this app I'm building is going to be the real challange 😨

Of course @egargan! Let us know if you need anything related to xCDAT.

tomvothecoder avatar Mar 31 '25 17:03 tomvothecoder