Skip to content

Commit

Permalink
include coverage and coverage uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
monobot committed Mar 20, 2019
1 parent 0e27332 commit 983dc9e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 126 deletions.
10 changes: 6 additions & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[run]
omit =
*/site-packages/asyncpg/*
*/site-packages/netaddr/*
tests/*
omit =
*/site-packages/asyncpg/*
*/site-packages/netaddr/*
tests/*
source =
asyncorm/
34 changes: 15 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
.DEFAULT_GOAL := help

define PRINT_HELP_PYSCRIPT
import re, sys

for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT

.PHONY: help
help: ## Show the help menu
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: clean-build
clean-build: ## Remove build artifacts
clean-build: ## Clean Remove build artifacts
clean-build:
rm -rf build/
rm -rf dist/
Expand All @@ -26,15 +15,15 @@ clean-build:
find . -name '*.egg' -exec rm -f {} +

.PHONY: clean-pyc
clean-pyc: ## Remove Python file artifacts
clean-pyc: ## Clean Remove Python file artifacts
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +

.PHONY: clean-test
clean-test: ## Remove test and coverage artifacts
clean-test: ## Clean Remove test and coverage artifacts
clean-test:
rm -rf .tox/
rm -f .coverage
Expand Down Expand Up @@ -67,11 +56,18 @@ test: ## Run tests quickly with the default Python
test-all: ## Run tests on every Python version with tox
pipenv run tox

PHONY: coverage
coverage: ## Check code coverage quickly with the default Python
coverage: coverage run --source asyncorm setup.py test
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
coverage:
pipenv run coverage run -m tests
pipenv run coverage report -m
pipenv run coverage html
xdg-open htmlcov/index.html

PHONY: report-coverage
report-coverage: ## Report coverage results to codacy
report-coverage:
pipenv run python-codacy-coverage -r coverage.xml

.PHONY: docs
docs: ## Generate Sphinx HTML documentation, including API docs
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ pytest-asyncio = "*"
rope = "*"
Sphinx = "*"
tox = ">=3.7.0<3.8"
watchdog = "*"

[packages]
asyncpg = "==0.18.3"
netaddr = "==0.7.19"
pylint = "*"

[requires]
python_version = "3.6"
140 changes: 38 additions & 102 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 983dc9e

Please sign in to comment.