From efa8041c5e607983c22076fa4a3154ab350bc6bd Mon Sep 17 00:00:00 2001 From: f-PLT Date: Mon, 23 Sep 2024 11:51:20 -0400 Subject: [PATCH] Fix docformatter --- .pre-commit-config.yaml | 1 + CHANGES.md | 3 ++- poetry.lock | 3 ++- pyproject.toml | 5 ++--- tox.ini | 8 ++++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 022e08a..3971ae8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,6 +33,7 @@ repos: hooks: - id: docformatter args: [ --in-place ] + additional_dependencies: [tomli] - repo: https://github.com/PyCQA/flake8 rev: 7.0.0 diff --git a/CHANGES.md b/CHANGES.md index a275b9a..97616fc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,8 @@ [Unreleased](https://github.com/RolnickLab/geospatial-tools/tree/main) (latest) ------------------------------------------------------------------------------------- -[//]: # (New changes here in list form) +- Fix `docformatter` with missing extra dependency for use with `pyproject.toml` + [0.1.1](https://github.com/RolnickLab/geospatial-tools/tree/0.1.1) (2024-09-20) ------------------------------------------------------------------------------------- diff --git a/poetry.lock b/poetry.lock index e986683..76662d8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1064,6 +1064,7 @@ files = [ [package.dependencies] charset_normalizer = ">=3.0.0,<4.0.0" +tomli = {version = ">=2.0.0,<3.0.0", optional = true, markers = "python_version < \"3.11\" and extra == \"tomli\""} untokenize = ">=0.1.1,<0.2.0" [package.extras] @@ -4927,4 +4928,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.12" -content-hash = "49e0ea0c72da13d710740c09cd243ab3286badabeda2170cdfdd66155fa0973a" +content-hash = "bb5b396bd268e6f4cc510c5b2b66cf3c04b76acc95031f558e4f195b6d32fd71" diff --git a/pyproject.toml b/pyproject.toml index 7e648cc..2150c70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,6 @@ pystac-client = "^0.7.7" planetary-computer = "^1.0.0" rioxarray = "^0.15.5" pyogrio = "^0.8.0" -docformatter = {extras = ["toml"], version = "^1.7.5"} dask-geopandas = "^0.4.1" pyarrow = "^17" numpy = "^2.1.1" @@ -40,10 +39,10 @@ flynt = "^1.0.1" flake8 = "^7.0.0" pre-commit = "^3.7.0" flake8-pyproject = "^1.2.3" -docformatter = {extras = ["toml"], version = "^1.7.5"} +docformatter = {extras = ["tomli"], version = "^1.7.5"} nbval = "^0.11.0" - black = "^24.8.0" + [tool.poetry.group.lab.dependencies] jupyterlab = "^4.0.10" notebook = "^7.0.6" diff --git a/tox.ini b/tox.ini index 5ddabaf..28490ee 100644 --- a/tox.ini +++ b/tox.ini @@ -12,8 +12,8 @@ allowlist_externals = poetry commands_pre = poetry install -file_and_folder_list_all = geospatial_tools/ tests/ scripts/ -file_and_folder_list_module = geospatial_tools/ scripts/ +file_and_folder_list_all = {toxinidir}/geospatial_tools/ {toxinidir}/tests/ {toxinidir}/scripts/ +file_and_folder_list_module = {toxinidir}/geospatial_tools/ {toxinidir}/scripts/ [testenv:pylint] commands = @@ -25,14 +25,14 @@ commands = [testenv:docformatter] commands = - poetry run docformatter {[testenv]file_and_folder_list_all} + poetry run docformatter --config {toxinidir}/pyproject.toml {[testenv]file_and_folder_list_all} [testenv:fix] commands = poetry run black {[testenv]file_and_folder_list_all} poetry run isort {[testenv]file_and_folder_list_all} poetry run flynt {[testenv]file_and_folder_list_all} - poetry run docformatter --in-place {[testenv]file_and_folder_list_all} + poetry run docformatter --in-place --config {toxinidir}/pyproject.toml {[testenv]file_and_folder_list_all} [testenv:precommit] commands =