Skip to content

Commit

Permalink
Test minimum version of deps (microsoft#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart authored Jun 18, 2022
1 parent 84257f7 commit cf04f4c
Show file tree
Hide file tree
Showing 21 changed files with 171 additions and 88 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
directory: "requirements"
schedule:
interval: "daily"
# Allow up to 2 open pull requests at a time
open-pull-requests-limit: 2
ignore:
# tensorboard requires protobuf < 4
# torch, tensorboard require protobuf < 4
- dependency-name: "protobuf"
# segmentation-models-pytorch requires older timm, can't update
- dependency-name: "timm"
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
python-version: '3.10'
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run integration checks
run: pytest -m slow
Expand All @@ -52,7 +52,7 @@ jobs:
python-version: '3.10'
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run notebook checks
env:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version: '3.10'
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run black checks
run: black . --check --diff
Expand All @@ -37,7 +37,7 @@ jobs:
python-version: '3.10'
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run flake8 checks
run: flake8
Expand All @@ -53,7 +53,7 @@ jobs:
python-version: '3.10'
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run isort checks
run: isort . --check --diff
Expand All @@ -69,7 +69,7 @@ jobs:
python-version: '3.10'
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run pydocstyle checks
run: pydocstyle
Expand All @@ -85,7 +85,7 @@ jobs:
python-version: '3.10'
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run pyupgrade checks
run: pyupgrade --py37-plus $(find . -name "*.py")
27 changes: 25 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version: '3.10'
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run mypy checks
run: mypy .
Expand Down Expand Up @@ -62,7 +62,30 @@ jobs:
if: ${{ runner.os == 'Windows' }}
- name: Install pip dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip list
- name: Run pytest checks
run: pytest --cov=torchgeo --cov-report=xml
- name: Report coverage
uses: codecov/codecov-action@v2
minimum:
name: minimum
runs-on: ubuntu-latest
env:
MPLBACKEND: Agg
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install apt dependencies (Linux)
run: sudo apt-get install libgeos-dev libhdf5-dev unrar
- name: Install pip dependencies
run: |
pip install cython numpy==1.17.2 # needed by pycocotools
pip install -r requirements/requirements-min.txt
pip list
- name: Run pytest checks
run: pytest --cov=torchgeo --cov-report=xml
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build:
# Configuration of the Python environment to be used
python:
install:
- requirements: requirements.txt
- requirements: requirements/requirements.txt
- requirements: docs/requirements.txt
- method: pip
path: .
Expand Down
35 changes: 16 additions & 19 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,45 @@ channels:
- conda-forge
- open3d-admin # for open3d
dependencies:
- einops
- fiona>=1.5
- h5py
- numpy
- einops>=0.3
- fiona>=1.8
- h5py>=2.6
- numpy>=1.17.2
- open3d>=0.11.2
- pip
- protobuf<4
- pycocotools
- pycocotools>=2
- pyproj>=2.2
- python>=3.7
- pytorch>=1.7
- pytorch>=1.9
- rarfile>=3
- rasterio>=1.0.16
- rasterio>=1.0.20
- shapely>=1.3
- torchvision>=0.10
- pip:
- black>=21.4b0
- black[jupyter]>=21.8
- flake8>=3.8
- ipywidgets>=7
- isort[colors]>=5.8
- jupyterlab
- kornia>=0.6.4
- laspy>=2.0.0
- laspy>=2
- mypy>=0.900
- nbmake>=0.1
- nbsphinx>=0.8.5
- omegaconf>=2.1
- opencv-python
- opencv-python>=3.4.2.17
- pandas>=0.23.2
- pillow>=2.9
- pillow>=6.2
- pydocstyle[toml]>=6.1
- pytest>=6
- pytest>=6.1.2
- pytest-cov>=2.4
- pytorch-lightning>=1.3
- pytorch-lightning>=1.5.1
- git+https://github.com/pytorch/pytorch_sphinx_theme
- radiant-mlhub>=0.2.1
- rtree>=1
- scikit-learn>=0.18
- scipy>=0.9
- scikit-learn>=0.21
- scipy>=1.2
- segmentation-models-pytorch>=0.2
- setuptools>=42
- sphinx>=4
- timm>=0.2.1
- timm>=0.4.12
- torchmetrics>=0.7
- zipfile-deflate64>=0.2
20 changes: 16 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
# setuptools 42+ required for metadata.license_files support in setup.cfg
"setuptools>=42,<63",
"wheel<0.38",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -58,18 +58,30 @@ filterwarnings = [
"error",

# Warnings raised by dependencies of dependencies, out of our control
# https://github.com/Cadene/pretrained-models.pytorch/issues/221
"ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:pretrainedmodels.datasets.utils",
# https://github.com/pytorch/vision/pull/5898
"ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:torchvision.transforms.functional_pil",
# https://github.com/rwightman/pytorch-image-models/pull/1256
"ignore:.*is deprecated and will be removed in Pillow 10:DeprecationWarning",
"ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:timm.data",
# https://github.com/pytorch/pytorch/issues/72906
# https://github.com/pytorch/pytorch/pull/69823
"ignore:distutils Version classes are deprecated. Use packaging.version instead.:DeprecationWarning",
"ignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning:torch.utils.tensorboard",
# https://github.com/PyTorchLightning/pytorch-lightning/issues/13256
"ignore:torch.distributed._sharded_tensor will be deprecated, use torch.distributed._shard.sharded_tensor instead:DeprecationWarning",
# https://github.com/PyTorchLightning/pytorch-lightning/pull/13261
"ignore:torch.distributed._sharded_tensor will be deprecated:DeprecationWarning:torch.distributed._sharded_tensor",
# https://github.com/rasterio/rasterio/issues/1742
# https://github.com/rasterio/rasterio/pull/1753
"ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:rasterio.crs",
# https://github.com/pytorch/pytorch/issues/60053
# https://github.com/pytorch/pytorch/pull/60059
"ignore:Named tensors and all their associated APIs are an experimental feature and subject to change:UserWarning:torch.nn.functional",

# Expected warnings
# pytorch-lightning warns us about using num_workers=0, but it's faster on macOS
"ignore:The dataloader, .*, does not have many workers which may be a bottleneck:UserWarning",
# pytorch-lightning warns us about using the CPU when a GPU is available
"ignore:GPU available but not used.:UserWarning",

# Unexpected warnings, worth investigating
# pytorch-lightning is having trouble inferring the batch size for ChesapeakeCVPRDataModule and CycloneDataModule for some reason
Expand Down
54 changes: 54 additions & 0 deletions requirements/requirements-min.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This file is not managed by dependabot. It documents the minimum version of our
# dependencies that is supported.

# setup
setuptools==42.0.0

# install
einops==0.3.0
fiona==1.8.0
kornia==0.6.4
matplotlib==3.3.0
numpy==1.17.2
omegaconf==2.1.0
pillow==6.2.0
pyproj==2.2.0
pytorch-lightning==1.5.1
rasterio==1.0.20
rtree==1.0.0
scikit-learn==0.21.0
segmentation-models-pytorch==0.2.0
shapely==1.3.0
timm==0.4.12
torch==1.9.0
torchmetrics==0.7.0
torchvision==0.10.0

# datasets
h5py==2.6.0
laspy==2.0.0
open3d==0.11.2
opencv-python==3.4.2.17
pandas==0.23.2
pycocotools==2.0.0
radiant-mlhub==0.2.1
rarfile==3.0
scipy==1.2.0
zipfile-deflate64==0.2.0

# docs
nbsphinx==0.8.5
sphinx==4.0.0

# style
black[jupyter]==21.8b0
flake8==3.8.0
isort[colors]==5.8.0
pydocstyle[toml]==6.1.0
pyupgrade==1.24.0

# tests
mypy==0.900
nbmake==0.1
pytest==6.1.2
pytest-cov==2.4.0
2 changes: 0 additions & 2 deletions requirements.txt → requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# setup
setuptools==62.4.0
wheel==0.37.1

# install
einops==0.4.1
Expand Down Expand Up @@ -47,7 +46,6 @@ scipy==1.7.3;python_version=='3.7'
zipfile-deflate64==0.2.0

# docs
ipywidgets==7.7.0
nbsphinx==0.8.9
sphinx==5.0.2

Expand Down
Loading

0 comments on commit cf04f4c

Please sign in to comment.