This repository has been archived by the owner on May 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
81 lines (62 loc) · 1.9 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
73
74
75
76
77
78
79
80
81
ifndef PHPIPAM_VALIDATE_CERTS
override PHPIPAM_VALIDATE_CERTS = true
endif
ifdef PYPI_REPO
TWINE_OPTIONS = --repository $(PYPI_REPO)
endif
ifdef PYPI_API_TOKEN
TWINE_OPTIONS += --username __token__ --password $(PYPI_API_TOKEN)
endif
ifdef PYPI_DRY_RUN
TWINE_CMD = echo twine
else
TWINE_CMD = twine
endif
default: help
help:
@echo "Please use \`make <target>' where <target> is one of:"
@echo " help - to show this message"
@echo " dist - to build the collection archive"
@echo " lint - to run code linting"
@echo " clean - clean workspace"
@echo " doc-setup - prepare environment for creating documentation"
@echo " doc - create documentation"
@echo " test-setup - prepare environment for tests"
@echo " test-all - run all tests"
@echo " test-<test> - run a specifig test"
@echo " coverage - display code coverage"
@echo " coverage-xml - create xml coverage report"
lint:
flake8 phpypam
dist:
python3 setup.py sdist bdist_wheel
check: dist
$(TWINE_CMD) check dist/*
publish: check
$(TWINE_CMD) upload $(TWINE_OPTIONS) dist/*
release-%:
bumpversion $*
changelog release --$*
clean:
rm -Rf docs/{build,_build} {build,dist} *.egg-info coverage.xml .pytest_cache
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
coverage erase
doc-setup:
pip install --upgrade -r docs/requirements.txt
doc:
install -d -m 750 ./docs/plugins
sphinx-apidoc -M -f -o docs/plugins/ p3eFritzBox
make -C docs html
test-all:
coverage run -m pytest tests/test_cases/* -v
test-%:
coverage run -m pytest tests/test_cases/$*.py -v
coverage: test-all
coverage report -m --include 'phpypam/*','phpypam/**/*','tests/**/*'
coverage-xml: test-all
coverage xml --include 'phpypam/*','phpypam/**/*','tests/**/*'
FORCE:
.PHONY: help dist lint publish FORCE