diff --git a/Makefile.python b/Makefile.python index acd9548..5a14700 100644 --- a/Makefile.python +++ b/Makefile.python @@ -1,56 +1,44 @@ # -*- mode: Makefile -*- PYMODULE := $(shell basename `pwd` | sed 's/-/./g') PYDIR := $(shell basename `pwd` | sed 's%-%/%g') PYTHON_BIN := $(shell test -d bin/ && find bin/ -type f -executable | xargs egrep -H '^\#.*python' | cut -f 1 -d :) TEST_DIRS := . TEST = python3 -m pytest TESTFLAGS = -CODESPELL = codespell -CODESPELLFLAGS = -BLACK = python3 -m black -BLACKFLAGS = -FLAKE = python3 -m flake8 -FLAKEFLAGS = LINT = pylint3 LINTFLAGS = --rcfile=../pylintrc MYPY = mypy MYPYFLAGS = all: .PHONY: test test: $(TEST) $(TESTFLAGS) $(TEST_DIRS) .PHONY: coverage coverage: $(TEST) $(TESTFLAGS) --cov=$(PYMODULE) --cov-branch $(TEST_DIRS) .PHONY: check check: pre-commit run --all-files -.PHONY: check-staged -check-staged: - git diff -z --staged --name-only -- '*.py' $(PYTHON_BIN) \ - | xargs -0 -L1 -i'{}' /bin/sh -c \ - "git show ':{}' | $(FLAKE) $(FLAKEFLAGS) --stdin-display-name '{}' -" - .PHONY: lint lint: $(LINT) $(LINTFLAGS) $(PYMODULE) .PHONY: docs docs: make -C docs .PHONY: distclean # Clean up Python bytecode files and a bunch of Python tool caches. distclean: find . -type d -name __pycache__ | xargs rm -rf find . -type f -name '*.pyc' -delete rm -rf .tox/ .mypy_cache/