From 6991f5f1fbf2720fee0dd4119d55dec279dac95e Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 14:29:33 +0800 Subject: [PATCH 01/24] Pin scipy dependency version --- .github/workflows/python-publish.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 32e0236e..339052eb 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,11 +21,11 @@ jobs: matrix: os: [windows-latest, ubuntu-latest, macos-13, macos-14] versions: - - { python: "3.8", numpy: 1.22.4 } - - { python: "3.9", numpy: 1.22.4 } - - { python: "3.10", numpy: 1.22.4 } - - { python: "3.11", numpy: 1.24.3 } - - { python: "3.12", numpy: 1.26.4 } + - { python: "3.8", numpy: 1.22.4, scipy: 1.13.1 } + - { python: "3.9", numpy: 1.22.4, scipy: 1.13.1 } + - { python: "3.10", numpy: 1.22.4, scipy: 1.13.1 } + - { python: "3.11", numpy: 1.24.3, scipy: 1.13.1 } + - { python: "3.12", numpy: 1.26.4, scipy: 1.13.1 } steps: - uses: actions/checkout@v4 @@ -60,15 +60,15 @@ jobs: - name: Upgrade pip wheel setuptools run: pip install wheel setuptools pip --upgrade - - name: Install numpy ${{ matrix.versions.numpy }} - run: pip install numpy==${{ matrix.versions.numpy }} + - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} + run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" - name: Install other dependencies run: | - pip install scipy Cython wheel + pip install Cython wheel - name: Build wheels run: python${{ matrix.versions.python }} setup.py bdist_wheel @@ -105,12 +105,12 @@ jobs: - name: Install numpy run: | - python -m pip install numpy==1.22.4 + python -m pip install numpy==1.22.4 scipy==1.13.1 python -c "import numpy; print(numpy.__version__)" - name: Install other dependencies run: | - python -m pip install scipy Cython wheel + python -m pip install Cython wheel - name: Build source tar file run: python setup.py sdist From 7b3ea14bf7da10a41ebe6a13f84ec3c2a99f23e8 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 14:54:34 +0800 Subject: [PATCH 02/24] display numpy version after installing other dependencies --- .github/workflows/python-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 339052eb..ddda3746 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -63,13 +63,13 @@ jobs: - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - - name: Display numpy version - run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" - - name: Install other dependencies run: | pip install Cython wheel + - name: Display numpy version + run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" + - name: Build wheels run: python${{ matrix.versions.python }} setup.py bdist_wheel From b7b0e7b44664037554c204df812f689c585b33e8 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 14:57:55 +0800 Subject: [PATCH 03/24] Update pip install function --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index ddda3746..b022f52a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -58,7 +58,7 @@ jobs: pip --version - name: Upgrade pip wheel setuptools - run: pip install wheel setuptools pip --upgrade + run: python${{ matrix.versions.python }} -m pip install wheel setuptools pip --upgrade - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} From 483b9c6440236c44ee236dbe8dacefa10750cd8f Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 16:34:28 +0800 Subject: [PATCH 04/24] Pin scipy version for python-package --- .github/workflows/python-package.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9352892d..b28aad59 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -19,11 +19,11 @@ jobs: os: [windows-latest, ubuntu-latest, macos-13, macos-14] # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] versions: - - { python: "3.8", numpy: 1.22.4 } - - { python: "3.9", numpy: 1.22.4 } - - { python: "3.10", numpy: 1.22.4 } - - { python: "3.11", numpy: 1.24.3 } - - { python: "3.12", numpy: 1.26.4 } + - { python: "3.8", numpy: 1.22.4, scipy: 1.13.1 } + - { python: "3.9", numpy: 1.22.4, scipy: 1.13.1 } + - { python: "3.10", numpy: 1.22.4, scipy: 1.13.1 } + - { python: "3.11", numpy: 1.24.3, scipy: 1.13.1 } + - { python: "3.12", numpy: 1.26.4, scipy: 1.13.1 } steps: - name: Get number of CPU cores @@ -60,17 +60,17 @@ jobs: pip --version - name: Upgrade pip wheel setuptools - run: pip install wheel setuptools pip --upgrade + run: python${{ matrix.versions.python }} -m pip install wheel setuptools pip --upgrade - - name: Install numpy ${{ matrix.versions.numpy }} - run: pip install numpy==${{ matrix.versions.numpy }} + - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} + run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" - name: Install other dependencies run: | - pip install scipy Cython pytest pytest-cov flake8 + pip install Cython pytest pytest-cov flake8 python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} pip install -e .[tests] From 5f40c95771273cd3c93b3c217d55230fbc69e7e1 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 17:11:05 +0800 Subject: [PATCH 05/24] Update package steps and pytest step --- .github/workflows/python-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b28aad59..d278687e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -64,16 +64,16 @@ jobs: - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - - - name: Display numpy version - run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" - + - name: Install other dependencies run: | pip install Cython pytest pytest-cov flake8 python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} pip install -e .[tests] + - name: Display numpy version + run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -83,4 +83,4 @@ jobs: - name: Test with pytest run: | - pytest --cov=cornac + python${{ matrix.versions.python }} -m pytest --cov=cornac From db345818400a89bc8e101d85e965341c0aff0f40 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 17:34:30 +0800 Subject: [PATCH 06/24] Reordered numpy scipy installation step --- .github/workflows/python-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d278687e..f059688e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -61,9 +61,6 @@ jobs: - name: Upgrade pip wheel setuptools run: python${{ matrix.versions.python }} -m pip install wheel setuptools pip --upgrade - - - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} - run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - name: Install other dependencies run: | @@ -71,6 +68,9 @@ jobs: python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} pip install -e .[tests] + - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} + run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} + - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" From 423e0cff87268421eb147410eb41fd68d366045d Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 17:38:27 +0800 Subject: [PATCH 07/24] add numpy scipy to install step --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f059688e..f7f02769 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -64,11 +64,11 @@ jobs: - name: Install other dependencies run: | - pip install Cython pytest pytest-cov flake8 + pip install numpy scipy Cython pytest pytest-cov flake8 python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} pip install -e .[tests] - - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} + - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - name: Display numpy version From 6185604d132e732a1500cbb43c720b58f0a12c1a Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 21:35:09 +0800 Subject: [PATCH 08/24] Update python 3.8 scipy package version --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f7f02769..6e8c01bb 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -19,7 +19,7 @@ jobs: os: [windows-latest, ubuntu-latest, macos-13, macos-14] # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] versions: - - { python: "3.8", numpy: 1.22.4, scipy: 1.13.1 } + - { python: "3.8", numpy: 1.22.4, scipy: 1.10.1 } - { python: "3.9", numpy: 1.22.4, scipy: 1.13.1 } - { python: "3.10", numpy: 1.22.4, scipy: 1.13.1 } - { python: "3.11", numpy: 1.24.3, scipy: 1.13.1 } From a64f2c930eafdf3aa6be4ff96fae0b82864707dd Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 22:01:53 +0800 Subject: [PATCH 09/24] update dependency installing sequence --- .github/workflows/python-package.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6e8c01bb..f32fda53 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -63,14 +63,15 @@ jobs: run: python${{ matrix.versions.python }} -m pip install wheel setuptools pip --upgrade - name: Install other dependencies + run: pip install Cython pytest pytest-cov flake8 + + - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: | - pip install numpy scipy Cython pytest pytest-cov flake8 + pip uninstall numpy scipy + pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} pip install -e .[tests] - - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} - run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" From 9eb14df75dbccc253a9c93d21ce330ef56c3d95e Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 22:10:29 +0800 Subject: [PATCH 10/24] Update pinned dependencies numpy scipy installation --- .github/workflows/python-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f32fda53..ec3f94fd 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -63,14 +63,14 @@ jobs: run: python${{ matrix.versions.python }} -m pip install wheel setuptools pip --upgrade - name: Install other dependencies - run: pip install Cython pytest pytest-cov flake8 + run: python${{ matrix.versions.python }} -m pip install Cython pytest pytest-cov flake8 - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: | - pip uninstall numpy scipy - pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} + python${{ matrix.versions.python }} -m pip uninstall numpy scipy + python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} - pip install -e .[tests] + python${{ matrix.versions.python }} -m pip install -e .[tests] - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" From d5e2d7f304bc5ac6d9657d62a7aee24738dbccf0 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 22:33:17 +0800 Subject: [PATCH 11/24] Remove pip install -e --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ec3f94fd..d62c9078 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -70,7 +70,7 @@ jobs: python${{ matrix.versions.python }} -m pip uninstall numpy scipy python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} - python${{ matrix.versions.python }} -m pip install -e .[tests] + # python${{ matrix.versions.python }} -m pip install -e .[tests] - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" From d7d5e89c003d7e9eb015f8f67bc79a8b348bd728 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 22:38:34 +0800 Subject: [PATCH 12/24] Reordered pinned dependencies step --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d62c9078..365e767a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -67,10 +67,10 @@ jobs: - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: | + python${{ matrix.versions.python }} -m pip install -e .[tests] python${{ matrix.versions.python }} -m pip uninstall numpy scipy python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} - # python${{ matrix.versions.python }} -m pip install -e .[tests] - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" From 1ec670a80dc10216fc269445f0e31ca67ab02dc4 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 22:49:49 +0800 Subject: [PATCH 13/24] Attempt installation of pinned bumpy scipy versions --- .github/workflows/python-package.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 365e767a..ee18c589 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -67,10 +67,11 @@ jobs: - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: | + python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} + python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} python${{ matrix.versions.python }} -m pip install -e .[tests] python${{ matrix.versions.python }} -m pip uninstall numpy scipy python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" From aed3d2585d432d2d482a8b75679f7af01dcb7910 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 23:10:55 +0800 Subject: [PATCH 14/24] Confirm pip uninstall numpy scipy --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ee18c589..9d1e4841 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -70,7 +70,7 @@ jobs: python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} python${{ matrix.versions.python }} -m pip install -e .[tests] - python${{ matrix.versions.python }} -m pip uninstall numpy scipy + python${{ matrix.versions.python }} -m pip uninstall -y numpy scipy python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - name: Display numpy version From a4740d4ae454fbb14c4a1ce8b33f46693f5afb13 Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 25 Jun 2024 23:41:57 +0800 Subject: [PATCH 15/24] Pin circleci numpy version --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a47864ea..738f87c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,8 +17,9 @@ jobs: no_output_timeout: 30m command: | pip install --upgrade pip - pip install --only-binary=numpy,scipy numpy==1.22.4 scipy Cython pytest pytest-cov codecov + pip install --only-binary=numpy,scipy numpy==1.22.4 scipy==1.10.1 Cython pytest pytest-cov codecov pip install -e .[tests] + pip install numpy==1.22.4 scipy==1.10.1 - run: name: Run tests no_output_timeout: 30m From 0d784a90604d04d47d075adee95e89581933ab76 Mon Sep 17 00:00:00 2001 From: darrylong Date: Wed, 26 Jun 2024 00:04:42 +0800 Subject: [PATCH 16/24] Remove pip uninstall numpy scipy from python-package --- .github/workflows/python-package.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9d1e4841..4b8d29a3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -70,7 +70,6 @@ jobs: python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} python${{ matrix.versions.python }} -m pip install -e .[tests] - python${{ matrix.versions.python }} -m pip uninstall -y numpy scipy python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - name: Display numpy version From 37d4b600f116620751a05efa756467c434ef2f99 Mon Sep 17 00:00:00 2001 From: darrylong Date: Wed, 26 Jun 2024 11:29:11 +0800 Subject: [PATCH 17/24] Set package version limits to setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 44384bf2..f1bc32a2 100644 --- a/setup.py +++ b/setup.py @@ -343,7 +343,7 @@ def run(self): "recommendation", ], ext_modules=extensions, - install_requires=["numpy", "scipy", "tqdm", "powerlaw"], + install_requires=["numpy<=1.26", "scipy<=1.13", "tqdm", "powerlaw"], extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov", "Flask"]}, cmdclass=cmdclass, packages=find_packages(), From d2cdbc4b9d298e3b6476f03462767b90375fa8e6 Mon Sep 17 00:00:00 2001 From: darrylong Date: Wed, 26 Jun 2024 11:44:59 +0800 Subject: [PATCH 18/24] Change upperbound limit of numpy to < 2.0.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f1bc32a2..0862ce41 100644 --- a/setup.py +++ b/setup.py @@ -343,7 +343,7 @@ def run(self): "recommendation", ], ext_modules=extensions, - install_requires=["numpy<=1.26", "scipy<=1.13", "tqdm", "powerlaw"], + install_requires=["numpy<2.0.0", "scipy<=1.13.1", "tqdm", "powerlaw"], extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov", "Flask"]}, cmdclass=cmdclass, packages=find_packages(), From b8b4ed1bb1b8465f7a02ab7d8f37a9e98e4a8164 Mon Sep 17 00:00:00 2001 From: darrylong Date: Wed, 26 Jun 2024 11:45:28 +0800 Subject: [PATCH 19/24] Remove double installation of pinned dependency --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4b8d29a3..950a3c2d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -70,7 +70,7 @@ jobs: python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} python${{ matrix.versions.python }} -m pip install -e .[tests] - python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} + # python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" From 96bb78b1290ed230269763140ead0cc23f99f873 Mon Sep 17 00:00:00 2001 From: darrylong Date: Wed, 26 Jun 2024 12:19:24 +0800 Subject: [PATCH 20/24] set upper bound installing to numpy and scipy instead of pinning versions --- .github/workflows/python-package.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 950a3c2d..10d2a086 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -67,10 +67,9 @@ jobs: - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: | - python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} + python${{ matrix.versions.python }} -m pip install numpy<2.0.0 scipy<=1.13.1 python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} python${{ matrix.versions.python }} -m pip install -e .[tests] - # python${{ matrix.versions.python }} -m pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} - name: Display numpy version run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" From 4dcc2e14be993d52d43c80f7418f1520f4cb2f08 Mon Sep 17 00:00:00 2001 From: darrylong Date: Wed, 26 Jun 2024 12:23:59 +0800 Subject: [PATCH 21/24] add quotes to upper bound dependencies --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 10d2a086..f7b4f3dc 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -67,7 +67,7 @@ jobs: - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} run: | - python${{ matrix.versions.python }} -m pip install numpy<2.0.0 scipy<=1.13.1 + python${{ matrix.versions.python }} -m pip install "numpy<2.0.0" "scipy<=1.13.1" python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} python${{ matrix.versions.python }} -m pip install -e .[tests] From dbad48b16f9a1b3c8b71cd50be60e0e80681f7d6 Mon Sep 17 00:00:00 2001 From: darrylong Date: Wed, 26 Jun 2024 13:33:08 +0800 Subject: [PATCH 22/24] clean up package action --- .github/workflows/python-package.yml | 44 +++++++++++++--------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f7b4f3dc..f58e2aba 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -17,14 +17,10 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-13, macos-14] - # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - versions: - - { python: "3.8", numpy: 1.22.4, scipy: 1.10.1 } - - { python: "3.9", numpy: 1.22.4, scipy: 1.13.1 } - - { python: "3.10", numpy: 1.22.4, scipy: 1.13.1 } - - { python: "3.11", numpy: 1.24.3, scipy: 1.13.1 } - - { python: "3.12", numpy: 1.26.4, scipy: 1.13.1 } - + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + env: + LIMIT_NUMPY_VERSION: 2.0.0 + LIMIT_SCIPY_VERSION: 1.13.1 steps: - name: Get number of CPU cores uses: SimenB/github-actions-cpu-cores@v2 @@ -32,47 +28,47 @@ jobs: - uses: actions/checkout@v4 - - name: Setup Python ${{ matrix.versions.python }} - if: ${{ (matrix.os != 'macos-14') || ((matrix.os == 'macos-14') && (matrix.versions.python != '3.8') && (matrix.versions.python != '3.9')) }} + - name: Setup Python ${{ matrix.python-version }} + if: ${{ (matrix.os != 'macos-14') || ((matrix.os == 'macos-14') && (matrix.python-version != '3.8') && (matrix.python-version != '3.9')) }} uses: actions/setup-python@v5 id: pysetup with: - python-version: ${{ matrix.versions.python }} + python-version: ${{ matrix.python-version }} cache: 'pip' - name: Setup Python 3.8-3.9 - macos-arm - if: ${{ (matrix.os == 'macos-14') && ((matrix.versions.python == '3.8') || (matrix.versions.python == '3.9')) }} + if: ${{ (matrix.os == 'macos-14') && ((matrix.python-version == '3.8') || (matrix.python-version == '3.9')) }} run: | brew update - brew install python@${{ matrix.versions.python }} + brew install python@${{ matrix.python-version }} curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py - python${{ matrix.versions.python }} get-pip.py + python${{ matrix.python-version }} get-pip.py - name: Create Python alias for Windows if: matrix.os == 'windows-latest' run: | - $newPath = "${{ steps.pysetup.outputs.python-path }}".Replace("python.exe", "python${{ matrix.versions.python }}.exe") + $newPath = "${{ steps.pysetup.outputs.python-path }}".Replace("python.exe", "python${{ matrix.python-version }}.exe") New-Item -ItemType HardLink -Path "$newPath" -Value "${{ steps.pysetup.outputs.python-path }}" - name: Display Python and Pip versions run: | - python${{ matrix.versions.python }} -c "import sys; print(sys.version)" + python${{ matrix.python-version }} -c "import sys; print(sys.version)" pip --version - name: Upgrade pip wheel setuptools - run: python${{ matrix.versions.python }} -m pip install wheel setuptools pip --upgrade + run: python${{ matrix.python-version }} -m pip install wheel setuptools pip --upgrade - name: Install other dependencies - run: python${{ matrix.versions.python }} -m pip install Cython pytest pytest-cov flake8 + run: python${{ matrix.python-version }} -m pip install Cython pytest pytest-cov flake8 - - name: Install pinned dependencies - numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} + - name: Install other dependencies run: | - python${{ matrix.versions.python }} -m pip install "numpy<2.0.0" "scipy<=1.13.1" - python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} - python${{ matrix.versions.python }} -m pip install -e .[tests] + python${{ matrix.python-version }} -m pip install Cython pytest pytest-cov flake8 "numpy<${{ env.LIMIT_NUMPY_VERSION }}" "scipy<=${{ env.LIMIT_SCIPY_VERSION }}" + python${{ matrix.python-version }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }} + python${{ matrix.python-version }} -m pip install -e .[tests] - name: Display numpy version - run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" + run: python${{ matrix.python-version }} -c "import numpy; print(numpy.__version__)" - name: Lint with flake8 run: | @@ -83,4 +79,4 @@ jobs: - name: Test with pytest run: | - python${{ matrix.versions.python }} -m pytest --cov=cornac + python${{ matrix.python-version }} -m pytest --cov=cornac From cb137d8e29a49900361fb28be6bade7a3a394f99 Mon Sep 17 00:00:00 2001 From: darrylong Date: Thu, 27 Jun 2024 17:40:49 +0800 Subject: [PATCH 23/24] standardise circleci numpy scipy versioning --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 738f87c9..3702b089 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,9 @@ jobs: build-and-test: docker: - image: cimg/python:3.10.2 + environment: + LIMIT_NUMPY_VERSION: 2.0.0 + LIMIT_SCIPY_VERSION: 1.13.1 steps: - checkout - python/install-packages: @@ -17,9 +20,8 @@ jobs: no_output_timeout: 30m command: | pip install --upgrade pip - pip install --only-binary=numpy,scipy numpy==1.22.4 scipy==1.10.1 Cython pytest pytest-cov codecov + pip install --only-binary=numpy,scipy "numpy<$LIMIT_NUMPY_VERSION" "scipy<=$LIMIT_SCIPY_VERSION" Cython pytest pytest-cov codecov pip install -e .[tests] - pip install numpy==1.22.4 scipy==1.10.1 - run: name: Run tests no_output_timeout: 30m From a2a7d938286e14be3663da183abf3d4daadac641 Mon Sep 17 00:00:00 2001 From: darrylong Date: Thu, 27 Jun 2024 17:51:18 +0800 Subject: [PATCH 24/24] Update publish actions versioning to align with package --- .github/workflows/python-publish.yml | 40 +++++++++++++--------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b022f52a..fdb260c7 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -12,6 +12,10 @@ on: release: types: [published] +env: + LIMIT_NUMPY_VERSION: 2.0.0 + LIMIT_SCIPY_VERSION: 1.13.1 + jobs: build-wheels: name: Building on ${{ matrix.os }} @@ -20,58 +24,52 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-13, macos-14] - versions: - - { python: "3.8", numpy: 1.22.4, scipy: 1.13.1 } - - { python: "3.9", numpy: 1.22.4, scipy: 1.13.1 } - - { python: "3.10", numpy: 1.22.4, scipy: 1.13.1 } - - { python: "3.11", numpy: 1.24.3, scipy: 1.13.1 } - - { python: "3.12", numpy: 1.26.4, scipy: 1.13.1 } - + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Setup Python ${{ matrix.versions.python }} - if: ${{ (matrix.os != 'macos-14') || ((matrix.os == 'macos-14') && (matrix.versions.python != '3.8') && (matrix.versions.python != '3.9')) }} + - name: Setup Python ${{ matrix.python-version }} + if: ${{ (matrix.os != 'macos-14') || ((matrix.os == 'macos-14') && (matrix.python-version != '3.8') && (matrix.python-version != '3.9')) }} uses: actions/setup-python@v5 id: pysetup with: - python-version: ${{ matrix.versions.python }} + python-version: ${{ matrix.python-version }} cache: 'pip' - name: Setup Python 3.8-3.9 - macos-arm - if: ${{ (matrix.os == 'macos-14') && ((matrix.versions.python == '3.8') || (matrix.versions.python == '3.9')) }} + if: ${{ (matrix.os == 'macos-14') && ((matrix.python-version == '3.8') || (matrix.python-version == '3.9')) }} run: | brew update - brew install python@${{ matrix.versions.python }} + brew install python@${{ matrix.python-version }} curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py - python${{ matrix.versions.python }} get-pip.py + python${{ matrix.python-version }} get-pip.py - name: Create Python alias for Windows if: matrix.os == 'windows-latest' run: | - $newPath = "${{ steps.pysetup.outputs.python-path }}".Replace("python.exe", "python${{ matrix.versions.python }}.exe") + $newPath = "${{ steps.pysetup.outputs.python-path }}".Replace("python.exe", "python${{ matrix.python-version }}.exe") New-Item -ItemType HardLink -Path "$newPath" -Value "${{ steps.pysetup.outputs.python-path }}" - name: Display Python and Pip versions run: | - python${{ matrix.versions.python }} -c "import sys; print(sys.version)" + python${{ matrix.python-version }} -c "import sys; print(sys.version)" pip --version - name: Upgrade pip wheel setuptools - run: python${{ matrix.versions.python }} -m pip install wheel setuptools pip --upgrade + run: python${{ matrix.python-version }} -m pip install wheel setuptools pip --upgrade - - name: Install numpy ${{ matrix.versions.numpy }}, scipy ${{ matrix.versions.scipy }} - run: pip install numpy==${{ matrix.versions.numpy }} scipy==${{ matrix.versions.scipy }} + - name: Install numpy, scipy + run: pip install "numpy<${{ env.LIMIT_NUMPY_VERSION }}" "scipy<=${{ env.LIMIT_SCIPY_VERSION }}" - name: Install other dependencies run: | pip install Cython wheel - name: Display numpy version - run: python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)" + run: python${{ matrix.python-version }} -c "import numpy; print(numpy.__version__)" - name: Build wheels - run: python${{ matrix.versions.python }} setup.py bdist_wheel + run: python${{ matrix.python-version }} setup.py bdist_wheel - name: Rename Linux wheels to supported platform of PyPI if: matrix.os == 'ubuntu-latest' @@ -105,7 +103,7 @@ jobs: - name: Install numpy run: | - python -m pip install numpy==1.22.4 scipy==1.13.1 + python -m pip install "numpy<${{ env.LIMIT_NUMPY_VERSION }}" "scipy<=${{ env.LIMIT_SCIPY_VERSION }}" python -c "import numpy; print(numpy.__version__)" - name: Install other dependencies