Skip to content

Commit 1598718

Browse files
committed
CI: Convert pre-release CI jobs to tox
1 parent 98b7bb9 commit 1598718

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

.github/workflows/pre-release.yml

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,7 @@ jobs:
3535
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
3636
python-version: ["3.9", "3.10", "3.11", "3.12"]
3737
architecture: ['x64', 'x86']
38-
install: ['pip']
39-
check: ['test']
40-
pip-flags: ['PRE_PIP_FLAGS']
41-
depends: ['REQUIREMENTS']
42-
optional-depends: ['DEFAULT_OPT_DEPENDS']
43-
include:
44-
# Pydicom master
45-
- os: ubuntu-latest
46-
python-version: "3.11"
47-
install: pip
48-
check: test
49-
pip-flags: ''
50-
depends: REQUIREMENTS
51-
optional-depends: PYDICOM_MASTER
52-
exclude:
53-
- os: ubuntu-latest
54-
architecture: x86
55-
- os: macos-latest
56-
architecture: x86
57-
- python-version: '3.12'
58-
architecture: x86
59-
60-
env:
61-
DEPENDS: ${{ matrix.depends }}
62-
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
63-
INSTALL_TYPE: ${{ matrix.install }}
64-
CHECK_TYPE: ${{ matrix.check }}
65-
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
38+
dependencies: ['pre']
6639

6740
steps:
6841
- uses: actions/checkout@v3
@@ -77,19 +50,14 @@ jobs:
7750
allow-prereleases: true
7851
- name: Display Python version
7952
run: python -c "import sys; print(sys.version)"
80-
- name: Create virtual environment
81-
run: tools/ci/create_venv.sh
82-
- name: Build archive
53+
- name: Install tox
8354
run: |
84-
source tools/ci/build_archive.sh
85-
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
86-
- name: Install dependencies
87-
run: tools/ci/install_dependencies.sh
88-
- name: Install NiBabel
89-
run: tools/ci/install.sh
90-
- name: Run tests
91-
run: tools/ci/check.sh
92-
if: ${{ matrix.check != 'skiptests' }}
55+
python -m pip install --upgrade pip
56+
python -m pip install tox tox-gh-actions
57+
- name: Run tox
58+
run: tox
59+
env:
60+
DEPENDS: ${{ matrix.dependencies }}
9361
- uses: codecov/codecov-action@v3
9462
if: ${{ always() }}
9563
with:
@@ -98,5 +66,5 @@ jobs:
9866
uses: actions/upload-artifact@v3
9967
with:
10068
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
101-
path: for_testing/test-results.xml
102-
if: ${{ always() && matrix.check == 'test' }}
69+
path: test-results.xml
70+
if: ${{ always() }}

tox.ini

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,32 @@ envlist =
1010
typecheck
1111
skip_missing_interpreters = true
1212

13+
[gh-actions]
14+
python =
15+
3.8: py38
16+
3.9: py39
17+
3.10: py310
18+
3.11: py311
19+
3.12: py312
20+
21+
[gh-actions:env]
22+
DEPENDS =
23+
pre: pre
24+
full: full
25+
min: min
26+
27+
CHECK =
28+
build: build
29+
doctest: doctest
30+
style: style
31+
typecheck: typecheck
32+
1333
[testenv]
1434
description = Typical pytest invocation with coverage
35+
install_command =
36+
python -I -m pip install \
37+
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
38+
{opts} {packages}
1539
pip_pre =
1640
pre: true
1741
deps =
@@ -33,22 +57,30 @@ deps =
3357
min: h5py ==3.0
3458
min: indexed_gzip ==1.4
3559
min: pyzstd ==0.14.3
60+
pre: numpy <2.0.dev0
3661
full,pre: scipy >=1.6
3762
full,pre: matplotlib >=3.4
3863
full,pre: pillow >=8.1
3964
full,pre: h5py >=3.0
4065
full,pre: indexed_gzip >=1.4
4166
full,pre: pyzstd >=0.14.3
4267
min: pydicom ==2.1
43-
full: pydicom >=2.1
44-
pre: pydicom @ git+https://github.com/pydicom/pydicom.git@master
68+
full,pre: pydicom >=2.1
69+
# pre: pydicom @ git+https://github.com/pydicom/pydicom.git@main
4570

4671
commands =
4772
pytest --doctest-modules --doctest-plus \
4873
--cov nibabel --cov-report xml:cov.xml \
4974
--junitxml test-results.xml \
5075
--pyargs nibabel {posargs:-n auto}
5176

77+
[testenv:install]
78+
description = "Install and verify imports succeed"
79+
deps =
80+
install_command = python -I -m pip install {opts} {packages}
81+
commands =
82+
python -c "import nibabel; print(nibabel.__version__)"
83+
5284
[testenv:docs]
5385
description = Typical pytest invocation with coverage
5486
allowlist_externals = make

0 commit comments

Comments
 (0)