Skip to content

fix: Python 3.9 compatibility for type annotations - #18

Merged
fdaviddpt merged 1 commit into
Digital-Process-Tools:mainfrom
urilopatin:fix/plugin-cache-compat
Apr 15, 2026
Merged

fdaviddpt merged 1 commit into
Digital-Process-Tools:mainfrom
urilopatin:fix/plugin-cache-compat

Conversation

@urilopatin

Copy link
Copy Markdown
Contributor

Summary

  • All 6 pipeline modules use PEP 604 (str | None) and PEP 585 (list[str], dict[str, str]) type hint syntax, which requires Python 3.10+ at runtime
  • macOS ships Python 3.9 via CommandLineTools, causing TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' on every pipeline import
  • Adds from __future__ import annotations (PEP 563) to all pipeline modules, making annotations lazy strings so the newer syntax works on 3.9 without changing any signatures

Context

Discovered while debugging why the plugin produced only empty/error log files when installed via the Claude Code plugin marketplace on macOS. The path resolution bugs were already fixed by resolve-paths.sh in main, but the Python 3.9 issue remained — the extraction pipeline crashes before it can do anything.

Test plan

  • Verify python3.9 -c "from pipeline.extract import extract_session" succeeds
  • Verify existing test suite passes on Python 3.10+ (no regressions from the future import)
  • Verify save-session.sh --dry produces extracted output on a macOS machine with system Python 3.9

🤖 Generated with Claude Code

All pipeline modules use PEP 604 union syntax (`str | None`) and PEP 585
generic syntax (`list[str]`, `dict[str, str]`) in type annotations. These
require Python 3.10+ at runtime. macOS ships Python 3.9 via CommandLineTools,
causing TypeError on import.

Adding `from __future__ import annotations` (PEP 563) to every pipeline
module makes all annotations lazy strings, so the newer syntax works on 3.9
without changing any signatures.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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