This repository was archived by the owner on Jan 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile
More file actions
128 lines (102 loc) · 4.29 KB
/
Makefile
File metadata and controls
128 lines (102 loc) · 4.29 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
PKG_TARGETS = $(subst packages/,,$(wildcard packages/*))
# Help target
.PHONY: help
help:
@echo "Jumpstarter Makefile Help"
@echo "=========================="
@echo ""
@echo "Build targets:"
@echo " build - Build all packages"
@echo " protobuf-gen - Generate code from protobuf definitions"
@echo " sync - Sync all packages and extras"
@echo ""
@echo "Documentation targets:"
@echo " docs - Build HTML documentation with warnings as errors"
@echo " docs-singlehtml - Build single HTML page documentation"
@echo " docs-all - Build multiversion documentation"
@echo " docs-serve - Build and serve documentation locally"
@echo " docs-serve-all - Build and serve multiversion documentation locally"
@echo " docs-linkcheck - Check documentation links"
@echo ""
@echo "Testing targets:"
@echo " test - Run all package tests and documentation tests"
@echo " pkg-test-all - Run tests for all packages"
@echo " pkg-test-<pkg> - Run tests for a specific package"
@echo " docs-test - Run documentation tests"
@echo ""
@echo "Linting and type checking:"
@echo " ty - Run ty type checking on all packages"
@echo " pkg-ty-all - Run ty on all packages"
@echo " pkg-ty-<pkg> - Run ty on a specific package"
@echo " lint - Run ruff linter"
@echo " lint-fix - Run ruff linter with auto-fix"
@echo ""
@echo "Cleaning targets:"
@echo " clean - Run all clean targets"
@echo " clean-venv - Clean virtual environment"
@echo " clean-build - Clean build artifacts"
@echo " clean-test - Clean test artifacts"
@echo " clean-docs - Clean documentation build"
default: help
docs-singlehtml:
uv run --isolated --all-packages --group docs $(MAKE) -C docs singlehtml
docs:
uv run --isolated --all-packages --group docs $(MAKE) -C docs html SPHINXOPTS="-W --keep-going -n"
docs-all:
uv run --isolated --all-packages --group docs $(MAKE) -C docs multiversion
docs-serve: clean-docs
uv run --isolated --all-packages --group docs $(MAKE) -C docs serve
docs-serve-all: clean-docs docs-all
uv run --isolated --all-packages --group docs $(MAKE) -C docs serve-multiversion
docs-test:
uv run --isolated --all-packages --group docs $(MAKE) -C docs doctest
docs-linkcheck:
uv run --isolated --all-packages --group docs $(MAKE) -C docs linkcheck
pkg-test-%: packages/%
uv run --isolated --directory $< pytest || [ $$? -eq 5 ]
pkg-ty-%: packages/%
uv run --isolated --directory $< ty check .
pkg-test-all: $(addprefix pkg-test-,$(PKG_TARGETS))
pkg-ty-all: $(addprefix pkg-ty-,$(PKG_TARGETS))
build:
uv build --all --out-dir dist
protobuf-gen:
podman run --volume "$(shell pwd):/workspace" --workdir /workspace docker.io/bufbuild/buf:latest generate
# Fix Python imports: convert absolute imports to relative imports
# In jumpstarter/client/v1: from jumpstarter.v1 import -> from ...v1 import
find packages/jumpstarter-protocol/jumpstarter_protocol/jumpstarter/client/v1 -name "*_pb2*.py" -type f -exec sed -i.bak \
-e 's|^from jumpstarter\.v1 import|from ...v1 import|g' \
-e 's|^from jumpstarter\.client\.v1 import|from . import|g' \
{} \; -exec rm {}.bak \;
# In jumpstarter/v1: from jumpstarter.v1 import -> from . import
find packages/jumpstarter-protocol/jumpstarter_protocol/jumpstarter/v1 -name "*_pb2*.py" -type f -exec sed -i.bak \
-e 's|^from jumpstarter\.v1 import|from . import|g' \
{} \; -exec rm {}.bak \;
sync:
uv sync --all-packages --all-extras
clean-venv:
-rm -rf ./.venv
-find . -type d -name __pycache__ -exec rm -r {} \+
clean-build:
-rm -rf dist
clean-test:
-rm -f .coverage
-rm -f coverage.xml
-rm -rf htmlcov
clean-docs:
uv run --isolated --all-packages --group docs $(MAKE) -C docs clean
clean: clean-docs clean-venv clean-build clean-test
test: pkg-test-all docs-test
ty: pkg-ty-all
lint:
uv run ruff check
lint-fix:
uv run ruff check --fix
.PHONY: default help docs docs-all docs-serve docs-serve-all docs-clean docs-test \
docs-linkcheck pkg-test-all pkg-ty-all build generate sync \
clean-venv clean-build clean-test clean-all test-all ty-all docs \
lint lint-fix \
pkg-ty-jumpstarter \
pkg-ty-jumpstarter-cli-admin \
pkg-ty-jumpstarter-kubernetes \
pkg-ty-jumpstarter-protocol