Skip to content

[MRG] Build POT against oldest-supported-numpy (local PR) #349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 23, 2022
Merged
8 changes: 1 addition & 7 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,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: |
Expand All @@ -37,7 +35,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

Expand Down Expand Up @@ -65,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: |
Expand All @@ -80,8 +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_BEFORE_BUILD: "pip install numpy cython"
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: |
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_wheels_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down
2 changes: 1 addition & 1 deletion docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "numpy>=1.20", "cython>=0.23"]
requires = ["setuptools", "wheel", "oldest-supported-numpy", "cython>=0.23"]
build-backend = "setuptools.build_meta"
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
numpy>=1.20
scipy>=1.3
cython
matplotlib
autograd
pymanopt==0.2.4; python_version <'3'
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@
license='MIT',
scripts=[],
data_files=[],
setup_requires=["numpy>=1.20", "cython>=0.23"],
install_requires=["numpy>=1.20", "scipy>=1.0"],
setup_requires=["oldest-supported-numpy", "cython>=0.23"],
install_requires=["numpy>=1.16", "scipy>=1.0"],
python_requires=">=3.6",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand Down
4 changes: 3 additions & 1 deletion test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down