From e66bd356ac7def9e196053efc8912934bd3f27f5 Mon Sep 17 00:00:00 2001 From: Aditya Vaidya Date: Sat, 31 Aug 2024 21:55:18 -0500 Subject: [PATCH 1/6] Fix obsolete numpy directory in setup --- setup.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 77bee040..ad2a9211 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import os from glob import glob -from numpy.distutils.misc_util import get_numpy_include_dirs +import numpy try: import configparser @@ -78,10 +78,10 @@ def get_version(): 'OpenCTM-1.0.3/lib/liblzma/LzFind.c', 'OpenCTM-1.0.3/lib/liblzma/LzmaDec.c', 'OpenCTM-1.0.3/lib/liblzma/LzmaEnc.c', - 'OpenCTM-1.0.3/lib/liblzma/LzmaLib.c',], + 'OpenCTM-1.0.3/lib/liblzma/LzmaLib.c',], libraries=['m'], include_dirs=[ - 'OpenCTM-1.0.3/lib/', - 'OpenCTM-1.0.3/lib/liblzma/'] + get_numpy_include_dirs(), + 'OpenCTM-1.0.3/lib/', + 'OpenCTM-1.0.3/lib/liblzma/', numpy.get_include()], define_macros=[ ('LZMA_PREFIX_CTM', None), ('OPENCTM_BUILD', None), @@ -89,7 +89,7 @@ def get_version(): ] ) formats = Extension('cortex.formats', ['cortex/formats.pyx'], - include_dirs=get_numpy_include_dirs()) + include_dirs=[numpy.get_include()]) DISTNAME = 'pycortex' # VERSION needs to be modified under cortex/version.py From d708bd0599afc95959673a62e55c2b200771bfeb Mon Sep 17 00:00:00 2001 From: Aditya Vaidya Date: Sat, 31 Aug 2024 22:17:52 -0500 Subject: [PATCH 2/6] Remove setuptools version requirement --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ddda6017..fe641d85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] # Minimum requirements for the build system to execute, according to PEP518 # specification. -requires = ["setuptools<60.0", "build", "numpy", "cython<3.0", "wheel"] +requires = ["setuptools", "build", "numpy", "cython<3.0", "wheel"] build-backend = "setuptools.build_meta" [tool.codespell] From b599e2655d7a5b34d49d9339de53a4420e0d095b Mon Sep 17 00:00:00 2001 From: Aditya Vaidya Date: Sat, 31 Aug 2024 22:33:16 -0500 Subject: [PATCH 3/6] distutils.version.LooseVersion --> looseversion.LooseVersion --- cortex/svgoverlay.py | 2 +- cortex/utils.py | 2 +- requirements.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cortex/svgoverlay.py b/cortex/svgoverlay.py index 7dad915c..01ee4d6a 100644 --- a/cortex/svgoverlay.py +++ b/cortex/svgoverlay.py @@ -11,7 +11,7 @@ from scipy.spatial import cKDTree from builtins import zip, str -from distutils.version import LooseVersion +from looseversion import LooseVersion from lxml import etree from lxml.builder import E diff --git a/cortex/utils.py b/cortex/utils.py index 63c3c20b..887755c0 100644 --- a/cortex/utils.py +++ b/cortex/utils.py @@ -9,7 +9,7 @@ import tempfile import urllib.request import warnings -from distutils.version import LooseVersion +from looseversion import LooseVersion from importlib import import_module import h5py diff --git a/requirements.txt b/requirements.txt index b30db96c..1094dd79 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,3 +14,4 @@ pillow nibabel>=2.1 networkx>=2.1 imageio +looseversion From 43d6fc10bdcad1482f372caf39e1ea9fb63d5355 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Sun, 1 Sep 2024 11:39:33 -0700 Subject: [PATCH 4/6] MNT run tests on python 3.12 --- .github/workflows/run_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index e70ca67d..6c82b89d 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] max-parallel: 5 steps: @@ -52,4 +52,4 @@ jobs: env_vars: OS,PYTHON fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - verbose: false \ No newline at end of file + verbose: false From 0fa76b74765c123dc6980dcec7fde43da23ff89c Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Sun, 1 Sep 2024 11:46:04 -0700 Subject: [PATCH 5/6] MNT let's test wheels on all python versions too --- .github/workflows/install_from_wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install_from_wheel.yml b/.github/workflows/install_from_wheel.yml index 7753caea..95097883 100644 --- a/.github/workflows/install_from_wheel.yml +++ b/.github/workflows/install_from_wheel.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] max-parallel: 5 steps: From 656e6c5f61577ef88fa5adddcd9e9345a4468f92 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Sun, 1 Sep 2024 11:49:06 -0700 Subject: [PATCH 6/6] Install setuptools to build wheel --- .github/workflows/install_from_wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install_from_wheel.yml b/.github/workflows/install_from_wheel.yml index 95097883..977f5045 100644 --- a/.github/workflows/install_from_wheel.yml +++ b/.github/workflows/install_from_wheel.yml @@ -35,7 +35,7 @@ jobs: sudo apt-get update sudo apt-get install -y inkscape pip install --upgrade pip - pip install build wheel numpy "cython<3.0" + pip install setuptools build wheel numpy "cython<3.0" - name: Create the wheel run: python setup.py bdist_wheel