Skip to content

feat(python-sdk): add py.typed marker for PEP 561 type checking support#1298

Open
FisherXZ wants to merge 2 commits intoe2b-dev:mainfrom
FisherXZ:feat/issue-888-py-typed
Open

feat(python-sdk): add py.typed marker for PEP 561 type checking support#1298
FisherXZ wants to merge 2 commits intoe2b-dev:mainfrom
FisherXZ:feat/issue-888-py-typed

Conversation

@FisherXZ
Copy link
Copy Markdown

@FisherXZ FisherXZ commented Apr 28, 2026

Context

Python packages can opt into PEP 561 by shipping a py.typed marker file alongside their source. Without it, type checkers like mypy --strict and pyright treat the package as untyped and suppress all type errors at the import boundary — meaning users get no type safety from e2b even though the SDK ships full annotations.

Issue: #888

Investigation

The e2b Python SDK already ships complete type annotations across all public APIs (sandbox/, sandbox_async/, sandbox_sync/, etc.). The only missing piece was the py.typed marker file that signals to type checkers that the package is typed.

Checked pyproject.toml — no additional configuration needed. The existing:

packages = [{ include = "e2b" }, { include = "e2b_connect" }]

tells Poetry to include the entire e2b/ directory recursively in the built wheel, which picks up py.typed automatically.

Fix

Added an empty py.typed marker file at packages/python-sdk/e2b/py.typed per the PEP 561 spec. No pyproject.toml or __init__.py changes required.

Also includes a pre-existing ruff formatting fix in test_stacktrace.py surfaced by make format.

Test Plan

  • make lint (ruff check + ruff format --check) — passes
  • make typecheck — local Poetry venv has a broken Python 3.13 dylib (pre-existing env issue unrelated to this change); CI should confirm
  • Downstream verification: add e2b to a mypy --strict or pyright project and confirm no Cannot find implementation or library stub errors

🤖 Generated with Claude Code

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 28, 2026

🦋 Changeset detected

Latest commit: bd18fcd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@e2b/python-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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