hookmeup

A Git hook to automate your Pipenv and Django workflow
git clone git://git.danielmoch.com/hookmeup.git
Log | Files | Refs | README | LICENSE

commit 58dddfcad37cc31ddf7531455cbc9c5049820294
parent d8c6247a9f279ed86db4b58c8e5eaa4b1e329f5f
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sun, 26 Aug 2018 15:46:29 -0400

Use Makefile for test commands

Diffstat:
M.travis.yml | 2+-
MMakefile | 33++++++++++++++++++---------------
MPipfile | 4++--
MPipfile.lock | 24++++++++----------------
Mtox.ini | 17+++++++++--------
5 files changed, 38 insertions(+), 42 deletions(-)

diff --git a/.travis.yml b/.travis.yml @@ -18,7 +18,7 @@ env: install: - pip install pipenv python-coveralls - - pipenv --bare install --dev --skip-lock + - make test-install jobs: include: diff --git a/Makefile b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean clean-test clean-pyc clean-build help +.PHONY: clean clean-test clean-pyc clean-build help lint coverage coverage-html release dist install run debug .DEFAULT_GOAL := help define BROWSER_PYSCRIPT @@ -44,7 +44,7 @@ clean-pyc: ## remove Python file artifacts find . -name '*.pyo' -exec rm -f {} + find . -name '*~' -exec rm -f {} + find . -name '__pycache__' -exec rm -fr {} + - $(PIPENV) pip uninstall -y hookmeup + pipenv run pip uninstall -y hookmeup clean-test: ## remove test and coverage artifacts rm -f .coverage @@ -53,34 +53,37 @@ clean-test: ## remove test and coverage artifacts rm -fr .tox lint: ## check style with pylint - $(PIPENV) pylint --rcfile tests/pylintrc hookmeup tests --disable=parse-error + pipenv run pylint --rcfile tests/pylintrc hookmeup tests --disable=parse-error test: ## run tests quickly with the default Python - $(PIPENV) python -m pytest + pipenv run python -m pytest test-all: ## run tests on every Python version with tox - $(PIPENV) tox + pipenv run tox + +test-install: ## install dependenices from Pipfile (for tox / CI builds) + pipenv --bare install --dev --skip-lock coverage: ## check code coverage quickly with the default Python - $(PIPENV) python -m pytest --cov=hookmeup --cov-config tests/coveragerc - $(PIPENV) coverage report -m + pipenv run python -m pytest --cov=hookmeup --cov-config tests/coveragerc + pipenv run coverage report -m coverage-html: coverage ## generate an HTML report and open in browser - $(PIPENV) coverage html + pipenv run coverage html $(BROWSER) htmlcov/index.html release: dist ## package and upload a release - $(PIPENV) flit publish + pipenv run flit publish -dist: clean ## builds source and wheel package - $(PIPENV) flit build +dist: ## builds source and wheel package + pipenv run flit build ls -l dist -install: clean ## install the package to the active Python's site-packages - $(PIPENV) flit install +install: ## install the package to the active Python's site-packages + pipenv run flit install run: install ## run the package from site-packages - $(PIPENV) hookmeup + pipenv run hookmeup debug: install ## debug the package from site packages - $(PIPENV) pudb3 `$(PIPENV) which hookmeup` + pipenv run pudb3 `pipenv run which hookmeup` diff --git a/Pipfile b/Pipfile @@ -7,9 +7,9 @@ name = "pypi" flit = "*" [dev-packages] -pytest = "<3.7.0" +pytest = "*" pytest-cov = "*" -pytest-pylint = "*" pytest-mock = "*" pudb = "*" tox = "*" +pylint = "*" diff --git a/Pipfile.lock b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "d84e746ae4397ab19ad512149953aada1cd58cfb793b9b40d6246de0d2553721" + "sha256": "42d3fadef08fd402d291ca260c55846114d09a8f00aca6b5728fa16ae7d00529" }, "pipfile-spec": 6, "requires": {}, @@ -38,11 +38,11 @@ }, "flit": { "hashes": [ - "sha256:5eba92b254f198e534855919c1596d68bb46a7ee2adab60037df6268672dba38", - "sha256:95b8577b2232da39ee14ae237575b7a85afeeabc1e87f4a19485fac34f85aa89" + "sha256:178e6865185b1802aa3b1944f4957d2c83fc56294dc8047d2c4722131f696e61", + "sha256:da823d4acae9bda42dcc0c7ab1d9be475a8a47aae5fd6dde63841d9f430ccb2f" ], "index": "pypi", - "version": "==1.0" + "version": "==1.1" }, "idna": { "hashes": [ @@ -233,15 +233,16 @@ "sha256:1d6d3622c94b4887115fe5204982eee66fdd8a951cf98635ee5caee6ec98c3ec", "sha256:31142f764d2a7cd41df5196f9933b12b7ee55e73ef12204b648ad7e556c119fb" ], + "index": "pypi", "version": "==2.1.1" }, "pytest": { "hashes": [ - "sha256:341ec10361b64a24accaec3c7ba5f7d5ee1ca4cebea30f76fad3dd12db9f0541", - "sha256:952c0389db115437f966c4c2079ae9d54714b9455190e56acebe14e8c38a7efa" + "sha256:3459a123ad5532852d36f6f4501dfe1acf4af1dd9541834a164666aa40395b02", + "sha256:96bfd45dbe863b447a3054145cd78a9d7f31475d2bce6111b133c0cc4f305118" ], "index": "pypi", - "version": "==3.6.4" + "version": "==3.7.2" }, "pytest-cov": { "hashes": [ @@ -259,15 +260,6 @@ "index": "pypi", "version": "==1.10.0" }, - "pytest-pylint": { - "hashes": [ - "sha256:5e39b9e1c306319500779f5335ffa35bcc78e973bed61d069b5ce9058ca59f32", - "sha256:a928125d59a6329a8fb6ab9af9e570ded4bf607b326d515a5bc6f8a5995edf70", - "sha256:d30da4ddbf2ad3a0b47987a664db1510b8aa273fc50f4fdc883404381ec0ba89" - ], - "index": "pypi", - "version": "==0.12.1" - }, "six": { "hashes": [ "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", diff --git a/tox.ini b/tox.ini @@ -4,25 +4,26 @@ skipsdist = True [testenv:pylint] deps = pylint -commands = pylint --rcfile tests/pylintrc hookmeup +whitelist_externals = make +commands = make lint [testenv:coverage] deps = pipenv setenv = - PYTHONPATH = {toxinidir} PIPENV_NO_INHERIT = 1 PIPENV_HIDE_EMOJIS = 1 +whitelist_externals = make commands = - pipenv --bare install --dev --skip-lock - pipenv run python -m pytest --cov=hookmeup --cov-config tests/coveragerc --cov-report=term-missing + make test-install + make coverage [testenv] deps = pipenv setenv = - PYTHONPATH = {toxinidir} PIPENV_NO_INHERIT = 1 PIPENV_HIDE_EMOJIS = 1 +whitelist_externals = make commands = - pipenv --bare install --dev --skip-lock - pipenv run flit install - pipenv run pytest + make test-install + make install + make test