-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 1.21 KB
/
Makefile
File metadata and controls
37 lines (29 loc) · 1.21 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
# Export variables
export UID := $(shell id -u)
export GID := $(shell id -g)
# Add a help target to a Makefile that will allow all targets to be self documenting
# https://gist.github.com/prwhite/8168133
all:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
install: ## Install all Python dependencies and pre-commits
@uv sync --all-extras
@.venv/bin/pre-commit install
check: ## Lint, format, and type-check the code
@ruff check --fix
@ruff format
@ty check
profile: ## Run profiling
@python3 -X importtime -m codesectools 1>/dev/null 2>/tmp/import.log || tuna /tmp/import.log
test: ## Run tests in a Docker container
@docker compose build 1>/dev/null
@docker compose run --rm test
test-force: ## Run tests in a Docker container while ignoring any stored state
@docker volume rm codesectools_pytest-cache 2>&1 1>/dev/null || true
@docker volume rm codesectools_cstools-cache 2>&1 1>/dev/null || true
@docker compose build 1>/dev/null
@docker compose run --rm test
test-debug: ## Spawn an interactive shell in the test container to debug
@docker compose build
@docker compose run --rm test /bin/bash
docs-serve: ## Serve the documentation locally
@mkdocs serve --livereload