5656 runs-on : ubuntu-latest
5757 strategy :
5858 matrix :
59- opt : ["codeformat", "mypy"] # "pytype" omitted for being essentially deprecated, see #8865
59+ opt : ["codeformat", "pyrefly"]
6060 steps :
6161 - name : Clean unused tools
6262 run : |
@@ -75,13 +75,12 @@ jobs:
7575 - name : Install dependencies
7676 run : |
7777 python -m pip install --upgrade pip wheel
78- python -m pip install --no-build-isolation -r requirements-dev.txt
78+ python -m pip install .[all,testing]
7979 - name : Lint and type check
8080 run : |
8181 # clean up temporary files
8282 $(pwd)/runtests.sh --build --clean
83- # Github actions have multiple cores, so parallelize pytype
84- $(pwd)/runtests.sh --build --${{ matrix.opt }} -j $(nproc --all)
83+ $(pwd)/runtests.sh --build --${{ matrix.opt }}
8584
8685 min-dep : # Test with minumum dependencies installed for different OS, Python, and PyTorch combinations
8786 runs-on : ${{ matrix.os }}
@@ -138,15 +137,14 @@ jobs:
138137 - name : Prepare pip wheel
139138 run : |
140139 which python
141- python -m pip install --upgrade pip wheel
142- python -m pip install --user more-itertools>=8.0
140+ python -m pip install --upgrade pip wheel tomli
143141 - name : Install the minimum dependencies
144142 run : |
145143 # min. requirements
146144 python -m pip install torch==${{ matrix.pytorch-version }}
147- python -m pip install -r requirements-min.txt
145+ python monai/config/print_dependencies.py build-system | xargs pip install --no-build-isolation
146+ python -m pip install --no-build-isolation .[testing]
148147 python -m pip list
149- BUILD_MONAI=0 python setup.py develop # no compile of extensions
150148 shell : bash
151149 - if : matrix.os == 'linux-gpu-runner'
152150 name : Print GPU Info
@@ -219,16 +217,17 @@ jobs:
219217 shell : bash
220218 - name : Install the complete dependencies
221219 run : |
222- python -m pip install --user --upgrade pip wheel pybind11 # TODO: pybind11 added for macOS, may not be needed
223- cat "requirements-dev.txt"
224- python -m pip install --no-build-isolation -r requirements-dev.txt
220+ python -m pip install --user --upgrade pip wheel tomli
221+ python monai/config/print_dependencies.py build-system | xargs pip install --no-build-isolation
222+ python -m pip install --no-build-isolation .[all,testing]
225223 python -m pip list
226- python -m pip install --no-build-isolation -e . # test no compile installation
227224 shell : bash
228225 - name : Run compiled (${{ runner.os }})
229226 run : |
230227 python -m pip uninstall -y monai
231- BUILD_MONAI=1 python -m pip install --no-build-isolation -e . # compile the cpp extensions
228+ BUILD_MONAI=1 python -m pip install --no-build-isolation -e . # compile the cpp extensions in-place with -e
229+ # ensure extensions were compiled
230+ python -c 'import monai._C' > /dev/null
232231 shell : bash
233232 - if : runner.os != 'macOS'
234233 name : Run full tests
@@ -275,14 +274,15 @@ jobs:
275274 cache : ' pip'
276275 - name : Install dependencies + nvsubquadratic (no-deps)
277276 run : |
278- python -m pip install --upgrade pip wheel
279- python -m pip install torch==${PYTORCH_VER1} torchvision==${TORCHVISION_VER1}
280- python -m pip install --no-build-isolation -r requirements-dev.txt
281- python -m pip install -e .
282- # nvsubquadratic runtime imports need only torch + einops + omegaconf; install
283- # the package itself without its core dependency tree (see job comment above).
284- python -m pip install omegaconf
285- python -m pip install --no-deps 'nvsubquadratic>=0.1.1'
277+ python -m pip install --upgrade pip wheel tomli pytest
278+ # need a specific version of torch for nvsubquadratic
279+ python monai/config/print_dependencies.py build-system | \
280+ xargs -d '\n' pip install --no-build-isolation torch==2.10.0 torchvision==0.25.0
281+ # # nvsubquadratic runtime imports need only torch + einops + omegaconf; install
282+ # # the package itself without its core dependency tree (see job comment above).
283+ python -m pip install --no-build-isolation omegaconf
284+ python -m pip install --no-build-isolation --no-deps 'nvsubquadratic>=0.1.1'
285+ python -m pip install --no-build-isolation .[hyena,testing]
286286 python -m pip list
287287 shell : bash
288288 - name : Run Hyena tests (CUDA-required cases skip cleanly)
@@ -299,6 +299,7 @@ jobs:
299299 runs-on : ubuntu-latest
300300 env :
301301 QUICKTEST : True
302+ INDEX_URL : " https://download.pytorch.org/whl/cpu"
302303 steps :
303304 - name : Clean unused tools
304305 run : |
@@ -317,11 +318,10 @@ jobs:
317318 cache : ' pip'
318319 - name : Install dependencies
319320 run : |
320- python -m pip install --user --upgrade pip setuptools wheel twine packaging
321+ python -m pip install --user --upgrade pip setuptools wheel twine packaging tomli
321322 # install the latest pytorch for testing
322- # however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
323- # fresh torch installation according to pyproject.toml
324- python -m pip install torch==${PYTORCH_VER1} torchvision --extra-index-url https://download.pytorch.org/whl/cpu
323+ python monai/config/print_dependencies.py build-system all testing | \
324+ xargs -d '\n' pip install --no-build-isolation torch==${PYTORCH_VER1} --extra-index-url $INDEX_URL
325325 - name : Check packages
326326 run : |
327327 python -m pip uninstall -y monai
@@ -350,7 +350,7 @@ jobs:
350350 working-directory : ${{ steps.mktemp.outputs.tmp_dir }}
351351 run : |
352352 # install from wheel
353- python -m pip install monai*.whl --extra-index-url https://download.pytorch.org/whl/cpu
353+ python -m pip install --no-build-isolation monai*.whl --extra-index-url $INDEX_URL
354354 python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown"
355355 python -c 'import monai; print(monai.__file__)'
356356 python -m pip uninstall -y monai
@@ -360,6 +360,14 @@ jobs:
360360 run : |
361361 for name in *.tar.gz; do break; done
362362 echo $name
363- python -m pip install ${name}[all] --extra-index-url https://download.pytorch.org/whl/cpu
363+ python -m pip install --no-build-isolation ${name}[all] --extra-index-url $INDEX_URL
364+ python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown"
365+ python -c 'import monai; print(monai.__file__)'
366+ python -m pip uninstall -y monai
367+ - name : Install using uv
368+ working-directory : ${{ steps.root.outputs.pwd }}
369+ run : |
370+ pip install uv
371+ uv pip install --system --no-build-isolation .[all] --extra-index-url $INDEX_URL
364372 python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown"
365373 python -c 'import monai; print(monai.__file__)'
0 commit comments