forked from pymodbus-dev/pymodbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (57 loc) · 2.27 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
# Makefile for the `pymodbus' package.
WORKON_HOME ?= $(HOME)/.virtualenvs
VIRTUAL_ENV ?= $(WORKON_HOME)/pymodbus
PATH := $(VIRTUAL_ENV)/bin:$(PATH)
MAKE := $(MAKE) --no-print-directory
SHELL = bash
PYVER=$(shell python -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));print(t)")
default:
@echo 'Makefile for pymodbus'
@echo
@echo 'Usage:'
@echo
@echo ' make install install the package in a virtual environment'
@echo ' make reset recreate the virtual environment'
@echo ' make check check coding style (PEP-8, PEP-257)'
@echo ' make test run the test suite, report coverage'
@echo ' make tox run the tests on all Python versions'
@echo ' make docs creates sphinx documentation in html'
@echo ' make clean cleanup all temporary files'
@echo
install:
@test -d "$(VIRTUAL_ENV)" || mkdir -p "$(VIRTUAL_ENV)"
@test -x "$(VIRTUAL_ENV)/bin/python" || virtualenv --quiet "$(VIRTUAL_ENV)"
@test -x "$(VIRTUAL_ENV)/bin/pip" || easy_install pip
@pip install --upgrade --quiet --requirement=requirements.txt
@pip uninstall --yes pymodbus &>/dev/null || true
@pip install --quiet --no-deps --ignore-installed .
reset:
$(MAKE) clean
rm -Rf "$(VIRTUAL_ENV)"
$(MAKE) install
check: install
@pip install --upgrade --quiet --requirement=requirements-checks.txt
@flake8
test: install
@pip install --upgrade --quiet --requirement=requirements-tests.txt
$(info Running tests on $(PYVER))
@pip install --upgrade pip --quiet
@pytest --cov=pymodbus/ --cov-report term-missing test
@coverage report --fail-under=85 -i
tox: install
@pip install --upgrade --quiet tox && tox
docs: install
@pip install --upgrade --quiet --requirement=requirements-docs.txt
@cd doc && make clean && make html
publish: install
git push origin && git push --tags origin
$(MAKE) clean
pip install --quiet twine wheel
python setup.py sdist bdist_wheel
twine upload dist/*
$(MAKE) clean
clean:
@rm -Rf *.egg .eggs *.egg-info *.db .cache .coverage .tox build dist docs/build htmlcov doc/_build test/.Python test/pip-selfcheck.json test/lib/ test/include/ test/bin/
@find . -depth -type d -name __pycache__ -exec rm -Rf {} \;
@find . -type f -name '*.pyc' -delete
.PHONY: default install reset check test tox docs publish clean