Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move project configuration from setup.cfg to pyproject.toml #1446

Merged
merged 5 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[flake8]
max-line-length = 88
extend-ignore =
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,
exclude =
# TorchGeo
data/,
images/,
logo/,
logs/,
output/,

# Docs
docs/src/,

# Spack
.spack-env/,

# Python
build/,
dist/,
.cache/,
.mypy_cache/,
.pytest_cache/,
__pycache__/,
*.egg-info/,

# Git
.git/,
.github/,
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies:
- scikit-image>=0.18
- scipy>=1.6.2
- segmentation-models-pytorch>=0.2
- setuptools>=42
- setuptools>=61
- sphinx>=4,<6
- tensorboard>=2.9.1
- timm>=0.4.12
Expand Down
161 changes: 158 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,155 @@
[build-system]
requires = [
# setuptools 42+ required for metadata.license_files support in setup.cfg
"setuptools>=42,<69",
# setuptools 61+ required for pyproject.toml support
"setuptools>=61,<69",
]
build-backend = "setuptools.build_meta"

# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
[project]
name = "torchgeo"
description = "TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data"
readme = "README.md"
requires-python = ">=3.9,<4"
license = {file = "LICENSE"}
authors = [
{name = "Adam J. Stewart", email = "ajstewart426@gmail.com"},
]
maintainers = [
{name = "Adam J. Stewart", email = "ajstewart426@gmail.com"},
{name = "Caleb Robinson", email = "Caleb.Robinson@microsoft.com"},
{name = "Isaac Corley", email = "isaac.corley@my.utsa.edu"},
{name = "Nils Lehmann", email = "n.lehmann@tum.de"},
{name = "Ashwin Nair", email = "ashnair0007@gmail.com"},
]
keywords = ["pytorch", "deep learning", "machine learning", "remote sensing", "satellite imagery", "earth observation", "geospatial"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: GIS",
]
dependencies = [
# einops 0.3+ required for einops.repeat
"einops>=0.3,<0.7",
# fiona 1.8.19+ required to fix erroneous warning
# https://github.com/Toblerity/Fiona/issues/986
"fiona>=1.8.19,<2",
# kornia 0.6.9+ required for kornia.augmentation.RandomBrightness
"kornia>=0.6.9,<0.7",
# lightly 1.4.4+ required for MoCo v3 support
"lightly>=1.4.4",
# lightning 1.8+ is first release
"lightning>=1.8,<3",
# matplotlib 3.3.3+ required for Python 3.9 wheels
"matplotlib>=3.3.3,<4",
# numpy 1.19.3+ required by Python 3.9 wheels
"numpy>=1.19.3,<2",
# pillow 8+ required for Python 3.9 wheels
"pillow>=8,<10",
# pyproj 3+ required for Python 3.9 wheels
"pyproj>=3,<4",
# rasterio 1.2+ required for Python 3.9 wheels
"rasterio>=1.2,<2",
# rtree 1+ required for len(index), index & index, index | index
"rtree>=1,<2",
# segmentation-models-pytorch 0.2+ required for smp.losses module
"segmentation-models-pytorch>=0.2,<0.4",
# shapely 1.7.1+ required for Python 3.9 wheels
"shapely>=1.7.1,<3",
# timm 0.4.12 required by segmentation-models-pytorch
"timm>=0.4.12,<0.10",
# torch 1.12+ required by torchvision
"torch>=1.12,<3",
# torchmetrics 0.10+ required for binary/multiclass/multilabel classification metrics
"torchmetrics>=0.10,<0.12",
# torchvision 0.13+ required for torchvision.models._api.WeightsEnum
"torchvision>=0.13,<0.16",
]
dynamic = ["version"]

[project.optional-dependencies]
datasets = [
# h5py 3+ required for Python 3.9 wheels
"h5py>=3,<4",
# laspy 2+ required for laspy.read
"laspy>=2,<3",
# opencv-python 4.4.0.46+ required for Python 3.9 wheels
"opencv-python>=4.4.0.46,<5",
# pandas 1.1.3+ required for Python 3.9 wheels
"pandas>=1.1.3,<3",
# pycocotools 2.0.4+ required to avoid use of deprecated setuptools fetch_build_eggs
"pycocotools>=2.0.4,<3",
# pyvista 0.29+ required for to avoid segfault during testing
"pyvista>=0.29,<0.40",
# radiant-mlhub 0.3+ required for newer tqdm support required by lightning
"radiant-mlhub>=0.3,<0.6",
# rarfile 4+ required for wheels
"rarfile>=4,<5",
# scikit-image 0.18+ required for numpy 1.17+ compatibility
# https://github.com/scikit-image/scikit-image/issues/3655
"scikit-image>=0.18,<0.22",
# scipy 1.6.2+ required for scikit-image 0.18+ compatibility
"scipy>=1.6.2,<2",
# zipfile-deflate64 0.2+ required for extraction bugfix:
# https://github.com/brianhelba/zipfile-deflate64/issues/19
"zipfile-deflate64>=0.2,<0.3",
]
docs = [
# ipywidgets 7+ required by nbsphinx
"ipywidgets>=7,<9",
# nbsphinx 0.8.5 fixes bug with nbformat attributes
"nbsphinx>=0.8.5,<0.10",
# release versions missing files, must install from master
"pytorch-sphinx-theme",
# sphinx 4+ required for autodoc_typehints_description_target = documented
# sphinx 6+ is incompatible with pytorch-sphinx-theme
# https://github.com/pytorch/pytorch_sphinx_theme/issues/175
"sphinx>=4,<6",
]
style = [
# black 21.8+ required for Jupyter support
"black[jupyter]>=21.8,<24",
# 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,<7",
# isort 5.8+ required for extend_skip option
"isort[colors]>=5.8,<6",
# pydocstyle 6.1+ required for pyproject.toml support
"pydocstyle[toml]>=6.1,<7",
# pyupgrade 2.8+ required for --py39-plus flag
"pyupgrade>=2.8,<4",
]
tests = [
# hydra-core 1+ required for omegaconf 2 support
"hydra-core>=1,<2",
# mypy 0.900+ required for pyproject.toml support
"mypy>=0.900,<2",
# nbmake 1.3.3+ required for variable mocking
"nbmake>=1.3.3,<2",
# omegaconf 2+ required by lightning, 2.0.1+ required by hydra-core
"omegaconf>=2.0.1,<3",
# pytest 6.2+ required for pytest.MonkeyPatch
"pytest>=6.2,<8",
# pytest-cov 2.4+ required for pytest --cov flags
"pytest-cov>=2.4,<5",
# tensorboard 2.9.1+ required by lightning
"tensorboard>=2.9.1,<3",
]
all = [
"torchgeo[datasets,docs,style,tests]",
]

[project.urls]
Homepage = "https://github.com/microsoft/torchgeo"
Documentation = "https://torchgeo.readthedocs.io"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new, we previously only listed a homepage


[tool.black]
target-version = ["py39", "py310"]
color = true
Expand Down Expand Up @@ -68,7 +213,7 @@ filterwarnings = [
"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:torch.utils.tensorboard",
"ignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning",
"ignore:The distutils package is deprecated and slated for removal in Python 3.12:DeprecationWarning:torch.utils.tensorboard",
# https://github.com/Lightning-AI/lightning/issues/13256
# https://github.com/Lightning-AI/lightning/pull/13261
Expand Down Expand Up @@ -126,3 +271,13 @@ testpaths = [
"tests",
"docs/tutorials",
]

# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[tool.setuptools.dynamic]
version = {attr = "torchgeo.__version__"}

[tool.setuptools.package-data]
torchgeo = ["py.typed"]

[tool.setuptools.packages.find]
include = ["torchgeo*"]
2 changes: 1 addition & 1 deletion requirements/min-reqs.old
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# setup
setuptools==42.0.0
setuptools==61.0.0

# install
einops==0.3.0
Expand Down
168 changes: 0 additions & 168 deletions setup.cfg

This file was deleted.