Skip to content

fix(tests): read pyproject with tomli on Python 3.10 - #2582

Merged
abrichr merged 1 commit into
mainfrom
grok/fix-wrap-tomllib-py310
Nov 23, 2026
Merged

abrichr merged 1 commit into
mainfrom
grok/fix-wrap-tomllib-py310

Conversation

@abrichr

@abrichr abrichr commented Nov 23, 2026

Copy link
Copy Markdown
Member

Why

Python CI run-ci (ubuntu-latest, 3.10) failed deterministically on main after #2406:

The failure is tests/test_wrap_command.py::test_the_wrap_extra_brings_the_built_in_agent_sdk_and_the_base_stays_lean — ModuleNotFoundError: No module named 'tomllib'. #2406 added that test with a bare import tomllib. tomllib is stdlib only on 3.11+, so 3.10 always fails. The 3.11/3.12 jobs passed. #2580 did not touch this test. PR CI for #2406 ran launcher run-ci on 3.12 only, so it slipped through.

Change

Use the same tomllib / tomli fallback already used by the other launcher tests (for example tests/test_python_support.py). Assertions are unchanged. The test is not skipped or weakened.

Claim: https://github.com/OpenAdaptAI/openadapt-internal/issues/211#issuecomment-7095282964

The wrap extra lean-install check imported tomllib unconditionally.
tomllib is stdlib only on 3.11+, so Python CI run-ci on ubuntu 3.10
failed deterministically after #2406. Use the same tomllib/tomli
fallback as the other launcher tests. Assertions are unchanged.
@abrichr

abrichr commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Claude
Reviewed-Head: 2640afa

This approval holds only if CI passes.

This is a test-only change in tests/test_wrap_command.py. On Python 3.11 and later it imports tomllib, and on 3.10 it falls back to tomli. The fallback is safe on 3.10 CI because pytest itself depends on tomli for Python < 3.11. uv.lock already pins it under the marker python_full_version < '3.11', so no new dependency is needed. The test's assertions are unchanged, and no product code or protected path is touched.

Remaining point (non-blocking): this PR only runs the 3.12 launcher job. The 3.10 path is confirmed only when main's Python CI 3.10 job passes after merge.

@abrichr
abrichr merged commit 4f54159 into main Nov 23, 2026
49 checks passed
@abrichr
abrichr deleted the grok/fix-wrap-tomllib-py310 branch November 23, 2026 08:27
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