Skip to content

Commit 7b9cb34

Browse files
authored
Weekly Preview Fix (#9075)
### Description The `weekly-preview.yml` action is not working due to some strange interaction with the updated build process. The solution is to install MONAI first before making the wheel. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent fd8a819 commit 7b9cb34

1 file changed

Lines changed: 27 additions & 10 deletions

File tree

.github/workflows/weekly-preview.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@ permissions:
66
on:
77
schedule:
88
- cron: "0 2 * * 0" # 02:00 of every Sunday
9+
pull_request:
10+
branches:
11+
- dev
12+
13+
env:
14+
PYTHON_VER: '3.10'
15+
PYTORCH_VER: '2.8.0'
16+
PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu" # forces CPU PyTorch installation, should be faster
917

1018
jobs:
1119
static-checks:
20+
if: github.event_name == 'schedule' # only check on cron run, these checks are redundant in a PR
1221
runs-on: ubuntu-latest
1322
strategy:
1423
matrix:
@@ -25,10 +34,10 @@ jobs:
2534
- uses: actions/checkout@v7
2635
with:
2736
persist-credentials: false
28-
- name: Set up Python 3.10
37+
- name: Set up Python ${{ env.PYTHON_VER }}
2938
uses: actions/setup-python@v6
3039
with:
31-
python-version: '3.10'
40+
python-version: ${{ env.PYTHON_VER }}
3241
cache: 'pip'
3342
- name: Install dependencies
3443
run: |
@@ -40,22 +49,24 @@ jobs:
4049
$(pwd)/runtests.sh --build --clean
4150
$(pwd)/runtests.sh --build --${{ matrix.opt }}
4251
43-
packaging:
52+
publish:
4453
if: github.repository == 'Project-MONAI/MONAI'
4554
runs-on: ubuntu-latest
4655
steps:
4756
- uses: actions/checkout@v7
4857
with:
49-
ref: dev
58+
# get the ref for the PR branch or dev if this is a cron job
59+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'dev' }}
5060
fetch-depth: 0
5161
persist-credentials: false
52-
- name: Set up Python 3.10
62+
- name: Set up Python ${{ env.PYTHON_VER }}
5363
uses: actions/setup-python@v6
5464
with:
55-
python-version: '3.10'
56-
- name: Install setuptools
65+
python-version: ${{ env.PYTHON_VER }}
66+
cache: 'pip'
67+
- name: Install tools
5768
run: |
58-
python -m pip install --user --upgrade setuptools wheel packaging
69+
python -m pip install -U pip build
5970
- name: Build distribution
6071
run: |
6172
export HEAD_COMMIT_ID=$(git rev-parse HEAD)
@@ -72,9 +83,15 @@ jobs:
7283
git tag "1.7.dev${YEAR_WEEK}"
7384
git log -1
7485
git tag --list
75-
python setup.py sdist bdist_wheel
76-
86+
python -m build
87+
ls -lh dist
88+
- name: Test Installation
89+
run: |
90+
pip install dist/*.whl
91+
pip list
92+
(cd "$(mktemp -d)" && python -c 'import monai; print(monai.__version__)')
7793
- name: Publish to PyPI
94+
if: github.event_name == 'schedule' # only publish on cron run
7895
uses: pypa/gh-action-pypi-publish@release/v1
7996
with:
8097
user: __token__

0 commit comments

Comments
 (0)