forked from pulp/pulp-smash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (48 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
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 " docs-api to (re)generate .rst files for the API"
@echo " install-dev to install in editable mode with development dependencies"
@echo " publish to upload dist/* to PyPi"
@echo " setup-pre-commit to setup pre-commit to run every commit."
@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 docs-clean docs-html dist-clean dist
dist:
./setup.py --quiet sdist bdist_wheel --universal test
dist-clean:
rm -rf build dist pulp_smash.egg-info
docs-html: docs-api
@cd docs; $(MAKE) html
docs-clean:
@cd docs; $(MAKE) clean
docs-api:
rm -rf docs/api/*
scripts/gen_api_docs.sh
install-dev:
pip install --upgrade pip
pip install -e .[dev]
make setup-pre-commit
publish: dist
twine upload dist/*
setup-pre-commit:
pre-commit install
pre-commit install-hooks
test:
python3 $(TEST_OPTIONS)
test-coverage:
coverage run --include 'pulp_smash/*' --omit 'pulp_smash/tests/*' $(TEST_OPTIONS)
.PHONY: help all docs-html docs-clean docs-api \
test test-coverage dist-clean publish install-dev setup-pre-commit