forked from games-on-whales/inputtino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (39 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
49 lines (39 loc) · 1.72 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
help: ## Show help
@grep -E '^[.a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
clean: ## Clean autogenerated files
rm -rf dist
rm -rf build
rm -rf .venv
find . -type f -name "*.DS_Store" -ls -delete
find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
find . | grep -E ".pytest_cache" | xargs rm -rf
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
find . | grep -E ".ruff_cache" | xargs rm -rf
rm -f .coverage
install: ## Install this project to site-packages
uv sync --reinstall
stubs: install ## Generate stub file.
uv run pybind11-stubgen inputtino._core -o src/
@sed -i 's/def _pybind11_conduit_v1_(\*args, \*\*kwargs):/def _pybind11_conduit_v1_(*args: typing.Any, **kwargs: typing.Any) -> typing.Any:/' src/inputtino/_core.pyi
type: ## Run type check
uv run pyright src
test: ## Run tests
uv run pytest -v --log-level INFO --cov -m "not practical"
test-full: ## Run full test
uv run pytest -v --cov
CPP_FILES=$(shell find src -regex '.*\.\(cpp\|hpp\|cc\|cxx\)')
PYTHON_FILES=$(shell find src -regex '.*\.\(py\|pyi\)')
PYTHON_TEST_FILES=$(shell find tests -regex '.*\.\(py\|pyi\)')
lint: ## Run linter
uv run ruff check . --fix
cppcheck $(CPP_FILES)
cpplint $(CPP_FILES)
format: ## Run formatter
uv run docformatter $(PYTHON_FILES) $(PYTHON_TEST_FILES) --in-place --wrap-summaries=79 --wrap-descriptions=72
uv run pyupgrade --py310-plus $(PYTHON_FILES) $(PYTHON_TEST_FILES)
uv run ruff format .
clang-format --style=Google -i $(CPP_FILES)
run: format lint test type ## Run all workflow.
includes: ## Shows the include directories.
@pybind11-config --includes | tr ' ' '\n' | grep -e '^-I' | sed 's/^-I//'
@echo $(PWD)/../../include