Open
Conversation
With the `commit` builder, the SDK uses parenthesized `async with` syntax.
Example:
```
async with (
httpx.AsyncClient() as client,
client.stream(...) as response,
):
```
This syntax is only valid in Python 3.10+. However, `pyproject.toml`
declared `requires-python >= 3.9`.
So on Python 3.9, the entire `commit` module would fail to
import with a `SyntaxError` at startup making it completely unusable
despite the package claiming 3.9 support.
Updating this syntax allows it to be compatible all the way back to 3.1.
fat
approved these changes
Mar 3, 2026
Author
|
i suspect this break came from the will see what we have do do in order to prevent regressing again. |
Enabling SIM117 wants to simplify the context management however, it breaks compatibility on < 3.10 for the `async with` usage.
imownbey
approved these changes
Mar 3, 2026
Contributor
imownbey
left a comment
There was a problem hiding this comment.
Assuming it’s backwards compatible with the old sdk methods sounds fire
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.
With the
commitbuilder, the SDK uses parenthesizedasync withsyntax.Example:
This syntax is only valid in Python 3.10+. However,
pyproject.tomldeclared
requires-python >= 3.9.So on Python 3.9, the entire
commitmodule would fail toimport with a
SyntaxErrorat startup making it completely unusabledespite the package claiming 3.9 support.
Updating this syntax allows it to be compatible all the way back to 3.1.
Alternatively, if we'd rather push 3.10+ we can also update the
pyproject.tomlto reflect that instead.