NRLMMD-GEOIPS / akima86

Akima interpolation routines
Other
0 stars 1 forks source link

Build fails up-to-date setuptools #3

Open biosafetylvl5 opened 1 week ago

biosafetylvl5 commented 1 week ago

Description

Environment

Code to demonstrate issue

On build:

215.2 /app/geoips_packages/akima86/setup.py:23: DeprecationWarning: 
215.2 
215.2   `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
215.2   of the deprecation of `distutils` itself. It will be removed for
215.2   Python >= 3.12. For older Python versions it will remain present.
215.2   It is recommended to use `setuptools < 60.0` for those Python versions.
215.2   For more details, see:
215.2     https://numpy.org/devdocs/reference/distutils_status_migration.html 
215.2 
215.2 
215.2   from numpy.distutils.core import setup, Extension
215.3 Traceback (most recent call last):
215.3   File "/app/geoips_packages/akima86/setup.py", line 23, in <module>
215.3     from numpy.distutils.core import setup, Extension
215.3   File "/home/geoips_user/.local/lib/python3.10/site-packages/numpy/distutils/core.py", line 24, in <module>
215.3     from numpy.distutils.command import config, config_compiler, \
215.3   File "/home/geoips_user/.local/lib/python3.10/site-packages/numpy/distutils/command/config.py", line 19, in <module>
215.3     from numpy.distutils.mingw32ccompiler import generate_manifest
215.3   File "/home/geoips_user/.local/lib/python3.10/site-packages/numpy/distutils/mingw32ccompiler.py", line 27, in <module>
215.3     from distutils.msvccompiler import get_build_version as get_build_msvc_version
215.3 ModuleNotFoundError: No module named 'distutils.msvccompiler'
jsolbrig commented 1 week ago

Verified the error. This error only exists on Python 3.12 which is not currently supported by GeoIPS. We are likely going to need to update a few things before we can run on 3.12.

For this particular issue, numpy.distutils was removed in Python 3.12. The normal solution for this would be to replace from numpy.distutils.core import ... with from setuptools import ... in setup.py but that will only work for pure python packages and packages that include C. It appears that setuptools does not handle Fortran, unfortunately.

The two solutions that I've seen so far are:

I'd like to see if there is a way to do this using poetry rather than meson since we use poetry for everything else.