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 3efeb7e4d2b754210bb669ced71a550911ae66cf
parent 078a4eb9d5905496e60bf24e1d16825d1c9605b5
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 15 Sep 2018 22:21:50 -0400

Clean up CI scripts

Diffstat:
M.travis.yml | 1-
MMakefile | 11++++++-----
Mmake.bat | 23+++++++++++------------
3 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/.travis.yml b/.travis.yml @@ -17,7 +17,6 @@ env: - PIPENV_HIDE_EMOJIS=1 PIPENV_NO_INHERIT=1 install: - - pip install --upgrade pip pipenv python-coveralls - make test-install jobs: diff --git a/Makefile b/Makefile @@ -24,6 +24,7 @@ for line in sys.stdin: endef export PRINT_HELP_PYSCRIPT +FLIT := flit PYTHON := python PIP := pip BROWSER := $(PYTHON) -c "$$BROWSER_PYSCRIPT" @@ -48,7 +49,7 @@ clean-pyc: ## remove Python file artifacts find . -name '*.pyo' -exec rm -f {} + find . -name '*~' -exec rm -f {} + find . -name '__pycache__' -exec rm -fr {} + - $(PIPRUN) pip uninstall -y hookmeup + $(PIPRUN) $(PIP) uninstall -y hookmeup clean-test: ## remove test and coverage artifacts rm -f .coverage @@ -66,7 +67,7 @@ test-all: ## run tests on every Python version with tox $(PIPRUN) tox test-install: ## install dependenices from Pipfile (for tox / CI builds) - $(PYTHON) -m $(PIP) install --upgrade pip pipenv + $(PYTHON) -m $(PIP) install --upgrade $(PIP) $(PIPENV) python-coveralls $(PIPINST) coverage: ## check code coverage quickly with the default Python @@ -77,14 +78,14 @@ coverage-html: coverage ## generate an HTML report and open in browser $(BROWSER) htmlcov/index.html release: dist ## package and upload a release - $(PIPRUN) flit publish + $(PIPRUN) $(FLIT) publish dist: ## builds source and wheel package - $(PIPRUN) flit build + $(PIPRUN) $(FLIT) build ls -l dist install: ## install the package to the active Python's site-packages - $(PIPRUN) flit install --deps=none + $(PIPRUN) $(FLIT) install --deps=none run: ## run the package from site-packages $(PIPRUN) $(PYTHON) -m hookmeup $(cmd) diff --git a/make.bat b/make.bat @@ -9,7 +9,7 @@ except:^ from urllib.request import pathname2url^ -webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))^ +webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) set PRINT_HELP_PYSCRIPT=import re, sys^ @@ -21,22 +21,21 @@ for line in sys.stdin:^ target, help = match.groups()^ - print("%-20s %s" % (target, help))^ + print("%-20s %s" % (target, help)) -rem PYTHON defined externally means something different from the way -rem it's used internally, so redefine it if "%PYTHON%"=="" ( set PYTHON=python ) else ( set "PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%" set PYTHON=python ) + set PIP=pip set PIPENV=pipenv set PIPRUN=%PIPENV% run set PIPINST=%PIPENV% --bare install --dev --skip-lock set BROWSER=%PYTHON% -c %BROWSER_PYSCRIPT% -set + if "%1" == "help" ( %PYTHON% -c "%PRINT_HELP_PYSCRIPT%" < %~f0 goto :end @@ -73,7 +72,7 @@ if "%1" == "lint" ( if "%1" == "test" ( @echo on - %PIPRUN% python -m pytest + %PIPRUN% %PYTHON% -m pytest @echo off goto :end ) @@ -87,7 +86,7 @@ if "%1" == "test-all" ( if "%1" == "test-install" ( @echo on - %PYTHON% -m %PIP% install --upgrade pip pipenv + %PYTHON% -m %PIP% install --upgrade %PIP% %PIPENV% python-coveralls %PIPINST% @echo off goto :end @@ -95,14 +94,14 @@ if "%1" == "test-install" ( if "%1" == "coverage" ( @echo on - %PIPRUN% python -m pytest --cov=hookmeup + %PIPRUN% %PYTHON% -m pytest --cov=hookmeup @echo off goto :end ) if "%1" == "coverage-html" ( @echo on - %PIPRUN% python -m pytest --cov=hookmeup + %PIPRUN% %PYTHON% -m pytest --cov=hookmeup %PIPRUN% coverage html %BROWSER% htmlcov\index.html @echo off @@ -135,7 +134,7 @@ if "%1" == "install" ( if "%1" == "run" ( @echo on - %PIPRUN% python -m hookmeup %cmd% + %PIPRUN% %PYTHON% -m hookmeup %cmd% @echo off goto :end ) @@ -164,7 +163,7 @@ del /S *.pyc del /S *.pyo del /S *~ del /S __pycache__ -%PIPRUN% pip uninstall -y hookmeup +%PIPRUN% %PIP% uninstall -y hookmeup @echo off exit /B 0 @@ -174,7 +173,7 @@ del .coverage rmdir /S /Q htmlcov rmdir /S /Q .pytest_cache rmdir /S /Q .tox -@echo on +@echo off exit /B 0 :end