Skip to content

Add reproducible Python lint and unit checks - #35

Open
justin-replit wants to merge 6 commits into
mainfrom
library-checks/unit
Open

justin-replit wants to merge 6 commits into
mainfrom
library-checks/unit

Conversation

@justin-replit

@justin-replit justin-replit commented Nov 16, 2026 •

Copy link
Copy Markdown

Why

The repository's Semaphore pipeline runs Python 3.10 lint and unit tests, but it has no flake checks. Add reproducible equivalents without removing the existing pipeline or changing releases.

What changed

Adds checks.x86_64-linux.lint and checks.x86_64-linux.unit. Both use Python 3.10 and dependencies selected from the existing Poetry lockfile. The commands remain ruff check src tests and pytest --cov-report term-missing --cov=./src ./tests/unit.

The environment contains runtime dependencies plus the locked Ruff, pytest and coverage tools, not documentation or publishing tools. A small fetcher override uses PyPI's Python-tag wheel redirect instead of poetry2nix's failing literal wheel URL.

Source and dependency filesets keep unrelated files out of the check inputs. The unit output retains its .coverage data.

Expected impact: Nix-based CI can execute and cache the existing lint and unit checks. No hosted speedup is claimed.

Test plan

  • Local Nix builds passed for both checks.
  • Unit tests: 13 passed, 92% statement coverage, Python 3.10.19, pytest 8.0.1, pytest-cov 4.1.0. Ruff remains locked to 0.1.15.
  • A staged unrelated file preserved both derivations. A test-source edit changed both.
  • Reversing one existing assertion failed the unit check with 1 failed and 12 passed. The assertion was restored, the original derivations returned, and nix flake check passed.
  • git diff --check passed.
  • Three manually started cache-hit suites completed in 117.14s, 86.01s, and 182.23s (median 117.14s; maximum 182.23s).
  • One test-source edit executed both checks successfully, including 13 passing unit tests, but its suite took 988.84s after abandoned-worker recovery. This fails the 600s acceptance limit; the failed timing sample is retained.
  • Additional source-edit timing samples were stopped at 1 of 3. Hosted deliberate-failure verification remains incomplete; its temporary probe was removed before verification.
  • All temporary changes were removed. The final tree contains only the flake and lockfile additions, and the restored latest-head manual suite passed in 238.12s with both checks cached.
  • Manual runs do not establish automatic PR triggering or required-check enforcement. Both remain unverified, and comparable Semaphore baseline timings remain unavailable. This is not a completed migration or authorization to remove Semaphore.

Rollout

  • This is fully backward and forward compatible

Semaphore remains unchanged. The existing py38 through py312 integration matrix remains in tox.ini, outside the Semaphore lint/unit workload. Its live storage fixture and cleanup require separate validation; this PR neither runs nor replaces it.

GitHub Actions publishing and manual release commands remain unchanged. No publishing credentials are requested or moved. This additive configuration is safe to revert.

Risk: None. Standard checks: CI and code review cover it.

~ written by ⠕ Replit

@justin-replit
justin-replit requested a review from a team as a code owner November 16, 2026 23:58
@justin-replit
justin-replit requested review from lincoln-replit and removed request for a team November 16, 2026 23:58
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.

2 participants