~javiljoen/lttb-numpy

058057a228d733f0db9f16b8fd60ec0d7ba977f1 — Jack Viljoen 3 years ago e0778f6
Add coverage commands to tox & Makefile
3 files changed, 33 insertions(+), 2 deletions(-)

M Makefile
M requirements-dev.txt
M tox.ini
M Makefile => Makefile +16 -1
@@ 1,15 1,18 @@
.PHONY: help clean clean-pyc clean-build lint test test-all build upload
.PHONY: help clean clean-all clean-pyc clean-build clean-caches lint test coverage test-all build upload

help:
	@echo "clean - remove Python file & build artifacts"
	@echo "lint - run linters to check the code style and formatting"
	@echo "test - run tests with the default Python"
	@echo "coverage - generate test coverage report with the default Python"
	@echo "test-all - run tests in multiple environments"
	@echo "build - package"
	@echo "upload - release package to PyPI"

clean: clean-build clean-pyc

clean-all: clean clean-caches

clean-build:
	rm -fr build/
	rm -fr dist/


@@ 22,6 25,13 @@ clean-pyc:
	find . -name __pycache__ -type d -exec rmdir {} +
	rm -fr .cache/

clean-caches:
	rm -fr .eggs/
	rm -fr .hypothesis/
	rm -fr .pytest_cache/
	rm -fr .tox/
	rm -fr htmlcov/

lint:
	flake8 lttb tests
	black --check .


@@ 29,6 39,11 @@ lint:
test:
	pytest -n 2

coverage:
	coverage run -m pytest
	coverage html
	coverage erase

test-all:
	PYENV_VERSION="" tox -p 2


M requirements-dev.txt => requirements-dev.txt +1 -0
@@ 1,4 1,5 @@
black
coverage
flake8
flake8-bugbear
hypothesis[numpy]

M tox.ini => tox.ini +16 -1
@@ 1,5 1,5 @@
[tox]
envlist = py27, py35, py38
envlist = py27, py35, py38, coverage

[testenv]
deps =


@@ 11,6 11,21 @@ deps =

commands = pytest

[testenv:coverage]
deps =
    pytest
    coverage
    hypothesis

commands =
    coverage run -m pytest
    coverage report
    coverage erase

[coverage:run]
branch = true
source = lttb

[flake8]
max-line-length = 80
select = C,E,F,W,B,B950