Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: Resurrect tox config to cover dev workflows and CI checks #1262

Merged
merged 47 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
df2377a
MNT: Update tox config to what we actually do
effigies Oct 6, 2023
4a02317
STY: Apply style fixes
effigies Oct 6, 2023
79889f8
TOX: Add -pre environments
effigies Oct 6, 2023
95af765
TOX: Split doc build from doctest
effigies Oct 6, 2023
5cb6824
TOX: Add build/publish environments
effigies Oct 6, 2023
54fa30e
MNT: Pacify build warnings
effigies Oct 6, 2023
51a7384
MNT: Only error on build-strict
effigies Oct 6, 2023
4fb412f
CI: Update to latest checkout
effigies Oct 6, 2023
55309c0
TOX: Encode minimum versions in dependencies, add -min and -full flags
effigies Oct 6, 2023
22e7472
Update minimum pyzstd, add zenodo and pre-release environments
effigies Oct 6, 2023
98b7bb9
MNT: Convert dev optional dependencies to tox
effigies Oct 6, 2023
4b6adaa
CI: Convert pre-release CI jobs to tox
effigies Oct 6, 2023
e905ef1
CI: Convert stable CI to tox
effigies Oct 6, 2023
7b2a0c3
CI: Exclude 3.12 on x86, skip full dependencies for 3.12 for now
effigies Oct 6, 2023
8fb7abb
CI: Run miscellaneous checks through tox
effigies Oct 6, 2023
20d3f14
MNT: Require wheels for things that cannot be built on CI
effigies Oct 6, 2023
4de4db4
CI: Do not fail fast
effigies Oct 6, 2023
5cbf035
CI: Just run tox directly for miscellaneous checks
effigies Oct 6, 2023
5877467
MNT: Push h5py support back a bit
effigies Oct 6, 2023
69ec580
MNT: Drop tools/ci for tox
effigies Oct 6, 2023
f2ca9be
CI: Install doctestplus correctly
effigies Oct 8, 2023
22e8b94
MNT: Use none to explicitly avoid dependencies, add labels
effigies Oct 8, 2023
574846c
CI: Show tox config for debugging
effigies Oct 8, 2023
366ff8e
CI: Hack around h5py weirdness
effigies Oct 8, 2023
e77199a
MNT: Restore doc/test extras
effigies Oct 8, 2023
ff8cd5e
CI: Fix expr syntax
effigies Oct 8, 2023
5f6c838
MNT: scipy unavailable for some x86 Pythons
effigies Oct 8, 2023
7d796a8
TOX: Update environment list to match CI targets
effigies Oct 8, 2023
dc611df
TOX: h5py is not unique, handle scipy likewise
effigies Oct 8, 2023
2fa1daa
TOX: Fix h5py range, avoid indexed_gzip on 3.12
effigies Oct 8, 2023
bac556d
CI: Pending wheels are covered by tox.ini
effigies Oct 8, 2023
bd498d4
DOC: Improve tox.ini documentation
effigies Oct 8, 2023
74b9965
CI: Timeout tox and dump debug information if we go >20 minutes
effigies Oct 9, 2023
7f28eb3
TOX: Use h5py wheels for all full/pre-x64 builds
effigies Oct 9, 2023
648a225
CI: Consolidate stable and pre-release tests
effigies Oct 10, 2023
1850687
CI: Add verbosity to tox
effigies Oct 10, 2023
194cdb4
CI: Remove unnecessary pipx call
effigies Oct 10, 2023
f6a2c9f
TOX: Pillow is hard to build on CI
effigies Oct 10, 2023
15fe94e
TOX: Match matplotlib conditions to scipy
effigies Oct 10, 2023
f4fefd5
CI: Add install to none and full tests
effigies Oct 10, 2023
dadd3f5
MNT: Ignore coverage/testing summary outputs
effigies Oct 10, 2023
c7ef0d4
DOC: Add docs on using tox and pre-commit
effigies Oct 11, 2023
f244c4b
TOX: Add NIPY_EXTRA_TESTS to pass_env
effigies Oct 11, 2023
873d5bf
CI: Quote python versions for consistency
effigies Oct 11, 2023
6e86852
TOX: Update install_command overrides with x86/x64/pre-specific overr…
effigies Oct 11, 2023
5a8e303
CI: Merge checks into test workflow
effigies Oct 11, 2023
a0dc67e
CI: Update action version
effigies Oct 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions .github/workflows/misc.yml

This file was deleted.

102 changes: 0 additions & 102 deletions .github/workflows/pre-release.yml

This file was deleted.

107 changes: 50 additions & 57 deletions .github/workflows/stable.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Stable tests
name: Build and test

# This file tests the claimed support range of NiBabel including
#
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -94,70 +94,45 @@ jobs:
if: matrix.package == 'archive'
run: pip install archive/nibabel-archive.tgz
- run: python -c 'import nibabel; print(nibabel.__version__)'
- name: Install test extras
- name: Install minimum test dependencies
run: pip install nibabel[test]
- name: Run tests
run: pytest --doctest-modules --doctest-plus -v --pyargs nibabel
run: pytest --doctest-modules --doctest-plus -v --pyargs nibabel -n auto

stable:
test:
# Check each OS, all supported Python, minimum versions and latest releases
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.dependencies == 'pre' }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
architecture: ['x64', 'x86']
install: ['pip']
check: ['test']
pip-flags: ['']
depends: ['REQUIREMENTS']
optional-depends: ['DEFAULT_OPT_DEPENDS']
dependencies: ['full', 'pre']
include:
# Basic dependencies only
- os: ubuntu-latest
python-version: 3.8
install: pip
check: test
pip-flags: ''
depends: REQUIREMENTS
optional-depends: ''
dependencies: 'none'
# Absolute minimum dependencies
- os: ubuntu-latest
python-version: 3.8
install: pip
check: test
pip-flags: ''
depends: MIN_REQUIREMENTS
optional-depends: ''
# Absolute minimum dependencies plus old MPL, Pydicom, Pillow
- os: ubuntu-latest
python-version: 3.8
install: pip
check: test
pip-flags: ''
depends: MIN_REQUIREMENTS
optional-depends: MIN_OPT_DEPENDS
# Clean install imports only with package-declared dependencies
- os: ubuntu-latest
python-version: 3.8
install: pip
check: skiptests
pip-flags: ''
depends: ''
dependencies: 'min'
exclude:
- os: ubuntu-latest
architecture: x86
- os: macos-latest
architecture: x86
- python-version: '3.12'
architecture: x86

env:
DEPENDS: ${{ matrix.depends }}
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
INSTALL_TYPE: ${{ matrix.install }}
CHECK_TYPE: ${{ matrix.check }}
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
DEPENDS: ${{ matrix.dependencies }}
ARCH: ${{ !contains(fromJSON('["none", "min"]'), matrix.dependencies) && matrix.architecture }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand All @@ -166,36 +141,54 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
allow-prereleases: true
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Create virtual environment
run: tools/ci/create_venv.sh
- name: Build archive
- name: Install tox
run: |
source tools/ci/build_archive.sh
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
- name: Install dependencies
run: tools/ci/install_dependencies.sh
- name: Install NiBabel
run: tools/ci/install.sh
- name: Run tests
if: ${{ matrix.check != 'skiptests' }}
run: tools/ci/check.sh
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Show tox config
run: tox c
- name: Run tox
run: tox -v --exit-and-dump-after 1200
- uses: codecov/codecov-action@v3
if: ${{ always() }}
with:
files: cov.xml
- name: Upload pytest test results
if: ${{ always() && matrix.check == 'test' }}
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: for_testing/test-results.xml
path: test-results.xml
if: ${{ always() }}

checks:
runs-on: 'ubuntu-latest'
continue-on-error: true
strategy:
matrix:
check: ['style', 'doctest', 'typecheck']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Show tox config
run: pipx run tox c
- name: Show tox config (this call)
run: pipx run tox c -e ${{ matrix.check }}
- name: Run check
run: pipx run tox -e ${{ matrix.check }}

publish:
runs-on: ubuntu-latest
environment: "Package deployment"
needs: [stable, test-package]
needs: [test, test-package]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ dist/
*.egg-info/
.shelf
.tox/
.coverage
.coverage*
cov.xml
test-results.xml
.ropeproject/
htmlcov/
.*_cache/
Expand Down
Loading