Skip to content

python: make generated package private - #2202

Open
omidsaffari wants to merge 1 commit into
github:mainfrom
omidsaffari:fix-python-generated-private
Open

python: make generated package private#2202
omidsaffari wants to merge 1 commit into
github:mainfrom
omidsaffari:fix-python-generated-private

Conversation

@omidsaffari

Copy link
Copy Markdown

Why

copilot.generated documents itself as an internal implementation package, but its public-looking name does not follow Python's underscore convention for private modules.

What

  • Rename the generated implementation package to copilot._generated and update internal imports.
  • Keep the documented copilot.rpc and copilot.session_events entry points and their current exports unchanged.
  • Update the Python generator, codegen workflow path filter, and static-analysis exclusions for the new location.
  • Add regression coverage for the private package boundary and preserved public exports.

This intentionally does not curate or otherwise change the existing generated export lists.

The mistakenly exposed copilot.generated import path is removed. Consumers should use the documented copilot.rpc and copilot.session_events modules instead.

Fixes #2048

Validation

  • uv run pytest --ignore=e2e -q — 326 passed
  • uv run pytest test_public_api.py test_codegen_type_names.py test_event_forward_compatibility.py test_tools.py test_rpc_generated.py -q — 64 passed
  • uv run ruff format --check .
  • uv run ruff check .
  • uv run ty check copilot — exits successfully with the two diagnostics already present on main
  • Regenerated Python protocol types and confirmed a second generation produces no diff
  • Built the wheel and confirmed it contains copilot._generated, copilot.rpc, and copilot.session_events, with no copilot.generated package

@omidsaffari
omidsaffari requested a review from a team as a code owner August 1, 2026 09:25
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.

[python] copilot.generated exposed as part of the public API

1 participant