-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
feat: add support for Python 3.13 #3850
base: main
Are you sure you want to change the base?
Conversation
@@ -130,13 +135,14 @@ dev = [ | |||
"trio", | |||
"aiosqlite", | |||
"asyncpg>=0.29.0", | |||
"psycopg[pool,binary]>=3.1.10,<3.2", | |||
"psycopg[pool,binary]>=3.1.10,<3.2; python_version < \"3.13\"", | |||
"psycopg[pool,c]; python_version >= \"3.13\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package needs to be built for 3.13
tests/examples/test_contrib/test_sqlalchemy/test_sqlalchemy_examples.py
Outdated
Show resolved
Hide resolved
|
||
exec(f"async def test_fn({reserved_kwarg}: int) -> None: pass") | ||
handler_with_path_param = decorator("/{" + reserved_kwarg + ":int}")(locals()["test_fn"]) | ||
local = dict(locals(), **globals()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also caused some weird issues with the scope of the locals()
output. This was the only way I could consistently make sure the call to locals
contained the test_fn
key
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3850 +/- ##
=======================================
Coverage 98.34% 98.34%
=======================================
Files 347 347
Lines 15727 15727
Branches 1738 1738
=======================================
Hits 15467 15467
Misses 124 124
Partials 136 136 ☔ View full report in Codecov by Sentry. |
if sys.version_info < (3, 13): | ||
with caplog.at_level(logging.INFO): | ||
client = create_test_client( | ||
route_handlers=[post_handler], middleware=[MiddlewareProtocolRequestLoggingMiddleware] | ||
) | ||
response = client.post("/", json={"name": "moishe zuchmir", "age": 40, "programmer": True}) | ||
assert response.status_code == 201 | ||
assert "test logging" in caplog.text | ||
else: | ||
client = create_test_client( | ||
route_handlers=[post_handler], middleware=[MiddlewareProtocolRequestLoggingMiddleware] | ||
) | ||
response = client.post("/", json={"name": "moishe zuchmir", "age": 40, "programmer": True}) | ||
assert response.status_code == 201 | ||
assert "test logging" in caplog.text | ||
log = capsys.readouterr() | ||
assert "test logging" in log.err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried everything to get these to behave more consistently. For now, this is working, but I think it should be revisited. However, let's not hold up because of this.
@@ -1,5 +1,5 @@ | |||
default_language_version: | |||
python: "3" | |||
python: "3.12" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to leave the version at 3.12 to avoid having to have the odd dependency setup for 3.13. Once psycopg ships with a binary, we can change this to 3.13
pydantic = [ | ||
"pydantic", | ||
"email-validator", | ||
"pydantic-extra-types!=2.9.0; python_version < \"3.9\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like only the 2.9.0 version is impacted. Since it wasn't pulled from pypi, i'm just ignoring this single release.
For reference on the |
Quality Gate passedIssues Measures |
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3850 |
"pytest-asyncio; python_version < \"3.13\"", | ||
"pytest-asyncio @ git+https://github.com/provinzkraut/pytest-asyncio.git@shutdown-asyncgens; python_version >= \"3.13\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"pytest-asyncio; python_version < \"3.13\"", | |
"pytest-asyncio @ git+https://github.com/provinzkraut/pytest-asyncio.git@shutdown-asyncgens; python_version >= \"3.13\"", | |
"pytest-asyncio", |
Revert this once the PR has been merged.
Description
This PR implements support for Python 3.13.
Note
msgspec
implementation, while all other versions prefer the pre-built litestar wheels.psycopg[binary]
. If you rely on this for development, you'll need to have the postgres development libraries installedpicologging
does not currently support Python 3.13. These tests are skipped automatically.pytest-asyncio
. Once the branch has been merged upstream, we can remove this test dependency.make install
will still install using Python 3.12. This is done to ensure we don't get additional bug reports due to build dependencies missing. If you want to use python 3.13, runuv sync --all-extras --dev --python 3.13
Closes