Skip to content

fix(testing): make repository script imports deterministic under pytest - #1091

Merged
seonghobae merged 4 commits into
mainfrom
fix/pytest-repository-path-1090
Aug 24, 2026
Merged

seonghobae merged 4 commits into
mainfrom
fix/pytest-repository-path-1090

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Closes #1090.

Root cause

The committed pytest configuration exposed only python, while tests that materialize repository automation scripts through importlib need the repository root to resolve the scripts namespace. The installed pytest entrypoint therefore failed during collection unless an operator supplied PYTHONPATH=..

A second consistency defect was found while refreshing canonical guidance: pyproject.toml and AGENTS.md require Python >=3.12, but CLAUDE.md still advertised >=3.10 and an incomplete CI support matrix. That stale setup guidance could direct future changes toward an unsupported interpreter floor.

Fix

  • expose . and python through [tool.pytest.ini_options].pythonpath;
  • remove an unused import in the affected deadline regression module;
  • add a repository-guidance regression that reads the authoritative requires-python value from pyproject.toml and requires both AGENTS.md and CLAUDE.md to advertise that same value;
  • align CLAUDE.md with the >=3.12 package floor and CPython 3.12/3.14 required CI matrix;
  • record both deterministic test-environment contracts in the authoritative changelog fragment.

No runtime, numerical, dependency, database, or release-version behavior changes.

Validation discipline

The original one-commit head passed the focused ignored-Rust/deadline suites, Ruff, Interrogate, and git diff --check. Those results are predecessor-head evidence only after the guidance follow-up. Review and merge decisions must use fresh checks and reviews from the current exact head; do not transfer predecessor-head results.

Merge only after the protected required contexts, unresolved-thread requirements, exact-head evidence, and any independent approval required by live governance are terminal and clean. No self-approval or bypass.


Open in Devin Review

@seonghobae
seonghobae enabled auto-merge (squash) August 20, 2026 20:48
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 17 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1feba4bc-a01a-4397-bd15-4609f9fead89

📥 Commits

Reviewing files that changed from the base of the PR and between 04d0bc2 and 767f7a2.

📒 Files selected for processing (5)
  • CLAUDE.md
  • docs/changelog.d/1090-pytest-repository-path.md
  • pyproject.toml
  • tests/test_ignored_rust_subprocess_deadlines.py
  • tests/test_repository_product_boundary_guidance.py

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.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head review request for PR #1091: pytest repository-path configuration fix. Local proof on d9db575: 25 affected shard/deadline tests, 22 statistical/deadline tests, Ruff, Interrogate 100%, and diff check pass without PYTHONPATH. Review only this head against protected main@04d0bc21a2a20693bcf16108cd76d394fe844d23; no runtime or numerical change. @opencode-agent review @cwl-noema-review review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Copy link
Copy Markdown
Contributor Author

Please re-review this exact current head only: d9db575a9c9e6d0da7f509ba3f7f26b45cdbb38c, based on main@04d0bc21a2a20693bcf16108cd76d394fe844d23. Prior review records are predecessor-head evidence and must not transfer. Review-only dispatch requested; do not update the branch or merge via bypass.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please perform a review-only formal review of exact current PR head d9db575a9c9e6d0da7f509ba3f7f26b45cdbb38c. Re-check changed-file scope, current-head findings, unresolved threads, mergeability, and every required Check. Do not reuse a stale review, mutate the branch, self-approve, or merge.

@opencode-agent
opencode-agent Bot disabled auto-merge August 21, 2026 00:22
@seonghobae

Copy link
Copy Markdown
Contributor Author

Current-head review record for d9db575a9c9e6d0da7f509ba3f7f26b45cdbb38c: the change is limited to committed pytest path configuration, removal of an unused test import, and its changelog fragment. The repository root plus python are now configured in tool.pytest.ini_options, which fixes the observed spec-loaded scripts.* import failure without operator-specific PYTHONPATH=.. Focused affected governance/deadline/procurement tests pass (46 passed), Ruff and compileall pass, and git diff --check passes. Full-tree interrogate remains an existing 98.1% baseline outside this three-file change; no production Python file is changed. Review exact current HEAD only; do not transfer predecessor approvals or bypass protected review.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Re-validated the remote agent's current exact HEAD 767f7a2 after fast-forwarding the dedicated worktree. The packaging-floor guidance test now derives requires-python from pyproject.toml and both agent guides assert the same value; no production runtime dependency was added. Focused repository/bounded-script verification: 42 passed; Ruff, compileall, and git diff --check passed. Hosted checks are queued for this exact SHA; current evidence is clean.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Root-cause review: current repository-script tests fail without an operator PYTHONPATH because [tool.pytest.ini_options] exposes only python; this PR correctly makes the committed config authoritative with pythonpath=[".", "python"], and adds a regression contract. It is the prerequisite for docs/figma-adr-boundary-1190 and similar script-import tests. Please re-review exact head 767f7a2 under the protected gate; no bypass or self-approval.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact head 767f7a2 revalidated in a CodeGraph-indexed detached worktree: committed pytest pythonpath=[".", "python"] removes the operator-only import workaround; focused repository/script/Figma regression tests pass (21), and Ruff passes. This remains the prerequisite for script-heavy PRs such as #1130. Please publish fresh protected OpenCode/Noema review evidence when the queued jobs complete; auto-merge remains armed.

@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: bug Defect or incorrect behavior labels Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.


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.

@seonghobae
seonghobae merged commit 070d47d into main Aug 24, 2026
38 checks passed
@seonghobae
seonghobae deleted the fix/pytest-repository-path-1090 branch August 24, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(testing): make repository script imports deterministic under pytest

1 participant