Skip to content
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(core)!: drop Python 3.8 support #4010

Open
wants to merge 10 commits into
base: v3.0
Choose a base branch
from
Open

feat(core)!: drop Python 3.8 support #4010

wants to merge 10 commits into from

Conversation

provinzkraut
Copy link
Member

Drop support for Python 3.8.

How to review this?

This is a rather big PR, however, almost all changes have been made automatically by ruff. I've put those into separate commits, so I suggest reviewing the commits not consisting of ruff changes individually.

@provinzkraut provinzkraut requested review from a team as code owners February 16, 2025 15:17
@github-actions github-actions bot added area/asgi area/background-tasks area/channels area/ci This PR involves changes to the CI/Infra area/connection area/contrib This PR involves changes to the contrib (Deprecated) area/controller area/datastructures area/dependencies This PR involves changes to the dependencies area/docs This PR involves changes to the documentation area/dto This PR involves changes to the DTOs area/events area/handlers This PR involves changes to the handlers area/kwargs area/layers area/middleware This PR involves changes to the middleware area/multipart area/openapi This PR involves changes to the OpenAPI schema area/params This PR involves changes to the params area/plugins This PR involves changes to the plugins area/private-api This PR involves changes to the privatized API area/response area/router area/security area/serialization area/signature area/template area/testing labels Feb 16, 2025
Copy link

codecov bot commented Feb 16, 2025

Codecov Report

Attention: Patch coverage is 99.41860% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.26%. Comparing base (33071ed) to head (ff400a3).

Files with missing lines Patch % Lines
litestar/utils/compat.py 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             v3.0    #4010   +/-   ##
=======================================
  Coverage   98.26%   98.26%           
=======================================
  Files         342      342           
  Lines       15390    15414   +24     
  Branches     1667     1666    -1     
=======================================
+ Hits        15123    15147   +24     
+ Misses        133      132    -1     
- Partials      134      135    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7 New Major Issues (required ≤ 2)
7 New Code Smells (required ≤ 3)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Great to see old code removed! 🎉

@@ -8,7 +8,7 @@
from litestar.plugins.sqlalchemy import SQLAlchemyDTO

if TYPE_CHECKING:
from typing import List
pass
Copy link
Member

Choose a reason for hiding this comment

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

I think we can just remove the entire block

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, no idea why ruff doesn't do these automatically?

@@ -8,7 +8,7 @@
from litestar.plugins.sqlalchemy import SQLAlchemySerializationPlugin

if TYPE_CHECKING:
from typing import List
pass

Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove the TYPE_CHECKING import

@@ -9,7 +9,7 @@
from litestar.plugins.sqlalchemy import SQLAlchemySerializationPlugin

if TYPE_CHECKING:
from typing import List
pass
Copy link
Member

Choose a reason for hiding this comment

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

Same

@@ -8,7 +8,7 @@
from litestar.plugins.sqlalchemy import SQLAlchemySerializationPlugin

if TYPE_CHECKING:
from typing import List
pass
Copy link
Member

Choose a reason for hiding this comment

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

Same

@@ -9,7 +9,7 @@
from litestar.plugins.sqlalchemy import SQLAlchemySerializationPlugin

if TYPE_CHECKING:
from typing import List
pass
Copy link
Member

Choose a reason for hiding this comment

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

And another

@@ -281,8 +277,8 @@ def _validate_handler_function(self) -> None:
async def default_connection_lifespan(
self,
socket: WebSocket,
on_accept_dependencies: Optional[Dict[str, Any]] = None, # noqa: UP006, UP007
on_disconnect_dependencies: Optional[Dict[str, Any]] = None, # noqa: UP006, UP007
on_accept_dependencies: Optional[dict[str, Any]] = None, # noqa: UP007
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove UP007 and the Optional as well?

Choose a reason for hiding this comment

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

Sure because Python 3.8 also have support of | operator as Union, we can use SomeType | None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/asgi area/background-tasks area/channels area/ci This PR involves changes to the CI/Infra area/connection area/contrib This PR involves changes to the contrib (Deprecated) area/controller area/datastructures area/dependencies This PR involves changes to the dependencies area/docs This PR involves changes to the documentation area/dto This PR involves changes to the DTOs area/events area/handlers This PR involves changes to the handlers area/kwargs area/layers area/middleware This PR involves changes to the middleware area/multipart area/openapi This PR involves changes to the OpenAPI schema area/params This PR involves changes to the params area/plugins This PR involves changes to the plugins area/private-api This PR involves changes to the privatized API area/response area/router area/security area/serialization area/signature area/template area/testing area/types This PR involves changes to the custom types Breaking 🔨 pr/internal size: large type/feat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants