Skip to content

chore(python-sdk): drop Python 3.10 compatibility shims - #2004

Merged
mishushakov merged 2 commits into
mainfrom
devin/1792508774-py311-cleanup
Oct 20, 2026
Merged

mishushakov merged 2 commits into
mainfrom
devin/1792508774-py311-cleanup

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up cleanup for SDK-288. The requires-python >=3.11 bump already shipped in #1974; this PR removes the workarounds it made unnecessary and fixes one edge case.

  • first_event (e2b/envd/client_async): removed the getattr(task, "cancelling", None) fallback. It also now reads the task's cancellation count before wait_for and compares against that entry value instead of 0:
    cancelling_before = task.cancelling()
    ...
    except ConnectError as e:
        if e.code is Code.CANCELED and ... and task.cancelling() == cancelling_before:
            raise _request_timeout_exception(...)
    This fixes a timer expiry being reported as ConnectError(CANCELED) instead of the request timeout when the caller's task already had a cancel pending that it had swallowed. The new regression test test_timeout_with_preexisting_pending_cancellation fails with the old == 0 check.
  • asyncio.TimeoutError → built-in TimeoutError (the same class since 3.11) in first_event, AsyncVolume and both filesystem watchers.
  • Imports from typing_extensions now come from typing (Self, Unpack, NotRequired, Literal, TypedDict) in python-sdk, code-interpreter-python and desktop-python.

Kept on purpose: the generated e2b/sandbox/mcp.py still imports TypedDict from typing_extensions because it uses closed=True (PEP 728, which stdlib typing doesn't support before 3.15). So the typing-extensions dependency stays, and the lockfiles are unchanged.

Link to Devin session: https://app.devin.ai/sessions/b2a09b10bdc54fe1b59931165138c6b8
Open in Devin Desktop: https://app.devin.ai/desktop/session/b2a09b10bdc54fe1b59931165138c6b8?variant=devin
Requested by: @mishushakov

Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@cla-bot cla-bot Bot added the cla-signed label Oct 20, 2026
@changeset-bot

changeset-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2fb3e8e

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

This PR includes changesets to release 3 packages
Name Type
@e2b/python-sdk Patch
@e2b/code-interpreter-python Patch
@e2b/desktop-python 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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TASTE.md review: compliant. 0 violations. This PR only changes imports (typing_extensions to typing), the asyncio.TimeoutError to TimeoutError alias, and the internal first_event cancellation check. It leaves the public SDK surface alone and keeps parity across sync, async and JS (T-1, T-2). Timeout and error behavior (T-45, T-48, T-64) is unchanged.

Written by Devin

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Package Artifacts

Built from 2c719ad. Download artifacts from this workflow run.

JS SDK (e2b@2.57.1-devin-1792508774-py311-cleanup.0, with @e2b/dockerfile-utils@0.1.2-devin-1792508774-py311-cleanup.0):

npm install ./e2b-dockerfile-utils-0.1.2-devin-1792508774-py311-cleanup.0.tgz ./e2b-2.57.1-devin-1792508774-py311-cleanup.0.tgz

CLI (@e2b/cli@2.22.3-devin-1792508774-py311-cleanup.0):

npm install ./e2b-cli-2.22.3-devin-1792508774-py311-cleanup.0.tgz

Code Interpreter JS SDK (@e2b/code-interpreter@2.9.1-devin-1792508774-py311-cleanup.0):

npm install ./e2b-code-interpreter-2.9.1-devin-1792508774-py311-cleanup.0.tgz

Desktop JS SDK (@e2b/desktop@2.5.1-devin-1792508774-py311-cleanup.0):

npm install ./e2b-desktop-2.5.1-devin-1792508774-py311-cleanup.0.tgz

Python SDK (e2b==2.57.0+devin.1792508774.py311.cleanup, with e2b-dockerfile-utils==0.1.1+devin.1792508774.py311.cleanup):

pip install ./e2b_dockerfile_utils-0.1.1+devin.1792508774.py311.cleanup-py3-none-any.whl ./e2b-2.57.0+devin.1792508774.py311.cleanup-py3-none-any.whl

Code Interpreter Python SDK (e2b-code-interpreter==2.11.1+devin.1792508774.py311.cleanup):

pip install ./e2b_code_interpreter-2.11.1+devin.1792508774.py311.cleanup-py3-none-any.whl

Desktop Python SDK (e2b-desktop==2.7.0+devin.1792508774.py311.cleanup):

pip install ./e2b_desktop-2.7.0+devin.1792508774.py311.cleanup-py3-none-any.whl

@mishushakov
mishushakov marked this pull request as ready for review October 20, 2026 15:12
@mishushakov
mishushakov self-requested a review as a code owner October 20, 2026 15:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T15:14:14.115937Z f613272 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

devin-ai-integration[bot]

This comment was marked as resolved.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

…ntry value

Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
@mishushakov
mishushakov merged commit d7ed073 into main Oct 20, 2026
32 of 34 checks passed
@mishushakov
mishushakov deleted the devin/1792508774-py311-cleanup branch October 20, 2026 17:04
@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

SDK-288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant