From 62cd9934a2b7bfd1e8755887ccf92a4991b1ce36 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Wed, 23 Sep 2020 18:42:21 -0400 Subject: [PATCH] Add automation config files Add coveragerc for upcoming pytest coverage Add pre-commit config Add makefile for automating common processes --- .coveragerc | 7 +++++++ .pre-commit-config.yaml | 28 ++++++++++++++++++++++++++++ Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .coveragerc create mode 100644 .pre-commit-config.yaml create mode 100644 Makefile diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..77d2d87 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True + +[report] +exclude_lines = + \.\.\. + pass diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9f1d389 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +--- +repos: + - repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + language_version: python3.7 + + - repo: https://github.com/asottile/blacken-docs + rev: v0.5.0 + hooks: + - id: blacken-docs + additional_dependencies: [black==20.8b1] + language_version: python3.7 + + - repo: https://github.com/asottile/reorder_python_imports + rev: v2.3.5 + hooks: + - id: reorder-python-imports + language_version: python3 + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.0.0 + hooks: + - id: end-of-file-fixer + - id: fix-encoding-pragma + args: [--remove] + - id: trailing-whitespace diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2bd221e --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +# tox-poetry-installer makefile + +# You can set these variables from the command line +PROJECT = tox_poetry_installer + +.PHONY: help +# Put it first so that "make" without argument is like "make help" +# Adapted from: +# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html +help: ## List Makefile targets + $(info Makefile documentation) + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' + +tox: clean + tox + +clean-tox: + rm -rf ./.mypy_cache + rm -rf ./.tox + rm -f .coverage + +clean-py: + rm -rf ./dist + rm -rf ./build + rm -rf ./*.egg-info + rm -rf __pycache__/ + +clean: clean-tox clean-py clean-docs; ## Clean temp build/cache files and directories + +wheel: ## Build Python binary distribution wheel package + poetry build --format wheel + +source: ## Build Python source distribution package + poetry build --format sdist + +test: ## Run the project testsuite(s) + poetry run tox -r + +docs: ## Build the documentation using Sphinx + poetry run tox -e docs