forked from n8henrie/fastcli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
93 lines (75 loc) · 2.05 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SHELL := /bin/bash
PYTHON = /usr/bin/env python3
PWD = $(shell pwd)
GREP := $(shell command -v ggrep || command -v grep)
.PHONY: clean-pyc clean-build docs clean register release clean-docs help
help:
@$(GREP) --only-matching --word-regexp '^[^[:space:].]*:' Makefile | sed 's|:[:space:]*||'
clean: clean-build clean-pyc clean-test
clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
rm -fr src/*.egg-info
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test:
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
lint:
flake8 fastcli tests
test:
py.test tests
test-all:
tox
coverage:
coverage run --source fastcli setup.py test
coverage report -m
coverage html
open htmlcov/index.html
clean-docs:
rm -f docs/fastcli*.rst
rm -f docs/modules.rst
docs: clean-docs
source venv/bin/activate && sphinx-apidoc -o docs/ src/fastcli
$(MAKE) -C docs clean
$(MAKE) -C docs html
open docs/_build/html/index.html
register: dist
twine register dist/*.whl
release: dist
twine upload dist/*
dist: clean docs
$(PYTHON) setup.py --long-description | rst2html.py --halt=2
$(PYTHON) setup.py sdist
$(PYTHON) setup.py bdist_wheel
ls -l dist
venv:
$(PYTHON) -m venv venv
venv/bin/pip install --upgrade pip wheel
update-reqs: requirements.txt
venv/bin/python -c 'print("#" * 80)' >> $<
while read lib; do \
libname="$${lib%%=*}"; \
venv/bin/pip install --upgrade "$${libname}"; \
done < <($(GREP) --invert-match '^#' $<)
for lib in $$(venv/bin/pip freeze --all | grep '=='); do \
if grep "$${lib%%=*}" $< >/dev/null; then \
echo "$${lib}" >> $<; \
fi; \
done
update-dev-reqs: requirements-dev.txt
venv/bin/python -c 'print("#" * 80)' >> $<
while read lib; do \
libname="$${lib%%=*}"; \
venv/bin/pip install --upgrade "$${libname}"; \
done < <($(GREP) --invert-match '^#' $<)
for lib in $$(venv/bin/pip freeze --all | grep '=='); do \
if grep "$${lib%%=*}" $< >/dev/null; then \
echo "$${lib}" >> $<; \
fi; \
done