From 94505f6d356e5689aaea2abc96eb3c4efcd7a11b Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 6 May 2022 11:16:25 -0500 Subject: [PATCH] Test on Python 3.10 (#457) * Test on Python 3.10 * Install pre-release versions of rasterio for 3.10 wheels * Only use pre-release for rasterio * Open3D does not yet have 3.10 wheels --- .github/workflows/release.yaml | 16 +++++++++++----- .github/workflows/style.yaml | 33 ++++++++++++++++++++++++--------- .github/workflows/tests.yaml | 10 ++++++---- setup.cfg | 3 ++- 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a4e23d43d9a..5b5e9e83827 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,11 +16,12 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies run: | - pip install cython numpy # needed for pycocotools + pip install --pre 'rasterio>=1.0.16' pip install .[tests] + pip list - name: Run pytest checks run: pytest --cov=torchgeo --cov-report=xml integration: @@ -32,9 +33,12 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies - run: pip install .[datasets,tests] + run: | + pip install --pre 'rasterio>=1.0.16' + pip install .[datasets,tests] + pip list - name: Run integration checks run: pytest -m slow notebooks: @@ -46,11 +50,13 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies run: | + pip install --pre 'rasterio>=1.0.16' pip install .[datasets,tests] pip install -r docs/requirements.txt + pip list - name: Run notebook checks env: MLHUB_API_KEY: ${{ secrets.MLHUB_API_KEY }} diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index cfdac12b8cc..96cbda2524e 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -18,9 +18,12 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies - run: pip install .[style] + run: | + pip install --pre 'rasterio>=1.0.16' + pip install .[style] + pip list - name: Run black checks run: black . --check --diff flake8: @@ -32,9 +35,12 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies - run: pip install .[style] + run: | + pip install --pre 'rasterio>=1.0.16' + pip install .[style] + pip list - name: Run flake8 checks run: flake8 isort: @@ -46,9 +52,12 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies - run: pip install .[style] + run: | + pip install --pre 'rasterio>=1.0.16' + pip install .[style] + pip list - name: Run isort checks run: isort . --check --diff pydocstyle: @@ -60,9 +69,12 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies - run: pip install .[style] + run: | + pip install --pre 'rasterio>=1.0.16' + pip install .[style] + pip list - name: Run pydocstyle checks run: pydocstyle pyupgrade: @@ -76,6 +88,9 @@ jobs: with: python-version: 3.9 - name: Install pip dependencies - run: pip install .[style] + run: | + pip install --pre 'rasterio>=1.0.16' + pip install .[style] + pip list - name: Run pyupgrade checks run: pyupgrade --py37-plus $(find . -name "*.py") diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index befaca1c2b6..33954900004 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -18,11 +18,12 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies run: | - pip install cython numpy # needed for pycocotools + pip install --pre 'rasterio>=1.0.16' pip install .[datasets,tests] + pip list - name: Run mypy checks run: mypy . pytest: @@ -33,7 +34,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9] + python-version: ['3.7', '3.8', '3.9', '3.10'] steps: - name: Clone repo uses: actions/checkout@v2 @@ -62,8 +63,9 @@ jobs: if: ${{ runner.os == 'Windows' }} - name: Install pip dependencies run: | - pip install cython numpy # needed for pycocotools + pip install --pre 'rasterio>=1.0.16' pip install .[datasets,tests] + pip list - name: Run pytest checks run: pytest --cov=torchgeo --cov-report=xml - name: Report coverage diff --git a/setup.cfg b/setup.cfg index 574b5e9d038..349186e4905 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,6 +16,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 License :: OSI Approved :: MIT License Operating System :: OS Independent Topic :: Scientific/Engineering :: Artificial Intelligence @@ -77,7 +78,7 @@ datasets = laspy>=2 # open3d 0.11.2+ required to avoid GLFW error: # https://github.com/isl-org/Open3D/issues/1550 - open3d>=0.11.2 + open3d>=0.11.2;python_version<'3.10' opencv-python # pandas 0.23.2+ required for python 3.7 support pandas>=0.23.2