diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e781d91..7c68bde 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,6 +24,12 @@ repos: - mdformat-gfm - mdformat-black + - repo: https://github.com/pappasam/toml-sort + rev: v0.24.2 + hooks: + - id: toml-sort-fix + args: ["--in-place"] + - repo: https://github.com/adrienverge/yamllint.git rev: v1.35.1 hooks: diff --git a/pyproject.toml b/pyproject.toml index bc1a219..ce49cfb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,51 +8,74 @@ version = "0.5.1" description = "Tree detection from aerial imagery in Python." readme = "README.md" authors = [ - { name = "Martí Bosch", email = "marti.bosch@epfl.ch" }, + {name = "Martí Bosch", email = "marti.bosch@epfl.ch"} ] -license = { text = "GPL-3.0" } +license = {text = "GPL-3.0"} classifiers = [ - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13" ] requires-python = ">=3.8" dependencies = [ - "dask[delayed,distributed]", - "joblib", - "laspy[lazrs] >= 2.0.0", - "lightgbm", - "numpy >= 1.15", - "opencv-python >= 4.0.0", - "pandas >= 0.23", - "pymaxflow >= 1.0.0", - "rasterio >= 1.0.0", - "scikit-image", - "scikit-learn", - "scipy >= 1.0.0", - "skops", - "shapely", - "tqdm", + "dask[delayed,distributed]", + "joblib", + "laspy[lazrs] >= 2.0.0", + "lightgbm", + "numpy >= 1.15", + "opencv-python >= 4.0.0", + "pandas >= 0.23", + "pymaxflow >= 1.0.0", + "rasterio >= 1.0.0", + "scikit-image", + "scikit-learn", + "scipy >= 1.0.0", + "skops", + "shapely", + "tqdm" ] -[project.urls] -Repository = "https://github.com/martibosch/detectree" - -[project.scripts] -detectree = "detectree.cli.main:cli" - [project.optional-dependencies] test = ["coverage[toml]", "pytest", "pytest-cov", "ruff"] dev = ["build", "commitizen", "pre-commit", "pip", "toml", "tox", "twine"] doc = ["m2r2", "pydata-sphinx-theme", "sphinx"] -[tool.setuptools.packages.find] -include = ["detectree", "detectree.*"] +[project.scripts] +detectree = "detectree.cli.main:cli" + +[project.urls] +Repository = "https://github.com/martibosch/detectree" + +[tool.codespell] +skip = "CHANGELOG.md,paper/paper.bib" + +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "v$version" +version_provider = "pep621" +version_files = [ + "detectree/__init__.py", + "pyproject.toml:version" +] + +[tool.coverage.report] +exclude_lines = [ + "if self.debug:", + "pragma: no cover", + "raise NotImplementedError", + "except ModuleNotFoundError", + "except ImportError" +] +ignore_errors = true +omit = ["tests/*", "docs/conf.py"] + +[tool.coverage.run] +source = ["detectree"] [tool.ruff] line-length = 88 @@ -60,9 +83,6 @@ line-length = 88 [tool.ruff.lint] select = ["D", "E", "F", "I", "ARG"] -[tool.ruff.lint.pydocstyle] -convention = "numpy" - [tool.ruff.lint.isort] known-first-party = ["detectree"] @@ -71,111 +91,90 @@ known-first-party = ["detectree"] "tests/test_detectree.py" = ["D"] "docs/src/conf.py" = ["D"] -[tool.coverage.run] -source = ["detectree"] - -[tool.coverage.report] -exclude_lines = [ - "if self.debug:", - "pragma: no cover", - "raise NotImplementedError", - "except ModuleNotFoundError", - "except ImportError", -] - -ignore_errors = true -omit = ["tests/*", "docs/conf.py"] - -[tool.commitizen] -name = "cz_conventional_commits" -tag_format = "v$version" -version_provider = "pep621" -version_files = [ - "detectree/__init__.py", - "pyproject.toml:version" -] +[tool.ruff.lint.pydocstyle] +convention = "numpy" -[tool.codespell] -skip = "CHANGELOG.md,paper/paper.bib" +[tool.setuptools.packages.find] +include = ["detectree", "detectree.*"] [tool.tox] env_list = [ - "lint", - "py39", - "py310", - "py311", - "py312", - "py313", + "lint", + "py39", + "py310", + "py311", + "py312", + "py313" ] requires = [ - "tox>=4.19", + "tox>=4.19" ] [tool.tox.env.lint] commands = [ + [ + [ + "python", + "-m", + "build" + ], [ - [ - "python", - "-m", - "build", - ], - [ - "sphinx-build", - "docs", - "docs/_build", - ], - [ - "twine", - "check", - "dist/*", - ], + "sphinx-build", + "docs", + "docs/_build" ], + [ + "twine", + "check", + "dist/*" + ] + ] ] extras = [ - "dev", - "doc", - "test", + "dev", + "doc", + "test" ] whitelist_externals = [ - "build", - "sphinx-build", - "twine", + "build", + "sphinx-build", + "twine" ] [tool.tox.env_run_base] commands = [ - [ - "pytest", - "-s", - "--cov-append", - "--cov-report", - "--cov-report=xml", - "--cov=detectree", - "term-missing", - "tests", - ], + [ + "pytest", + "-s", + "--cov-append", + "--cov-report", + "--cov-report=xml", + "--cov=detectree", + "term-missing", + "tests" + ] ] extras = [ - "test", + "test" ] whitelist_externals = [ - "pytest", + "pytest" ] [tool.tox.gh.python] "3.9" = [ - "3.9", + "3.9" ] "3.10" = [ - "3.10", + "3.10" ] "3.11" = [ - "3.11", + "3.11" ] "3.12" = [ - "3.12", + "3.12" ] "3.13" = [ - "3.13", - "lint", + "3.13", + "lint" ]