-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
123 lines (97 loc) · 3.64 KB
/
Copy pathjustfile
File metadata and controls
123 lines (97 loc) · 3.64 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
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Genkit Python SDK — run `just py` to see all available commands.
#
# Usage: just py <command>
#
# Examples:
# just py lint # Lint and type-check all Python code
# just py test # Run all Python tests
# just py sample # Interactive sample runner
# just py fmt # Format Python code
set dotenv-load := true
set shell := ["bash", "-euo", "pipefail", "-c"]
# source_directory() returns the directory of *this* justfile, even when
# invoked as a submodule via `mod py` from the root justfile.
py_dir := source_directory()
top_dir := py_dir
# Default: show available commands.
default:
@just --list --unsorted
# --- Development -------------------------------------------------------
# Lint and type-check all Python code (ruff, ty, pyrefly, pyright).
lint:
uv run --directory "{{ py_dir }}" ruff check --fix --preview --unsafe-fixes .
uv run --directory "{{ py_dir }}" ruff format --preview .
uv run --directory "{{ py_dir }}" ty check .
uv run --directory "{{ py_dir }}" pyrefly check .
uv run --directory "{{ py_dir }}" pyright packages/
# Format Python code with ruff.
fmt:
uv run --directory "{{ py_dir }}" ruff format --preview .
uv run --directory "{{ py_dir }}" ruff check --fix --preview --unsafe-fixes .
# Run all Python tests in the default environment.
test:
uv run --directory "{{ py_dir }}" pytest .
# Run tests across multiple Python versions (3.10–3.14) with nox.
test-nox:
uv run --directory "{{ py_dir }}" nox
# Run security checks (bandit, pip-audit).
security:
"{{ py_dir }}/bin/run_python_security_checks"
# Sync workspace and verify all packages install.
sync:
uv sync --directory "{{ py_dir }}"
uv pip check --directory "{{ py_dir }}"
# Check workspace consistency (versions, naming, deps).
check:
python3 "{{ py_dir }}/scripts/check_consistency.py"
# Check lockfile is up to date.
check-lock:
uv lock --check --directory "{{ py_dir }}"
# Clean build artifacts and caches.
clean:
"{{ py_dir }}/bin/cleanup"
# --- Samples -----------------------------------------------------------
# Run a sample (interactive picker or by name).
sample NAME="":
"{{ py_dir }}/bin/run_sample" {{ NAME }}
# Test flows in a sample.
test-sample NAME="":
"{{ py_dir }}/bin/test_sample_flows" {{ NAME }}
# --- Code Generation ---------------------------------------------------
# Regenerate typing.py from JSON schema.
generate-schema:
"{{ py_dir }}/bin/generate_schema_typing"
# --- Release -----------------------------------------------------------
# Bump version in all packages.
bump-version VERSION:
"{{ py_dir }}/bin/bump_version" {{ VERSION }}
# Build wheel/sdist packages.
build:
"{{ py_dir }}/bin/build_dists"
# Create a GitHub release.
create-release:
"{{ py_dir }}/bin/create_release"
# Publish to PyPI.
publish:
"{{ py_dir }}/bin/publish_pypi.sh"
# Check version consistency across packages.
check-versions:
"{{ py_dir }}/bin/check_versions"
# Validate release documentation.
validate-docs:
"{{ py_dir }}/bin/validate_release_docs"