Skip to content

Weekly uv.lock update #19793

Weekly uv.lock update

Weekly uv.lock update #19793

Workflow file for this run

name: Pull request
on:
pull_request:
branches: [main]
# Concurrency: auto-cancels previous runs when new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
uses: "lgeiger/black-action@master"
with:
args: ". -l 79 --check"
check-version:
name: Check version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: |
uv pip install -e . --system
uv pip install "yaml-changelog>=0.1.7" --system
- name: Build changelog
run: make changelog
Quick-Feedback:
name: Quick Feedback (Selective Tests + Coverage)
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 10 # Need full history for git diff
- name: Fetch base branch
run: |
git fetch origin ${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
# Install core package and its dependencies
uv pip install -e . --system
# Install only coverage for testing (not docs dependencies)
uv pip install coverage --system
- name: Turn off default branching
shell: bash
run: ./update_itemization.sh
- name: Run selective tests based on changed files
env:
PYTHONUNBUFFERED: 1
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_BASE_REF: ${{ github.base_ref }}
run: |
echo "Running selective tests based on changed files..."
python policyengine_us/tests/run_selective_tests.py --base-branch ${{ github.base_ref }} --coverage
- name: Generate coverage report
id: coverage
if: always()
run: |
echo "📊 Coverage Report"
echo "=================="
# Show files below 100% coverage (won't fail CI)
coverage report --fail-under=0 --skip-covered --skip-empty || echo "No coverage data available."
# Count files below 100%
TOTAL_FILES=$(coverage report --skip-covered --skip-empty 2>/dev/null | grep -E "^[a-zA-Z].*\.py " | wc -l || echo "0")
if [ "$TOTAL_FILES" -gt "0" ]; then
echo ""
echo "⚠️ $TOTAL_FILES file(s) have less than 100% coverage"
echo "Consider adding tests to improve coverage."
else
echo ""
echo "✅ All files have 100% coverage!"
fi
# Generate XML for Codecov
coverage xml || echo "No coverage data to generate XML report."
# Expose whether we have coverage for later steps
if [ -f coverage.xml ]; then
echo "has_coverage=true" >> "$GITHUB_OUTPUT"
else
echo "has_coverage=false" >> "$GITHUB_OUTPUT"
fi
- name: Upload coverage to Codecov
if: ${{ always() && steps.coverage.outputs.has_coverage == 'true' }}
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
flags: unittests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Build package
run: uv build
NonStructural-States:
name: Full Suite - States (excl NY) & Python
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --dev
- name: Turn off default branching
shell: bash
run: bash ./update_itemization.sh
- name: Run non-structural YAML tests (states)
env:
PYTHONUNBUFFERED: 1
run: |
echo "Running non-structural YAML tests (states)..."
uv run make test-yaml-no-structural-states
- name: Run Python-based tests
env:
PYTHONUNBUFFERED: 1
run: |
echo "Running Python-based tests..."
uv run make test-other
NonStructural-Other:
name: Full Suite - Baseline (incl NY) & Reform
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --dev
- name: Turn off default branching
shell: bash
run: bash ./update_itemization.sh
- name: Run non-structural YAML tests (other)
env:
PYTHONUNBUFFERED: 1
run: |
echo "Running non-structural YAML tests (other)..."
uv run make test-yaml-no-structural-other
Structural-Heavy:
name: Full Suite - Structural (States)
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --dev
- name: Turn off default branching
shell: bash
run: bash ./update_itemization.sh
- name: Run structural YAML tests (states)
env:
PYTHONUNBUFFERED: 1
run: |
echo "Running structural YAML tests (contrib/states)..."
uv run make test-yaml-structural-heavy
Structural:
name: Full Suite - Structural (Other)
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --dev
- name: Turn off default branching
shell: bash
run: bash ./update_itemization.sh
- name: Run structural YAML tests (other)
env:
PYTHONUNBUFFERED: 1
run: |
echo "Running structural YAML tests (contrib excl states)..."
uv run make test-yaml-structural