Skip to content

Add lightweight CI for pull requests - #20

Merged
adsharma merged 1 commit into
mainfrom
add-pr-ci
Oct 5, 2026
Merged

adsharma merged 1 commit into
mainfrom
add-pr-ci

Conversation

@adsharma

@adsharma adsharma commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Problem

This repo has no CI on pull requests. The existing build-and-test.yml only runs on pushes to main/testing, releases, and manual dispatch — and it builds full wheels on four platforms, so it's too heavy to run per-PR anyway.

What this adds

New .github/workflows/ci.yml (runs on pull_request, pushes to main, manual dispatch) with two fast jobs:

  • Lint — ruff check . (pinned 0.9.5) + compileall
  • Tests — matrix over Python 3.12/3.13/3.14, installs .[test], smoke-imports pgembed, runs pytest

Supporting changes

  • tests/conftest.py (new): most tests need a live server backed by binaries from make, which a lightweight PR job doesn't build. Such tests now skip with a clear reason when binaries are absent unless marked @pytest.mark.no_server_required. No-op when binaries exist, so build-and-test.yml behavior is unchanged. Verified: 1 passed, 20 skipped on a fresh checkout.
  • Lint fixes: repo had 26 pre-existing ruff violations that would fail the lint job on day one. All trivial/behavior-preserving (unused imports, placeholder-less f-strings, __all__ for re-exports, import pwd next to its platform guard).
  • pyproject.toml: cap test-only sqlalchemy>=2,<2.1 — fresh installs otherwise pull 2.1.x, which breaks sqlalchemy-utils 0.42.1 (latest) at import and errors the whole suite during collection. This also protects the heavy workflow's test step.

Follow-up (needs repo settings, not code)

Mark the new CI workflow as a required status check in branch protection for main.

The existing build-and-test workflow only runs on pushes to
main/testing and releases, and builds full wheels on four platforms,
so PRs get no feedback. Add a fast CI workflow (lint + pytest on
3.12-3.14) that runs on pull requests and pushes to main.

Server-dependent tests skip gracefully when the bundled PostgreSQL
binaries have not been built (see tests/conftest.py); they still run
in build-and-test.yml where the binaries exist.

Also fix the 26 pre-existing ruff violations so the lint job is green,
and cap test-only sqlalchemy to <2.1 since sqlalchemy-utils 0.42.1
(latest) is incompatible with sqlalchemy 2.1 and breaks test
collection on fresh installs.
@adsharma
adsharma added this pull request to stack #22 October 5, 2026 19:57
@adsharma
adsharma merged commit f04a396 into main Oct 5, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant