This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (43 loc) · 1.69 KB
/
Copy pathMakefile
File metadata and controls
69 lines (43 loc) · 1.69 KB
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
60
61
62
63
64
65
66
67
68
69
VIRTUAL_ENV ?= $(PWD)/env
PY = $(VIRTUAL_ENV)/bin/python
PIP = $(VIRTUAL_ENV)/bin/pip
PACKAGE = pycli_tools
SPHINXBUILD = $(VIRTUAL_ENV)/bin/sphinx-build
$(PY):
virtualenv env
$(eval VIRTUAL_ENV = $(PWD)/env)
build: $(PY) test
$(PY) setup.py sdist
develop: $(PY)
$(PY) setup.py develop
deps: $(PY)
if [ -f requirements.txt ]; then $(PIP) install -r requirements.txt; fi
test: $(PY)
$(PY) setup.py test
bump:
@echo "Current $(PACKAGE) version is: $(shell sed -E "s/__version__ = .([^']+)./\\1/" $(PACKAGE)/__init__.py)"
@test ! -z "$(version)" || ( echo "specify a version number: make bump version=X.X.X" && exit 1 )
@! git status --porcelain 2> /dev/null | grep -v "^??" || ( echo 'uncommited changes. commit them first' && exit 1 )
@echo "Bumping to $(version)"
sed -i'.bak' -e "/^__version__ = .*$$/s/'[^']*'/'$(version)'/" $(PACKAGE)/__init__.py
rm -f $(PACKAGE)/__init__.py.bak
git add $(PACKAGE)/__init__.py
git commit -m 'Bumped version number to $(version)'
git tag $(version)
@echo "Version $(version) commited and tagged. Don't forget to push to github."
clean:
find $(PACKAGE) -name '*.pyc' -exec rm -f {} +
find $(PACKAGE) -name '*.pyo' -exec rm -f {} +
find $(PACKAGE) -name '*~' -exec rm -f {} +
find $(PACKAGE) -name '._*' -exec rm -f {} +
find $(PACKAGE) -name '.coverage*' -exec rm -f {} +
rm -rf build/ dist/ MANIFEST 2>/dev/null || true
upload: $(PY) test
$(PY) setup.py sdist register upload
docs: $(PY) $(SPHINXBUILD)
cd docs/; $(MAKE) html SPHINXBUILD=$(SPHINXBUILD)
upload_docs: $(PY)
$(PY) setup.py upload_docs --upload-dir docs/_build/html/
$(SPHINXBUILD): $(PY)
$(PIP) install sphinx
.PHONY: build develop deps test bump clean upload docs upload_docs