From 3740b4859c8a02ce0cad0d63c5a3942e19176275 Mon Sep 17 00:00:00 2001 From: David Ghiurco <9147386+davidghiurco@users.noreply.github.com> Date: Fri, 11 Feb 2022 11:32:06 -0600 Subject: [PATCH 01/10] Configure setup to compile against oldest supported numpy version using the meta-package: https://pypi.org/project/oldest-supported-numpy/ - build all wheels --- .github/workflows/build_wheels.yml | 3 --- pyproject.toml | 2 +- requirements.txt | 1 - setup.py | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index c746eb8b5..d0d936e7b 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -28,7 +28,6 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -U "cython" - name: Install cibuildwheel run: | @@ -37,7 +36,6 @@ jobs: - name: Build wheels env: CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp* cp36*" # remove pypy on mac and win (wrong version) - CIBW_BEFORE_BUILD: "pip install numpy cython" run: | python -m cibuildwheel --output-dir wheelhouse @@ -81,7 +79,6 @@ jobs: - name: Build wheels env: CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp* cp*musl* cp36*" # remove pypy on mac and win (wrong version) - CIBW_BEFORE_BUILD: "pip install numpy cython" CIBW_ARCHS_LINUX: auto aarch64 # force aarch64 with QEMU CIBW_ARCHS_MACOS: x86_64 universal2 arm64 run: | diff --git a/pyproject.toml b/pyproject.toml index 93ebab343..67d36346f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "wheel", "numpy>=1.20", "cython>=0.23"] +requires = ["setuptools", "wheel", "oldest-supported-nunpy", "cython>=0.23"] build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f9934ce14..7cbb29a48 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ numpy>=1.20 scipy>=1.3 -cython matplotlib autograd pymanopt==0.2.4; python_version <'3' diff --git a/setup.py b/setup.py index d46ae1cc9..887294af2 100644 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ license='MIT', scripts=[], data_files=[], - setup_requires=["numpy>=1.20", "cython>=0.23"], + setup_requires=["oldest-supported-numpy", "cython>=0.23"], install_requires=["numpy>=1.20", "scipy>=1.0"], classifiers=[ 'Development Status :: 5 - Production/Stable', From aa1a4950bac7769cbfee60740ca4676021d4f221 Mon Sep 17 00:00:00 2001 From: David Ghiurco <9147386+davidghiurco@users.noreply.github.com> Date: Fri, 11 Feb 2022 11:50:26 -0600 Subject: [PATCH 02/10] Set minimum Python requirement to `>=3.7` in setup.py since !328 removed Python 3.6 support - build all wheels --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 887294af2..4251a5f8b 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,7 @@ data_files=[], setup_requires=["oldest-supported-numpy", "cython>=0.23"], install_requires=["numpy>=1.20", "scipy>=1.0"], + python_requires=">=3.7", classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -91,7 +92,6 @@ 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering :: Information Analysis', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', From 77a2b7ffcea38f0f6f34eec30e2d60f173b04399 Mon Sep 17 00:00:00 2001 From: David Ghiurco <9147386+davidghiurco@users.noreply.github.com> Date: Fri, 11 Feb 2022 12:12:50 -0600 Subject: [PATCH 03/10] Fix typo in pyproject.toml - build all wheels --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 67d36346f..378920623 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "wheel", "oldest-supported-nunpy", "cython>=0.23"] +requires = ["setuptools", "wheel", "oldest-supported-numpy", "cython>=0.23"] build-backend = "setuptools.build_meta" \ No newline at end of file From 04b1cf9814410f7a7368094c404e3364d120c4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 11 Feb 2022 22:13:20 +0100 Subject: [PATCH 04/10] Update setup.py build all wheels --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4251a5f8b..6be768ea6 100644 --- a/setup.py +++ b/setup.py @@ -69,7 +69,7 @@ scripts=[], data_files=[], setup_requires=["oldest-supported-numpy", "cython>=0.23"], - install_requires=["numpy>=1.20", "scipy>=1.0"], + install_requires=["numpy>=1.16", "scipy>=1.0"], python_requires=">=3.7", classifiers=[ 'Development Status :: 5 - Production/Stable', From 2cf13dd60ab787141c7a37521f6ed672581cd390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Tue, 15 Feb 2022 09:08:33 +0100 Subject: [PATCH 05/10] Update setup.py and build wheels --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6be768ea6..da8904b9e 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ data_files=[], setup_requires=["oldest-supported-numpy", "cython>=0.23"], install_requires=["numpy>=1.16", "scipy>=1.0"], - python_requires=">=3.7", + python_requires=">=3.6", classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', From 0ef2a31a310536ec094dbb91924a264bcab22766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Tue, 22 Feb 2022 17:38:35 +0100 Subject: [PATCH 06/10] build wheels --- docs/source/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index e74b0190f..09a362bac 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -1002,7 +1002,7 @@ FAQ 2. **pip install POT fails with error : ImportError: No module named Cython.Build** - As discussed shortly in the README file. POT requires to have :code:`numpy` + As discussed shortly in the README file. POT<0.8 requires to have :code:`numpy` and :code:`cython` installed to build. This corner case is not yet handled by :code:`pip` and for now you need to install both library prior to installing POT. From 72c6e1c7c3915a723a81875f7bf73f389bf1b2c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Tue, 22 Feb 2022 17:43:02 +0100 Subject: [PATCH 07/10] remoe install dpeendencies for wheels building and build wheels --- .github/workflows/build_wheels.yml | 3 --- .github/workflows/build_wheels_weekly.yml | 2 -- 2 files changed, 5 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index d0d936e7b..8bf7b7e8e 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -27,7 +27,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt - name: Install cibuildwheel run: | @@ -63,8 +62,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -U "cython" - name: Install cibuildwheel run: | diff --git a/.github/workflows/build_wheels_weekly.yml b/.github/workflows/build_wheels_weekly.yml index dbf342f0f..b9154c532 100644 --- a/.github/workflows/build_wheels_weekly.yml +++ b/.github/workflows/build_wheels_weekly.yml @@ -26,8 +26,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -U "cython" - name: Install cibuildwheel run: | From 2aedb06fffecd357ad15547fd45479f9282f23b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Wed, 23 Feb 2022 08:07:34 +0100 Subject: [PATCH 08/10] Apply suggestions from code review Co-authored-by: David M. Ghiurco <9147386+davidghiurco@users.noreply.github.com> --- .github/workflows/build_wheels.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 8bf7b7e8e..475058c8c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -75,7 +75,7 @@ jobs: - name: Build wheels env: - CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp* cp*musl* cp36*" # remove pypy on mac and win (wrong version) + CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp* cp*musl*" # remove pypy on mac and win (wrong version) CIBW_ARCHS_LINUX: auto aarch64 # force aarch64 with QEMU CIBW_ARCHS_MACOS: x86_64 universal2 arm64 run: | diff --git a/setup.py b/setup.py index da8904b9e..c03191a8b 100644 --- a/setup.py +++ b/setup.py @@ -92,6 +92,7 @@ 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering :: Information Analysis', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', From 36121312ef990196f0128b84ea23678491f78835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Wed, 23 Feb 2022 08:13:06 +0100 Subject: [PATCH 09/10] correct timing test add info in release file and build wheels --- RELEASES.md | 1 + test/test_utils.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 925920a77..92b7ba577 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -16,6 +16,7 @@ - Bug in instantiating an `autograd` function (`ValFunction`, Issue #337, PR #338) +- Make POT ABI compatible with old and new numpy (Issue #346, PR #349) ## 0.8.1.0 *December 2021* diff --git a/test/test_utils.py b/test/test_utils.py index 5ad167b35..a0fbf8d2b 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -67,7 +67,9 @@ def test_tic_toc(): t2 = ot.toq() # test timing - np.testing.assert_allclose(0.1, t, rtol=1e-1, atol=1e-1) + # np.testing.assert_allclose(0.1, t, rtol=1e-1, atol=1e-1) + # very slow macos github action equality not possible + assert t>0.09 # test toc vs toq np.testing.assert_allclose(t, t2, rtol=1e-1, atol=1e-1) From aac1a2a4e1c3afb904af7e4cfe4f44c77b1ce863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Wed, 23 Feb 2022 08:14:33 +0100 Subject: [PATCH 10/10] pep8 and build wheels --- test/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_utils.py b/test/test_utils.py index a0fbf8d2b..3cfd295ed 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -69,7 +69,7 @@ def test_tic_toc(): # test timing # np.testing.assert_allclose(0.1, t, rtol=1e-1, atol=1e-1) # very slow macos github action equality not possible - assert t>0.09 + assert t > 0.09 # test toc vs toq np.testing.assert_allclose(t, t2, rtol=1e-1, atol=1e-1)