diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29e5d8e..ff5f37e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v1.16.0 hooks: - id: mypy name: python mypy @@ -8,7 +8,7 @@ repos: pass_filenames: false args: ["."] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.11.12 hooks: - id: ruff name: ruff-check diff --git a/psqlpy_piccolo/engine.py b/psqlpy_piccolo/engine.py index 48b3f91..fe6e9e1 100644 --- a/psqlpy_piccolo/engine.py +++ b/psqlpy_piccolo/engine.py @@ -352,7 +352,7 @@ class PSQLPyEngine(Engine[PostgresTransaction]): engine_type = "postgres" min_version_number = 10 - def __init__( # noqa: PLR0913 + def __init__( self: Self, config: dict[str, Any], extensions: Sequence[str] = ("uuid-ossp",), diff --git a/tests/test_extra_node.py b/tests/test_extra_node.py index 0d02b23..4dc9f27 100644 --- a/tests/test_extra_node.py +++ b/tests/test_extra_node.py @@ -16,7 +16,7 @@ def skip_test_extra_nodes() -> None: test_engine = engine_finder() assert test_engine is not None - test_engine = typing.cast(PSQLPyEngine, test_engine) + test_engine = typing.cast("PSQLPyEngine", test_engine) EXTRA_NODE: typing.Final = MagicMock(spec=PSQLPyEngine(config=test_engine.config)) # noqa: N806 EXTRA_NODE.run_querystring = AsyncMock(return_value=[]) diff --git a/tests/test_pool.py b/tests/test_pool.py index 1cd6166..663df78 100644 --- a/tests/test_pool.py +++ b/tests/test_pool.py @@ -11,7 +11,7 @@ async def test_create_pool() -> None: - engine: typing.Final = typing.cast(PSQLPyEngine, Manager._meta.db) + engine: typing.Final = typing.cast("PSQLPyEngine", Manager._meta.db) await engine.start_connection_pool() assert engine.pool is not None @@ -45,7 +45,7 @@ async def get_data() -> None: async def test_proxy_methods() -> None: - engine: typing.Final = typing.cast(PSQLPyEngine, Manager._meta.db) + engine: typing.Final = typing.cast("PSQLPyEngine", Manager._meta.db) # Deliberate typo ('nnn'): await engine.start_connnection_pool() diff --git a/tests/test_transaction.py b/tests/test_transaction.py index 09b9328..7e50ef0 100644 --- a/tests/test_transaction.py +++ b/tests/test_transaction.py @@ -93,7 +93,7 @@ async def get_transaction_ids() -> list[str]: async def test_transaction_exists() -> None: """Make sure we can detect when code is within a transaction.""" - engine: typing.Final = typing.cast(PSQLPyEngine, Manager._meta.db) + engine: typing.Final = typing.cast("PSQLPyEngine", Manager._meta.db) async with engine.transaction(): assert engine.transaction_exists()