Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.5 KB
/
Copy pathMakefile
File metadata and controls
58 lines (44 loc) · 1.5 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
TEST_SCOPE?=tests/
.PHONY: build build-wheel build-sdist verify-version init-project init test lint_check type_check format format_check precommit clean-build
init-project:
uv sync --all-extras
init: init-project
uv run pre-commit install
test:
uv run pytest $(TEST_SCOPE)
lint_check:
uv run ruff check perception tests
type_check:
uv run mypy perception
format:
uv run black .
format_check:
uv run black --check . || (echo '\nUnexpected format.' && exit 1)
precommit:
uv lock --check
uv run ruff check perception tests
uv run mypy perception
uv run black --check . || (echo '\nUnexpected format.' && exit 1)
uv run pytest $(TEST_SCOPE)
verify-version:
@echo "uv: $$(uv --version)"
@echo "Python: $$(uv run python --version)"
@echo "Git describe: $$(git describe --tags --always)"
clean-build:
@rm -rf build Perception.egg-info
build-wheel:
@rm -rf build Perception.egg-info
@echo "uv: $$(uv --version)"
@echo "Python: $$(uv run python --version)"
@echo "Git describe: $$(git describe --tags --always)"
uv build --wheel --out-dir="dist-tmp" --clear
uv tool run --from repairwheel repairwheel -o dist dist-tmp/*.whl
@find dist -name "*.whl" -type f | sed -n "s/\(.*\)\.linux.*\.whl$$/& \1.whl/p" | xargs -r -n 2 mv # Fix wheel name
@rm -rf dist-tmp
build-sdist:
@rm -rf build Perception.egg-info
@echo "uv: $$(uv --version)"
@echo "Python: $$(uv run python --version)"
@echo "Git describe: $$(git describe --tags --always)"
uv build --sdist --out-dir="dist"
build: build-wheel build-sdist