-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
58 lines (45 loc) · 1.38 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
#
# December 16, 2014 Christian E. Hopps <[email protected]>
#
PIP=pip
PYLINT=pylint -sn -rn --rcfile=pylintrc
PYTEST=py.test
PYTHON=python
TSFILE=.lint-timestamp
.PHONY: doc
check:
@echo Running lint on changes with PYLINT=$(PYLINT)
@OK=YES; for f in $$(git status | awk '/^[ \t]+(modified|new file): +.*.py$$/{print $$2}'); do if [[ $$f -nt $(TSFILE) ]]; then echo "=== $$f"; if ! $(PYLINT) $$f; then OK=NO; fi; fi; done; if [[ $$OK = YES ]]; then touch $(TSFILE); fi
clean:
find . -name '*.pyc' -exec rm {} +
$(PYTHON) setup.py clean
rm -rf bulid doc/build
doc:
python setup.py build_sphinx
install:
$(PIP) install -e .
uninstall:
$(PIP) uninstall -y netconf
lint:
@for f in $$(find netconf tests -name '*.py'); do \
echo "=== Linting $$f"; \
$(PYLINT) $$f; \
done
test: lint run-test
run-test:
@echo "Running python tests"
$(PYTEST) -v --doctest-modules
pypi-upload:
$(PYTHON) setup.py sdist bdist_wheel
$(PYTHON) setup.py --version
PYPKGVER=$$($(PYTHON) setup.py --version); \
PYPKGNAME=$$($(PYTHON) setup.py --name); \
echo "package: $$PYPKGNAME version: $${PYPKGVER}"; \
if [[ "$${PYPKGVER%%.dev*}" == "$${PYPKGVER}" ]]; then \
echo "Deploying $${PYPKGVER} of $${PYPKGNAME}"; \
for f in dist/*; do if [[ -f $$f ]]; then twine upload --skip-existing $$f; fi; done; \
fi
run-server:
python example/system-server.py
kill-server:
pkill -f "python example/system-server.py"