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 ddf41ec2778c29d0720089835a2e4f7ce644d278
parent 44b1e4852321ea5081fe6f3577e433f372e05db0
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 15 Sep 2018 13:24:27 -0400

Makefile and make.bat improvements

Diffstat:
M.travis.yml | 2+-
MMakefile | 13++++++++-----
Mappveyor.yml | 9++++-----
Mmake.bat | 14+++++++++++---
4 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/.travis.yml b/.travis.yml @@ -17,7 +17,7 @@ env: - PIPENV_HIDE_EMOJIS=1 PIPENV_NO_INHERIT=1 install: - - pip install pipenv python-coveralls + - pip install --upgrade pip pipenv python-coveralls - make test-install jobs: diff --git a/Makefile b/Makefile @@ -24,13 +24,15 @@ for line in sys.stdin: endef export PRINT_HELP_PYSCRIPT -BROWSER := python -c "$$BROWSER_PYSCRIPT" +PYTHON := python +PIP := pip +BROWSER := $(PYTHON) -c "$$BROWSER_PYSCRIPT" PIPENV := pipenv PIPRUN := $(PIPENV) run PIPINST := $(PIPENV) --bare install --dev --skip-lock help: - @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) + @$(PYTHON) -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts @@ -58,16 +60,17 @@ lint: ## check style with pylint $(PIPRUN) pylint hookmeup tests --disable=parse-error test: ## run tests quickly with the default Python - $(PIPRUN) python -m pytest + $(PIPRUN) $(PYTHON) -m pytest test-all: ## run tests on every Python version with tox $(PIPRUN) tox test-install: ## install dependenices from Pipfile (for tox / CI builds) + $(PIP) install --upgrade pip pipenv $(PIPINST) coverage: ## check code coverage quickly with the default Python - $(PIPRUN) python -m pytest --cov=hookmeup + $(PIPRUN) $(PYTHON) -m pytest --cov=hookmeup coverage-html: coverage ## generate an HTML report and open in browser $(PIPRUN) coverage html @@ -84,7 +87,7 @@ install: ## install the package to the active Python's site-packages $(PIPRUN) flit install --deps=none run: ## run the package from site-packages - $(PIPRUN) python -m hookmeup $(cmd) + $(PIPRUN) $(PYTHON) -m hookmeup $(cmd) debug: install ## debug the package from site packages $(PIPRUN) pudb3 $$($(PIPRUN) which hookmeup) $(cmd) diff --git a/appveyor.yml b/appveyor.yml @@ -2,13 +2,12 @@ environment: matrix: # For Python versions available on Appveyor, see # http://www.appveyor.com/docs/installed-software#python - - PYTHON: "C:\\Python34\\python.exe" - - PYTHON: "C:\\Python35-x64\\python.exe" - - PYTHON: "C:\\Python36\\python.exe" - - PYTHON: "C:\\Python37\\python.exe" + - PYTHON: "C:\\Python34" + - PYTHON: "C:\\Python35-x64" + - PYTHON: "C:\\Python36" + - PYTHON: "C:\\Python37" install: - - "%PYTHON% -m pip install pipenv" - "make test-install" build: off diff --git a/make.bat b/make.bat @@ -23,9 +23,16 @@ for line in sys.stdin:^ print("%-20s %s" % (target, help))^ -if "%PYTHON%"=="" set PYTHON=python -set -set PIPENV=%PYTHON% -m pipenv +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% @@ -80,6 +87,7 @@ if "%1" == "test-all" ( if "%1" == "test-install" ( @echo on + %PIP% install --upgrade pip pipenv %PIPINST% @echo off goto :end