-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (48 loc) · 1.56 KB
/
Copy pathMakefile
File metadata and controls
54 lines (48 loc) · 1.56 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
.PHONY: install install-dev install-docs install-hooks test publish build verify-version check format-check lint typecheck format coverage docs docs-serve docs-deploy clean
install:
@uv sync
install-dev:
@uv sync --group dev
install-docs:
@uv sync --group docs --group dev
install-hooks:
@uv run pre-commit install
build:
@uv build
verify-version:
@PKG_VERSION=$$(uv run python -c "ns = {}; exec(open('rocketstruct/_version.py').read(), ns); print(ns['__version__'])"); \
TAG_VERSION=$${GITHUB_REF_NAME#v}; \
if [ "$$PKG_VERSION" != "$$TAG_VERSION" ]; then \
echo "::error::Tag version ($$TAG_VERSION) does not match package version ($$PKG_VERSION)"; \
exit 1; \
fi; \
echo "Version verified: $$PKG_VERSION"
test:
@uv run pytest
publish:
@$(MAKE) build
@twine upload dist/*
check: format-check lint typecheck
format-check:
@uv run ruff format --check
lint:
@uv run ruff check .
typecheck:
@uv run pyright rocketstruct
format:
@uv run ruff format
@uv run ruff check . --fix
coverage:
@uv run pytest --cov=rocketstruct --cov-branch --cov-report=term-missing --cov-report=html --cov-report=xml tests/
docs:
@uv run mkdocs build
docs-serve:
@uv run mkdocs serve --watch rocketstruct
docs-deploy:
@uv run mkdocs build --strict
clean:
@rm -rf build dist htmlcov site .coverage
@find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name '*.egg-info' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name .ruff_cache -exec rm -rf {} + 2>/dev/null || true