-
Notifications
You must be signed in to change notification settings - Fork 52
/
Makefile
62 lines (50 loc) · 1.36 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
PACKAGE=trakt
# TEST_RESULTS defines the directory to which test results will be saved.
TEST_RESULTS=
# LINT_RESULTS defines the directory to which linter results will be saved.
LINT_RESULTS=
.PHONY: ci
ci: init style test
.PHONY: clean
clean:
rm -rf dist/
rm -rf build/
rm -rf $(PACKAGE)/*.pyc
rm -rf $(PACKAGE)/__pycache__
rm -rf $(PACKAGE)/__pycache__
rm -rf $(PACKAGE).egg-info
.PHONY: coverage
coverage:
py.test --verbose --cov-report term-missing --cov=$(PACKAGE) -p no:cacheprovider tests
.PHONY: docs-init
docs-init:
python3 -m pip install -r docs/requirements.txt
.PHONY: docs
docs:
cd docs && make html
@echo "\033[95m\n\nBuild successful! View the docs homepage at docs/_build/html/index.html.\n\033[0m"
.PHONY: init
init:
python3 -m pip install -r testing-requirements.txt
.PHONY: publish
publish:
python3 -m pip install -U pip setuptools wheel twine
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
rm -fr build dist .egg $(PACKAGE).egg-info
.PHONY: style
style: clean init
ifeq ($(strip $(LINT_RESULTS)),)
flake8 $(PACKAGE)
else
mkdir -p $(LINT_RESULTS)
flake8 $(PACKAGE) > $(LINT_RESULTS)/linter.out
endif
.PHONY: test
test: clean init
ifeq ($(strip $(TEST_RESULTS)),)
py.test -s --verbose -p no:cacheprovider tests
else
mkdir -p $(LINT_RESULTS)
py.test -s --verbose -p no:cacheprovider tests > $(TEST_RESULTS)/tests.out
endif