-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (52 loc) · 1.7 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
60
61
62
63
64
65
python ?= python3.4
.PHONY: all
all: git_devbliss.egg_info/
git_devbliss.egg_info/: bin/pip
bin/pip install --editable .
.PHONY: test
test: flake8 coverage all
.PHONY: flake8
flake8: bin/flake8 all
bin/flake8 setup.py git_devbliss
.PHONY: coverage
coverage: bin/coverage all
bin/coverage run --source=git_devbliss,setup.py -m unittest discover -vfb
bin/coverage html
bin/coverage report --fail-under=100 && bin/coverage html
bin/coverage: bin/pip
bin/pip install coverage
bin/flake8: bin/pip
bin/pip install flake8
bin/pip: bin/python
#bin/python -m ensurepip --upgrade
wget --no-check-certificate -O - https://bootstrap.pypa.io/get-pip.py | bin/python
bin/python:
$(python) -m venv --without-pip .
.PHONY: clean-dist
clean-dist:
rm -rf htmlcov/ .coverage
rm -rf *.egg-info/ *.egg build/ dist/
find . -name __pycache__ -type d | xargs rm -rf
.PHONY: clean
clean: clean-dist
rm -rf bin/ lib/ include/ pyvenv.cfg
.PHONY: changelog
changelog:
@$${EDITOR:-"vi"} CHANGES.md
.PHONY: version
version:
@changelog_version=`sed -n 's/## \(.*\)/\1/p' CHANGES.md | head -n 1`; \
echo "setting setup.py version to $$changelog_version" found in CHANGES.md; \
sed -i '' "/git_devbliss/,/install_requires/s/version.*/version=\"$$changelog_version\",/" setup.py
.PHONY: release
release:
@if [ -z $$DEVBLISS_VERSION ] ; then read -p 'DEVBLISS_VERSION not found. Please specify the release version: ' DEVBLISS_VERSION; fi; \
echo "setting setup.py version to DEVBLISS_VERSION ($$DEVBLISS_VERSION)"; \
sed -i '' "/git_devbliss/,/install_requires/s/version.*/version=\"$$DEVBLISS_VERSION\",/" setup.py
.PHONY: finish
finish:
make test
.PHONY: upload
upload:
bin/python setup.py register; \
bin/python setup.py sdist upload