Skip to content

Commit e905ef1

Browse files
committed
CI: Convert stable CI to tox
1 parent 4b6adaa commit e905ef1

File tree

2 files changed

+25
-54
lines changed

2 files changed

+25
-54
lines changed

.github/workflows/stable.yml

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ jobs:
9494
if: matrix.package == 'archive'
9595
run: pip install archive/nibabel-archive.tgz
9696
- run: python -c 'import nibabel; print(nibabel.__version__)'
97-
- name: Install test extras
98-
run: pip install nibabel[test]
97+
- name: Install minimum test dependencies
98+
run: pip install pytest pytest-doctest-plus
9999
- name: Run tests
100100
run: pytest --doctest-modules --doctest-plus -v --pyargs nibabel
101101

@@ -107,57 +107,24 @@ jobs:
107107
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
108108
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
109109
architecture: ['x64', 'x86']
110-
install: ['pip']
111-
check: ['test']
112-
pip-flags: ['']
113-
depends: ['REQUIREMENTS']
114-
optional-depends: ['DEFAULT_OPT_DEPENDS']
110+
dependencies: ['full']
115111
include:
116112
# Basic dependencies only
117113
- os: ubuntu-latest
118114
python-version: 3.8
119-
install: pip
120-
check: test
121-
pip-flags: ''
122-
depends: REQUIREMENTS
123-
optional-depends: ''
115+
dependencies: ''
124116
# Absolute minimum dependencies
125117
- os: ubuntu-latest
126118
python-version: 3.8
127-
install: pip
128-
check: test
129-
pip-flags: ''
130-
depends: MIN_REQUIREMENTS
131-
optional-depends: ''
132-
# Absolute minimum dependencies plus old MPL, Pydicom, Pillow
133-
- os: ubuntu-latest
134-
python-version: 3.8
135-
install: pip
136-
check: test
137-
pip-flags: ''
138-
depends: MIN_REQUIREMENTS
139-
optional-depends: MIN_OPT_DEPENDS
140-
# Clean install imports only with package-declared dependencies
141-
- os: ubuntu-latest
142-
python-version: 3.8
143-
install: pip
144-
check: skiptests
145-
pip-flags: ''
146-
depends: ''
119+
dependencies: 'min'
147120
exclude:
148121
- os: ubuntu-latest
149122
architecture: x86
150123
- os: macos-latest
151124
architecture: x86
152-
env:
153-
DEPENDS: ${{ matrix.depends }}
154-
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
155-
INSTALL_TYPE: ${{ matrix.install }}
156-
CHECK_TYPE: ${{ matrix.check }}
157-
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
158125

159126
steps:
160-
- uses: actions/checkout@v4
127+
- uses: actions/checkout@v3
161128
with:
162129
submodules: recursive
163130
fetch-depth: 0
@@ -166,31 +133,27 @@ jobs:
166133
with:
167134
python-version: ${{ matrix.python-version }}
168135
architecture: ${{ matrix.architecture }}
136+
allow-prereleases: true
169137
- name: Display Python version
170138
run: python -c "import sys; print(sys.version)"
171-
- name: Create virtual environment
172-
run: tools/ci/create_venv.sh
173-
- name: Build archive
139+
- name: Install tox
174140
run: |
175-
source tools/ci/build_archive.sh
176-
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
177-
- name: Install dependencies
178-
run: tools/ci/install_dependencies.sh
179-
- name: Install NiBabel
180-
run: tools/ci/install.sh
181-
- name: Run tests
182-
if: ${{ matrix.check != 'skiptests' }}
183-
run: tools/ci/check.sh
141+
python -m pip install --upgrade pip
142+
python -m pip install tox tox-gh-actions
143+
- name: Run tox
144+
run: tox
145+
env:
146+
DEPENDS: ${{ matrix.dependencies }}
184147
- uses: codecov/codecov-action@v3
185148
if: ${{ always() }}
186149
with:
187150
files: cov.xml
188151
- name: Upload pytest test results
189-
if: ${{ always() && matrix.check == 'test' }}
190152
uses: actions/upload-artifact@v3
191153
with:
192154
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
193-
path: for_testing/test-results.xml
155+
path: test-results.xml
156+
if: ${{ always() }}
194157

195158
publish:
196159
runs-on: ubuntu-latest

tox.ini

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ install_command =
3838
{opts} {packages}
3939
pip_pre =
4040
pre: true
41+
# getpass.getuser() sources for Windows:
42+
pass_env =
43+
LOGNAME
44+
USER
45+
LNAME
46+
USERNAME
4147
deps =
4248
pytest
4349
pytest-doctestplus
@@ -61,7 +67,9 @@ deps =
6167
full,pre: scipy >=1.6
6268
full,pre: matplotlib >=3.4
6369
full,pre: pillow >=8.1
64-
full,pre: h5py >=3.0
70+
full: h5py >=3.0
71+
# h5py missing 3.12 wheels, so disable from pre for now
72+
# full,pre: h5py >=3.0
6573
full,pre: indexed_gzip >=1.4
6674
full,pre: pyzstd >=0.14.3
6775
min: pydicom ==2.1

0 commit comments

Comments
 (0)