Skip to content

Commit 321c074

Browse files
committed
CI: Drop direct setup.py calls, use pipx where convenient
1 parent 1776a76 commit 321c074

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,20 @@ jobs:
2626
- uses: actions/checkout@v3
2727
with:
2828
fetch-depth: 0
29-
- name: Build in confined, updated environment and interpolate version
29+
- name: Build package
3030
run: |
31-
python -m venv /tmp/buildenv
32-
source /tmp/buildenv/bin/activate
33-
python -m pip install -U setuptools pip wheel twine docutils
34-
python setup.py sdist bdist_wheel
35-
python -m twine check dist/nitransforms*
31+
pipx run build
32+
- name: Determine expected version
33+
run: |
34+
python -m venv /tmp/getversion
35+
source /tmp/getversion/bin/activate
36+
python -m pip install setuptools_scm
3637
3738
# Interpolate version
3839
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
3940
TAG=${GITHUB_REF##*/}
4041
fi
41-
THISVERSION=$( python setup.py --version )
42+
THISVERSION=$( python -m setuptools_scm )
4243
THISVERSION=${TAG:-$THISVERSION}
4344
echo "Expected VERSION: \"${THISVERSION}\""
4445
echo "THISVERSION=${THISVERSION}" >> ${GITHUB_ENV}
@@ -47,7 +48,7 @@ jobs:
4748
run: |
4849
python -m venv /tmp/install_sdist
4950
source /tmp/install_sdist/bin/activate
50-
python -m pip install --upgrade pip wheel
51+
python -m pip install --upgrade pip
5152
python -m pip install dist/nitransforms*.tar.gz
5253
INSTALLED_VERSION=$(python -c 'import nitransforms; print(nitransforms.__version__, end="")')
5354
echo "VERSION: \"${THISVERSION}\""
@@ -58,7 +59,7 @@ jobs:
5859
run: |
5960
python -m venv /tmp/install_wheel
6061
source /tmp/install_wheel/bin/activate
61-
python -m pip install --upgrade pip wheel
62+
python -m pip install --upgrade pip
6263
python -m pip install dist/nitransforms*.whl
6364
INSTALLED_VERSION=$(python -c 'import nitransforms; print(nitransforms.__version__, end="")')
6465
echo "INSTALLED: \"${INSTALLED_VERSION}\""
@@ -94,5 +95,4 @@ jobs:
9495
uses: actions/setup-python@v4
9596
with:
9697
python-version: 3.7
97-
- run: pip install flake8
98-
- run: flake8 nitransforms/
98+
- run: pipx run flake8 nitransforms

0 commit comments

Comments
 (0)