Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ad1122c
Combine information into pyproject.toml
ericspod Jul 17, 2026
f2b5460
Moving all dependencies into the toml file, adding script to extract …
ericspod Jul 17, 2026
1a7be99
Collect testing dependencies into one optional name
ericspod Jul 18, 2026
4e410ee
Updating install process in other places
ericspod Jul 22, 2026
43da203
Re-adding file
ericspod Jul 22, 2026
7725ded
Updates to Dockerfile, not done yet
ericspod Jul 22, 2026
2103022
Dockerfile works and versioneer updated
ericspod Jul 22, 2026
c0ee0c5
Update
ericspod Jul 22, 2026
ce9b4ab
Docker updates
ericspod Jul 23, 2026
1d619ad
Docs update
ericspod Jul 23, 2026
24d4b80
Merge branch 'dev' into build_update
ericspod Jul 23, 2026
bbdb0bc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 23, 2026
8a8fc41
Fix
ericspod Jul 23, 2026
621e440
Merge branch 'build_update' of github.com:ericspod/MONAI into build_u…
ericspod Jul 23, 2026
573176c
Review fixes
ericspod Jul 25, 2026
1c8f626
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2026
1ccfd60
Merge branch 'dev' into build_update
ericspod Jul 25, 2026
6df3abe
Fix
ericspod Jul 25, 2026
2f0b0dc
Fix again
ericspod Jul 25, 2026
9458b12
Fixes
ericspod Jul 25, 2026
0371c28
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2026
c54cfb1
Oopsy
ericspod Jul 25, 2026
95bbd24
Fixes
ericspod Jul 25, 2026
ae2e55f
Updates
ericspod Jul 29, 2026
2bcc870
Updates from comments
ericspod Aug 13, 2026
f20ad99
Fixes
ericspod Aug 13, 2026
50a5d14
DCO Remediation Commit for Eric Kerfoot <17726042+ericspod@users.nore…
ericspod Aug 13, 2026
7ce51a0
Merge branch 'dev' into build_update
ericspod Aug 13, 2026
e7ed501
xargs fix
ericspod Aug 13, 2026
beb96e7
macos nonsense
ericspod Aug 13, 2026
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
2 changes: 2 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
env:
# minimum supported version of Python
PYTHON_VER1: '3.10'
# force installation of CPU-only PyTorch
PIP_EXTRA_INDEX_URL: 'https://download.pytorch.org/whl/cpu'
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ env.PYTHON_VER1 }}
Expand Down
39 changes: 21 additions & 18 deletions .github/workflows/cicd_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install --no-build-isolation -r requirements-dev.txt
python -m pip install .[all,testing]
- name: Lint and type check
run: |
# clean up temporary files
Expand Down Expand Up @@ -138,15 +138,14 @@ jobs:
- name: Prepare pip wheel
run: |
which python
python -m pip install --upgrade pip wheel
python -m pip install --user more-itertools>=8.0
python -m pip install --upgrade pip wheel tomli
- name: Install the minimum dependencies
run: |
# min. requirements
python -m pip install torch==${{ matrix.pytorch-version }}
python -m pip install -r requirements-min.txt
python monai/config/print_dependencies.py build-system | xargs pip install --no-build-isolation
python -m pip install --no-build-isolation .[testing]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
python -m pip list
BUILD_MONAI=0 python setup.py develop # no compile of extensions
shell: bash
- if: matrix.os == 'linux-gpu-runner'
name: Print GPU Info
Expand Down Expand Up @@ -175,6 +174,7 @@ jobs:
timeout-minutes: 120
env:
QUICKTEST: True
BUILD_MONAI: 1
steps:
- if: runner.os == 'Linux'
name: Clean unused tools
Expand Down Expand Up @@ -219,16 +219,17 @@ jobs:
shell: bash
- name: Install the complete dependencies
run: |
python -m pip install --user --upgrade pip wheel pybind11 # TODO: pybind11 added for macOS, may not be needed
cat "requirements-dev.txt"
python -m pip install --no-build-isolation -r requirements-dev.txt
python -m pip install --user --upgrade pip wheel tomli
python monai/config/print_dependencies.py build-system | xargs pip install --no-build-isolation
python -m pip install --no-build-isolation .[all,testing]
python -m pip list
python -m pip install --no-build-isolation -e . # test no compile installation
shell: bash
- name: Run compiled (${{ runner.os }})
run: |
python -m pip uninstall -y monai
BUILD_MONAI=1 python -m pip install --no-build-isolation -e . # compile the cpp extensions
python -m pip install --no-build-isolation -e . # compile the cpp extensions in-place with -e
# ensure extensions were compiled
python -c 'import monai._C' &> /dev/null
shell: bash
- if: runner.os != 'macOS'
name: Run full tests
Expand Down Expand Up @@ -275,14 +276,14 @@ jobs:
cache: 'pip'
- name: Install dependencies + nvsubquadratic (no-deps)
run: |
python -m pip install --upgrade pip wheel
python -m pip install --upgrade pip wheel tomli pytest
python monai/config/print_dependencies.py build-system | xargs pip install --no-build-isolation
python -m pip install torch==${PYTORCH_VER1} torchvision==${TORCHVISION_VER1}
python -m pip install --no-build-isolation -r requirements-dev.txt
python -m pip install -e .
# nvsubquadratic runtime imports need only torch + einops + omegaconf; install
# the package itself without its core dependency tree (see job comment above).
python -m pip install omegaconf
python -m pip install --no-deps 'nvsubquadratic>=0.1.1'
# # nvsubquadratic runtime imports need only torch + einops + omegaconf; install
# # the package itself without its core dependency tree (see job comment above).
# python -m pip install omegaconf
# python -m pip install --no-deps 'nvsubquadratic>=0.1.1'
python -m pip install --no-build-isolation .[hyena,testing]
python -m pip list
shell: bash
- name: Run Hyena tests (CUDA-required cases skip cleanly)
Expand Down Expand Up @@ -317,11 +318,13 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --user --upgrade pip setuptools wheel twine packaging
python -m pip install --user --upgrade pip setuptools wheel twine packaging tomli
# install the latest pytorch for testing
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
# fresh torch installation according to pyproject.toml
python -m pip install torch==${PYTORCH_VER1} torchvision --extra-index-url https://download.pytorch.org/whl/cpu
python monai/config/print_dependencies.py build-system all testing > requirements.txt
pip install --no-build-isolation -r requirements.txt
Comment thread
ericspod marked this conversation as resolved.
- name: Check packages
run: |
python -m pip uninstall -y monai
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
rm -rf /opt/hostedtoolcache/{node,go,Ruby,Java*}
ls -al /opt/hostedtoolcache
rm -rf /usr/share/dotnet/
python -m pip install -U --no-build-isolation pip wheel wheel-stub
python -m pip install --no-build-isolation -r requirements-dev.txt
python -m pip install -U pip wheel wheel-stub
python -m pip install .[all,testing]
BUILD_MONAI=1 ./runtests.sh --build

- name: Perform CodeQL Analysis
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cron-ngc-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
- name: Install dependencies
run: |
rm -rf /github/home/.cache/torch/hub/bundle/
python -m pip install --no-build-isolation --upgrade pip wheel wheel-stub
python -m pip install --no-build-isolation -r requirements-dev.txt
python -m pip install -U pip wheel wheel-stub
python -m pip install .[all,testing]
- name: Loading Bundles
run: |
# clean up temporary files
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
python -m pip install --upgrade pip wheel
python -m pip uninstall -y torch torchvision
python -m pip install ${{ matrix.pytorch }}
python -m pip install -r requirements-dev.txt
python -m pip install .[all,testing]
python -m pip list
- name: Run tests report coverage
env:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
run: |
which python
python -m pip install --upgrade pip wheel
python -m pip install -r requirements-dev.txt
python -m pip install .[all,testing]
python -m pip list
- name: Run tests report coverage
env:
Expand Down Expand Up @@ -137,7 +137,8 @@ jobs:
- name: Install the dependencies
run: |
which python
python -m pip install --upgrade pip wheel twine
python -m pip install --upgrade pip wheel twine tomli
python monai/config/print_dependencies.py build-system all testing | xargs -d '\n' pip install --no-build-isolation
python -m pip list
- name: Run tests report coverage
shell: bash
Expand Down Expand Up @@ -171,7 +172,6 @@ jobs:
python -c 'import monai; print(monai.__file__)'

# run tests
cp $root_dir/requirements*.txt "$tmp_dir"
cp -r $root_dir/tests "$tmp_dir"
pwd
ls -al
Expand All @@ -186,7 +186,6 @@ jobs:
python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null &
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"

python -m pip install -r requirements-dev.txt
PYTHONPATH="$tmp_dir":$PYTHONPATH BUILD_MONAI=1 python ./tests/runner.py -p 'test_((?!integration).)' # unit tests
if pgrep python; then pkill python; fi

Expand Down Expand Up @@ -238,8 +237,8 @@ jobs:
id: monai-install
run: |
which python
python -m pip install --upgrade pip wheel
python -m pip install -r requirements-dev.txt
python -m pip install --upgrade pip wheel tomli
python monai/config/print_dependencies.py build-system | xargs -d '\n' pip install --no-cache-dir --no-build-isolation
BUILD_MONAI=1 python setup.py develop # install monai
nvidia-smi
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils | tail -n 1)
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ jobs:
cat _version.py
mv _version.py monai/

# build "latest": remove flake package as it is not needed on hub.docker.com
sed -i '/flake/d' requirements-dev.txt
docker build -t projectmonai/monai:latest -f Dockerfile .

# distribute as always w/ tag "latest" to hub.docker.com
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
pip uninstall -y monai
pip uninstall -y monai-weekly
pip uninstall -y monai-weekly
python -m pip install --upgrade torch torchvision torchaudio torchtext
python -m pip install -r requirements-dev.txt
python monai/config/print_dependencies.py build-system | xargs -d '\n' pip install --no-cache-dir --no-build-isolation
python -m pip install --no-build-isolation .[all,testing]
rm -rf /github/home/.cache/torch/hub/mmars/
- name: Clean directory
run: |
Expand Down Expand Up @@ -113,8 +113,7 @@ jobs:
pip uninstall -y monai
pip uninstall -y monai-weekly
pip uninstall -y monai-weekly
python -m pip install --upgrade torch torchvision torchaudio torchtext
python -m pip install -r requirements-dev.txt
python -m pip install .[all,testing]
rm -rf /github/home/.cache/torch/hub/mmars/
- name: Clean directory
run: |
Expand All @@ -124,7 +123,7 @@ jobs:
nvidia-smi
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils -c 1 | tail -n 1)
echo $CUDA_VISIBLE_DEVICES
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c "import torch; print(torch.__version__); print(f'{torch.cuda.device_count()} of GPUs available')"
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'

- name: Auto3dseg latest algo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
rm -rf $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/ruamel*
rm -rf $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/llvmlite* #6377
python -m pip install ${{ matrix.pytorch }}
python -m pip install -r requirements-dev.txt
python -m pip install .[all,testing]
python -m pip list
- name: Run quick tests (GPU)
if: github.event.pull_request.merged != true
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pythonapp-hyena-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
run: |
python -m pip install --upgrade pip wheel
python -c "import sys; assert sys.version_info >= (3, 10), f'Python >= 3.10 required for nvsubquadratic, got {sys.version}'"
python -m pip install -r requirements-dev.txt
python -m pip install -e .
python -m pip install -e .[all,testing]
# Install nvsubquadratic with --no-deps: the default torch_fft path needs only
# torch + einops + omegaconf, and nvsubquadratic pins torch>=2.10,<2.11 which can
# clash with the container's torch. To exercise the accelerated fused CUDA
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install setuptools
- name: Install Dependencies
run: |
python -m pip install --user --upgrade setuptools wheel packaging
python -m pip install --user --upgrade setuptools wheel packaging tomli
python monai/config/print_dependencies.py build-system all testing | xargs -d '\n' pip install --no-build-isolation
- name: Build and test source archive and wheel file
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
Expand Down Expand Up @@ -55,11 +56,10 @@ jobs:
# clean up
cd "$root_dir"
rm -r "$tmp_dir"
rm -rf monai/
ls -al .
- name: Quick test installed
run: |
python -m pip install -r requirements-min.txt
python -m pip install -e .[testing]
python -m tests.min_tests
Comment thread
ericspod marked this conversation as resolved.
env:
QUICKTEST: True
Expand Down Expand Up @@ -105,7 +105,8 @@ jobs:
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
git describe
python -m pip install --user --upgrade setuptools wheel packaging
python -m pip install --user --upgrade setuptools wheel packaging tomli
python monai/config/print_dependencies.py build-system all testing | xargs -d '\n' pip install --no-build-isolation
python setup.py build
cat build/lib/monai/_version.py
- name: Upload version
Expand Down Expand Up @@ -159,8 +160,6 @@ jobs:
echo "unmatched version string, please check the tagging branch."
exit 1
fi
# remove flake package as it is not needed on hub.docker.com
sed -i '/flake/d' requirements-dev.txt
docker build -t projectmonai/monai:"$RELEASE_VERSION" -f Dockerfile .
# distribute with a tag to hub.docker.com
echo "${{ secrets.DOCKER_PW }}" | docker login -u projectmonai --password-stdin
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/setupapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ jobs:
if: github.ref == 'refs/heads/dev'
run: |
cd $GITHUB_WORKSPACE
rm -rf monai/
ls -al .
python -m pip install -r requirements-min.txt
python -m pip install -e .[testing]
python -m tests.min_tests
env:
QUICKTEST: True
10 changes: 5 additions & 5 deletions .github/workflows/weekly-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install --no-build-isolation -r requirements-dev.txt
python -m pip install -U pip wheel
python -m pip install .[all,testing]
- name: Lint and type check
run: |
# clean up temporary files
Expand All @@ -59,12 +59,12 @@ jobs:
- name: Build distribution
run: |
export HEAD_COMMIT_ID=$(git rev-parse HEAD)
sed -i 's/name\ =\ monai$/name\ =\ monai-weekly/g' setup.cfg
sed -i 's/name\ =\ "monai"$/name\ =\ "monai-weekly"/g' pyproject.toml
echo "__commit_id__ = \"$HEAD_COMMIT_ID\"" >> monai/__init__.py
git diff setup.cfg monai/__init__.py
git diff pyproject.toml monai/__init__.py
git config user.name "CI Builder"
git config user.email "monai.contact@gmail.com"
git add setup.cfg monai/__init__.py
git add pyproject.toml monai/__init__.py
git commit -m "Weekly build at $HEAD_COMMIT_ID"
export YEAR_WEEK=$(date +'%y%U')
echo "Year week for tag is ${YEAR_WEEK}"
Expand Down
12 changes: 3 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ Before submitting a pull request, we recommend that all linting should pass, by
```bash
# optionally update the dependencies and dev tools
python -m pip install -U pip
python -m pip install -U -r requirements-dev.txt

# run the linting and type checking tools
./runtests.sh --codeformat

# try to fix the coding style errors automatically
./runtests.sh --autofix
Expand Down Expand Up @@ -132,7 +128,7 @@ It is recommended that the new test `test_[module_name].py` is constructed by us
python 3.9+ build-in functions, `torch`, `numpy`, `coverage` (for reporting code coverages) and `parameterized` (for organising test cases) packages.
If it requires any other external packages, please make sure:

- the packages are listed in [`requirements-dev.txt`](requirements-dev.txt)
- the packages are listed in [`pyproject.toml`](pyproject.toml)
- the new test `test_[module_name].py` is added to the `exclude_cases` in [`./tests/min_tests.py`](./tests/min_tests.py) so that
the minimal CI runner will not execute it.

Expand Down Expand Up @@ -219,10 +215,8 @@ Integration tests with minimal requirements are deployed to ensure this strategy
To add new optional dependencies, please communicate with the core team during pull request reviews,
and add the necessary information (at least) to the following files:

- [setup.cfg](https://github.com/Project-MONAI/MONAI/blob/dev/setup.cfg) (for package's `[options.extras_require]` config)
- [requirements-dev.txt](https://github.com/Project-MONAI/MONAI/blob/dev/requirements-dev.txt) (pip requirements file)
- [pyproject.toml](https://github.com/Project-MONAI/MONAI/blob/dev/pyproject.toml) (for package's `[project.optional-dependencies]` config)
- [docs/requirements.txt](https://github.com/Project-MONAI/MONAI/blob/dev/docs/requirements.txt) (docs pip requirements file)
- [environment-dev.yml](https://github.com/Project-MONAI/MONAI/blob/dev/environment-dev.yml) (conda environment file)
- [installation.md](https://github.com/Project-MONAI/MONAI/blob/dev/docs/source/installation.md) (documentation)

When writing unit tests that use 3rd-party packages, it is a good practice to always consider
Expand Down Expand Up @@ -437,7 +431,7 @@ Do **not** use `[skip ci]` for commits that change:

- Source code in `monai/`
- Test files in `tests/`
- Dependencies (`requirements*.txt`, `setup.cfg`, `setup.py`)
- Dependencies (`pyproject.toml`, `setup.py`, `docs/requirements.txt`)
- Anything that could affect correctness or compatibility

### Quick example
Expand Down
Loading
Loading