-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (76 loc) · 2.27 KB
/
Makefile
File metadata and controls
99 lines (76 loc) · 2.27 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
# See https://tech.davis-hansson.com/p/make/
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
##############################################
PYTHON_VERSION = python3.9
VENV_NAME := venv
VENV_BIN := $(VENV_NAME)/bin
ACTIVATE = $(VENV_BIN)/activate
PYTHON = $(VENV_BIN)/python3
$(PYTHON):
> test -d $(VENV_NAME) || $(PYTHON_VERSION) -m venv --upgrade-deps $(VENV_NAME)
venv: $(PYTHON)
install: venv requirements.txt setup.py
> $(PYTHON) -m pip install -r requirements.txt
> $(VENV_BIN)/pre-commit install
lint:
> $(PYTHON) -m flake8 --count --show-source --statistics camera_alignment_core
.PHONY: lint
type-check:
> $(PYTHON) -m mypy --ignore-missing-imports camera_alignment_core
.PHONY: type-check
fmt:
> $(PYTHON) -m black camera_alignment_core
.PHONY: fmt
import-sort:
> $(PYTHON) -m isort camera_alignment_core
.PHONY: import-sort
test:
> $(PYTHON) -m pytest camera_alignment_core/tests/
.PHONY: test
test-exclude-slow:
> $(PYTHON) -m pytest -m "not slow"
.PHONY: test-exclude-slow
clean: # Clear proj dir of all .gitignored files
> git clean -Xfd -e "!.vscode"
.PHONY: clean
docs:
> source $(ACTIVATE) && sphinx-apidoc -f -o docs camera_alignment_core camera_alignment_core/tests
> source $(ACTIVATE) && sphinx-build -b html docs docs/build
.PHONY: docs
docs-serve:
> $(PYTHON) -m http.server --directory docs/build 8080
.PHONY: docs-serve
build: install
> rm -rf dist/
> $(PYTHON) -m build
.PHONY: build
publish: build
> $(PYTHON) -m twine upload --verbose -r release-local dist/*
.PHONY: publish
publish-snapshot: build
> $(PYTHON) -m twine upload --verbose -r snapshot-local dist/*
.PHONY: publish-snapshot
bumpversion-release:
> $(PYTHON) -m bumpversion --list release
.PHONY: bumpversion-release
bumpversion-major:
> $(PYTHON) -m bumpversion --list major
.PHONY: bumpversion-major
bumpversion-minor:
> $(PYTHON) -m bumpversion --list minor
.PHONY: bumpversion-minor
bumpversion-patch:
> $(PYTHON) -m bumpversion --list patch
.PHONY: bumpversion-patch
bumpversion-dev:
> $(PYTHON) -m bumpversion --list devbuild
.PHONY: bumpversion-dev