Skip to content
Open
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
62 changes: 26 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,34 @@ on:
branches: [main]

jobs:
lint:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
fetch-depth: 0
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Cache pip dependencies
uses: actions/cache@v4
with:
version: "0.10.8"
enable-cache: true


- name: Set up Python
run: uv python install 3.10 && uv venv --python 3.10

- name: Install dependencies
run: uv sync --locked

- name: Run Ruff Check
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin main
git diff --diff-filter=ACMR --name-only -z origin/main...HEAD -- '*.py' \
| xargs -0 -r uv run ruff check --
else
uv run ruff check .
fi

- name: Run Ruff Format
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin main
git diff --diff-filter=ACMR --name-only -z origin/main...HEAD -- '*.py' \
| xargs -0 -r uv run ruff format --check --
else
uv run ruff format --check .
fi
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-

- name: Install package and dev dependencies
run: pip install -e ".[dev]"

- name: Run linter
run: ruff check openverifiablellm/

- name: Run tests
run: pytest tests/ -v --tb=short
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,19 @@ dependencies = [
"tokenizers==0.15.2"
]

# Intentionally duplicated from [dependency-groups] below.
# pip uses this section; uv/PEP 735 uses [dependency-groups]. Keep both in sync.
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"ruff>=0.15.4",
]
Comment on lines +20 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Protect the duplicated dev dependency lists from drift.

[project.optional-dependencies].dev and [dependency-groups].dev are now separate sources of truth. Comments alone won't prevent them from diverging, and once they do CI and local development will resolve different toolchains. Add a small parity check in CI or a helper script so mismatches fail fast.

Also applies to: 31-37

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` around lines 20 - 26, Add an automated parity check so the
duplicated dev lists in pyproject.toml cannot drift: implement a small script
(e.g., check_dev_deps) that parses pyproject.toml, compares the arrays at
[project.optional-dependencies].dev and [dependency-groups].dev (or equivalent
keys), and exits non‑zero with a clear message if they differ; wire that script
into CI as a pre-merge job so mismatches fail fast. Locate the two sections by
their section names in the file (project.optional-dependencies and
dependency-groups) and ensure the check normalizes ordering/quotes before
comparing to avoid false positives.


[tool.setuptools.packages.find]
include = ["openverifiablellm*"]

# Intentionally duplicated from [project.optional-dependencies] above.
# uv/PEP 735 uses this section; pip uses [project.optional-dependencies]. Keep both in sync.
[dependency-groups]
dev = [
"pytest>=7.0",
Expand Down
Loading