-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
177 lines (145 loc) Β· 5.19 KB
/
justfile
File metadata and controls
177 lines (145 loc) Β· 5.19 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
uv := require("uv")
project_dir := justfile_directory()
src_dir := project_dir / "helm_sdkpy"
tests_dir := project_dir / "tests"
export PY_COLORS := "1"
export PYTHONBREAKPOINT := "pdb.set_trace"
export PYTHONPATH := project_dir / "helm_sdkpy"
uv_run := "uv run --frozen"
[private]
default:
@just help
# Regenerate uv.lock
[group("dev")]
lock:
uv lock
# Create a development environment
[group("dev")]
env: lock
uv sync --extra dev
# Upgrade uv.lock with the latest dependencies
[group("dev")]
upgrade:
uv lock --upgrade
# Apply coding style standards to code
[group("lint")]
fmt: lock
{{uv_run}} ruff format {{src_dir}} {{tests_dir}}
{{uv_run}} ruff check --fix {{src_dir}} {{tests_dir}}
# Check code against coding style standards
[group("lint")]
lint: lock
{{uv_run}} codespell {{src_dir}}
{{uv_run}} ruff check {{src_dir}}
# Run static type checker on code
[group("lint")]
typecheck: lock
{{uv_run}} pyright
# Build the native Go library using Docker (proper/recommended way)
[group("dev")]
build-lib:
#!/usr/bin/env bash
set -e
echo "==> Building native library using Docker"
docker build --target go-build --tag helm-sdkpy-lib-builder .
docker create --name helm-sdkpy-lib-extract helm-sdkpy-lib-builder
docker cp helm-sdkpy-lib-extract:/build/helm_sdkpy/_lib/. ./helm_sdkpy/_lib/
docker rm helm-sdkpy-lib-extract
echo "==> Library extracted to helm_sdkpy/_lib/"
ls -lh helm_sdkpy/_lib/linux-amd64/
# Run unit tests with coverage
[group("test")]
unit: lock build-lib
{{uv_run}} pytest {{tests_dir}} --cov={{src_dir}} --cov-report=term-missing
# Build helm-sdkpy wheel using Docker
build-wheel:
./scripts/build_wheel_docker.sh
# Install Docusaurus dependencies
[group("docusaurus")]
docs-install:
@echo "π¦ Installing Docusaurus dependencies..."
cd docusaurus && yarn install
# Start Docusaurus development server
[group("docusaurus")]
docs-dev: docs-install
@echo "π Starting Docusaurus development server..."
cd docusaurus && yarn start
# Start Docusaurus development server on specific port
[group("docusaurus")]
docs-dev-port port="3000": docs-install
@echo "π Starting Docusaurus development server on port {{port}}..."
cd docusaurus && yarn start --port {{port}}
# Build Docusaurus for production
[group("docusaurus")]
docs-build: docs-install
@echo "ποΈ Generating API documentation from source..."
uv run python3 ./docusaurus/scripts/generate-api-docs.py
@echo "ποΈ Building Docusaurus for production..."
cd docusaurus && yarn build
# Generate API documentation from SDK source code
[group("docusaurus")]
docs-generate-api:
@echo "π Generating API documentation from source..."
{{uv_run}} python3 ./docusaurus/scripts/generate-api-docs.py
# Serve built Docusaurus site locally
[group("docusaurus")]
docs-serve: docs-build
@echo "π Serving built Docusaurus site..."
cd docusaurus && yarn serve
# Clean Docusaurus build artifacts
[group("docusaurus")]
docs-clean:
@echo "π§Ή Cleaning Docusaurus build artifacts..."
cd docusaurus && rm -rf build .docusaurus
# Show available documentation commands
[group("docusaurus")]
docs-help:
@echo "π Docusaurus Commands:"
@echo " docs-install - Install dependencies"
@echo " docs-dev - Start development server"
@echo " docs-dev-port - Start dev server on specific port"
@echo " docs-build - Build for production (includes API docs generation)"
@echo " docs-generate-api - Generate API docs from SDK source"
@echo " docs-serve - Serve built site"
@echo " docs-clean - Clean build artifacts"
# Release helm-sdkpy with a new version
# Usage: just release 0.0.21
[group("release")]
release version:
#!/usr/bin/env bash
set -euo pipefail
echo "π Releasing helm-sdkpy version {{version}}..."
# Create release branch
echo "πΏ Creating release branch release/{{version}}..."
git checkout -b "release/{{version}}"
# Bump pyproject.toml version
echo "π Updating pyproject.toml..."
sed -i 's/^version = ".*"/version = "{{version}}"/' pyproject.toml
# Update docusaurus version.yml if it exists
if [ -f "docusaurus/data/version.yml" ]; then
echo "π Updating docusaurus/data/version.yml..."
sed -i 's/^version: .*/version: "{{version}}"/' docusaurus/data/version.yml
fi
# Regenerate lock file
echo "π Regenerating uv.lock..."
uv lock --no-cache
# Commit changes
echo "π¦ Committing version bump..."
git add pyproject.toml uv.lock
if [ -f "docusaurus/data/version.yml" ]; then
git add docusaurus/data/version.yml
fi
git commit -m "chore: bump version to {{version}}"
# Push release branch
echo "π Pushing release branch..."
git push origin "release/{{version}}"
sleep 1
# Create tag
echo "π·οΈ Creating tag..."
git tag -a "v{{version}}" -m "helm-sdkpy release version {{version}}"
# Push tag
echo "π Pushing tag..."
git push origin "v{{version}}"
echo "β
Released helm-sdkpy version {{version}}"
echo " Branch: release/{{version}}"
echo " Tag: v{{version}}"