Skip to content

chore(scripts): read tooling configuration with tomllib - #813

Merged
yeongseon merged 4 commits into
mainfrom
chore/issue-763-tomllib
Oct 11, 2026
Merged

yeongseon merged 4 commits into
mainfrom
chore/issue-763-tomllib

Conversation

@yeongseon

@yeongseon yeongseon commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Read pyproject.toml through Python 3.11's tomllib in scripts/check_tool_versions.py. Dependency groups, published extras, Ruff scope and Python classifiers now use parsed TOML data. Exact Ruff/Mypy pin validation accepts requirement extras and still rejects missing, ranged or duplicate declarations. Other tooling checks are unchanged.

Scope

Only scripts/check_tool_versions.py and test/test_tool_versions.py change. The tests cover valid TOML formatting, extras, duplicate and ranged pins, missing or incorrectly typed dependency groups, unbounded Alembic requirements, valid dependency-group includes, and the existing drift checks. Exact pin tests now derive their versions from the current configuration. This PR has no file overlap with open PRs #811 and #812.

Validation

  • pytest --noconftest test/test_tool_versions.py -q -k 'not active_environment_agree': 30 passed, 1 deselected.
  • ruff check scripts/check_tool_versions.py test/test_tool_versions.py: passed.
  • ruff format --check scripts/check_tool_versions.py test/test_tool_versions.py: passed.
  • python3.11 -c 'from pathlib import Path; from scripts.check_tool_versions import check, declared_pins; print(declared_pins(Path.cwd())); print(check(Path.cwd()))': returned the current pins and [].
  • git diff --check: passed.
  • Full pytest test/ -m repo could not start locally because SQLAlchemy is not installed; creating a fresh environment was blocked by a PyPI connection error. The direct CLI ran and reported the host's existing Ruff/Mypy versions differ from the repository pins. CI must provide the full repo-test and pinned-environment evidence.

Docs: not needed - this changes only an internal developer-tool parser and preserves the existing configuration policy and public behavior.

Closes #763

Parse dependency groups, optional extras, Ruff scope and Python classifiers structurally for #763.

Cover exact pins with extras, duplicate and ranged pins, malformed groups and valid TOML formatting.
Copilot AI balanced review requested due to automatic review settings October 11, 2026 14:27

Copilot AI 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.

🟡 Changes recommended

Exact pins with valid whitespace are rejected, and several tests remain coupled to current pin versions.

2 open findings
What changed in this PR

Replaces regex-based pyproject.toml inspection with structured tomllib parsing for repository tooling checks.

Changes:

  • Parses dependency groups, extras, Ruff scope, and classifiers structurally.
  • Adds exact-pin validation supporting requirement extras.
  • Expands parser and invalid-configuration tests.
File Description
scripts/​check_tool_versions.py Implements TOML-based tooling validation.
test/​test_tool_versions.py Adds parser and pin-validation coverage.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/check_tool_versions.py Outdated
Comment thread test/test_tool_versions.py Outdated
Use current declared pins in parser tests and reject unbounded Alembic requirements. Refs #763.
Parse valid spaced exact requirements, including extras. Refs #763.
Preserve valid PEP 735 group entries while reading direct tool pins. Refs #763.
@yeongseon

Copy link
Copy Markdown
Contributor Author

Review status: complete for head 1807c50.

Development route: standalone Codex. Copilot submitted a substantive COMMENTED review on 38b0a90; both findings were fixed in 780357f and 3408b38, checked at the final head, and their inline threads are resolved. A separate Codex review identified a valid dependency-group include regression; 1807c50 fixes it with a focused test. An independent final-head review found no actionable regression.

Local focused validation: 30 passed, 1 environment-dependent test deselected; Ruff check and format, direct configuration check and diff check passed. Final-head PR CI is green, including repo-tests, integration, matrix-result, lint, typecheck and security checks. The full repository test command and pinned-tool environment check did not run locally because dependencies could not be installed; CI supplied the required repository-test evidence. No blocking findings or unresolved threads remain.

@yeongseon
yeongseon merged commit e24c278 into main Oct 11, 2026
23 of 24 checks passed
@yeongseon
yeongseon deleted the chore/issue-763-tomllib branch October 11, 2026 14:49
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.

chore(scripts): read pyproject.toml with tomllib in check_tool_versions.py

2 participants