Skip to content

Commit 0d19a72

Browse files
KumoLiuericspod
andauthored
Temporarily Restrict setuptools Version to 79.0.1 (#8441)
workaround for #8439 ### Description This PR temporarily restricts the setuptools version to 79.0.1 to maintain compatibility with our current setup. In future updates, we need to review and update our setup configurations to accommodate later versions of setuptools. ### 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 <eric.kerfoot@kcl.ac.uk> Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> Co-authored-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
1 parent b58e883 commit 0d19a72

File tree

9 files changed

+10
-12
lines changed

9 files changed

+10
-12
lines changed

.github/workflows/pythonapp-min.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
strategy:
125125
fail-fast: false
126126
matrix:
127-
pytorch-version: ['2.3.1', '2.4.1', '2.5.1', 'latest']
127+
pytorch-version: ['2.4.1', '2.5.1', '2.6.0'] # FIXME: add 'latest' back once PyTorch 2.7 issues are resolved
128128
timeout-minutes: 40
129129
steps:
130130
- uses: actions/checkout@v4

.github/workflows/pythonapp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
# install the latest pytorch for testing
156156
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
157157
# fresh torch installation according to pyproject.toml
158-
python -m pip install torch>=2.3.0 torchvision
158+
python -m pip install torch>=2.4.1 torchvision
159159
- name: Check packages
160160
run: |
161161
pip uninstall monai

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-f https://download.pytorch.org/whl/cpu/torch-2.3.0%2Bcpu-cp39-cp39-linux_x86_64.whl
2-
torch>=2.3.0
2+
torch>=2.4.1, <2.7.0
33
pytorch-ignite==0.4.11
44
numpy>=1.20
55
itk>=5.2

monai/networks/schedulers/ddpm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def step(
238238
pred_prev_sample = pred_original_sample_coeff * pred_original_sample + current_sample_coeff * sample
239239

240240
# 6. Add noise
241-
variance = 0
241+
variance: torch.Tensor = torch.tensor(0)
242242
if timestep > 0:
243243
noise = torch.randn(
244244
model_output.size(),

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
requires = [
33
"wheel",
44
"setuptools",
5-
"torch>=2.3.0",
5+
"torch>=2.4.1, <2.7.0",
66
"ninja",
77
"packaging"
88
]
99

1010
[tool.black]
1111
line-length = 120
12-
target-version = ['py38', 'py39', 'py310']
12+
target-version = ['py39', 'py310', 'py311', 'py312']
1313
include = '\.pyi?$'
1414
exclude = '''
1515
(

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mccabe
1717
pep8-naming
1818
pycodestyle
1919
pyflakes
20-
black>=22.12
20+
black>=25.1.0
2121
isort>=5.1, <6.0
2222
ruff
2323
pytype>=2020.6.1; platform_system != "Windows"

requirements-min.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Requirements for minimal tests
22
-r requirements.txt
33
setuptools>=50.3.0,<66.0.0,!=60.6.0 ; python_version < "3.12"
4-
setuptools>=70.2.0; python_version >= "3.12"
4+
setuptools>=70.2.0,<=79.0.1; python_version >= "3.12"
55
coverage>=5.5
66
parameterized
77
packaging

requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
torch>=2.3.0; sys_platform != 'win32'
2-
torch>=2.4.1; sys_platform == 'win32'
1+
torch>=2.4.1, <2.7.0
32
numpy>=1.24,<3.0

setup.cfg

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ setup_requires =
4242
ninja
4343
packaging
4444
install_requires =
45-
torch>=2.3.0; sys_platform != 'win32'
46-
torch>=2.4.1; sys_platform == 'win32'
45+
torch>=2.4.1, <2.7.0
4746
numpy>=1.24,<3.0
4847

4948
[options.extras_require]

0 commit comments

Comments
 (0)