@@ -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
0 commit comments