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 d8c6247a9f279ed86db4b58c8e5eaa4b1e329f5f
parent a93f9258bb769456bd40e87c94bba050cf2701dc
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 25 Aug 2018 20:23:38 -0400

Force tox and travis to Pipenv for dependencies

Diffstat:
M.travis.yml | 35+++++++++++++++++++++++------------
MMakefile | 8+++++---
MPipfile | 3---
MPipfile.lock | 19+++++++++----------
Mpyproject.toml | 1+
Dpytest.ini | 2--
Mtests/coveragerc | 3---
Mtox.ini | 24+++++++++++++++++-------
8 files changed, 55 insertions(+), 40 deletions(-)

diff --git a/.travis.yml b/.travis.yml @@ -13,18 +13,29 @@ matrix: packages: - libgnutls-dev -jobs: - include: - - python: 3.5 - - python: 3.6 - - <<: *xenial-mixin - python: 3.7 +env: + - PIPENV_HIDE_EMOJIS=1 PIPENV_NO_INHERIT=1 install: - - pip install -U 'pytest<3.7.0' pytest-cov pytest-pylint pytest-mock python-coveralls - -script: - - python -m pytest + - pip install pipenv python-coveralls + - pipenv --bare install --dev --skip-lock -after_success: - - coveralls +jobs: + include: + - stage: test + script: make test + python: 3.5 + - stage: test + script: make test + python: 3.6 + - stage: test + script: make test + <<: *xenial-mixin + python: 3.7 + - stage: lint + script: make lint + python: 3.6 + - stage: coverage + script: make coverage + after_success: coveralls + python: 3.5 diff --git a/Makefile b/Makefile @@ -53,17 +53,19 @@ clean-test: ## remove test and coverage artifacts rm -fr .tox lint: ## check style with pylint - $(PIPENV) pylint --rcfile tests/pylintrc hookmeup tests + $(PIPENV) pylint --rcfile tests/pylintrc hookmeup tests --disable=parse-error test: ## run tests quickly with the default Python - -$(PIPENV) python -m pytest + $(PIPENV) python -m pytest test-all: ## run tests on every Python version with tox $(PIPENV) tox coverage: ## check code coverage quickly with the default Python - -$(PIPENV) python -m pytest + $(PIPENV) python -m pytest --cov=hookmeup --cov-config tests/coveragerc $(PIPENV) coverage report -m + +coverage-html: coverage ## generate an HTML report and open in browser $(PIPENV) coverage html $(BROWSER) htmlcov/index.html diff --git a/Pipfile b/Pipfile @@ -13,6 +13,3 @@ pytest-pylint = "*" pytest-mock = "*" pudb = "*" tox = "*" - -[requires] -python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock @@ -1,12 +1,10 @@ { "_meta": { "hash": { - "sha256": "dbd531a84c2641232ac42cdd4450966f9a3af2034db26189b3b0b9a6bef8e79e" + "sha256": "d84e746ae4397ab19ad512149953aada1cd58cfb793b9b40d6246de0d2553721" }, "pipfile-spec": 6, - "requires": { - "python_version": "3.7" - }, + "requires": {}, "sources": [ { "name": "pypi", @@ -18,10 +16,10 @@ "default": { "certifi": { "hashes": [ - "sha256:4c1d68a1408dd090d2f3a869aa94c3947cc1d967821d1ed303208c9f41f0f2f4", - "sha256:b6e8b28b2b7e771a41ecdd12d4d43262ecab52adebbafa42c77d6b57fb6ad3a4" + "sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638", + "sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a" ], - "version": "==2018.8.13" + "version": "==2018.8.24" }, "chardet": { "hashes": [ @@ -92,10 +90,11 @@ }, "atomicwrites": { "hashes": [ - "sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585", - "sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6" + "sha256:6b5282987b21cd79151f51caccead7a09d0a32e89c568bd9e3c4aaa7bbdf3f3a", + "sha256:e16334d50fe0f90919ef7339c24b9b62e6abaa78cd2d226f3d94eb067eb89043" ], - "version": "==1.1.5" + "markers": "python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.3.*' and python_version != '3.0.*'", + "version": "==1.2.0" }, "attrs": { "hashes": [ diff --git a/pyproject.toml b/pyproject.toml @@ -18,6 +18,7 @@ classifiers = ["License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Version Control :: Git"] requires-python=">=3.5" +dev-requires = ['pytest<3.7.0', 'pytest-cov', 'pytest-pylint', 'pytest-mock'] [tool.flit.scripts] hookmeup = "hookmeup:main" diff --git a/pytest.ini b/pytest.ini @@ -1,2 +0,0 @@ -[pytest] -addopts= --cov=hookmeup --cov-config tests/coveragerc --cov-report=term-missing --pylint --pylint-rcfile=tests/pylintrc diff --git a/tests/coveragerc b/tests/coveragerc @@ -1,5 +1,2 @@ [run] branch = True - -[report] -fail_under = 100 diff --git a/tox.ini b/tox.ini @@ -1,18 +1,28 @@ [tox] -envlist = py35, py36, py37, pylint +envlist = py35, py36, py37, pylint, coverage skipsdist = True [testenv:pylint] -basepython = python deps = pylint commands = pylint --rcfile tests/pylintrc hookmeup +[testenv:coverage] +deps = pipenv +setenv = + PYTHONPATH = {toxinidir} + PIPENV_NO_INHERIT = 1 + PIPENV_HIDE_EMOJIS = 1 +commands = + pipenv --bare install --dev --skip-lock + pipenv run python -m pytest --cov=hookmeup --cov-config tests/coveragerc --cov-report=term-missing + [testenv] +deps = pipenv setenv = PYTHONPATH = {toxinidir} -deps = pytest<3.7.0 - pytest-cov - pytest-pylint - pytest-mock + PIPENV_NO_INHERIT = 1 + PIPENV_HIDE_EMOJIS = 1 commands = - py.test --basetemp={envtmpdir} + pipenv --bare install --dev --skip-lock + pipenv run flit install + pipenv run pytest