Skip to content

Add Python 3.13 and switch to uv package management #73

Add Python 3.13 and switch to uv package management

Add Python 3.13 and switch to uv package management #73

Workflow file for this run

name: Validate Source Rules
on:
push:
branches:
- main
pull_request:
concurrency:
group: check-${{github.ref}}
cancel-in-progress: true
jobs:
lint:
name: Check Source Code
runs-on: ubuntu-latest
steps:
- name: 📥 Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: 🛠️ Install development tools and dependencies
run: |
pip install -e .[dev]
- name: 🪮 Check source code formatting
id: format
run: |
if ruff format --diff $PKG_DIR; then
echo passed=yes >>"$GITHUB_OUTPUT"
else
echo passed=no >>"$GITHUB_OUTPUT"
echo "::error::source code not formatted"
fi
env:
PKG_DIR: seedbank
- name: 🐜 Check source code lint rules
id: lint
run: |
if ruff check --output-format=github $PKG_DIR; then
echo passed=yes >>"$GITHUB_OUTPUT"
else
echo passed=no >>"$GITHUB_OUTPUT"
echo "::error::source code lint check failed"
fi
env:
PKG_DIR: seedbank
- name: 🧾 Checking lint and format results
run: |
if [ "$FMT_PASSED" = no ]; then
echo "::error::format failed, failing build"
exit 1
fi
if [ "$LINT_PASSED" = no ]; then
if [ "$LINT_REQUIRED" = true ]; then
echo "::error::lint failed, failing build"
exit 2
else
echo "::error::lint failed but non-mandatory"
fi
fi
env:
FMT_PASSED: ${{ steps.format.outputs.passed }}
LINT_PASSED: ${{ steps.lint.outputs.passed }}
LINT_REQUIRED: True
- name: 📐 Check types
id: typecheck
uses: jakebailey/pyright-action@v2
with:
version: PATH
extra-args: seedbank