Skip to content

Commit

Permalink
Test on Python 3.10 (microsoft#457)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
adamjstewart authored May 6, 2022
1 parent c8431c6 commit 75ef2d2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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")
10 changes: 6 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 75ef2d2

Please sign in to comment.