-
Notifications
You must be signed in to change notification settings - Fork 902
Fix Python SDK type issues with ty type checker #1122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0f6e130
Fix Python SDK type issues with ty type checker
mishushakov 71716b3
Remove invalid overloads for class_method_variant methods
mishushakov af0f97b
Replace type: ignore[invalid-argument-type] with proper fixes
mishushakov b68fb31
fix: rename _cls_connect to _cls_connect_sandbox to fix invalid-metho…
mishushakov 0a9376e
refactor: clean up SandboxCreateResponse construction
mishushakov 9579ac6
refactor: use res.parsed directly instead of local alias
mishushakov 6e169f7
chore: add ty type checker as dev dependency
mishushakov 5a41999
fix: use None instead of empty string for missing envd_access_token
mishushakov c090080
feat: add overloads for class_method_variant methods
mishushakov a397a4a
fix: use @classmethod overloads for basedpyright compatibility
mishushakov ccf8f2a
docs: restore docstrings on overloaded method variants
mishushakov 9e8f1cf
fix: use @staticmethod overloads to avoid reportInconsistentOverload
mishushakov c6995c1
fix: suppress reportInconsistentOverload in basedpyright config
mishushakov cadbcfc
ci: add typecheck workflow and pnpm typecheck script
mishushakov bf2e5e7
chore: remove typecheck script from apps/web
mishushakov 4be79c5
Potential fix for code scanning alert no. 14: Workflow does not conta…
mishushakov 5ddeb44
fix: resolve 57 ty type checker diagnostics
mishushakov 0a32a6c
Merge branch 'main' into mishushakov/fix-ty-type-errors
mishushakov bc834ca
added changeset
mishushakov ce1799a
Merge branch 'main' into mishushakov/fix-ty-type-errors
mishushakov be1f50b
fix: restore mcp falsy-check semantics and simplify sandbox_url access
mishushakov f664028
Merge branch 'main' into mishushakov/fix-ty-type-errors
mishushakov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: Typecheck | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| typecheck: | ||
| name: Typecheck | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Parse .tool-versions | ||
| uses: wistia/parse-tool-versions@v2.1.1 | ||
| with: | ||
| filename: '.tool-versions' | ||
| uppercase: 'true' | ||
| prefix: 'tool_version_' | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: '${{ env.TOOL_VERSION_PNPM }}' | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '${{ env.TOOL_VERSION_NODEJS }}' | ||
| cache: pnpm | ||
|
|
||
| - name: Configure pnpm | ||
| run: | | ||
| pnpm config set auto-install-peers true | ||
| pnpm config set exclude-links-from-lockfile true | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '${{ env.TOOL_VERSION_PYTHON }}' | ||
|
|
||
| - name: Install and configure Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| version: '${{ env.TOOL_VERSION_POETRY }}' | ||
| virtualenvs-create: true | ||
| virtualenvs-in-project: true | ||
| installer-parallel: true | ||
|
|
||
| - name: Install Python dependencies | ||
| working-directory: packages/python-sdk | ||
| run: | | ||
| poetry install --with dev | ||
|
|
||
| - name: Run typecheck | ||
| run: | | ||
| pnpm run typecheck | ||
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
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,7 +31,7 @@ class SandboxCreateResponse: | |||||||
| sandbox_id: str | ||||||||
| sandbox_domain: Optional[str] | ||||||||
| envd_version: str | ||||||||
| envd_access_token: str | ||||||||
| envd_access_token: Optional[str] | ||||||||
| traffic_access_token: Optional[str] | ||||||||
|
|
||||||||
|
|
||||||||
|
|
@@ -135,7 +135,7 @@ def __init__( | |||||||
| "transport": transport, | ||||||||
| }, | ||||||||
| headers=headers, | ||||||||
| token=token, | ||||||||
| token=token or "", | ||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is fine E2B/packages/python-sdk/e2b/api/client/client.py Lines 265 to 267 in 12c8d6e
|
||||||||
| auth_header_name=auth_header_name, | ||||||||
| prefix=prefix, | ||||||||
| *args, | ||||||||
|
|
||||||||
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.