Skip to content

Commit f26ba2a

Browse files
committed
Merge branch 'cicd_test_update' of github.com:ericspod/MONAI into cicd_test_update
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
2 parents 3c5a3da + c4155a4 commit f26ba2a

193 files changed

Lines changed: 3785 additions & 855 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
__pycache__/
44
docs/
55

6+
.vscode
7+
.git
8+
.mypy_cache
9+
.ruff_cache
10+
.pytype
611
.coverage
712
.coverage.*
813
.coverage/
914
coverage.xml
1015
.readthedocs.yml
11-
*.toml
1216

1317
!README.md

.github/workflows/chatops.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: dispatch
13-
uses: peter-evans/slash-command-dispatch@v5.0.0
13+
uses: peter-evans/slash-command-dispatch@v5.0.2
1414
with:
1515
token: ${{ secrets.PR_MAINTAIN }}
1616
reaction-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cicd_tests.yml

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,12 @@ jobs:
4848
uses: actions/setup-python@v6
4949
with:
5050
python-version: '3.10'
51-
- name: cache weekly timestamp
52-
id: pip-cache
53-
run: |
54-
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
55-
- name: cache for pip
56-
uses: actions/cache@v4
57-
id: cache
58-
with:
59-
path: ~/.cache/pip
60-
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
51+
cache: 'pip'
6152
- name: Install dependencies
6253
run: |
6354
python -m pip install --upgrade pip wheel
64-
python -m pip install -r requirements-dev.txt
65-
- name: Lint and type check with "./runtests.sh --build --${{ matrix.opt }}"
55+
python -m pip install --no-build-isolation -r requirements-dev.txt
56+
- name: Lint and type check
6657
run: |
6758
# clean up temporary files
6859
$(pwd)/runtests.sh --build --clean
@@ -186,23 +177,11 @@ jobs:
186177
uses: actions/setup-python@v6
187178
with:
188179
python-version: '3.10'
180+
cache: 'pip'
189181
- name: Prepare pip wheel
190182
run: |
191183
which python
192184
python -m pip install --upgrade pip wheel
193-
python -m pip install --user more-itertools>=8.0
194-
- name: cache weekly timestamp
195-
id: pip-cache
196-
run: |
197-
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
198-
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
199-
shell: bash
200-
- name: cache for pip
201-
uses: actions/cache@v4
202-
id: cache
203-
with:
204-
path: ${{ steps.pip-cache.outputs.dir }}
205-
key: ${{ matrix.os }}-latest-pip-${{ steps.pip-cache.outputs.datew }}
206185
- if: runner.os == 'windows'
207186
name: Install torch cpu from pytorch.org (Windows only)
208187
run: |
@@ -216,14 +195,14 @@ jobs:
216195
python -m pip install --user --upgrade pip wheel
217196
python -m pip install torch==2.5.1 torchvision==0.20.1
218197
cat "requirements-dev.txt"
219-
python -m pip install -r requirements-dev.txt
198+
python -m pip install --no-build-isolation -r requirements-dev.txt
220199
python -m pip list
221-
python setup.py develop # test no compile installation
200+
python -m pip install -e . # test no compile installation
222201
shell: bash
223202
- name: Run compiled (${{ runner.os }})
224203
run: |
225-
python setup.py develop --uninstall
226-
BUILD_MONAI=1 python setup.py develop # compile the cpp extensions
204+
python -m pip uninstall -y monai
205+
BUILD_MONAI=1 python -m pip install -e . # compile the cpp extensions
227206
shell: bash
228207
- name: Run quick tests
229208
run: |
@@ -255,25 +234,14 @@ jobs:
255234
uses: actions/setup-python@v6
256235
with:
257236
python-version: '3.10'
258-
- name: cache weekly timestamp
259-
id: pip-cache
260-
run: |
261-
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
262-
- name: cache for pip
263-
uses: actions/cache@v4
264-
id: cache
265-
with:
266-
path: |
267-
~/.cache/pip
268-
~/.cache/torch
269-
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
237+
cache: 'pip'
270238
- name: Install dependencies
271239
run: |
272240
python -m pip install --user --upgrade pip setuptools wheel twine packaging
273241
# install the latest pytorch for testing
274242
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
275243
# fresh torch installation according to pyproject.toml
276-
python -m pip install torch\>=2.5.1 torchvision
244+
python -m pip install torch>=2.5.1 torchvision --extra-index-url https://download.pytorch.org/whl/cpu
277245
- name: Check packages
278246
run: |
279247
pip uninstall monai
@@ -302,7 +270,7 @@ jobs:
302270
working-directory: ${{ steps.mktemp.outputs.tmp_dir }}
303271
run: |
304272
# install from wheel
305-
python -m pip install monai*.whl
273+
python -m pip install monai*.whl --extra-index-url https://download.pytorch.org/whl/cpu
306274
python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown"
307275
python -c 'import monai; print(monai.__file__)'
308276
python -m pip uninstall -y monai
@@ -313,7 +281,7 @@ jobs:
313281
# install from tar.gz
314282
name=$(ls *.tar.gz | head -n1)
315283
echo $name
316-
python -m pip install $name[all]
284+
python -m pip install $name[all] --extra-index-url https://download.pytorch.org/whl/cpu
317285
python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown"
318286
python -c 'import monai; print(monai.__file__)'
319287
- name: Quick test
@@ -323,7 +291,30 @@ jobs:
323291
cp ${{ steps.root.outputs.pwd }}/requirements*.txt .
324292
cp -r ${{ steps.root.outputs.pwd }}/tests .
325293
ls -al
326-
python -m pip install -r requirements-dev.txt
294+
python -m pip install --no-build-isolation -r requirements-dev.txt --extra-index-url https://download.pytorch.org/whl/cpu
327295
python -m unittest -v
328296
env:
329297
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # https://github.com/Project-MONAI/MONAI/issues/4354
298+
299+
build-docs:
300+
runs-on: ubuntu-latest
301+
steps:
302+
- uses: actions/checkout@v6
303+
- name: Set up Python 3.10
304+
uses: actions/setup-python@v6
305+
with:
306+
python-version: '3.10'
307+
cache: 'pip'
308+
- name: Install dependencies
309+
run: |
310+
python -m pip install --upgrade pip wheel
311+
python -m pip install -r docs/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
312+
- name: Make html
313+
run: |
314+
cd docs/
315+
make clean
316+
make html 2>&1 | tee tmp_log
317+
if [[ $(grep -c "ERROR:" tmp_log) != 0 ]]; then echo "found errors"; grep "ERROR:" tmp_log; exit 1; fi
318+
sed '/WARNING.*pip/d' tmp_log > tmp_log1; mv tmp_log1 tmp_log # monai#7133
319+
if [[ $(grep -c "WARNING:" tmp_log) != 0 ]]; then echo "found warnings"; grep "WARNING:" tmp_log; exit 1; fi
320+
shell: bash

.github/workflows/cron-ngc-bundle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: pip-cache
2727
run: echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
2828
- name: cache for pip
29-
uses: actions/cache@v4
29+
uses: actions/cache@v5
3030
id: cache
3131
with:
3232
path: ~/.cache/pip

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python setup.py build
3838
cat build/lib/monai/_version.py
3939
- name: Upload version
40-
uses: actions/upload-artifact@v5
40+
uses: actions/upload-artifact@v6
4141
with:
4242
name: _version.py
4343
path: build/lib/monai/_version.py

.github/workflows/integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
id: pip-cache
2323
run: echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
2424
- name: cache for pip
25-
uses: actions/cache@v4
25+
uses: actions/cache@v5
2626
id: cache
2727
with:
2828
path: |
@@ -98,7 +98,7 @@ jobs:
9898
id: pip-cache
9999
run: echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
100100
- name: cache for pip
101-
uses: actions/cache@v4
101+
uses: actions/cache@v5
102102
id: cache
103103
with:
104104
path: |

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
- if: matrix.python-version == '3.10' && startsWith(github.ref, 'refs/tags/')
6868
name: Upload artifacts
69-
uses: actions/upload-artifact@v5
69+
uses: actions/upload-artifact@v6
7070
with:
7171
name: dist
7272
path: dist/
@@ -109,7 +109,7 @@ jobs:
109109
python setup.py build
110110
cat build/lib/monai/_version.py
111111
- name: Upload version
112-
uses: actions/upload-artifact@v5
112+
uses: actions/upload-artifact@v6
113113
with:
114114
name: _version.py
115115
path: build/lib/monai/_version.py

.github/workflows/setupapp.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
3636
- name: cache for pip
3737
if: ${{ startsWith(github.ref, 'refs/heads/dev') }}
38-
uses: actions/cache@v4
38+
uses: actions/cache@v5
3939
id: cache
4040
with:
4141
path: |
@@ -90,23 +90,12 @@ jobs:
9090
uses: actions/setup-python@v6
9191
with:
9292
python-version: ${{ matrix.python-version }}
93-
- name: cache weekly timestamp
94-
id: pip-cache
95-
run: |
96-
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
97-
- name: cache for pip
98-
uses: actions/cache@v4
99-
id: cache
100-
with:
101-
path: |
102-
~/.cache/pip
103-
~/.cache/torch
104-
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ steps.pip-cache.outputs.datew }}
93+
cache: pip
10594
- name: Install the dependencies
10695
run: |
10796
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
10897
python -m pip install --upgrade pip wheel
109-
python -m pip install -r requirements-dev.txt
98+
python -m pip install --no-build-isolation -r requirements-dev.txt
11099
- name: Run quick tests CPU ubuntu
111100
env:
112101
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
@@ -115,8 +104,8 @@ jobs:
115104
run: |
116105
python -m pip list
117106
python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
118-
BUILD_MONAI=0 ./runtests.sh --build --quick --unittests
119-
BUILD_MONAI=1 ./runtests.sh --build --quick --min
107+
BUILD_MONAI=0 ./runtests.sh --build --coverage --quick --unittests
108+
BUILD_MONAI=1 ./runtests.sh --build --coverage --quick --min
120109
coverage xml --ignore-errors
121110
- name: Upload coverage
122111
uses: codecov/codecov-action@v5
@@ -136,7 +125,7 @@ jobs:
136125
run: |
137126
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
138127
- name: cache for pip
139-
uses: actions/cache@v4
128+
uses: actions/cache@v5
140129
id: cache
141130
with:
142131
path: |

.github/workflows/weekly-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: |
2222
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
2323
- name: cache for pip
24-
uses: actions/cache@v4
24+
uses: actions/cache@v5
2525
id: cache
2626
with:
2727
path: ~/.cache/pip

.pre-commit-config.yaml

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ci:
99

1010
repos:
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v5.0.0
12+
rev: v6.0.0
1313
hooks:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
@@ -27,46 +27,18 @@ repos:
2727
- id: end-of-file-fixer
2828
- id: mixed-line-ending
2929
- repo: https://github.com/astral-sh/ruff-pre-commit
30-
rev: v0.7.0
30+
rev: v0.14.11
3131
hooks:
32-
- id: ruff
33-
args:
34-
- --fix
35-
36-
- repo: https://github.com/asottile/pyupgrade
37-
rev: v3.19.0
38-
hooks:
39-
- id: pyupgrade
40-
args: [--py39-plus, --keep-runtime-typing]
41-
name: Upgrade code with exceptions
32+
- id: ruff-check
33+
args: ["--fix"]
4234
exclude: |
4335
(?x)(
4436
^versioneer.py|
45-
^monai/_version.py|
46-
^monai/networks/| # avoid typing rewrites
47-
^monai/apps/detection/utils/anchor_utils.py| # avoid typing rewrites
48-
^tests/test_compute_panoptic_quality.py # avoid typing rewrites
37+
^monai/_version.py
4938
)
5039
51-
- repo: https://github.com/asottile/yesqa
52-
rev: v1.5.0
53-
hooks:
54-
- id: yesqa
55-
name: Unused noqa
56-
additional_dependencies:
57-
- flake8>=3.8.1
58-
- flake8-bugbear<=24.2.6
59-
- flake8-comprehensions
60-
- pep8-naming
61-
exclude: |
62-
(?x)^(
63-
monai/__init__.py|
64-
docs/source/conf.py|
65-
tests/utils.py
66-
)$
67-
6840
- repo: https://github.com/hadialqattan/pycln
69-
rev: v2.5.0
41+
rev: v2.6.0
7042
hooks:
7143
- id: pycln
7244
args: [--config=pyproject.toml]

0 commit comments

Comments
 (0)