mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-14 04:59:28 +08:00
The Maturin-based wheel packaging was a historical remnant from when the local gateway launch path and OpenShell CLI were coupled in one binary. The gateway and CLI now ship as standalone artifacts, so the Python distribution should contain only the SDK. Build a single platform-independent setuptools wheel, verify that it cannot contain native code or an openshell entry point, and simplify the release jobs and documentation for SDK-only PyPI installs. Signed-off-by: Simon Scatton <sscatton@nvidia.com>
65 lines
1.8 KiB
TOML
65 lines
1.8 KiB
TOML
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Python development, build, lint, and format tasks
|
|
|
|
["python:dev"]
|
|
description = "Install the Python SDK in development mode"
|
|
depends = ["python:proto"]
|
|
run = "uv sync --group dev"
|
|
hide = true
|
|
|
|
["build:python:wheel"]
|
|
description = "Build the pure-Python SDK wheel"
|
|
depends = ["python:proto"]
|
|
run = """
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
WHEEL_OUTPUT_DIR=${WHEEL_OUTPUT_DIR:-target/wheels}
|
|
rm -rf "$WHEEL_OUTPUT_DIR"
|
|
mkdir -p "$WHEEL_OUTPUT_DIR"
|
|
|
|
uv build --wheel --out-dir "$WHEEL_OUTPUT_DIR"
|
|
|
|
VERIFY_ARGS=()
|
|
if [ -n "${SETUPTOOLS_SCM_PRETEND_VERSION_FOR_OPENSHELL:-}" ]; then
|
|
VERIFY_ARGS+=(--expected-version "$SETUPTOOLS_SCM_PRETEND_VERSION_FOR_OPENSHELL")
|
|
fi
|
|
uv run --no-project python tasks/scripts/verify-python-wheel.py "$WHEEL_OUTPUT_DIR" "${VERIFY_ARGS[@]}"
|
|
"""
|
|
hide = true
|
|
|
|
["python:build"]
|
|
description = "Alias for build:python:wheel"
|
|
depends = ["build:python:wheel"]
|
|
hide = true
|
|
|
|
["python:lint"]
|
|
description = "Lint Python code with ruff"
|
|
depends = ["python:proto"]
|
|
env = { UV_NO_SYNC = "1" }
|
|
run = "uv run ruff check {{vars.python_paths}}"
|
|
hide = true
|
|
|
|
["python:format"]
|
|
description = "Format Python code with ruff"
|
|
run = "uv run ruff format {{vars.python_paths}}"
|
|
hide = true
|
|
|
|
["python:format:check"]
|
|
description = "Check Python formatting with ruff"
|
|
run = "uv run ruff format --check {{vars.python_paths}}"
|
|
hide = true
|
|
|
|
["python:typecheck"]
|
|
description = "Type check Python code with ty"
|
|
depends = ["python:proto"]
|
|
run = "uv run ty check {{vars.python_paths}}"
|
|
hide = true
|
|
|
|
["python:proto"]
|
|
description = "Generate Python protobuf stubs from .proto files"
|
|
run = "uv run --frozen python tasks/scripts/generate_python_proto.py"
|
|
hide = true
|