Skip to content
Merged
Show file tree
Hide file tree
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
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI (Python)

on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.11", "3.12", "3.13", "3.14" ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
requirements.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Core dev tooling
pip install pytest pytest-cov ruff flake8
# Project deps
pip install -r requirements.txt
# If your package is installable (optional)
if [ -f pyproject.toml ] || [ -f setup.cfg ] || [ -f setup.py ]; then pip install -e .; fi

- name: Lint (ruff)
run: |
# Lint package code and tests
ruff check src/ tests


- name: Run tests (pytest + coverage)
run: |
mkdir -p reports
pytest -q tests \
--maxfail=1 \
--disable-warnings \
--junitxml=reports/junit.xml \
--cov=soa_builder \
--cov-report=xml:reports/coverage.xml \
--cov-report=term-missing

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-py${{ matrix.python-version }}
path: reports/
if-no-files-found: ignore
44 changes: 0 additions & 44 deletions .github/workflows/python-app.yml

This file was deleted.

23 changes: 10 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# Optional: standard formatting/lint hooks
- repo: https://github.com/psf/black
rev: 24.8.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
hooks:
- id: black
- id: ruff-check
args: [ --fix ]
- id: ruff-format

# Local hooks for tests/lint
- repo: local
hooks:
- id: pytest
name: Run pytest
entry: pytest
language: system
types: [python]
pass_filenames: false

# optional: reuse same flake8 config as GitHub Actions
- id: flake8
name: Run flake8
entry: flake8 src/soa_builder tests/
language: system
pass_filenames: false
always_run: true
# Standardize to actual directory structure (underscore)
files: ^(src/|tests/)
1 change: 1 addition & 0 deletions normalize_soa.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- Support rule recurrence expansion into concrete scheduled instances.
- Add endpoints linkage and CRF page mapping.
"""

from __future__ import annotations

import argparse
Expand Down
2 changes: 1 addition & 1 deletion src/soa_builder/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def cmd_expand(
with open(json_out, "w", encoding="utf-8") as f:
json.dump([inst.__dict__ for inst in instances], f, indent=2)
click.echo(
f"Instances written: CSV={csv_out}{' JSON='+json_out if json_out else ''}"
f"Instances written: CSV={csv_out}{' JSON=' + json_out if json_out else ''}"
)


Expand Down
Loading