Skip to content

Conversation

@patchmemory
Copy link
Owner

Problem

Two tests were failing because the codebase was using tomllib (Python 3.11+ only) without a fallback for Python 3.10:

  • test_folder_config_precedence_includes_excludes - folder-level .scidk.toml filtering failed
  • test_schema_includes_file_and_folder_after_scan - recursive scan indexing failed

Root Cause

tomllib was added in Python 3.11. On Python 3.10, the import fails silently in exception handlers, causing folder config features to not work at all.

Solution

Add try/except fallback to import tomli (the backport package) on Python < 3.11:

try:
    import tomllib
except ModuleNotFoundError:
    import tomli as tomllib

Changes

  • scidk/core/folder_config.py: Add tomllib/tomli fallback
  • scidk/services/scans_service.py: Add tomllib/tomli fallback
  • tests/init.py: Add missing file to fix module imports
  • Removed: Obsolete pytest-playwright tests (superseded by TypeScript Playwright)

Test Results

✅ All 113 pytest tests now pass on Python 3.10
✅ All 12 Playwright E2E tests pass

Related

Fixes pre-existing bugs that were blocking the E2E task completion workflow.

- Add tests/__init__.py to fix 'ModuleNotFoundError: No module named tests.helpers'
- Remove obsolete pytest-playwright tests (test_graph_features.py, test_scan_workflow.py)
  - These are superseded by TypeScript Playwright tests in e2e/*.spec.ts
  - They reference non-existent 'page_helpers' fixture

Remaining test failures are pre-existing bugs unrelated to E2E work:
- test_folder_config_precedence: folder-level .scidk.toml filtering not working
- test_schema_file_folder: recursive scan not indexing nested files correctly
The folder_config.py and scans_service.py modules were importing tomllib
which only exists in Python 3.11+, causing all folder-level .scidk.toml
filtering to fail silently on Python 3.10.

Changes:
- Add try/except fallback to import tomli (backport) on Python < 3.11
- Fixes test_folder_config_precedence (folder include/exclude patterns)
- Fixes test_schema_file_and_folder (recursive scan indexing)

All 113 pytest tests now pass on Python 3.10.
Changes:
- pyproject.toml: Update requires-python from >=3.10 to >=3.12
- docs/ux-runbook: Update Python requirement from 3.10+ to 3.12+
- scidk/core/folder_config.py: Remove tomli fallback (tomllib built-in since 3.11)
- scidk/services/scans_service.py: Remove tomli fallback

Rationale:
- CI already uses Python 3.12
- bootstrap-dev.sh already requires python3.12
- tomllib is built-in since Python 3.11, no fallback needed for 3.12+
- Simplifies dependency management and removes version inconsistencies
@patchmemory patchmemory merged commit 362dd86 into main Jan 16, 2026
2 checks passed
@patchmemory patchmemory deleted the fix/test-failures-python310 branch January 16, 2026 15:37
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.

2 participants