-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (44 loc) · 1.83 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
PYTHON3 = python3
SOURCEDIR = qlink_interface
TESTDIR = tests
EXAMPLEDIR = examples
RUNEXAMPLES = ${EXAMPLEDIR}/run_examples.py
MINCOV = 0
help:
@echo "install Installs the package (editable)."
@echo "verify Verifies the installation, runs the linter and tests."
@echo "tests Runs the tests."
@echo "examples Runs the examples and makes sure they work."
@echo "open-cov-report Creates and opens the coverage report."
@echo "lint Runs the linter."
@echo "bdist Builds the package."
@echo "test-deps Installs the requirements needed for running tests and linter."
@echo "python-deps Installs the requirements needed for using the package."
@echo "docs Creates the html documentation"
@echo "clean Removes all .pyc files."
test-deps:
@$(PYTHON3) -m pip install -r test_requirements.txt
requirements python-deps:
@$(PYTHON3) -m pip install -r requirements.txt ${PIP_FLAGS}
clean:
@/usr/bin/find . -name '*.pyc' -delete
lint:
@$(PYTHON3) -m flake8 ${SOURCEDIR} ${TESTDIR} ${EXAMPLEDIR}
tests:
@$(PYTHON3) -m pytest --cov=${SOURCEDIR} --cov-fail-under=${MINCOV} tests
open-cov-report:
@$(PYTHON3) -m pytest --cov=${SOURCEDIR} --cov-report html tests && open htmlcov/index.html
examples:
@${PYTHON3} ${RUNEXAMPLES} > /dev/null && echo "Examples OK!" || echo "Examples failed!"
docs html:
@${MAKE} -C docs html
build bdist: _clean_dist
@$(PYTHON3) setup.py bdist_wheel
install: test-deps
@$(PYTHON3) -m pip install -e . ${PIP_FLAGS}
_clean_dist:
@/bin/rm -rf dist
verify: clean test-deps python-deps lint tests examples _verified
_verified:
@echo "The snippet is verified :)"
.PHONY: clean lint test-deps python-deps tests verify bdist deploy-bdist _clean_dist install open-cov-report examples docs