cowork: fix packaging-quality tests on Python 3.10 (tomllib compat)#48
Draft
Coding-Dev-Tools wants to merge 1 commit into
Draft
cowork: fix packaging-quality tests on Python 3.10 (tomllib compat)#48Coding-Dev-Tools wants to merge 1 commit into
Coding-Dev-Tools wants to merge 1 commit into
Conversation
The two TestPackagingQuality tests imported tomllib unconditionally, which does not exist before Python 3.11. Since the project declares requires-python = '>=3.10' and classifies 3.10 as supported, the test suite fails on the declared minimum interpreter (CI only exercises 3.11-3.13, so this was invisible there). - test_cli_edge_cases.py: import tomllib with a tomli fallback for 3.10; remove the two inline imports; sort the import block (ruff I001). - pyproject.toml: add 'tomli>=2.0.0; python_version < 3.11' to the dev extra so the fallback resolves on 3.10. Verified: 7/7 in test_cli_edge_cases.py pass on Python 3.10 (were 2 failing); 274 core tests green; ruff check src/ clean.
🤖 Automated Code Review
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two
TestPackagingQualitytests intests/test_cli_edge_cases.pyimportedtomllibunconditionally.tomllibis stdlib only from Python 3.11+, so these tests raiseModuleNotFoundErroron Python 3.10 — a version the project declares as supported (requires-python = '>=3.10'and aProgramming Language :: Python :: 3.10classifier). CI only runs 3.11–3.13, so the failure was invisible in CI but breaks anyone testing on the declared minimum.Changes
tests/test_cli_edge_cases.py: importtomllibwith atomlifallback for 3.10; drop the two inline imports; sort the import block (ruff I001).pyproject.toml: addtomli>=2.0.0; python_version < '3.11'to thedevextra so the fallback resolves on 3.10.Verification
test_cli_edge_cases.py: 7/7 pass on Python 3.10 (was 2 failing).ruff check src/ --target-version py310clean.🤖 cowork repo-improver-rotation