Skip to content

Commit 9292800

Browse files
authored
Updating Workflows to Fix Missing pkg_resources (#2057)
### Description This updates the workflow files to fix changes to `setuptools` which drops support for `pkg_resources` but also removes the package from PyPI. With the `--no-build-isolation` flag added to `pip`, the version of `setuptools` in the installing environment is used, rather than a new one being installed in an isolated one which will be too new and fail when `pkg_resources` is found missing. ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [ ] Avoid including large-size files in the PR. - [ ] Clean up long text outputs from code cells in the notebook. - [ ] For security purposes, please check the contents and remove any sensitive info such as user names and private key. - [ ] Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the `./figure` folder - [ ] Notebook runs automatically `./runner.sh -t <path to .ipynb file>` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated CI workflows to newer action versions and upgraded Python runtime to 3.10 * Simplified and consolidated dependency caching into a unified pip cache, removing legacy timestamp caching * Streamlined dependency installation and test/lint invocations (including upgraded packaging tooling and adjustments to build isolation) for more consistent and reliable CI runs <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent 17ef259 commit 9292800

4 files changed

Lines changed: 27 additions & 68 deletions

File tree

.github/workflows/copyright.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,19 @@ on:
88
pull_request:
99

1010
jobs:
11-
# caching of these jobs:
12-
# - docker-20-03-py3-pip- (shared)
13-
# - ubuntu py37 pip-
14-
# - os-latest-pip- (shared)
1511
copyright:
1612
runs-on: ubuntu-latest
1713
steps:
18-
- uses: actions/checkout@v3
19-
- name: Set up Python 3.9
20-
uses: actions/setup-python@v3
14+
- uses: actions/checkout@v6
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v6
2117
with:
22-
python-version: 3.9
23-
- name: cache weekly timestamp
24-
id: pip-cache
25-
run: |
26-
echo "::set-output name=datew::$(date '+%Y-%V')"
27-
- name: cache for pip
28-
uses: actions/cache@v3
29-
id: cache
30-
with:
31-
path: ~/.cache/pip
32-
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
18+
python-version: '3.10'
19+
cache: 'pip'
3320
- name: Install dependencies
3421
run: |
3522
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
36-
python -m pip install --upgrade pip wheel
37-
python -m pip install -r https://raw.githubusercontent.com/Project-MONAI/MONAI/dev/requirements-dev.txt
23+
python -m pip install --upgrade pip wheel wheel-stub
3824
python -m pip install -r requirements.txt
3925
- name: Copyright check
4026
run: |

.github/workflows/guidelines.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,19 @@ on:
88
pull_request:
99

1010
jobs:
11-
# caching of these jobs:
12-
# - docker-20-03-py3-pip- (shared)
13-
# - ubuntu py37 pip-
14-
# - os-latest-pip- (shared)
1511
guidelines:
1612
runs-on: ubuntu-latest
1713
steps:
18-
- uses: actions/checkout@v3
19-
- name: Set up Python 3.9
20-
uses: actions/setup-python@v3
14+
- uses: actions/checkout@v6
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v6
2117
with:
22-
python-version: 3.9
23-
- name: cache weekly timestamp
24-
id: pip-cache
25-
run: |
26-
echo "::set-output name=datew::$(date '+%Y-%V')"
27-
- name: cache for pip
28-
uses: actions/cache@v3
29-
id: cache
30-
with:
31-
path: ~/.cache/pip
32-
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
18+
python-version: '3.10'
19+
cache: 'pip'
3320
- name: Install dependencies
3421
run: |
3522
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
36-
python -m pip install --upgrade pip wheel
37-
python -m pip install -r https://raw.githubusercontent.com/Project-MONAI/MONAI/dev/requirements-dev.txt
23+
python -m pip install --upgrade pip wheel wheel-stub
3824
python -m pip install -r requirements.txt
3925
- name: Guidelines notebook format check
4026
run: |

.github/workflows/pep8.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,19 @@ on:
88
pull_request:
99

1010
jobs:
11-
# caching of these jobs:
12-
# - docker-20-03-py3-pip- (shared)
13-
# - ubuntu py37 pip-
14-
# - os-latest-pip- (shared)
1511
pep8:
1612
runs-on: ubuntu-latest
1713
steps:
18-
- uses: actions/checkout@v3
19-
- name: Set up Python 3.9
20-
uses: actions/setup-python@v3
14+
- uses: actions/checkout@v6
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v6
2117
with:
22-
python-version: 3.9
23-
- name: cache weekly timestamp
24-
id: pip-cache
25-
run: |
26-
echo "::set-output name=datew::$(date '+%Y-%V')"
27-
- name: cache for pip
28-
uses: actions/cache@v3
29-
id: cache
30-
with:
31-
path: ~/.cache/pip
32-
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
18+
python-version: '3.10'
19+
cache: 'pip'
3320
- name: Install dependencies
3421
run: |
3522
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
36-
python -m pip install --upgrade pip wheel
37-
python -m pip install -r https://raw.githubusercontent.com/Project-MONAI/MONAI/dev/requirements-dev.txt
23+
python -m pip install --upgrade pip wheel wheel-stub
3824
python -m pip install -r requirements.txt
3925
- name: PEP8 check
4026
run: |

.github/workflows/test-modified.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v6
2020
- name: Set up Python 3.10
21-
uses: actions/setup-python@v3
21+
uses: actions/setup-python@v6
2222
with:
2323
python-version: '3.10'
24+
cache: 'pip'
2425
- name: Install MONAI
2526
id: monai-install
2627
env:
@@ -30,17 +31,17 @@ jobs:
3031
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
3132
df -h
3233
which python
33-
python -m pip install -U pip wheel
34+
python -m pip install -U pip wheel wheel-stub
3435
# Force CPU-only PyTorch wheels so we don't download huge CUDA/nvidia-* wheels in CI.
3536
# Keep PyPI available for torch's dependencies.
36-
python -m pip install --index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.org/simple torch torchvision torchaudio
37+
pip install --index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.org/simple torch torchvision torchaudio
3738
38-
python -m pip install -r https://raw.githubusercontent.com/Project-MONAI/MONAI/dev/requirements-dev.txt
39-
python -m pip install -r requirements.txt
39+
pip install --no-build-isolation -r https://raw.githubusercontent.com/Project-MONAI/MONAI/dev/requirements-dev.txt
40+
pip install -r requirements.txt
4041
4142
# Avoid PEP517 build isolation (which can re-install torch and pull CUDA wheels).
42-
BUILD_MONAI=0 python -m pip install --no-build-isolation git+https://github.com/Project-MONAI/MONAI#egg=MONAI
43-
python -m pip list
43+
BUILD_MONAI=0 pip install --no-build-isolation git+https://github.com/Project-MONAI/MONAI#egg=MONAI
44+
pip list
4445
- name: Notebook quick check
4546
shell: bash
4647
run: |

0 commit comments

Comments
 (0)