nanograv / enterprise

ENTERPRISE (Enhanced Numerical Toolbox Enabling a Robust PulsaR Inference SuitE) is a pulsar timing analysis code, aimed at noise analysis, gravitational-wave searches, and timing model analysis.
https://enterprise.readthedocs.io
MIT License
67 stars 67 forks source link

Support for newer versions of Python (3.11, 3.12) #384

Open rossjjennings opened 6 months ago

rossjjennings commented 6 months ago

Currently, it's not possible to install Enterprise from the master branch, or using pip or conda, on Python 3.11, (although it is possible if you install from the nanograv:dev branch), and it's not possible to install on Python 3.12 at all (at least, without first patching the code to remove the version cap in setup.py). This can result in a situation where trying to install packages that depend on Enterprise (e.g., enterprise_extensions or pint_pal) on these newer Python versions results in a very old version of Enterprise (that didn't have a cap on the Python version) being installed, and ultimately in an unsolvable environment.

I ran into this in trying to set up an environment for the next NANOGrav data release, where we'd want something like an anaconda-env.yaml file or similar, and are trying to use the most recent Python version we can, so having a tagged release on PyPI / conda-forge that supports these newer Python versions would be ideal. I created an older issue about Python 3.11 support back in October (#350), which is now closed as completed, but the changes have only made it to the nanograv:dev branch, and not into a release.

It's possible that Enterprise could support Python 3.12 simply by lifting the version cap in setup.py, but I don't know if that will cause other things to break.

vhaasteren commented 6 months ago

We should just merge dev into master, and do a new release. It's overdue

lzkelley commented 6 months ago

I was able to install enterprise:dev on py312 just by removing the limit in setup.py

mattpitkin commented 4 months ago

There is now a new version of libstempo (v2.4.7) that should work for Python 3.11/3.12. The PyPI release is currently pinned for NumPy <2.0, but I'm planning to generate a NumPy 2.0 compatible version (probably v2.5.0) soon, which I expect would have to only be Python >=3.9 compatible.

JPGlaser commented 3 months ago

Is there anything holding this back? This prevents us from updating the IPTA environments to Python 3.11 because of the strict setup.py restriction.

~ Joe G.