-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
59 lines (47 loc) · 1.5 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.PHONY: all virtualenv install nopyc clean test docs local validate-release upload
SHELL := /usr/bin/env bash
PYTHON_BIN ?= python
all: virtualenv install
virtualenv:
@if [ ! -d "venv" ]; then \
$(PYTHON_BIN) -m pip install virtualenv --user; \
$(PYTHON_BIN) -m virtualenv venv; \
fi
install: virtualenv
@( \
source venv/bin/activate; \
python -m pip install -r requirements.txt -r requirements-dev.txt; \
)
nopyc:
find . -name '*.pyc' | xargs rm -f || true
find . -name __pycache__ | xargs rm -rf || true
clean: nopyc
rm -rf _build dist *.egg-info venv
test: install
@( \
source venv/bin/activate; \
python `which nosetests` --with-coverage --cover-erase --cover-package=. --cover-html --cover-html-dir=_build/coverage; \
)
docs: install
@( \
source venv/bin/activate; \
python -m pip install -r docs/requirements.txt; \
sphinx-build -M html docs _build/docs; \
)
local:
@rm -rf *.egg-info dist
@( \
$(PYTHON_BIN) setup.py sdist; \
$(PYTHON_BIN) -m pip install dist/*.tar.gz; \
)
validate-release:
@if [[ "${VERSION}" == "" ]]; then echo "VERSION is not set" & exit 1 ; fi
@if [[ $$(grep "__version__ = \"${VERSION}\"" setup.py) == "" ]] ; then echo "Version not bumped in setup.py" & exit 1 ; fi
@if [[ $$(grep "__version__ = \"${VERSION}\"" hookee/hookeemanager.py) == "" ]] ; then echo "Version not bumped in hookee/hookeemanager.py" & exit 1 ; fi
upload:
@rm -rf *.egg-info dist
@( \
source venv/bin/activate; \
python setup.py sdist; \
python -m twine upload dist/*; \
)