-
Notifications
You must be signed in to change notification settings - Fork 52
/
Makefile
141 lines (101 loc) · 3.47 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
BIN=venv/bin
default: test
PYTHONVERSION ?=3.11
PYTHON=python$(PYTHONVERSION)
.PHONY: clean
clean:
rm -rf dist
.PHONY: dist
dist:
$(BIN)/python setup.py sdist
.PHONY: test
test:
TEST=true PYTHONPATH=. $(BIN)/pytest --capture sys --show-capture all tests
.PHONY: ci
ci:
CI=true PYTHONPATH=. $(BIN)/pytest --capture sys --show-capture all tests
.PHONY: check
check:
CI=true PYTHONPATH=. $(BIN)/pytest --capture sys --show-capture all -m "not gfx" tests
.PHONY: check-gfx
check-gfx:
PYTHONPATH=. $(BIN)/pytest --capture sys --show-capture all -m "gfx" tests
.PHONY: check-cairo
check-cairo:
PYTHONPATH=. $(BIN)/pytest --capture sys --show-capture all -m "cairo" tests
.PHONY: flake
flake:
$(BIN)/flake8 gopro_overlay/ --count --select=E9,F63,F7,F82 --show-source --statistics
$(BIN)/flake8 gopro_overlay/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
.PHONY: venv
venv: venv/.installed
venv/.installed:
@echo python version is $(PYTHONVERSION)
$(PYTHON) -m venv venv
touch $@
.PHONY: req
req: venv/.installed
$(BIN)/python -m pip install --upgrade pip
$(BIN)/pip install -r requirements-dev.txt
.PHONY: test-publish
test-publish: dist
$(BIN)/pip install twine
$(BIN)/twine check dist/*
$(BIN)/twine upload --non-interactive --repository testpypi dist/*
DIST_TEST=$(realpath tmp/dist-test)
CURRENT_VERSION=$(shell PYTHONPATH=. $(PYTHON) -c 'import gopro_overlay.__version__;print(gopro_overlay.__version__.__version__)')
.PHONY: version
version:
@echo $(CURRENT_VERSION)
.PHONY: test-distribution-install
test-distribution-install: dist
@echo "Current Version is $(CURRENT_VERSION)"
rm -rf $(DIST_TEST)
rm -rf gopro_overlay.egg-info
$(PYTHON) -m venv $(DIST_TEST)/venv
$(DIST_TEST)/venv/bin/pip install wheel dist/gopro-overlay-$(CURRENT_VERSION).tar.gz
$(DIST_TEST)/venv/bin/pip install pycairo==1.23.0
$(DIST_TEST)/venv/bin/pip install pytest
.PHONY: test-distribution-test
test-distribution-test:
PYTHONPATH=. DISTRIBUTION=$(DIST_TEST)/venv $(DIST_TEST)/venv/bin/pytest --capture sys --show-capture all tests-dist
.PHONY: test-distribution
test-distribution: test-distribution-install test-distribution-test
.PHONY: ensure-not-released
ensure-not-released:
build-scripts/ensure-version-not-released.sh $(CURRENT_VERSION)
.PHONY: ensure-pristine
ensure-pristine:
build-scripts/ensure-working-directory-clean.sh
.PHONY: doc-examples
doc-examples:
PYTHONPATH=. $(BIN)/python3 build-scripts/generate-examples.py
.PHONY: doc-map-examples
doc-map-examples:
PYTHONPATH=. $(BIN)/python3 build-scripts/generate-map-examples.py
.PHONY: doc
doc: doc-examples doc-map-examples
.PHONY: publish
publish: ensure-not-released ensure-pristine clean test-distribution
$(BIN)/pip install twine
$(BIN)/twine check dist/*
$(BIN)/twine upload --skip-existing --non-interactive --repository pypi dist/*
git tag v$(CURRENT_VERSION)
.PHONY: bump
bump:
$(BIN)/pip install bumpversion
$(BIN)/bumpversion minor
.PHONY: bump-major
bump-major:
$(BIN)/pip install bumpversion
$(BIN)/bumpversion major
.PHONY: help
help:
PYTHONPATH=. $(BIN)/python bin/gopro-contrib-data-extract.py --help
PYTHONPATH=. $(BIN)/python bin/gopro-cut.py --help
PYTHONPATH=. $(BIN)/python bin/gopro-dashboard.py --help
PYTHONPATH=. $(BIN)/python bin/gopro-extract.py --help
PYTHONPATH=. $(BIN)/python bin/gopro-join.py --help
PYTHONPATH=. $(BIN)/python bin/gopro-rename.py --help
PYTHONPATH=. $(BIN)/python bin/gopro-to-csv.py --help
PYTHONPATH=. $(BIN)/python bin/gopro-to-gpx.py --help