Skip to content

Commit 17014b7

Browse files
akihironittaBorda
andauthored
CI: Enable testing with Python 3.10 (#1132)
* Enable testing with Python 3.10 * Update setup.py * Fix Python version syntax * Try unpinning numpy * Add back skip 3.9 oldest * Skip Python 3.10 on Windows * Add back skip 3.9 oldest * Apply suggestions from code review Co-authored-by: Jirka Borovec <[email protected]>
1 parent 412002c commit 17014b7

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

.github/assistant.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
LUT_PYTHON_TORCH = {
3030
"3.8": "1.4",
3131
"3.9": "1.7.1",
32+
"3.10": "1.11",
3233
}
3334
_path = lambda *ds: os.path.join(_PATH_ROOT, *ds)
3435
REQUIREMENTS_FILES = tuple(glob.glob(_path("requirements", "*.txt")) + [_path("requirements.txt")])

.github/workflows/ci_integrate.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
os: [ubuntu-20.04, macOS-10.15, windows-2019]
28-
python-version: [3.7, 3.9]
28+
python-version: ['3.7', '3.10']
2929
requires: ['oldest', 'latest']
3030
exclude:
31-
- {python-version: 3.7, requires: 'latest'}
32-
- {python-version: 3.9, requires: 'oldest'}
31+
- {python-version: '3.7', requires: 'latest'}
32+
- {python-version: '3.9', requires: 'oldest'}
33+
- {python-version: '3.10', requires: 'oldest'}
34+
- {python-version: '3.10', os: 'windows-2019'} # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
3335
env:
3436
PYTEST_ARTEFACT: test-results-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml
3537
PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html
@@ -56,10 +58,6 @@ jobs:
5658
if: inputs.requires == 'oldest'
5759
run: python .github/assistant.py set-oldest-versions --req_files=requirements/integrate.txt
5860

59-
- name: Freeze Numpy (hotfix)
60-
if: matrix.requires == 'latest'
61-
run: pip install "numpy==1.20.0" # temp fix for cypesq
62-
6361
- name: Freeze PIL (hotfix)
6462
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
6563
run: pip install "Pillow<9.0" # It messes with torchvision

.github/workflows/ci_test-conda.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ jobs:
2929
python-version: ["3.8"]
3030
pytorch-version: ["1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11"]
3131
include:
32-
- {python-version: 3.7, pytorch-version: '1.3'}
33-
- {python-version: 3.9, pytorch-version: '1.12'}
34-
- {python-version: 3.9, pytorch-version: '1.13'}
32+
- {python-version: '3.7', pytorch-version: '1.3'}
33+
- {python-version: '3.9', pytorch-version: '1.12'}
34+
- {python-version: '3.9', pytorch-version: '1.13'}
35+
- {python-version: '3.10', pytorch-version: '1.11'}
36+
- {python-version: '3.10', pytorch-version: '1.12'}
37+
- {python-version: '3.10', pytorch-version: '1.13'}
3538
env:
3639
PYTEST_ARTEFACT: test-conda-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}.xml
3740

@@ -75,7 +78,6 @@ jobs:
7578
pip install --requirement requirements/test.txt --quiet
7679
python ./.github/assistant.py prune-packages requirements/image.txt torchvision
7780
python ./.github/assistant.py prune-packages requirements/detection.txt torchvision
78-
pip install -q "numpy==1.20.0" # try to fix cocotools for PT 1.4 & 1.9
7981
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
8082
pip install -q "Pillow<9.0" # It messes with torchvision
8183
pip install -e . -r requirements/devel.txt -f https://download.pytorch.org/whl/cpu/torch_stable.html

.github/workflows/ci_test-full.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
os: [ubuntu-20.04, macOS-10.15, windows-2019]
31-
python-version: [3.7, 3.8, 3.9]
31+
python-version: ['3.7', '3.8', '3.9', '3.10']
3232
requires: ['oldest', 'latest']
3333
exclude:
34-
- {python-version: 3.7, requires: 'latest'}
35-
- {python-version: 3.9, requires: 'oldest'}
34+
- {python-version: '3.7', requires: 'latest'}
35+
- {python-version: '3.9', requires: 'oldest'}
36+
- {python-version: '3.10', requires: 'oldest'}
37+
- {python-version: '3.10', os: 'windows-2019'} # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
3638
env:
3739
PYTEST_ARTEFACT: test-results-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml
3840
PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html
@@ -81,10 +83,6 @@ jobs:
8183
# NOTE: run coverage on tests does not propagate failure status for Win, https://github.com/nedbat/coveragepy/issues/1003
8284
run: python -m pytest torchmetrics
8385

84-
- name: Freeze Numpy (hotfix)
85-
if: matrix.requires == 'latest'
86-
run: pip install "numpy==1.20.0" # temp fix for cypesq
87-
8886
- name: Freeze PIL (hotfix)
8987
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
9088
run: pip install "Pillow<9.0" # It messes with torchvision

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,6 @@ def _prepare_extras(skip_files: Tuple[str] = ("devel.txt",)):
159159
"Programming Language :: Python :: 3.7",
160160
"Programming Language :: Python :: 3.8",
161161
"Programming Language :: Python :: 3.9",
162+
"Programming Language :: Python :: 3.10",
162163
],
163164
)

0 commit comments

Comments
 (0)