Open vsnever opened 2 months ago
Yeah, this is sensible. We build Cherab wheels for PyPI using Numpy 1.x too (using the now-deprecated oldest-supported-numpy package), so will have the same problem. We can switch to specifying numpy~=2
for Python 3.9 and later since Numpy 2.0 produces a backward-compatible build, but for 3.7 (which UKAEA is still stuck on) and 3.8 would still need oldest-supported-numpy
.
When the Raysect binaries for NumPy 2.0 become available, we'll need to make the following changes:
pyproject.toml:
[build-system]
requires = [
"setuptools>=62.3",
"oldest-supported-numpy; python_version < '3.9'",
"numpy~=2.0; python_version >= '3.9'",
"cython~=3.0"
"raysect==0.8.1",
]
build-backend="setuptools.build_meta"
requirements.txt:
cython~=3.0
numpy>=1.14,<2.0; python_version < '3.9'
numpy~=2.0; python_version >= '3.9'
scipy
matplotlib
raysect==0.8.1
setup.py:
install_requires=[
"cython~=3.0",
"numpy>=1.14,<2.0; python_version < '3.9",
"numpy~=2.0; python_version >= '3.9'"
"scipy",
"matplotlib",
"raysect==0.8.1",
],
NumPy 2.0 was recently released. Although Cherab builds without errors with NumPy 2.0, trying to run any tests results in errors such as:
Looks like NumPy 2.0 is binary incompatible with NumPy 1.x, which Raysect is built against. Until we have Raysect binaries built with NumPy 2.0, I suggest limiting the NumPy version to 1.x in
setup.py
,requirements.txt
andci.yml
.