-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
85 lines (76 loc) · 1.98 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
SRC=pmix_borrow_web/
.PHONY: lint tags ltags test all lintall codestyle docstyle lintsrc \
linttest doctest doc docs code linters_all codesrc codetest docsrc \
doctest build dist pypi-push-test pypi-push pypi-test pip-test pypi \
pip remove-previous-build upgrade
# Batched Commands
# - Code & Style Linters
all: linters_all testall
lint: lintsrc codesrc docsrc
linters_all: doc code lintall
# Pylint Only
PYLINT_BASE =python3 -m pylint --output-format=colorized --reports=n
lintall: lintsrc linttest
lintsrc:
${PYLINT_BASE} ${SRC}
linttest:
${PYLINT_BASE} test/
# PyCodeStyle Only
PYCODESTYLE_BASE=python3 -m pycodestyle
codestyle: codestylesrc codestyletest
codesrc: codestylesrc
codetest: codestyletest
code: codestyle
codestylesrc:
${PYCODESTYLE_BASE} ${SRC}
codestyletest:
${PYCODESTYLE_BASE} test/
# PyDocStyle Only
PYDOCSTYLE_BASE=python3 -m pydocstyle
docstyle: docstylesrc docstyletest
docsrc: docstylesrc
doctest: docstyletest
docs: docstyle
docstylesrc:
${PYDOCSTYLE_BASE} ${SRC}
docstyletest:
${PYDOCSTYLE_BASE} test/
codetest:
python -m pycodestyle test/
codeall: code codetest
doc: docstyle
# Testing
test:
python3 -m unittest discover -v
testdoc:
python3 -m test.test --doctests-only
testall: test testdoc
test-survey-cto: #TODO: run a single unit test
python3 -m unittest discover -v
# Dependency management
upgrade:
# python3 -m pip uninstall pmix
python3 -m pip install --no-cache-dir --upgrade \
-r requirements-unlocked.txt; \
pip freeze > requirements.txt
# Package management
remove-previous-build:
rm -rf ./dist;
rm -rf ./build;
rm -rf ./*.egg-info
build: remove-previous-build
python3 setup.py sdist bdist_wheel
dist: build
pypi-push-test: build
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
pypi-push:
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*; \
make remove-previous-build
pypi-test: pypi-push-test
pip-test: pypi-push-test
pypi: pypi-push
pip: pypi-push
# Serve
serve:
open http://localhost:5000; \
python app.py