-
-
Notifications
You must be signed in to change notification settings - Fork 166
/
Makefile
69 lines (49 loc) · 1.78 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
.PHONY: flake8 dist twine twine-test integration-tests env-test network-test black mypy linting mypy-strict bandit bandit-strict
ifeq ($(OS),Windows_NT)
MOCKSPATH := tests\mocks;
INTEGRATION_CONFIG := tests/monitor-windows.ini
else
MOCKSPATH := $(PWD)/tests/mocks:
INTEGRATION_CONFIG := tests/monitor.ini
endif
PIPENV := $(shell which poetry)
flake8:
poetry run flake8 *.py simplemonitor/
integration-tests:
PATH="$(MOCKSPATH)$(PATH)" $(PIPENV) run coverage run monitor.py -1 -v -d -f $(INTEGRATION_CONFIG) -j 1
integration-tests-threaded:
PATH="$(MOCKSPATH)$(PATH)" $(PIPENV) run coverage run monitor.py -1 -v -d -f $(INTEGRATION_CONFIG)
env-test:
env TEST_VALUE=myenv poetry run coverage run --append monitor.py -t -f tests/monitor-env.ini
unit-test:
poetry run pytest --cov-append --cov=simplemonitor --cov-report= tests
network-test:
rm -f master.log
rm -f client.log
poetry run tests/test-network.sh
dist:
rm -f dist/simplemonitor-*
poetry run python setup.py sdist bdist_wheel
twine-test:
poetry run python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
twine:
poetry run python -m twine upload dist/*
black:
poetry run black --check --diff *.py simplemonitor/
mypy:
poetry run mypy *.py simplemonitor/
mypy-strict:
poetry run mypy --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --disallow-untyped-decorators *.py simplemonitor/
bandit:
poetry run bandit -r -ll *.py simplemonitor/
bandit-strict:
poetry run bandit -r -l *.py simplemonitor/
linting: black flake8 mypy bandit
docker-build:
docker build -f docker/monitor.Dockerfile .
docker-compose-build:
docker-compose build
html-bundle:
cd simplemonitor/html && npx webpack
fix-html-tests:
for i in tests/html/*.html; do sed -i -E -e 's/1.12.0/__VERSION__/g' "$$i"; done