-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathMakefile
More file actions
147 lines (108 loc) · 3.67 KB
/
Makefile
File metadata and controls
147 lines (108 loc) · 3.67 KB
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
142
143
144
145
146
147
BIN=venv/bin
default: test
PYTHONVERSION ?=3.12
PYTHON=python$(PYTHONVERSION)
.PHONY: clean
clean:
rm -rf build dist *.egg-info
.PHONY: dist
dist:
$(BIN)/pip install --upgrade twine build
$(BIN)/python -m build
.PHONY: test
test:
$(BIN)/pip install -e '.[test]'
TEST=true $(BIN)/pytest --capture sys --show-capture all tests
.PHONY: ci
ci:
$(BIN)/pip install -e '.[test]'
CI=true $(BIN)/pytest --capture sys --show-capture all tests
.PHONY: check
check:
$(BIN)/pip install -e '.[test]'
CI=true $(BIN)/pytest --capture sys --show-capture all -m "not gfx" tests
.PHONY: check-gfx
check-gfx:
$(BIN)/pip install -e '.[test]'
$(BIN)/pytest --capture sys --show-capture all -m "gfx" tests
.PHONY: check-cairo
check-cairo:
$(BIN)/pip install -e '.[test]'
$(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 -e '.[dev,test]'
.PHONY: test-publish
test-publish: dist
$(BIN)/pip install twine
$(BIN)/twine check dist/*
$(BIN)/twine upload --non-interactive --repository testpypi dist/*
DIST_TEST=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)
mkdir -p $(DIST_TEST)
rm -rf gopro_overlay.egg-info
$(PYTHON) -m venv $(DIST_TEST)/venv
$(DIST_TEST)/venv/bin/python -m pip install --upgrade pip
$(DIST_TEST)/venv/bin/pip install "dist/gopro_overlay-$(CURRENT_VERSION).tar.gz[test]"
.PHONY: test-distribution-test
test-distribution-test:
PYTHONPATH=. DISTRIBUTION=$(realpath $(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:
$(BIN)/python3 build-scripts/ensure-version-not-released.py $(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 --upgrade twine
$(BIN)/python -m build
$(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 bump-my-version
$(BIN)/bump-my-version bump minor
.PHONY: bump-major
bump-major:
$(BIN)/pip install bump-my-version
$(BIN)/bump-my-version bump 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