forked from pulp/pulp-smash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (49 loc) · 2.11 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
TEST_OPTIONS=-m unittest discover --start-directory tests --top-level-directory .
CPU_COUNT=$(shell python3 -c "from multiprocessing import cpu_count; print(cpu_count())")
help:
@echo "Please use \`make <target>' where <target> is one of:"
@echo " help to show this message"
@echo " all to to execute all following targets (except \`test')"
@echo " dist to generate installable Python packages"
@echo " dist-clean to remove generated Python packages"
@echo " docs-html to generate HTML documentation"
@echo " docs-clean to remove documentation"
@echo " lint to run all linters"
@echo " lint-flake8 to run the flake8 linter"
@echo " lint-pylint to run the pylint linter"
@echo " publish to upload dist/* to PyPi"
@echo " test to run unit tests"
@echo " test-coverage to run unit tests and measure test coverage"
# Edit with caution! Travis CI uses this target. ¶ We run docs-clean before
# docs-html to ensure a complete build. (Warnings are emitted only when a file
# is compiled, and Sphinx does not needlessly recompile.) More broadly, we
# order dependencies by execution time and (anecdotal) likelihood of finding
# issues. ¶ `test-coverage` is a functional superset of `test`. Why keep both?
all: test-coverage lint docs-clean docs-html dist-clean dist
dist:
./setup.py --quiet sdist bdist_wheel --universal
dist-clean:
rm -rf build dist pulp_smash.egg-info
docs-html:
@cd docs; $(MAKE) html
docs-clean:
@cd docs; $(MAKE) clean
lint-flake8:
flake8 . --ignore D203 --exclude docs/_build
lint-pylint:
pylint -j $(CPU_COUNT) --reports=n --disable=I \
docs/conf.py \
pulp_smash \
scripts/run_functional_tests.py \
setup.py \
tests
lint: lint-flake8 lint-pylint
publish: dist
twine upload dist/*
test:
python3 $(TEST_OPTIONS)
test-coverage:
coverage run --source pulp_smash.api,pulp_smash.cli,pulp_smash.config,pulp_smash.exceptions,pulp_smash.pulp_smash_cli,pulp_smash.selectors,pulp_smash.utils \
$(TEST_OPTIONS)
.PHONY: help all docs-html docs-clean lint-flake8 lint-pylint lint test \
test-coverage dist-clean publish