-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
117 lines (85 loc) · 2.6 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# ============
# Main targets
# ============
# -------------
# Configuration
# -------------
$(eval venvpath := .venv)
$(eval pip := $(venvpath)/bin/pip)
$(eval python := $(venvpath)/bin/python)
$(eval pytest := $(venvpath)/bin/pytest)
$(eval bumpversion := $(venvpath)/bin/bumpversion)
$(eval twine := $(venvpath)/bin/twine)
$(eval sphinx := $(venvpath)/bin/sphinx-build)
$(eval coverage := $(venvpath)/bin/coverage)
$(eval black := $(venvpath)/bin/black)
$(eval isort := $(venvpath)/bin/isort)
$(eval proselint := $(venvpath)/bin/proselint)
$(eval poe := $(venvpath)/bin/poe)
# Setup Python virtualenv
setup-virtualenv:
@test -e $(python) || python3 -m venv $(venvpath)
$(pip) install --requirement=requirements-utils.txt
# -------
# Testing
# -------
# Run the main test suite
test:
@test -e $(pytest) || $(MAKE) install-tests
$(poe) test
test-refresh: install-tests test
test-junit: install-tests
@$(pytest) tests --junit-xml .pytest_results/pytest.xml
test-coverage: install-tests
@$(pytest) tests \
--junit-xml .pytest_results/pytest.xml \
--cov luftdatenpumpe \
--cov-report term-missing \
--cov-report html:.pytest_results/htmlcov \
--cov-report xml:.pytest_results/coverage.xml
# -------
# Release
# -------
# Release this piece of software
# Synopsis:
# make release bump=minor (major,minor,patch)
release: bumpversion push build upload
# ===============
# Utility targets
# ===============
bumpversion: install-releasetools
@$(bumpversion) $(bump)
push:
git push && git push --tags
build:
@$(python) -m build
upload:
$(twine) upload --skip-existing dist/*{.tar.gz,.whl}
install-releasetools: setup-virtualenv
@$(pip) install --quiet --requirement requirements-release.txt --upgrade
install-tests: setup-virtualenv
@$(pip) install --upgrade --editable .[test]
@touch $(venvpath)/bin/activate
@mkdir -p .pytest_results
# ----------------------
# Formatting and linting
# ----------------------
format: setup-virtualenv
$(poe) format
lint: setup-virtualenv
$(poe) lint
# -------
# Project
# -------
mkvar:
mkdir -p var/lib
redis-start: mkvar
docker run --rm -it --publish 6379:6379 redis:7
postgis-start:
docker run --rm -it --publish=5432:5432 --env "POSTGRES_HOST_AUTH_METHOD=trust" postgis/postgis:14-3.3
influxdb-start:
docker run --rm -it --publish=8086:8086 influxdb:1.8
mosquitto-start:
docker run --rm -it --publish=1883:1883 eclipse-mosquitto:2.0.15 mosquitto -c /mosquitto-no-auth.conf
grafana-start:
docker run --rm -it --publish=3000:3000 --env='GF_SECURITY_ADMIN_PASSWORD=admin' grafana/grafana:8.5.15