Skip to content

Commit fec6f46

Browse files
committed
⬆️ Raise torch security floors and fold the extras that restate them
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
1 parent 53a8f29 commit fec6f46

1 file changed

Lines changed: 18 additions & 40 deletions

File tree

pyproject.toml

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ build = [
7979
]
8080

8181
[project.optional-dependencies]
82-
torch = ["torch>=2.4.1"]
82+
# torch shipped its last cp38 wheel in 2.4.1 and its last cp39 wheel in 2.8.0,
83+
# so each interpreter floors at the newest release it still has wheels for
84+
torch = [
85+
"torch>=2.13.0;python_version>='3.10'",
86+
"torch>=2.8.0;python_version=='3.9'",
87+
"torch>=2.4.1;python_version<'3.9'",
88+
]
8389
yolov5 = ["yolov5>=6.0.0,<8.0.0"]
8490
ultralytics = ["ultralytics>=8.0.0"]
8591
transformers = ["transformers>=4.49.0;python_version>='3.9'"]
@@ -94,47 +100,19 @@ onnx = [
94100
"onnxruntime>=1.23.2;python_version>='3.14'",
95101
]
96102
numba = ["numba>=0.59.0;python_version>='3.10'"]
97-
torchvision = ["torch>=2.4.1", "torchvision>=0.19.0"]
98-
all = [
99-
"yolov5>=6.0.0,<8.0.0",
100-
"ultralytics>=8.0.0",
101-
"torch>=2.4.1",
102-
"torchvision",
103-
"transformers>=4.49.0;python_version>='3.9'",
104-
# inference pins onnxruntime<1.22, which has no cp314 wheel
105-
"inference>=0.51.5;python_version>='3.12' and python_version<'3.14'",
106-
"rfdetr>=1.6.2;python_version>='3.12' and python_version<'3.14'",
107-
"onnx;python_version>='3.10'",
108-
"onnxruntime;python_version>='3.10' and python_version<'3.14'",
109-
"onnxruntime>=1.23.2;python_version>='3.14'",
110-
]
103+
torchvision = ["sahi[torch]", "torchvision>=0.19.0"]
104+
all = ["sahi[yolov5,ultralytics,torchvision,transformers,roboflow,onnx]"]
111105

112106
ci = [
113-
# max supported pytorch version for python 3.8 is 2.4.1, and 2.8.0 ships no cp314 wheel
114-
# CPU versions for Linux/Windows CI
115-
"torch==2.9.0+cpu;python_version>='3.14' and platform_system!='Darwin'",
116-
"torch==2.8.0+cpu;python_version>='3.9' and python_version<'3.14' and platform_system!='Darwin'",
117-
"torch==2.4.1+cpu;python_version=='3.8' and platform_system!='Darwin'",
118-
"torchvision==0.24.0+cpu;python_version>='3.14' and platform_system!='Darwin'",
119-
"torchvision==0.23.0;python_version>='3.9' and python_version<'3.14' and platform_system!='Darwin'",
120-
"torchvision==0.19.1+cpu;python_version=='3.8' and platform_system!='Darwin'",
121-
# Regular versions for macOS
122-
"torch==2.9.0;python_version>='3.14' and platform_system=='Darwin'",
123-
"torch==2.8.0;python_version>='3.9' and python_version<'3.14' and platform_system=='Darwin'",
124-
"torch==2.4.1;python_version=='3.8' and platform_system=='Darwin'",
125-
"torchvision==0.24.0;python_version>='3.14' and platform_system=='Darwin'",
126-
"torchvision==0.23.0;python_version>='3.9' and python_version<'3.14' and platform_system=='Darwin'",
127-
"torchvision==0.19.1;python_version=='3.8' and platform_system=='Darwin'",
128-
# transformers is supported for python>=3.9
129-
"transformers>=4.49.0;python_version>='3.9'",
130-
# test roboflow only for python>=3.12; inference pins onnxruntime<1.22, which has no cp314 wheel
131-
"inference>=0.51.5;python_version>='3.12' and python_version<'3.14'",
132-
"rfdetr>=1.6.2;python_version>='3.12' and python_version<'3.14'",
133-
# ultralytics onnx is supported for python>=3.10
134-
"onnx;python_version>='3.10'",
135-
"onnxruntime;python_version>='3.10' and python_version<'3.14'",
136-
"onnxruntime>=1.23.2;python_version>='3.14'",
137-
# These are available for all python versions
107+
"sahi[transformers,roboflow,onnx]",
108+
# pin the floors the torch extra declares; a bare version also matches the
109+
# +cpu local build that the pytorch-cpu index serves Linux and Windows
110+
"torch==2.13.0;python_version>='3.10'",
111+
"torch==2.8.0;python_version=='3.9'",
112+
"torch==2.4.1;python_version=='3.8'",
113+
"torchvision==0.28.0;python_version>='3.10'",
114+
"torchvision==0.23.0;python_version=='3.9'",
115+
"torchvision==0.19.1;python_version=='3.8'",
138116
"pycocotools>=2.0.7",
139117
"ultralytics>=8.3.161",
140118
"scikit-image",

0 commit comments

Comments
 (0)