Skip to content

Commit 4fbe7d4

Browse files
authored
Run tests with Python 3.12 (#3067)
1 parent 1d8121b commit 4fbe7d4

7 files changed

+26
-29
lines changed

.github/workflows/manage-python-cache.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ["3.9", "3.10", "3.11"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1818
steps:
1919
- name: Check out repository
2020
uses: actions/checkout@v4
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232
strategy:
3333
matrix:
34-
python-version: ["3.9", "3.10", "3.11"]
34+
python-version: ["3.9", "3.10", "3.11", "3.12"]
3535
steps:
3636
- name: Check out repository
3737
uses: actions/checkout@v4

.github/workflows/test-daily-integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: ["3.9", "3.10", "3.11"]
12+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version: ["3.9", "3.10", "3.11"]
19+
python-version: ["3.9", "3.10", "3.11", "3.12"]
2020
steps:
2121
- uses: actions/checkout@v4
2222
- name: Set up Python ${{ matrix.python-version }}
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ubuntu-latest
3737
strategy:
3838
matrix:
39-
python-version: ["3.9", "3.10", "3.11"]
39+
python-version: ["3.9", "3.10", "3.11", "3.12"]
4040
steps:
4141
- name: Clear free space
4242
run: |

.github/workflows/test_scenarios.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ["3.9", "3.10", "3.11"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1818
steps:
1919
- name: Clear free space
2020
run: |

pre-commit.sh

+8-9
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
# This script fails when any of its commands fail.
44
set -e
55

6-
# Check that python version is at least 3.8.
7-
valid_version=$(python3 -c 'import sys; print(sys.version_info[:2] >= (3, 8))')
8-
if [ "$valid_version" == "False" ]; then
9-
echo "Python 3 version (python3 --version) must be at least 3.8, but was:"
10-
python3 --version 2>&1
11-
exit 1
12-
fi
13-
146
# Python style checks and linting
157
black --check --diff src scripts || (
168
echo ""
@@ -24,6 +16,13 @@ black --check --diff src scripts || (
2416
)
2517

2618
mypy --install-types --non-interactive src scripts
27-
flake8 src scripts
19+
20+
PYTHON_VERSION=$(python3 --version 2>&1 | cut -d' ' -f2)
21+
if [[ $PYTHON_VERSION == 3.12* ]]; then
22+
echo "Skipping flake8 because Python version is 3.12."
23+
echo "See https://github.com/stanford-crfm/helm/issues/3072 for more information."
24+
else
25+
flake8 src scripts
26+
fi
2827

2928
echo "Done."

requirements.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ onnx==1.16.2
178178
onnxruntime==1.19.2
179179
open_clip_torch==2.26.1
180180
openai==1.48.0
181-
OpenCC==1.1.6
181+
OpenCC==1.1.7
182182
opencv-python==4.7.0.72
183183
opencv-python-headless==4.10.0.84
184184
openvino==2024.4.0
@@ -197,7 +197,6 @@ pandas==2.2.3
197197
param==2.1.1
198198
parameterized==0.9.0
199199
pathspec==0.12.1
200-
pathtools==0.1.2
201200
pdf2image==1.16.3
202201
pillow==10.4.0
203202
platformdirs==4.3.6
@@ -228,7 +227,6 @@ Pygments==2.18.0
228227
pyhocon==0.3.61
229228
pymongo==4.9.1
230229
pymoo==0.6.1.3
231-
pyonmttok==1.37.0
232230
pyparsing==3.1.4
233231
pypinyin==0.49.0
234232
PySocks==1.7.1
@@ -260,7 +258,7 @@ scikit-learn==1.5.2
260258
scipy==1.13.1
261259
seaborn==0.11.2
262260
selenium==4.17.2
263-
sentencepiece==0.1.99
261+
sentencepiece==0.2.0
264262
sentry-sdk==2.14.0
265263
setproctitle==1.3.3
266264
shapely==2.0.6
@@ -317,7 +315,7 @@ Unidecode==1.3.6
317315
uritemplate==4.1.1
318316
urllib3==1.26.20
319317
virtualenv==20.26.5
320-
wandb==0.13.11
318+
wandb==0.16.6
321319
wasabi==1.1.3
322320
wcwidth==0.2.13
323321
weasel==0.4.1

setup.cfg

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ classifiers =
1818
url = https://github.com/stanford-crfm/helm
1919

2020
[options]
21-
python_requires = >=3.9,<3.12
21+
python_requires = >=3.9
2222
package_dir =
2323
=src
2424
packages = find:
@@ -94,11 +94,11 @@ slurm =
9494
simple-slurm~=0.2.6
9595

9696
cleva =
97-
unidecode==1.3.6
98-
pypinyin==0.49.0
99-
jieba==0.42.1
100-
opencc==1.1.6
101-
langdetect==1.0.9
97+
unidecode~=1.3
98+
pypinyin~=0.49.0
99+
jieba~=0.42.1
100+
opencc~=1.1
101+
langdetect~=1.0
102102

103103
images =
104104
crfm-helm[accelerate]
@@ -156,7 +156,7 @@ together =
156156
together~=1.1
157157

158158
yandex =
159-
sentencepiece~=0.1.97
159+
sentencepiece~=0.2.0
160160

161161
models =
162162
crfm-helm[ai21]
@@ -242,7 +242,7 @@ heim =
242242
flax~=0.6.11
243243
ftfy~=6.1.1
244244
Unidecode~=1.3.6
245-
wandb~=0.13.11
245+
wandb~=0.16
246246

247247
# HEIM perturbations
248248
google-cloud-translate~=3.11.2
@@ -285,7 +285,7 @@ all =
285285
crfm-helm[mongo]
286286
crfm-helm[heim]
287287
crfm-helm[vlm]
288-
crfm-helm[bhasa]
288+
# crfm-helm[bhasa] is excluded because pyonmttok does not support Python 3.12
289289
# crfm-helm[dev] is excluded because end-users don't need it.
290290
# crfm-helm[summarize] is excluded because it requires torch<2.0
291291
# TODO(#2280): Add crfm-helm[summarize] back.

0 commit comments

Comments
 (0)