Skip to content

cowork: fix packaging-quality tests on Python 3.10 (tomllib compat)#48

Draft
Coding-Dev-Tools wants to merge 1 commit into
masterfrom
cowork/improve-envault
Draft

cowork: fix packaging-quality tests on Python 3.10 (tomllib compat)#48
Coding-Dev-Tools wants to merge 1 commit into
masterfrom
cowork/improve-envault

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Summary

Two TestPackagingQuality tests in tests/test_cli_edge_cases.py imported tomllib unconditionally. tomllib is stdlib only from Python 3.11+, so these tests raise ModuleNotFoundError on Python 3.10 — a version the project declares as supported (requires-python = '>=3.10' and a Programming Language :: Python :: 3.10 classifier). 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: import tomllib with a tomli fallback for 3.10; drop 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.

Verification

  • test_cli_edge_cases.py: 7/7 pass on Python 3.10 (was 2 failing).
  • 274 core tests green; all 474 collect without import errors.
  • ruff check src/ --target-version py310 clean.

🤖 cowork repo-improver-rotation

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.
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🤖 Automated Code Review

⚠️ Ruff Lint — 8 issue(s)

::error title=ruff (I001),file=/home/runner/work/envault/envault/_qa_repro_test.py,line=2,endLine=5::_qa_repro_test.py:2:1: I001 Import block is un-sorted or un-formatted%0A  help: Organize imports
::error title=ruff (I001),file=/home/runner/work/envault/envault/_qa_test_scan.py,line=2,endLine=5::_qa_test_scan.py:2:1: I001 Import block is un-sorted or un-formatted%0A  help: Organize imports
::error title=ruff (E402),file=/home/runner/work/envault/envault/_qa_test_scan.py,line=35,col=1,endLine=35,endColumn=21::_qa_test_scan.py:35:1: E402 Module level import not at top of file
::error title=ruff (I001),file=/home/runner/work/envault/envault/tests/test_encrypt_formats.py,line=7,endLine=9::tests/test_encrypt_formats.py:7:1: I001 Import block is un-sorted or un-formatted%0A  help: Organize imports
::error title=ruff (I001),file=/home/runner/work/envault/envault/tests/test_encrypt_secret_formats.py,line=7,endLine=10::tests/test_encrypt_secret_formats.py:7:1: I001 Import block is un-sorted or un-formatted%0A  help: Organize imports
::error title=ruff (I001),file=/home/runner/work/envault/envault/tests/test_history.py,line=3,endLine=7::tests/test_history.py:3:1: I001 Import block is un-sorted or un-formatted%0A  help: Organize imports
::error title=ruff (F403),file=/home/runner/work/envault/envault/tests/test_history.py,line=6,col=1,endLine=6,endColumn=30::tests/test_history.py:6:1: F403 `from envault.history import *` used; unable to detect undefined names
::error title=ruff (I001),file=/home/runner/work/envault/envault/tests/test_security_audit.py,line=3,endLine=12::tests/test_security_audit.py:3:1: I001 Import block is un-sorted or un-formatted%0A  help: Organize imports

⚠️ Ruff Format — Formatting needed

Would reformat: _qa_repro_test.py
Would reformat: _qa_test_scan.py
Would reformat: src/envault/audit.py
Would reformat: src/envault/auth.py
Would reformat: src/envault/backup.py
Would reformat: src/envault/cli.py
Would reformat: src/envault/config.py
Would reformat: src/envault/diff.py
Would reformat: src/envault/encrypt.py
Would reformat: src/envault/history.py
Would reformat: src/envault/rotate.py
Would reformat: src/envault/security_audit.py
Would reformat: src/envault/serve.py
Would reformat: src/envault/stores/__init__.py
Would reformat: src/envault/sync.py
Would reformat: tests/test_cli.py
Would reformat: tests/test_cli_edge_cases.py
Would reformat: tests/test_coverage_gaps.py
Would reformat: tests/test_encrypt_formats.py
Would reformat: tests/test_encrypt_secret_formats.py
Would reformat: tests/test_envault.py
Would reformat: tests/test_lint_regression.py
Would reformat: tests/test_security_audit.py
Would reformat: tests/test_serve.py
Would reformat: tests/test_stores_integration.py
Would reformat: tests/test_sync_coverage.py
26 files would be reformatted, 3 files already formatted

🔴 Secret Detection — 1 potential secret(s)

  src/envault/serve.py:36 — Secret Keyword

✅ Large Files — Within limits

📊 Diff Stats — 2 file(s) changed

 pyproject.toml               |  1 +
 tests/test_cli_edge_cases.py | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

Verdict: 🔴 Changes Requested — Potential secrets detected. Do not merge.

Automated by Coding-Dev-Tools/.github reusable workflow.

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