From d9d8699552bc2038a86caccba0b8f018618f2f0b Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 11 Aug 2021 16:03:38 +0000 Subject: [PATCH] Document minimum supported dependency versions --- .github/workflows/style.yaml | 6 ++-- .github/workflows/tests.yaml | 7 +++-- docs/conf.py | 4 +++ environment.yml | 34 +++++++++++----------- pyproject.toml | 2 +- requirements.txt | 56 +++++++++++++++++++++++++----------- setup.cfg | 35 +++++++++++----------- spack.yaml | 50 ++++++++++++++++---------------- 8 files changed, 113 insertions(+), 81 deletions(-) diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index a67892f160a..f68feb409bf 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -28,7 +28,7 @@ jobs: with: python-version: 3.9 - name: Install black - run: pip install --pre 'black[colorama]>=21' + run: pip install --pre 'black>=21' - name: Run black checks run: black . --check --diff flake8: @@ -42,7 +42,7 @@ jobs: with: python-version: 3.9 - name: Install flake8 - run: pip install flake8 + run: pip install 'flake8>=3.8' - name: Run flake8 checks run: flake8 isort: @@ -56,6 +56,6 @@ jobs: with: python-version: 3.9 - name: Install isort - run: pip install 'isort[colors]>=4.3.5' + run: pip install 'isort[colors]>=5.8' - name: Run isort checks run: isort . --check --diff diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ad63dd2f034..5993ead18a3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -39,7 +39,10 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9] + exclude: + - os: windows-latest + python-version: 3.6 steps: - name: Clone repo uses: actions/checkout@v2 @@ -62,7 +65,7 @@ jobs: if: ${{ runner.os == 'Windows' }} - name: Install conda dependencies (Windows) run: | - conda install fiona h5py 'rasterio>=1.0' + conda install 'fiona>=1.5' h5py 'rasterio>=1.0.16' conda list conda info if: ${{ runner.os == 'Windows' }} diff --git a/docs/conf.py b/docs/conf.py index 0e56934f39d..bd6d78a7525 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,6 +46,10 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ["_build"] +# Sphinx 3.0+ required for: +# autodoc_typehints = "description" +needs_sphinx = "3.0" + nitpicky = True nitpick_ignore = [ # https://github.com/sphinx-doc/sphinx/issues/8127 diff --git a/environment.yml b/environment.yml index a07e1022dad..3d9e0443f01 100644 --- a/environment.yml +++ b/environment.yml @@ -3,34 +3,34 @@ channels: - conda-forge dependencies: - cudatoolkit - - fiona + - fiona>=1.5 - h5py - numpy - pip - pycocotools - - python + - python>=3.6 - pytorch-gpu>=1.7 - - rarfile - - rasterio>=1.0 + - rarfile>=3 + - rasterio>=1.0.16 - torchvision>=0.3 - pip: - - black[colorama]>=21b - - flake8 - - isort[colors]>=4.3.5 + - black>=21.4b0 + - flake8>=3.8 + - isort[colors]>=5.8 - jupyterlab - mypy>=0.900 - - omegaconf + - omegaconf>=2.1 - opencv-python - - pillow + - pillow>=2.9 - pydocstyle[toml]>=6.1 - - pytest>=6.0 - - pytest-cov - - pytorch-lightning + - pytest>=6 + - pytest-cov>=2.4 + - pytorch-lightning>=1.3 - git+https://github.com/pytorch/pytorch_sphinx_theme - radiant-mlhub>=0.2.1 - - rtree>=0.5.0 - - scikit-learn - - segmentation-models-pytorch - - setuptools>=42 - - sphinx + - rtree>=0.5 + - scikit-learn>=0.18 + - segmentation-models-pytorch>=0.2 + - setuptools>=30.4 + - sphinx>=3 - torchmetrics diff --git a/pyproject.toml b/pyproject.toml index 40b47476095..b6a00cb98d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ build-backend = "setuptools.build_meta" [tool.black] -target-version = ["py37", "py38", "py39"] +target-version = ["py36", "py37", "py38", "py39"] color = true exclude = ''' /( diff --git a/requirements.txt b/requirements.txt index a8e645642bd..6169e68ea87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,29 +1,53 @@ -black[colorama]>=21b -fiona -flake8 +# black 21+ required for Python 3.9 support +black>=21 +# fiona 1.5+ required for fiona.transform module +fiona>=1.5 +# flake8 3.8+ depends on pyflakes 2.2+, which fixes a bug with mypy error code ignores: +# https://github.com/PyCQA/pyflakes/pull/455 +flake8>=3.8 h5py -isort[colors]>=4.3.5 +# isort 5.8+ required for extend_skip option +isort[colors]>=5.8 jupyterlab matplotlib +# mypy 0.900+ required for pyproject.toml support mypy>=0.900 numpy -omegaconf +# omegaconf 2.1+ required for to_object method +omegaconf>=2.1 opencv-python -pillow +# pillow 2.9+ required for height attribute +pillow>=2.9 pycocotools +# pydocstyle 6.1+ required for pyproject.toml support pydocstyle[toml]>=6.1 -pytest>=6.0 -pytest-cov -pytorch-lightning +# pytest 6+ required for pyproject.toml support +pytest>=6 +# pytest-cov 2.4+ required for pytest --cov flags +pytest-cov>=2.4 +# pytorch-lightning 1.3+ required for gradient_clip_algorithm argument to Trainer +pytorch-lightning>=1.3 +# release versions missing files, must install from master git+https://github.com/pytorch/pytorch_sphinx_theme +# radiant-mlhub 0.2.1+ required for api_key bugfix: +# https://github.com/radiantearth/radiant-mlhub/pull/48 radiant-mlhub>=0.2.1 -rarfile -rasterio>=1.0 -rtree>=0.5.0 -scikit-learn -segmentation-models-pytorch -setuptools>=42 -sphinx +# rarfile 3+ required for correct Rar file detection +rarfile>=3 +# rasterio 1.0.16+ required for CRS support +rasterio>=1.0.16 +# rtree 0.5+ required for 3D index support +rtree>=0.5 +# scikit-learn 0.18+ required for sklearn.model_selection module +scikit-learn>=0.18 +# segmentation-models-pytorch 0.2+ required for smp.losses module +segmentation-models-pytorch>=0.2 +# setuptools 30.4+ required for options.packages.find section in setup.cfg +setuptools>=30.4 +# sphinx 3+ required for autodoc_typehints = description +sphinx>=3 +# torch 1.7+ required for typing torch>=1.7 torchmetrics +# torchvision 0.3+ required for download_file_from_google_drive torchvision>=0.3 diff --git a/setup.cfg b/setup.cfg index a2f17940cc0..f321864dada 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,6 +12,7 @@ classifiers = Development Status :: 1 - Planning Intended Audience :: Science/Research Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -23,17 +24,17 @@ keywords = pytorch, deep learning, machine learning [options] setup_requires = - setuptools>=42 + setuptools>=30.4 install_requires = - fiona + fiona>=1.5 matplotlib numpy - pillow - rasterio>=1.0 - rtree>=0.5.0 + pillow>=2.9 + rasterio>=1.0.16 + rtree>=0.5 torch>=1.7 torchvision>=0.3 -python_requires = >= 3.7 +python_requires = >= 3.6 packages = find: [options.packages.find] @@ -46,25 +47,25 @@ datasets = opencv-python pycocotools radiant-mlhub>=0.2.1 - rarfile + rarfile>=3 # Optional developer requirements docs = jupyterlab - sphinx + sphinx>=3 pydocstyle[toml]>=6.1 pytorch-sphinx-theme style = - black[colorama]>=21 - flake8 - isort[colors]>=4.3.5 + black>=21 + flake8>=3.8 + isort[colors]>=5.8 tests = mypy>=0.900 - pytest>=6.0 - pytest-cov + pytest>=6 + pytest-cov>=2.4 train = - omegaconf - pytorch-lightning - scikit-learn - segmentation-models-pytorch + omegaconf>=2.1 + pytorch-lightning>=1.3 + scikit-learn>=0.18 + segmentation-models-pytorch>=0.2 torchmetrics diff --git a/spack.yaml b/spack.yaml index c8fb5efec11..30f551712b0 100644 --- a/spack.yaml +++ b/spack.yaml @@ -1,33 +1,33 @@ spack: specs: - - opencv+python3+imgcodecs+tiff+jpeg+png - - pil - - "python@3.7:+bz2" - - "py-black@21:+colorama" - - py-fiona - - py-flake8 - - py-h5py - - "py-isort@4.3.5:+colors" - - py-jupyterlab - - py-matplotlib + - "opencv+python3+imgcodecs+tiff+jpeg+png" + - "pil@2.9:" + - "python@3.6:+bz2" + - "py-black@21:" + - "py-fiona@1.5:" + - "py-flake8@3.8:" + - "py-h5py" + - "py-isort@5.8:+colors" + - "py-jupyterlab" + - "py-matplotlib" - "py-mypy@0.900:" - - py-numpy - - py-omegaconf - - py-pycocotools + - "py-numpy" + - "py-omegaconf@2.1:" + - "py-pycocotools" - "py-pydocstyle@6.1:+toml" - - "py-pytest@6.0:" - - py-pytest-cov - - py-pytorch-lightning - - py-pytorch-sphinx-theme + - "py-pytest@6:" + - "py-pytest-cov@2.4:" + - "py-pytorch-lightning@1.3:" + - "py-pytorch-sphinx-theme" - "py-radiant-mlhub@0.2.1:" - - py-rarfile - - "py-rasterio@1.0:" - - "py-rtree@0.5.0:" - - py-scikit-learn - - py-segmentation-models-pytorch - - "py-setuptools@42:" - - py-sphinx + - "py-rarfile@3:" + - "py-rasterio@1.0.16:" + - "py-rtree@0.5:" + - "py-scikit-learn@0.18:" + - "py-segmentation-models-pytorch@0.2:" + - "py-setuptools@30.4:" + - "py-sphinx@3:" - "py-torch@1.7:" - - py-torchmetrics + - "py-torchmetrics" - "py-torchvision@0.3:" concretization: together