Skip to content

ci: add GitHub Actions CI workflow with python matrix#82

Open
chaitanyamedidar wants to merge 2 commits intoAOSSIE-Org:mainfrom
chaitanyamedidar:ci/github-actions-workflow
Open

ci: add GitHub Actions CI workflow with python matrix#82
chaitanyamedidar wants to merge 2 commits intoAOSSIE-Org:mainfrom
chaitanyamedidar:ci/github-actions-workflow

Conversation

@chaitanyamedidar
Copy link

@chaitanyamedidar chaitanyamedidar commented Mar 21, 2026

Addressed Issues:

Repair and Enhance CI workflow with test job and python workflow

fixes the broken existing ci.yml which had
no test job, no matrix strategy, and a broken uv-based install

The existing ci.yml had several problems:

  • Only ran ruff, no test job at all
  • Hardcoded to Python 3.10 only, no matrix
  • Used uv sync --locked which failed to resolve dev dependencies declared under [dependency-groups] (PEP 735) when using pip
  • Overly complex conditional ruff-on-changed-files logic that was brittle

Screenshots/Recordings:

Additional Notes:

This PR replaces it with a clean, minimal workflow that:

  • Runs on push and PR to main
  • Tests across Python 3.10, 3.11, 3.12 via matrix strategy
  • Uses standard pip with pip install -e ".[dev]"
  • Adds [project.optional-dependencies] to pyproject.toml so the
    above install command resolves correctly alongside the existing
    [dependency-groups] block which uv contributors can still use
  • Runs ruff check then full pytest suite on every run
  • Caches pip dependencies keyed on OS along with Python version and pyproject.toml hash

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • Chores
    • CI updated: renamed job, expanded Python matrix (3.9–3.12), disabled fail-fast, added caching for package installer, and unified test execution.
    • Linting simplified to run code checks across the codebase rather than per-change.
    • Development extras added to project metadata for testing and code analysis tools.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2026

Walkthrough

Renamed CI job to test, added Python matrix (3.9–3.12), switched setup to actions/setup-python@v5, added pip cache, replaced uv provisioning with pip install -e ".[dev]", simplified Ruff invocation to ruff check openverifiablellm/, and added pytest test execution. Added project.optional-dependencies dev extras with pytest and ruff in pyproject.toml.

Changes

Cohort / File(s) Summary
CI Workflow
​.github/workflows/ci.yml
Renamed job linttest; added Python matrix 3.9, 3.10, 3.11, 3.12 and fail-fast: false; switched to actions/setup-python@v5; added actions/cache@v4 caching ~/.cache/pip keyed by OS, python-version, and pyproject.toml; replaced uv install/sync with pip install -e ".[dev]"; removed conditional per-PR Ruff steps and now runs ruff check openverifiablellm/; added pytest tests/ -v --tb=short step.
Project Configuration
pyproject.toml
Added [project.optional-dependencies].dev extra listing pytest>=7.0 and ruff>=0.15.4, duplicating existing dev entries for tool compatibility (commented).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Python Lang, Linter

Poem

🐰 I hopped through lines of YAML bright,
Installing devs by pip tonight,
Four Pythons chase each failing test,
Ruff polishes the code to best,
A little hop — CI sleeps tight.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: add GitHub Actions CI workflow with python matrix' directly and accurately summarizes the main change—introducing a new GitHub Actions CI workflow with Python version matrix support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pyproject.toml (1)

29-33: 🧹 Nitpick | 🔵 Trivial

Keep optional-dependencies and dependency-groups in sync.

The dev dependencies are now declared in both [project.optional-dependencies] (for pip) and [dependency-groups] (for uv/PEP 735). This duplication is intentional per the PR description, but consider adding a comment noting they should stay synchronized to prevent future drift.

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

In `@pyproject.toml` around lines 29 - 33, Add a short explanatory comment near
the duplicated dependency definitions to remind future maintainers to keep them
synchronized: annotate the [project.optional-dependencies] "dev" entry and the
[dependency-groups] "dev" entry with a one-line comment stating they are
intentionally duplicated and must be kept in sync (mentioning pip vs PEP
735/uv). This uses the existing "dev" key in both sections to make the intent
explicit and prevent drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 12-14: CI tests currently target python-version in the GitHub
Actions matrix ["3.10","3.11","3.12"] while pyproject.toml declares
requires-python = ">=3.9"; update the CI matrix to include "3.9" (add "3.9" to
the python-version array in the workflow strategy.matrix) so the declared
minimum supported Python is tested, or alternatively change the requires-python
in pyproject.toml to ">=3.10" if you intend to drop 3.9 support—adjust either
the python-version matrix entry or the requires-python value accordingly.
- Around line 12-14: The CI matrix currently uses the strategy.matrix
(python-version: ["3.10", "3.11", "3.12"]) which defaults to fail-fast; add a
fail-fast: false setting under the strategy block so the workflow runs all
matrix jobs even if one fails. Locate the strategy -> matrix configuration and
insert fail-fast: false at the same level as matrix (i.e., sibling to matrix) to
ensure all Python-version jobs complete and report results.

---

Outside diff comments:
In `@pyproject.toml`:
- Around line 29-33: Add a short explanatory comment near the duplicated
dependency definitions to remind future maintainers to keep them synchronized:
annotate the [project.optional-dependencies] "dev" entry and the
[dependency-groups] "dev" entry with a one-line comment stating they are
intentionally duplicated and must be kept in sync (mentioning pip vs PEP
735/uv). This uses the existing "dev" key in both sections to make the intent
explicit and prevent drift.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5564687a-6129-4163-a371-f4c9e8396587

📥 Commits

Reviewing files that changed from the base of the PR and between 578bc79 and ec48e41.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • pyproject.toml

@github-actions github-actions bot added size/M and removed size/M labels Mar 21, 2026
@github-actions github-actions bot added size/M and removed size/M labels Mar 21, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pyproject.toml`:
- Around line 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.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6738bce5-3e28-454a-9b12-86b40a9f3c8e

📥 Commits

Reviewing files that changed from the base of the PR and between ec48e41 and f3101f5.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • pyproject.toml

Comment on lines +20 to +26
# 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",
]
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants