Skip to content

Commit

Permalink
CI: Enable testing with Python 3.10 (#1132)
Browse files Browse the repository at this point in the history
* 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 <Borda@users.noreply.github.com>
  • Loading branch information
akihironitta and Borda committed Jul 11, 2022
1 parent 412002c commit 17014b7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions .github/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
LUT_PYTHON_TORCH = {
"3.8": "1.4",
"3.9": "1.7.1",
"3.10": "1.11",
}
_path = lambda *ds: os.path.join(_PATH_ROOT, *ds)
REQUIREMENTS_FILES = tuple(glob.glob(_path("requirements", "*.txt")) + [_path("requirements.txt")])
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/ci_integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
python-version: [3.7, 3.9]
python-version: ['3.7', '3.10']
requires: ['oldest', 'latest']
exclude:
- {python-version: 3.7, requires: 'latest'}
- {python-version: 3.9, requires: 'oldest'}
- {python-version: '3.7', requires: 'latest'}
- {python-version: '3.9', requires: 'oldest'}
- {python-version: '3.10', requires: 'oldest'}
- {python-version: '3.10', os: 'windows-2019'} # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
env:
PYTEST_ARTEFACT: test-results-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml
PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html
Expand All @@ -56,10 +58,6 @@ jobs:
if: inputs.requires == 'oldest'
run: python .github/assistant.py set-oldest-versions --req_files=requirements/integrate.txt

- name: Freeze Numpy (hotfix)
if: matrix.requires == 'latest'
run: pip install "numpy==1.20.0" # temp fix for cypesq

- name: Freeze PIL (hotfix)
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
run: pip install "Pillow<9.0" # It messes with torchvision
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ci_test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ jobs:
python-version: ["3.8"]
pytorch-version: ["1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11"]
include:
- {python-version: 3.7, pytorch-version: '1.3'}
- {python-version: 3.9, pytorch-version: '1.12'}
- {python-version: 3.9, pytorch-version: '1.13'}
- {python-version: '3.7', pytorch-version: '1.3'}
- {python-version: '3.9', pytorch-version: '1.12'}
- {python-version: '3.9', pytorch-version: '1.13'}
- {python-version: '3.10', pytorch-version: '1.11'}
- {python-version: '3.10', pytorch-version: '1.12'}
- {python-version: '3.10', pytorch-version: '1.13'}
env:
PYTEST_ARTEFACT: test-conda-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}.xml

Expand Down Expand Up @@ -75,7 +78,6 @@ jobs:
pip install --requirement requirements/test.txt --quiet
python ./.github/assistant.py prune-packages requirements/image.txt torchvision
python ./.github/assistant.py prune-packages requirements/detection.txt torchvision
pip install -q "numpy==1.20.0" # try to fix cocotools for PT 1.4 & 1.9
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
pip install -q "Pillow<9.0" # It messes with torchvision
pip install -e . -r requirements/devel.txt -f https://download.pytorch.org/whl/cpu/torch_stable.html
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
python-version: [3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9', '3.10']
requires: ['oldest', 'latest']
exclude:
- {python-version: 3.7, requires: 'latest'}
- {python-version: 3.9, requires: 'oldest'}
- {python-version: '3.7', requires: 'latest'}
- {python-version: '3.9', requires: 'oldest'}
- {python-version: '3.10', requires: 'oldest'}
- {python-version: '3.10', os: 'windows-2019'} # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
env:
PYTEST_ARTEFACT: test-results-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml
PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html
Expand Down Expand Up @@ -81,10 +83,6 @@ jobs:
# NOTE: run coverage on tests does not propagate failure status for Win, https://github.com/nedbat/coveragepy/issues/1003
run: python -m pytest torchmetrics

- name: Freeze Numpy (hotfix)
if: matrix.requires == 'latest'
run: pip install "numpy==1.20.0" # temp fix for cypesq

- name: Freeze PIL (hotfix)
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
run: pip install "Pillow<9.0" # It messes with torchvision
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,6 @@ def _prepare_extras(skip_files: Tuple[str] = ("devel.txt",)):
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)

0 comments on commit 17014b7

Please sign in to comment.