Skip to content

Commit

Permalink
Revert "[MAINT] use UV to install in CI" (nilearn#4963)
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau authored Dec 18, 2024
1 parent 6bced30 commit 8697af5
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 34 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install packages
run: uv tool install tox --with=tox-uv --with=tox-gh-actions
run: python -m pip install tox
- name: check links
run: tox run -e linkcheck

Expand Down Expand Up @@ -258,16 +256,13 @@ jobs:
- name: Set up display server for virtual browser
run: Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MIN_PYTHON_VERSION }}

- name: Install tox
run: uv tool install tox --with=tox-uv --with=tox-gh-actions
run: python -m pip install tox

- name: Show tox config
run: tox c
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/nightly_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:
cancel-in-progress: true

jobs:
nightly:
test_nightly:

# This prevents this workflow from running on a fork.
# To test this workflow on a fork, uncomment the following line.
Expand Down Expand Up @@ -62,23 +62,20 @@ jobs:
fi;
fi;
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install tox
if: steps.check-commit-msg.outputs.skip == 'false'
run: uv tool install tox --with=tox-uv --with=tox-gh-actions
run: python -m pip install tox

- name: Run test suite
if: steps.check-commit-msg.outputs.skip == 'false'
id: nightly
continue-on-error: true
run: tox run -e nightly -- nilearn
run: tox run -e test_nightly -- nilearn

- name: Upload test report
if: success() || failure()
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/test_with_tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,29 @@ jobs:
description: [latest dependencies]
py: ['3.13', '3.12', '3.11', '3.10', '3.9']
os: [ubuntu-latest, macos-latest, windows-latest]
env: [plotting]
env: [test_plotting]
include:
- description: pre-release dependencies
py: '3.13'
os: ubuntu-latest
env: pre
env: test_pre
- description: oldest dependencies - no plotting
py: '3.9'
os: ubuntu-latest
env: min
env: test_min
- description: oldest dependencies - no plotly
py: '3.9'
os: ubuntu-latest
env: plot_min
env: test_plot_min
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
allow-prereleases: true
- name: Install tox
run: uv tool install tox --with=tox-uv --with=tox-gh-actions
run: python -m pip install tox
- name: Show tox config
run: tox c
- name: Run test suite
Expand Down
4 changes: 2 additions & 2 deletions doc/maintenance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ Some environments allow passing extra argument:
tox run -e lint -- ruff
# only run some tests
tox -e plotting -- nilearn/glm/tests/test_contrasts.py
tox -e test_plotting -- nilearn/glm/tests/test_contrasts.py
You can also run any arbitrary command in a given environment with ``tox exec``:

.. code-block:: bash
tox exec -e latest -- python -m pytest nilearn/_utils/tests/test_data_gen.py
tox exec -e test_latest -- python -m pytest nilearn/_utils/tests/test_data_gen.py
How to make a release?
Expand Down
23 changes: 11 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,22 @@ deps =
commands =
pre-commit run --all-files --show-diff-on-failure prettier

[testenv:latest]
[testenv:test_latest]
description = run tests on latest version of all dependencies (plotting not included)
passenv = {[global_var]passenv}
extras = test
commands =
pytest --cov=nilearn --cov-report=xml --report=report.html -n auto {posargs:}

[testenv:plotting]
[testenv:test_plotting]
description = run tests on latest version of all dependencies
passenv = {[global_var]passenv}
extras = test
deps =
{[plotting]deps}
rich
commands =
{[testenv:latest]commands}
{[testenv:test_latest]commands}
{[testenv:test_doc]commands}

[testenv:test_doc]
Expand All @@ -103,8 +103,8 @@ commands =
; TODO find a way to rely on globbing instead of listing a specific folder
pytest -n auto --doctest-glob='*.rst' doc/manipulating_images/ --report=report_doc.html

[testenv:pre]
description = run latest and test_doc on pre-release version of all dependencies
[testenv:test_pre]
description = run test_latest and test_doc on pre-release version of all dependencies
passenv = {[global_var]passenv}
pip_pre = true
extras = test
Expand All @@ -113,19 +113,19 @@ deps =
pyarrow
rich
commands =
{[testenv:latest]commands}
{[testenv:test_latest]commands}
{[testenv:test_doc]commands}

[testenv:min]
[testenv:test_min]
description = run tests on minimum version of all dependencies (plotting not included)
passenv = {[global_var]passenv}
extras = test
deps =
{[min]deps}
commands =
{[testenv:latest]commands}
{[testenv:test_latest]commands}

[testenv:plot_min]
[testenv:test_plot_min]
description = run tests on minimum version of all dependencies (no plotly).
Plotly is additional for supporting interactive plots
but is not actually needed to use nilearn plotting functionality
Expand All @@ -135,9 +135,9 @@ deps =
{[min]deps}
{[plotmin]deps}
commands =
{[testenv:latest]commands}
{[testenv:test_latest]commands}

[testenv:nightly]
[testenv:test_nightly]
description = run tests on nightly build version of all dependencies
passenv = {[global_var]passenv}
setenv =
Expand All @@ -162,7 +162,6 @@ extras = doc
deps =
{[min]deps}
{[plotmin]deps}
setuptools
rich
plotly
kaleido
Expand Down

0 comments on commit 8697af5

Please sign in to comment.