From 4cb68c0a157d0451fbdd1acc2bc369afc2d2467f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bosch?= Date: Thu, 5 Dec 2024 15:23:21 +0100 Subject: [PATCH] style: added toml-sort --- .pre-commit-config.yaml | 6 ++ pyproject.toml | 213 ++++++++++++++++++++-------------------- 2 files changed, 112 insertions(+), 107 deletions(-) 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 bb3e1ce..0ae343c 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=detectree", - "--cov-append", - "--cov-report=xml", - "--cov-report", - "term-missing", - "tests", - ], + [ + "pytest", + "-s", + "--cov=detectree", + "--cov-append", + "--cov-report=xml", + "--cov-report", + "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" ]