From b6f230e983bfa18de59ec39e86b4f3512e2a6f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Wed, 27 Sep 2023 12:42:26 -0400 Subject: [PATCH] ENH: Relax the Python package version requirements Relax the Python package version requirements: use `>=` so that newer package version can be used. Especially relevant for the package to work with newer Python versions. Add a test case to the GHA workflow to test the minimum required versions. --- .github/workflows/test_package.yaml | 7 +++++++ requirements.txt | 20 ++++++++++---------- setup.py | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test_package.yaml b/.github/workflows/test_package.yaml index 9713563b..9166b475 100644 --- a/.github/workflows/test_package.yaml +++ b/.github/workflows/test_package.yaml @@ -12,6 +12,7 @@ jobs: matrix: os: [ubuntu-latest] python-version: ['3.8'] + requires: ['minimal', 'latest'] steps: - name: Check out repository @@ -24,6 +25,12 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Set min. dependencies + if: matrix.requires == 'minimal' + run: | + python -c "req = open('requirements.txt').read().replace(' >= ', ' == ') ; open('requirements.txt', 'w').write(req)" + python -c "req = open('setup.py').read().replace(' >= ', ' == ') ; open('setup.py', 'w').write(req)" + # - name: Cache pip # uses: actions/cache@v2 # id: cache diff --git a/requirements.txt b/requirements.txt index 885d0ce3..384fae56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ -cython==0.29.* -joblib==1.1.* -matplotlib==3.6.* -nibabel==3.0.* -numpy==1.20.* -pandas==2.0.3 -setuptools==44.0.* -scipy==1.4.* -statsmodels==0.10.* -vtk==9.1.* +cython>=0.29.0 +joblib>=1.1.0 +matplotlib>=3.6.0 +nibabel>=3.0.0 +numpy>=1.20.0 +pandas>=2.0.3 +setuptools>=44.0.0 +scipy>=1.4.0 +statsmodels>=0.10.0 +vtk>=9.1.0 xlrd diff --git a/setup.py b/setup.py index 6f90b0e4..a2cdfe69 100755 --- a/setup.py +++ b/setup.py @@ -86,7 +86,7 @@ def build_extensions(self): external_dependencies.append(dependency) -setup_requires = ['cython==0.29.*', 'numpy==1.20.*'] +setup_requires = ['cython>=0.29.0', 'numpy>=1.20.0'] setup( name='WhiteMatterAnalysis', version='0.3.0',