Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ vars:
PYTHON_PROJECTS:
sh: |
find "$(git rev-parse --show-toplevel)" \
-path "*/.venv" -prune -o \
\( -path "*/.git" -o -path "*/.venv" -o -path "*/target" \) -prune -o \
-name pyproject.toml -print | sort
ACTIVE_PYTHON_PROJECTS:
sh: |
if [ "${TASK_INCLUDE_PYTHON:-}" = "1" ]; then
find "$(git rev-parse --show-toplevel)" \
-path "*/.venv" -prune -o \
\( -path "*/.git" -o -path "*/.venv" -o -path "*/target" \) -prune -o \
-name pyproject.toml -print | sort
fi
RUST_CORE_PACKAGES: >-
Expand All @@ -57,8 +57,12 @@ tasks:
exit 1
fi
echo "{{.DETECTED_LANGUAGES}}"
if [ -n "{{.PYTHON_PROJECTS}}" ] && [ -z "{{.ACTIVE_PYTHON_PROJECTS}}" ]; then
echo "Python manifests detected; set TASK_INCLUDE_PYTHON=1 to include them in build/test/lint."
if [ -n "{{.PYTHON_PROJECTS}}" ]; then
echo "Python projects:"
printf '%s\n' "{{.PYTHON_PROJECTS}}"
if [ -z "{{.ACTIVE_PYTHON_PROJECTS}}" ]; then
echo "Set TASK_INCLUDE_PYTHON=1 to include Python projects in build/test/lint."
fi
fi

check:
Expand Down Expand Up @@ -113,7 +117,13 @@ tasks:
if [ -n "{{.ACTIVE_PYTHON_PROJECTS}}" ]; then
printf '%s\n' "{{.ACTIVE_PYTHON_PROJECTS}}" | while IFS= read -r pyproject; do
project_dir="$(dirname "${pyproject}")"
(cd "${project_dir}" && uv run pytest)
if [ -d "${project_dir}/tests" ] || find "${project_dir}" \
-maxdepth 1 \
-name 'test_*.py' -print -quit | grep -q .; then
(cd "${project_dir}" && uv run --with pytest pytest)
else
echo "Skipping Python tests in ${project_dir}; no top-level tests found."
fi
done
elif [ -n "{{.PYTHON_PROJECTS}}" ]; then
echo "Skipping Python tests by default; set TASK_INCLUDE_PYTHON=1 to include Python projects."
Expand Down Expand Up @@ -144,8 +154,8 @@ tasks:
project_dir="$(dirname "${pyproject}")"
(
cd "${project_dir}" &&
uv run ruff check . &&
uv run ruff format --check .
uv run --with ruff ruff check . &&
uv run --with ruff ruff format --check .
)
done
elif [ -n "{{.PYTHON_PROJECTS}}" ]; then
Expand Down
Loading