Skip to content

Commit

Permalink
fix: use collection.abc.Sequence instead of typing.Sequence (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin authored Oct 28, 2024
1 parent 2a9effd commit 74c58da
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
7 changes: 3 additions & 4 deletions advanced_alchemy/extensions/litestar/alembic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from collections.abc import Sequence
from contextlib import suppress
from typing import TYPE_CHECKING, Sequence
from typing import TYPE_CHECKING

from advanced_alchemy.alembic.commands import AlembicCommands as _AlembicCommands

Expand All @@ -23,9 +24,7 @@ def get_database_migration_plugin(app: Litestar) -> SQLAlchemyInitPlugin:
with suppress(KeyError):
return app.plugins.get(SQLAlchemyInitPlugin)
msg = "Failed to initialize database migrations. The required plugin (SQLAlchemyPlugin or SQLAlchemyInitPlugin) is missing."
raise ImproperConfigurationError(
msg,
)
raise ImproperConfigurationError(msg)


class AlembicCommands(_AlembicCommands):
Expand Down
4 changes: 3 additions & 1 deletion advanced_alchemy/extensions/litestar/plugins/init/plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

import contextlib
from typing import TYPE_CHECKING, Any, Sequence, cast
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any, cast

from litestar.di import Provide
from litestar.dto import DTOData
Expand Down Expand Up @@ -46,6 +47,7 @@
"Parameter": Parameter,
"Dependency": Dependency,
"DTOData": DTOData,
"Sequence": Sequence,
}


Expand Down
3 changes: 2 additions & 1 deletion advanced_alchemy/service/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

from __future__ import annotations

from collections.abc import Callable, Sequence
from functools import partial
from pathlib import Path, PurePath
from typing import TYPE_CHECKING, Any, Callable, List, Sequence, cast, overload
from typing import TYPE_CHECKING, Any, List, cast, overload
from uuid import UUID

from advanced_alchemy.exceptions import AdvancedAlchemyError
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ maintainers = [
name = "advanced_alchemy"
readme = "README.md"
requires-python = ">=3.8"
version = "0.22.0"
version = "0.22.1"

[project.urls]
Changelog = "https://docs.advanced-alchemy.litestar.dev/latest/changelog"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 74c58da

Please sign in to comment.