feat(python-sdk): add py.typed marker for PEP 561 type checking support#1298
Open
FisherXZ wants to merge 2 commits intoe2b-dev:mainfrom
Open
feat(python-sdk): add py.typed marker for PEP 561 type checking support#1298FisherXZ wants to merge 2 commits intoe2b-dev:mainfrom
FisherXZ wants to merge 2 commits intoe2b-dev:mainfrom
Conversation
Closes e2b-dev#888 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: bd18fcd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
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.
Context
Python packages can opt into PEP 561 by shipping a
py.typedmarker file alongside their source. Without it, type checkers likemypy --strictandpyrighttreat the package as untyped and suppress all type errors at the import boundary — meaning users get no type safety frome2beven though the SDK ships full annotations.Issue: #888
Investigation
The
e2bPython SDK already ships complete type annotations across all public APIs (sandbox/,sandbox_async/,sandbox_sync/, etc.). The only missing piece was thepy.typedmarker file that signals to type checkers that the package is typed.Checked
pyproject.toml— no additional configuration needed. The existing:tells Poetry to include the entire
e2b/directory recursively in the built wheel, which picks uppy.typedautomatically.Fix
Added an empty
py.typedmarker file atpackages/python-sdk/e2b/py.typedper the PEP 561 spec. Nopyproject.tomlor__init__.pychanges required.Also includes a pre-existing
ruffformatting fix intest_stacktrace.pysurfaced bymake format.Test Plan
make lint(ruff check+ruff format --check) — passesmake typecheck— local Poetry venv has a broken Python 3.13 dylib (pre-existing env issue unrelated to this change); CI should confirme2bto amypy --strictorpyrightproject and confirm noCannot find implementation or library stuberrors🤖 Generated with Claude Code