From a5b57befe579c5d729657206c43fd7ffc7dc2247 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Mon, 24 Jul 2023 16:49:50 +0100
Subject: [PATCH] MNT: no more setup.py

---
 .ci/test_template.sh  |  8 ++++----
 .ci/zenodo_deposit.sh | 12 ++++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/.ci/test_template.sh b/.ci/test_template.sh
index 2b95f300a..f8a8fc3d4 100644
--- a/.ci/test_template.sh
+++ b/.ci/test_template.sh
@@ -24,9 +24,9 @@ TEST_OPTS="--cov-report= --cov-append"
 # We run some tests under xvfb-run
 # because they invoke wx. Sleep in
 # between, otherwise xvfb gets upset.
-xvfb-run -a python setup.py test --addopts="$TEST_OPTS tests/test_idle.py"
+xvfb-run -a pytest --addopts="$TEST_OPTS tests/test_idle.py"
 sleep 5
-xvfb-run -a python setup.py test --addopts="$TEST_OPTS tests/test_platform.py"
+xvfb-run -a pytest --addopts="$TEST_OPTS tests/test_platform.py"
 
 # We run the immv/imcp tests as the nobody
 # user because some tests expect permission
@@ -40,11 +40,11 @@ cmd="$cmd --addopts='$TEST_OPTS tests/test_scripts/test_immv_imcp.py tests/test_
 su -s /bin/bash -c "$cmd" nobody
 
 # All other tests can be run as normal.
-python setup.py test --addopts="$TEST_OPTS -m 'not longtest' --ignore=tests/test_idle.py --ignore=tests/test_platform.py --ignore=tests/test_immv_imcp.py --ignore=tests/test_scripts/test_immv_imcp.py"
+pytest --addopts="$TEST_OPTS -m 'not longtest' --ignore=tests/test_idle.py --ignore=tests/test_platform.py --ignore=tests/test_immv_imcp.py --ignore=tests/test_scripts/test_immv_imcp.py"
 
 # Long tests are only run on release branches
 if [[ $CI_COMMIT_REF_NAME == v* ]]; then
-    python setup.py test --addopts="$TEST_OPTS -m 'longtest'"
+    pytest --addopts="$TEST_OPTS -m 'longtest'"
 fi
 
 python -m coverage report -i
diff --git a/.ci/zenodo_deposit.sh b/.ci/zenodo_deposit.sh
index 32856bb59..9c4a0ed7e 100644
--- a/.ci/zenodo_deposit.sh
+++ b/.ci/zenodo_deposit.sh
@@ -9,10 +9,14 @@ zenodo_url=$1
 zenodo_tkn=$2
 zenodo_depid=$3
 
-version=`python setup.py -V`
-upfile=`pwd`/dist/fslpy-"$version".tar.gz
-metafile=`pwd`/.ci/zenodo_meta.json.jinja2
-date=`date +"%Y-%m-%d"`
+version=$(cat fsl/version.py      |
+          egrep '^__version__ +=' |
+          cut -d "=" -f 2         |
+          tr -d "'"               |
+          tr -d ' ')
+upfile=$(pwd)/dist/fslpy-"$version".tar.gz
+metafile=$(pwd)/.ci/zenodo_meta.json.jinja2
+date=$(date +"%Y-%m-%d")
 
 pip install --retries 10 requests jinja2
 
-- 
GitLab