From 7a9a423e99fa2c8d14defaad6ba23747d9179b57 Mon Sep 17 00:00:00 2001 From: GarethCabournDavies Date: Mon, 5 Aug 2024 01:54:35 -0700 Subject: [PATCH 1/4] Try to copy #4789 for v23_release_branch --- .github/workflows/distribution.yml | 2 +- pyproject.toml | 5 +++-- setup.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/distribution.yml b/.github/workflows/distribution.yml index 183c2451604..122f01ae03d 100644 --- a/.github/workflows/distribution.yml +++ b/.github/workflows/distribution.yml @@ -22,7 +22,7 @@ jobs: with: python-version: 3.8 - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.3.1 + run: python -m pip install cibuildwheel - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: diff --git a/pyproject.toml b/pyproject.toml index 0810805586a..94964ac07d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,13 @@ [build-system] requires = ["setuptools", "wheel", - "cython>=0.29.21", + "cython>=3.0.0", "numpy==1.16.0; python_version <= '3.7'", "numpy==1.17.3; python_version == '3.8'", "numpy==1.19.3; python_version == '3.9'", "numpy==1.21.4; python_version =='3.10'", - "numpy; python_version >= '3.11'", + "numpy==1.23.4; python_version >= '3.11'", + "numpy; python_version >= '3.12'" ] # To ensure the best compatibility, try to match the numpy reqs diff --git a/setup.py b/setup.py index 894dffaf0a2..01d381abc2f 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup_requires = ['numpy>=1.16.0'] install_requires = setup_requires + [ 'cython>=0.29', - 'numpy>=1.16.0,!=1.19.0', + 'numpy>=1.16.0,!=1.19.0,<2.0.0', 'scipy>=0.16.0', 'astropy>=2.0.3,!=4.2.1,!=4.0.5', 'matplotlib>=1.5.1', From 0834e9f99cb742e0eb3fe48c9760a045bfb8d929 Mon Sep 17 00:00:00 2001 From: GarethCabournDavies Date: Mon, 5 Aug 2024 02:26:20 -0700 Subject: [PATCH 2/4] Limit scipy version --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 377238db4a3..4857c0aa9d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ # requirements for most basic library use astropy>=2.0.3,!=4.2.1,!=4.0.5 Mako>=1.0.1 -scipy>=0.16.0 +# WORKAROUND FRO V23_RELEASE_BRANCH - LIMIT SCIPY VERSION +scipy>=0.16.0,<1.14.0 matplotlib>=2.0.0 # Remove the upper bound ASAP, this is a temporary fix!!!!!! numpy>=1.16.0,!=1.19.0,<1.24.0 From 9084d59d54d5b16dc8a194ac06f7ec90229673ad Mon Sep 17 00:00:00 2001 From: GarethCabournDavies Date: Mon, 5 Aug 2024 02:35:07 -0700 Subject: [PATCH 3/4] Try this --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 01d381abc2f..b2c2e2f3590 100755 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ install_requires = setup_requires + [ 'cython>=0.29', 'numpy>=1.16.0,!=1.19.0,<2.0.0', - 'scipy>=0.16.0', + 'scipy>=0.16.0,<1.14.0', 'astropy>=2.0.3,!=4.2.1,!=4.0.5', 'matplotlib>=1.5.1', 'mpld3>=0.3', From 89e6d7d90fc20f766e812e4117bef21849e514c7 Mon Sep 17 00:00:00 2001 From: GarethDaviesGW Date: Mon, 5 Aug 2024 12:32:55 +0100 Subject: [PATCH 4/4] Use monkeypatch for numpy's float deprecation --- pycbc/inference/sampler/emcee_pt.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pycbc/inference/sampler/emcee_pt.py b/pycbc/inference/sampler/emcee_pt.py index eff5d96aea6..fe15fabb454 100644 --- a/pycbc/inference/sampler/emcee_pt.py +++ b/pycbc/inference/sampler/emcee_pt.py @@ -34,6 +34,9 @@ from pycbc.inference.io import EmceePTFile from .. import models +# This is a hack that will allow us to continue using emcee's abandoned +# PTSampler, which relied on `numpy.float`, until the end of time. +numpy.float = float if emcee.__version__ >= '3.0.0': raise ImportError