Python 3.14 compatibility for the pcc CLI - #176
Merged
Merged
Conversation
On Python 3.14 (PEP 649), annotations are evaluated lazily against module globals at signature-inspection time. Defining `async def list` and `async def set` at module scope rebinds those names, so by the time Typer inspects an earlier function annotated `list[str]`, the lookup resolves to a `FunctionWithAio` and raises `TypeError: not subscriptable` at CLI import. Rename to non-shadowing identifiers; the user-facing command names are unchanged (each `@*_cli.command(name=...)` is already explicit).
Runs `uv sync` plus `uv run pcc --help` across the supported Python matrix. The help command forces Typer to walk every command's annotations, which is where the previous 3.14 `FunctionWithAio` regression surfaced — `import pipecatcloud` alone would not catch it.
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
list,set). Under Python 3.14 (PEP 649), annotations are evaluated lazily against module globals, so a laterasync def listoverwrote the name before Typer inspected an earliersecrets: list[str]annotation — raisingTypeError: 'FunctionWithAio' object is not subscriptableat CLI import time. User-facing command names are unchanged since each@*_cli.command(name=...)is explicit.python-compatibilityworkflow that matrixes 3.11–3.14, runsuv sync --group dev, thenuv run pcc --help. The help command walks the full Typer command tree, which is exactly the path that surfaced this regression —import pipecatcloudalone would not have.Test plan
python-compatibilityjob passes on all four Python versionstestsandformatjobs still passuv run pcc --helpsucceeds (verified on 3.13)uv run --python 3.14 pcc --helpsucceeds (verified by reporter)uv run pytest tests/test_regions.pypasses (the rename touched one import alias here)🤖 Generated with Claude Code