Skip to content

Commit

Permalink
MNT Remove dependency on distutils (#553)
Browse files Browse the repository at this point in the history
* Fix obsolete numpy directory in setup

* Remove setuptools version requirement

* distutils.version.LooseVersion --> looseversion.LooseVersion

* MNT run tests on python 3.12

* MNT let's test wheels on all python versions too

* Install setuptools to build wheel

---------

Co-authored-by: Aditya Vaidya <kroq-gar78@users.noreply.github.com>
Co-authored-by: Matteo Visconti di Oleggio Castello <mvdoc@berkeley.edu>
  • Loading branch information
3 people authored Sep 1, 2024
1 parent 97370be commit 5e91db6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/install_from_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -52,4 +52,4 @@ jobs:
env_vars: OS,PYTHON
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: false
verbose: false
2 changes: 1 addition & 1 deletion cortex/svgoverlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cortex/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ pillow
nibabel>=2.1
networkx>=2.1
imageio
looseversion
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -78,18 +78,18 @@ 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),
#('__DEBUG_', None),
]
)
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
Expand Down

0 comments on commit 5e91db6

Please sign in to comment.