mirror of
https://github.com/katanemo/plano.git
synced 2026-06-05 14:45:15 +02:00
use uv run in validate script for local dev
Falls back to bare python when uv is not available (CI).
This commit is contained in:
parent
9487c085d7
commit
d96a2b32f7
1 changed files with 11 additions and 1 deletions
|
|
@ -1,6 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||||
|
CLI_DIR="$REPO_ROOT/cli"
|
||||||
|
|
||||||
|
# Use uv run if available and cli/ has a pyproject.toml, otherwise fall back to bare python
|
||||||
|
if command -v uv &> /dev/null && [ -f "$CLI_DIR/pyproject.toml" ]; then
|
||||||
|
PYTHON_CMD="uv run --directory $CLI_DIR python"
|
||||||
|
else
|
||||||
|
PYTHON_CMD="python"
|
||||||
|
fi
|
||||||
|
|
||||||
failed_files=()
|
failed_files=()
|
||||||
|
|
||||||
for file in $(find . -name config.yaml -o -name plano_config_full_reference.yaml); do
|
for file in $(find . -name config.yaml -o -name plano_config_full_reference.yaml); do
|
||||||
|
|
@ -14,7 +24,7 @@ for file in $(find . -name config.yaml -o -name plano_config_full_reference.yaml
|
||||||
ENVOY_CONFIG_TEMPLATE_FILE="envoy.template.yaml" \
|
ENVOY_CONFIG_TEMPLATE_FILE="envoy.template.yaml" \
|
||||||
PLANO_CONFIG_FILE_RENDERED="$rendered_file" \
|
PLANO_CONFIG_FILE_RENDERED="$rendered_file" \
|
||||||
ENVOY_CONFIG_FILE_RENDERED="/dev/null" \
|
ENVOY_CONFIG_FILE_RENDERED="/dev/null" \
|
||||||
python -m planoai.config_generator 2>&1 > /dev/null
|
$PYTHON_CMD -m planoai.config_generator 2>&1 > /dev/null
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Validation failed for $file"
|
echo "Validation failed for $file"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue