Changeset View
Changeset View
Standalone View
Standalone View
Makefile.python
# -*- mode: Makefile -*- | # -*- mode: Makefile -*- | ||||
PYMODULE := $(shell basename `pwd` | sed 's/-/./g') | PYMODULE := $(shell basename `pwd` | sed 's/-/./g') | ||||
PYDIR := $(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 :) | PYTHON_BIN := $(shell test -d bin/ && find bin/ -type f -executable | xargs egrep -H '^\#.*python' | cut -f 1 -d :) | ||||
TEST_DIRS := . | TEST_DIRS := . | ||||
NOSE = python3 -m nose | TEST = python3 -m pytest | ||||
NOSEFLAGS = -sv --with-doctest | TESTFLAGS = | ||||
CODESPELL = codespell | CODESPELL = codespell | ||||
CODESPELLFLAGS = | CODESPELLFLAGS = | ||||
FLAKE = python3 -m flake8 | FLAKE = python3 -m flake8 | ||||
FLAKEFLAGS = | FLAKEFLAGS = | ||||
LINT = pylint3 | LINT = pylint3 | ||||
LINTFLAGS = --rcfile=../pylintrc | LINTFLAGS = --rcfile=../pylintrc | ||||
all: | all: | ||||
.PHONY: test | .PHONY: test | ||||
test: | test: | ||||
$(NOSE) $(NOSEFLAGS) $(TEST_DIRS) | $(TEST) $(TESTFLAGS) $(TEST_DIRS) | ||||
.PHONY: coverage | .PHONY: coverage | ||||
coverage: | coverage: | ||||
$(NOSE) $(NOSEFLAGS) --with-coverage --cover-package $(PYMODULE) --cover-inclusive --cover-branches $(TEST_DIRS) | $(TEST) $(TESTFLAGS) --cov=$(PYMODULE) --cov-branch $(TEST_DIRS) | ||||
.PHONY: check check-flake check-codespell | .PHONY: check check-flake check-codespell | ||||
check: check-flake check-codespell | check: check-flake check-codespell | ||||
check-flake: | check-flake: | ||||
$(FLAKE) $(FLAKEFLAGS) swh $(PYTHON_BIN) | $(FLAKE) $(FLAKEFLAGS) swh $(PYTHON_BIN) | ||||
check-codespell: | check-codespell: | ||||
find swh docs -name '*.py' -o -name '*.rst' | xargs -r $(CODESPELL) $(CODESPELLFLAGS) | find swh docs -name '*.py' -o -name '*.rst' | xargs -r $(CODESPELL) $(CODESPELLFLAGS) | ||||
find . -maxdepth 1 -iname 'readme*' | xargs -r $(CODESPELL) $(CODESPELLFLAGS) | find . -maxdepth 1 -iname 'readme*' | xargs -r $(CODESPELL) $(CODESPELLFLAGS) | ||||
Show All 21 Lines |