From ac4c6804bf7307f26f7d8334c4caded6971ebc20 Mon Sep 17 00:00:00 2001 From: f-PLT Date: Mon, 16 Sep 2024 13:22:09 -0400 Subject: [PATCH] Update Makefile --- .make/base.make | 393 ++++++++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 7 +- Makefile | 215 ++-------------------- Makefile.targets | 8 + Makefile.variables | 6 + poetry.lock | 32 +++- pyproject.toml | 1 + 7 files changed, 461 insertions(+), 201 deletions(-) create mode 100644 .make/base.make create mode 100644 Makefile.targets create mode 100644 Makefile.variables diff --git a/.make/base.make b/.make/base.make new file mode 100644 index 0000000..be5e958 --- /dev/null +++ b/.make/base.make @@ -0,0 +1,393 @@ +######################################################################################## +# DO NOT MODIFY!!! +# If necessary, override the corresponding variable and/or target, or create new ones +# in one of the following files, depending on the nature of the override : +# +# Makefile.variables, Makefile.targets or Makefile.private`, +# +# The only valid reason to modify this file is to fix a bug or to add new +# files to include. +# +# Please report bugs to francis.pelletier@mila.quebec +######################################################################################## + +# Basic variables +PROJECT_PATH := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) +MAKEFILE_NAME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +SHELL := /usr/bin/env bash +BUMP_TOOL := bump-my-version +APP_VERSION := 0.0.0 +DOCKER_COMPOSE ?= docker compose +AUTO_INSTALL ?= + +# Conda variables +# CONDA_TOOL can be overridden in Makefile.private file +CONDA_TOOL := conda +CONDA_ENVIRONMENT ?= + +# Colors +_SECTION := \033[1m\033[34m +_TARGET := \033[36m +_NORMAL := \033[0m + +.DEFAULT_GOAL := help +## -- Informative targets ------------------------------------------------------------------------------------------- ## + +.PHONY: all +all: help + +# Auto documented help targets & sections from comments +# detects lines marked by double #, then applies the corresponding target/section markup +# target comments must be defined after their dependencies (if any) +# section comments must have at least a double dash (-) +# +# Original Reference: +# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html +# Formats: +# https://misc.flogisoft.com/bash/tip_colors_and_formatting +# +# As well as influenced by it's implementation in the Weaver Project +# https://github.com/crim-ca/weaver/tree/master + +.PHONY: help +# note: use "\#\#" to escape results that would self-match in this target's search definition +help: ## print this help message (default) + @echo "" + @echo "Please use 'make ' where is one of below options." + @echo "" + @for makefile in $(MAKEFILE_LIST); do \ + grep -E '\#\#.*$$' "$(PROJECT_PATH)/$${makefile}" | \ + awk 'BEGIN {FS = "(:|\-\-\-)+.*\#\# "}; \ + /\--/ {printf "$(_SECTION)%s$(_NORMAL)\n", $$1;} \ + /:/ {printf " $(_TARGET)%-24s$(_NORMAL) %s\n", $$1, $$2} ' 2>/dev/null ; \ + done + +.PHONY: targets +targets: help + +.PHONY: version +version: ## display current version + @echo "version: $(APP_VERSION)" + +## -- Conda targets ------------------------------------------------------------------------------------------------- ## + +.PHONY: conda-install +conda-install: ## Install Conda on your local machine + @echo "Looking for [$(CONDA_TOOL)]..."; \ + $(CONDA_TOOL) --version; \ + if [ $$? != "0" ]; then \ + echo " "; \ + echo "Your defined Conda tool [$(CONDA_TOOL)] has not been found."; \ + echo " "; \ + echo "If you know you already have [$(CONDA_TOOL)] or some other Conda tool installed,"; \ + echo "Check your [CONDA_TOOL] variable in the Makefile.private for typos."; \ + echo " "; \ + echo "If your conda tool has not been initiated through your .bashrc file,"; \ + echo "consider using the full path to its executable instead when"; \ + echo "defining your [CONDA_TOOL] variable"; \ + echo " "; \ + echo "If in doubt, don't install Conda and manually create and activate"; \ + echo "your own Python environment."; \ + echo " "; \ + echo -n "Would you like to install Miniconda ? [y/N]: "; \ + read ans; \ + case $$ans in \ + [Yy]*) \ + echo "Fetching and installing miniconda"; \ + echo " "; \ + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh; \ + bash ~/miniconda.sh -b -p ${HOME}/.conda; \ + export PATH=${HOME}/.conda/bin:$PATH; \ + conda init; \ + /usr/bin/rm ~/miniconda.sh; \ + ;; \ + *) \ + echo "Skipping installation."; \ + echo " "; \ + ;; \ + esac; \ + else \ + echo "Conda tool [$(CONDA_TOOL)] has been found, skipping installation"; \ + fi; + +.PHONY: conda-create-env +conda-create-env: conda-install ## Create a local Conda environment based on `environment.yml` file + @$(CONDA_TOOL) env create -y -f environment.yml + +.PHONY: conda-env-info +conda-env-info: ## Print information about active Conda environment using + @$(CONDA_TOOL) info + +.PHONY: _conda-poetry-install +_conda-poetry-install: + $(CONDA_TOOL) run -n $(CONDA_ENVIRONMENT) $(CONDA_TOOL) install -y poetry; \ + + + +.PHONY:conda-poetry-install +conda-poetry-install: ## Install Poetry in currently active Conda environment. Will fail if Conda is not found + @poetry --version; \ + if [ $$? != "0" ]; then \ + echo "Poetry not found, proceeding to install Poetry..."; \ + echo "Looking for [$(CONDA_TOOL)]...";\ + $(CONDA_TOOL) --version; \ + if [ $$? != "0" ]; then \ + echo "$(CONDA_TOOL) not found; Poetry will not be installed"; \ + else \ + echo "Installing Poetry with Conda in [$(CONDA_ENVIRONMENT)] environment"; \ + make -s _conda-poetry-install; \ + fi; \ + fi; + +.PHONY: conda-poetry-uninstall +conda-poetry-uninstall: ## Uninstall Poetry located in currently active Conda environment + $(CONDA_TOOL) run -n $(CONDA_ENVIRONMENT) $(CONDA_TOOL) remove poetry + +.PHONY: conda-clean-env +conda-clean-env: ## Completely removes local project's Conda environment + $(CONDA_TOOL) env remove -n $(CONDA_ENVIRONMENT) + +## -- Poetry targets ------------------------------------------------------------------------------------------------ ## + +.PHONY: poetry-install-auto +poetry-install-auto: ## Install Poetry in activated Conda environment, or with pipx if Conda not found + @poetry --version; \ + if [ $$? != "0" ]; then \ + echo "Poetry not found, proceeding to install Poetry..."; \ + echo "Looking for [$(CONDA_TOOL)]...";\ + $(CONDA_TOOL) --version; \ + if [ $$? != "0" ]; then \ + echo "$(CONDA_TOOL) not found, trying with pipx"; \ + pipx --version; \ + if [ $$? != "0" ]; then \ + echo "pipx not found; installing pipx"; \ + pip install --user pipx; \ + pipx ensurepath; \ + fi; \ + pipx install poetry; \ + else \ + echo "Installing poetry with Conda"; \ + make -s _conda-poetry-install; \ + fi; \ + fi; + +.PHONY: poetry-install +poetry-install: ## Install standalone Poetry using pipx and create Poetry env. Will install pipx if not found + @echo "Looking for Poetry version...";\ + poetry --version; \ + if [ $$? != "0" ]; then \ + if [ "$(AUTO_INSTALL)" = "true" ]; then \ + ans="y";\ + else \ + echo""; \ + echo -n "Would you like to install Poetry using pipx? (This will also install pipx if needed) [y/N]: "; \ + read ans; \ + fi; \ + case $$ans in \ + [Yy]*) \ + pipx --version; \ + if [ $$? != "0" ]; then \ + echo "pipx not found; installing pipx"; \ + pip install --user pipx; \ + pipx ensurepath; \ + fi; \ + echo "Installing Poetry"; \ + pipx install poetry; \ + make -s poetry-create-env; \ + ;; \ + *) \ + echo "Skipping installation."; \ + echo " "; \ + ;; \ + esac; \ + fi; + +.PHONY: poetry-env-info +poetry-env-info: ## Information about the currently active environment used by Poetry + @poetry env info + +.PHONY: poetry-create-env +poetry-create-env: ## Create a Poetry managed environment for the project (Outside of Conda environment). + @echo "Creating Poetry environment that will use Python $(PYTHON_VERSION)"; \ + poetry env use $(PYTHON_VERSION); \ + poetry env info + @echo"" + @echo "This environment can be accessed either by using the " + @echo "command, or activated with the command." + @echo"" + @echo "Use and for more information" + @echo"" + +.PHONY: poetry-remove-env +poetry-remove-env: ## Remove current project's Poetry managed environment. + @if [ "$(AUTO_INSTALL)" = "true" ]; then \ + ans_env="y";\ + env_path=$$(poetry env info -p); \ + env_name=$$(basename $$env_path); \ + else \ + echo""; \ + env_path=$$(poetry env info -p); \ + if [[ "$$env_path" != "" ]]; then \ + echo "The following environment has been found for this project: "; \ + env_name=$$(basename $$env_path); \ + echo""; \ + echo "Env name : $$env_name"; \ + echo "PATH : $$env_path"; \ + echo""; \ + echo "If the active environment listed above is a Conda environment,"; \ + echo "Choosing to delete it will have no effect; use the target "; \ + echo""; \ + echo -n "Would you like delete the environment listed above? [y/N]: "; \ + read ans_env; \ + else \ + env_name="None"; \ + env_path="None"; \ + fi; \ + fi; \ + if [[ $$env_name != "None" ]]; then \ + case $$ans_env in \ + [Yy]*) \ + poetry env remove $$env_name || echo "No environment was removed"; \ + ;; \ + *) \ + echo "No environment was found/provided - skipping environment deletion"; \ + ;;\ + esac; \ + fi; \ + + +.PHONY: poetry-uninstall-pipx +poetry-uninstall-pipx: poetry-remove-env ## Uninstall pipx-installed Poetry, the created env and pipx + @if [ "$(AUTO_INSTALL)" = "true" ]; then \ + ans="y";\ + else \ + echo""; \ + echo -n "Would you like to uninstall pipx-installed Poetry and pipx? [y/N]: "; \ + read ans; \ + fi; \ + case $$ans in \ + [Yy]*) \ + pipx uninstall poetry; \ + pip uninstall -y pipx; \ + ;; \ + *) \ + echo "Skipping uninstallation."; \ + echo " "; \ + ;; \ + esac; \ + +## -- Install targets (All install targets will install Poetry if not found using `make poetry-install-auto`)-------- ## + +.PHONY: install +install: install-precommit ## Install the application package, developer dependencies and pre-commit hook + +.PHONY: install-precommit +install-precommit: install-dev## Install the pre-commit hooks (also installs developer dependencies) + @if [ -f .git/hooks/pre-commit ]; then \ + echo "Pre-commit hook found"; \ + else \ + echo "Pre-commit hook not found, proceeding to configure it"; \ + poetry run pre-commit install; \ + fi; + +.PHONY: install-dev +install-dev: poetry-install-auto ## Install the application along with developer dependencies + @poetry install --with dev + +.PHONY: install-with-lab +install-with-lab: poetry-install-auto ## Install the application and it's dev dependencies, including Jupyter Lab + @poetry install --with dev --with lab + + +.PHONY: install-package +install-package: poetry-install-auto ## Install the application package only + @poetry install + +## -- Versioning targets ------------------------------------------------------------------------------------------- ## + +# Use the "dry" target for a dry-run version bump, ex. +# make bump-major dry +BUMP_ARGS ?= --verbose +ifeq ($(filter dry, $(MAKECMDGOALS)), dry) + BUMP_ARGS := $(BUMP_ARGS) --dry-run --allow-dirty +endif + +.PHONY: bump-major +bump-major: ## Bump application major version + $(BUMP_TOOL) $(BUMP_ARGS) bump major + +.PHONY: bump-minor +bump-minor: ## Bump application minor version <0.X.0> + $(BUMP_TOOL) $(BUMP_ARGS) bump minor + +.PHONY: bump-patch +bump-patch: ## Bump application patch version <0.0.X> + $(BUMP_TOOL) $(BUMP_ARGS) bump patch + +## -- Docker targets ------------------------------------------------------------------------------------------------ ## + +## -- Apptainer/Singularity targets --------------------------------------------------------------------------------- ## + +## -- Linting targets ----------------------------------------------------------------------------------------------- ## + +.PHONY: check-lint +check-lint: ## Check code linting (black, isort, flake8, docformatter and pylint) + poetry run tox -e black,isort,flake8,docformatter,pylint + +.PHONY: check-pylint +check-pylint: ## Check code with pylint + poetry run tox -e pylint + +.PHONY: fix-lint +fix-lint: ## Fix code linting (black, isort, flynt, docformatter) + poetry run tox -e fix + +.PHONY: precommit +precommit: ## Run Pre-commit on all files manually + poetry run tox -e precommit + +## -- Tests targets ------------------------------------------------------------------------------------------------- ## + +.PHONY: test +test: ## Run all tests + poetry run tox -e test + +TEST_ARGS ?= +MARKER_TEST_ARGS = -m "$(TEST_ARGS)" +SPECIFIC_TEST_ARGS = -k "$(TEST_ARGS)" +CUSTOM_TEST_ARGS = "$(TEST_ARGS)" + +.PHONY: test-marker +test-marker: ## Run tests using pytest markers. Ex. make test-tag TEST_ARGS="" + @if [ -n "$(TEST_ARGS)" ]; then \ + poetry run tox -e test-custom -- -- $(MARKER_TEST_ARGS); \ + else \ + echo "" ; \ + echo 'ERROR : Variable TEST_ARGS has not been set, please rerun the command like so :' ; \ + echo "" ; \ + echo ' make test-marker TEST_ARGS=""' ; \ + echo "" ; \ + fi +.PHONY: test-specific +test-specific: ## Run specific tests using the -k option. Ex. make test-specific TEST_ARGS="" + @if [ -n "$(TEST_ARGS)" ]; then \ + poetry run tox -e test-custom -- -- $(SPECIFIC_TEST_ARGS); \ + else \ + echo "" ; \ + echo 'ERROR : Variable TEST_ARGS has not been set, please rerun the command like so :' ; \ + echo "" ; \ + echo ' make test-specific TEST_ARGS=""' ; \ + echo "" ; \ + fi + +.PHONY: test-custom +test-custom: ## Run tests with custom args. Ex. make test-custom TEST_ARGS="-m 'not offline'" + @if [ -n "$(TEST_ARGS)" ]; then \ + poetry run tox -e test-custom -- -- $(CUSTOM_TEST_ARGS); \ + else \ + echo "" ; \ + echo 'ERROR : Variable TEST_ARGS has not been set, please rerun the command like so :' ; \ + echo "" ; \ + echo ' make test-custom TEST_ARGS=""' ; \ + echo "" ; \ + fi \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6cc6658..71b0aa6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,12 @@ repos: rev: 5.13.2 hooks: - id: isort - args: [ "--profile", "black" ] + + - repo: https://github.com/PyCQA/docformatter + rev: v1.7.5 + hooks: + - id: docformatter + args: [ --in-place ] - repo: https://github.com/PyCQA/flake8 rev: 7.0.0 diff --git a/Makefile b/Makefile index 48a7a9d..1bc3994 100644 --- a/Makefile +++ b/Makefile @@ -1,200 +1,19 @@ -## Basic variables -PROJECT_PATH := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) -MAKEFILE_NAME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -SHELL := /usr/bin/env bash -BUMP_TOOL := bump-my-version -DOCKER_COMPOSE := docker compose -APP_VERSION := 0.0.0 - -## Conda variables -# CONDA_TOOL can be overridden in Makefile.private file -CONDA_TOOL ?= conda -CONDA_ENVIRONMENT := geospatial-tools - -# Private variables import to override variables for local -# All overridable variables must be above this --include Makefile.private - -# Colors -_SECTION := \033[1m\033[34m -_TARGET := \033[36m -_NORMAL := \033[0m - -.DEFAULT_GOAL := help -## -- Informative targets ------------------------------------------------------------------------------------------- ## - -.PHONY: all -all: help - -# Auto documented help targets & sections from comments -# - detects lines marked by double #, then applies the corresponding target/section markup -# - target comments must be defined after their dependencies (if any) -# - section comments must have at least a double dash (-) +######################################################################################## # -# Original Reference: -# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html -# Formats: -# https://misc.flogisoft.com/bash/tip_colors_and_formatting +# DO NOT MODIFY!!! +# If necessary, override the corresponding variable and/or target, or create new ones +# in one of the following files, depending on the nature of the override : # -# As well as influenced by it's implementation in the Weaver Project -# https://github.com/crim-ca/weaver/tree/master - -.PHONY: help -# note: use "\#\#" to escape results that would self-match in this target's search definition -help: ## Print this help message (default) - @echo "" - @echo "Please use 'make ' where is one of below options." - @echo "" - @grep -E '\#\#.*$$' "$(PROJECT_PATH)/$(MAKEFILE_NAME)" \ - | awk ' BEGIN {FS = "(:|\-\-\-)+.*?\#\# "}; \ - /\--/ {printf "$(_SECTION)%s$(_NORMAL)\n", $$1;} \ - /:/ {printf " $(_TARGET)%-24s$(_NORMAL) %s\n", $$1, $$2} \ - ' - -.PHONY: targets -targets: help - -## -- Conda targets ------------------------------------------------------------------------------------------------- ## - -.PHONY: install-conda -install-conda: ## Install conda on your local machine - @$(CONDA_TOOL) --version; \ - if [ $$? != "0" ]; then \ - echo " "; \ - echo "Your defined Conda tool [$(CONDA_TOOL)] has not been found."; \ - echo " "; \ - echo "If you know you already have [$(CONDA_TOOL)] or some other Conda tool installed,"; \ - echo "Check your [CONDA_TOOL] variable in the Makefile.private for typos."; \ - echo " "; \ - echo "If your conda tool has not been initiated through your .bashrc file,"; \ - echo "consider using the full path to its executable instead when"; \ - echo "defining your [CONDA_TOOL] variable"; \ - echo " "; \ - echo "If in doubt, don't install Conda and manually create and activate"; \ - echo "your own Python environment."; \ - echo " "; \ - echo -n "Would you like to install Miniconda ? [y/N]: "; \ - read ans; \ - case $$ans in \ - [Yy]*) \ - echo "Fetching and installing miniconda"; \ - echo " "; \ - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh; \ - bash ~/miniconda.sh -b -p $HOME/.conda; \ - export PATH=$HOME/.conda/bin:$PATH; \ - conda init; \ - /usr/bin/rm ~/miniconda.sh; \ - ;; \ - *) \ - echo "Skipping installation."; \ - echo " "; \ - ;; \ - esac; \ - else \ - echo "Conda tool [$(CONDA_TOOL)] has been found, skipping installation"; \ - fi; - -.PHONY: create-conda-env -create-env: install-conda ## Create a local conda environment based on `environment.yml` - $(CONDA_TOOL) env create -f environment.yml - @echo "" - @echo "#####################################################################" - @echo "# #" - @echo "# Please activate your new environment using the following command: #" - @echo "# #" - @echo "#####################################################################" - @echo "" - @echo "$(CONDA_TOOL) activate $(CONDA_ENVIRONMENT)" - @echo "" - @echo "" - -## -- Install targets ----------------------------------------------------------------------------------------------- ## - -.PHONY: install-poetry -install-poetry: ## Install Poetry in the active environment (Also gets installed with other install targets) - @poetry --version; \ - if [ $$? != "0" ]; then \ - echo "Poetry not found, proceeding to install Poetry..."; \ - pip install poetry==1.8.2; \ - fi; - -.PHONY: install -install: install-precommit ## Install the application package, developer dependencies and pre-commit hook - -.PHONY: install-precommit -install-precommit: install-dev## Install the pre-commit hooks (also installs developer dependencies) - @if [ -f .git/hooks/pre-commit ]; then \ - echo "Pre-commit hook found"; \ - else \ - echo "Pre-commit hook not found, proceeding to configure it"; \ - poetry run pre-commit install; \ - fi; - -.PHONY: install-dev -install-dev: install-poetry ## Install the application along with developer dependencies - @poetry install --with dev - -.PHONY: install-with-lab -install-with-lab: install-poetry ## Install the application and it's dependencies, including Jupyter Lab - poetry install --with lab - -.PHONY: install-package -install-package: install-poetry ## Install the application package only - @poetry install - -## -- Versionning targets ------------------------------------------------------------------------------------------- ## - -# Use the "dry" target for a dry-run version bump, ex. -# make bump-major dry -BUMP_ARGS ?= --verbose -ifeq ($(filter dry, $(MAKECMDGOALS)), dry) - BUMP_ARGS := $(BUMP_ARGS) --dry-run --allow-dirty -endif - -.PHONY: version -version: ## Display current version - @-echo "version: $(APP_VERSION)" - -.PHONY: bump-major -bump-major: ## Bump application major version - $(BUMP_TOOL) $(BUMP_ARGS) major - -.PHONY: bump-minor -bump-minor: ## Bump application major version <0.X.0> - $(BUMP_TOOL) $(BUMP_ARGS) minor - -.PHONY: bump-patch -bump-patch: ## Bump application major version <0.0.X> - $(BUMP_TOOL) $(BUMP_ARGS) patch - -## -- Docker targets ------------------------------------------------------------------------------------------------ ## - -## -- Linting targets ----------------------------------------------------------------------------------------------- ## - -.PHONY: check-lint -check-lint: ## Check code linting (black, isort, flake8 and pylint) - poetry run tox -e black,isort,flake8,pylint - -.PHONY: check-pylint -check-pylint: ## Check code with pylint - poetry run tox -e pylint - -.PHONY: fix-lint -fix-lint: ## Fix code linting (black, isort, flynt) - poetry run tox -e fix - -.PHONY: precommit -precommit: ## Run Pre-commit on all files manually - poetry run tox -e precommit - -## -- Tests targets ------------------------------------------------------------------------------------------------- ## - -.PHONY: test -test: ## Run tests except offline tests - poetry run tox -e test - -.PHONY: test-all -test-all: ## Run all tests - poetry run tox -e test-all - -## -- Application targets ------------------------------------------------------------------------------------------- ## +# `Makefile.variables`, `Makefile.targets` or `Makefile.private`, +# +# The only valid reason to modify this file is to fix a bug or to add new +# files to include. +######################################################################################## + +#Include base makefile +include .make/base.make +# Include custom targets and variables +-include Makefile.targets +-include Makefile.variables +# Private variables and targets import to override variables for local +-include Makefile.private diff --git a/Makefile.targets b/Makefile.targets new file mode 100644 index 0000000..2554e5e --- /dev/null +++ b/Makefile.targets @@ -0,0 +1,8 @@ +# This file is for custom makefile targets at the project level. +# They are meant to be share by the whole project team. + +## -- Project targets ----------------------------------------------------------------------------------------------- ## + +.PHONY: custom-target-example +custom-target-example: ## Example custom target + @echo The name of the package contained in this repository is [$(APPLICATION_NAME)] \ No newline at end of file diff --git a/Makefile.variables b/Makefile.variables new file mode 100644 index 0000000..7f9054e --- /dev/null +++ b/Makefile.variables @@ -0,0 +1,6 @@ +# This file is for custom makefile variable at the project level. +# They are meant to be share by the whole project team. + +APPLICATION_NAME := geospatial_tools +CONDA_ENVIRONMENT := geospatial-tools +PYTHON_VERSION := 3.11 \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 0701b5b..762ee9a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "affine" @@ -696,6 +696,24 @@ files = [ {file = "distlib-0.3.8.tar.gz", hash = "sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64"}, ] +[[package]] +name = "docformatter" +version = "1.7.5" +description = "Formats docstrings to follow PEP 257" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "docformatter-1.7.5-py3-none-any.whl", hash = "sha256:a24f5545ed1f30af00d106f5d85dc2fce4959295687c24c8f39f5263afaf9186"}, + {file = "docformatter-1.7.5.tar.gz", hash = "sha256:ffed3da0daffa2e77f80ccba4f0e50bfa2755e1c10e130102571c890a61b246e"}, +] + +[package.dependencies] +charset_normalizer = ">=3.0.0,<4.0.0" +untokenize = ">=0.1.1,<0.2.0" + +[package.extras] +tomli = ["tomli (>=2.0.0,<3.0.0)"] + [[package]] name = "exceptiongroup" version = "1.2.1" @@ -3126,6 +3144,16 @@ files = [ {file = "tzdata-2024.1.tar.gz", hash = "sha256:2674120f8d891909751c38abcdfd386ac0a5a1127954fbc332af6b5ceae07efd"}, ] +[[package]] +name = "untokenize" +version = "0.1.1" +description = "Transforms tokens into original source code (while preserving whitespace)." +optional = false +python-versions = "*" +files = [ + {file = "untokenize-0.1.1.tar.gz", hash = "sha256:3865dbbbb8efb4bb5eaa72f1be7f3e0be00ea8b7f125c69cbd1f5fda926f37a2"}, +] + [[package]] name = "uri-template" version = "1.3.0" @@ -3233,4 +3261,4 @@ test = ["websockets"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.12" -content-hash = "99eb98239afcaecb4615b0fc7feb14544df5edbbfdb0746d6be7a5571761e908" +content-hash = "fc2658e50f1bf86ae2b1bf9d521bda3159489429700af0d734094f3776b3a02f" diff --git a/pyproject.toml b/pyproject.toml index c8db897..584fbf1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ 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"} [tool.poetry.group.lab] optional = true