diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67dd264f0..ba4e62ec4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,5 +66,9 @@ jobs: run: poetry run flake8 . - name: Run isort - dependency import sorting check run: poetry run isort --check-only . + - name: Run ruff - bug patterns + run: poetry run ruff check . + - name: Run import-linter - layer contracts + run: poetry run lint-imports - name: Run unit tests run: poetry run pytest ./tests/unit -Werror diff --git a/.importlinter b/.importlinter new file mode 100644 index 000000000..88057dfcc --- /dev/null +++ b/.importlinter @@ -0,0 +1,27 @@ +[importlinter] +root_package = aws_advanced_python_wrapper + +[importlinter:contract:aio-is-protected] +name = Only the aio tree and the async SQLAlchemy dialects import aio +type = protected +protected_modules = + aws_advanced_python_wrapper.aio +allowed_importers = + aws_advanced_python_wrapper.aio + aws_advanced_python_wrapper.sqlalchemy_dialects +ignore_imports = + aws_advanced_python_wrapper.database_dialect -> aws_advanced_python_wrapper.aio.host_list_provider + aws_advanced_python_wrapper.dialect_verifier -> aws_advanced_python_wrapper.aio.dialect_utils + +[importlinter:contract:core-not-integrations] +name = Core does not import the Django or SQLAlchemy integrations +type = forbidden +source_modules = + aws_advanced_python_wrapper.plugin_service + aws_advanced_python_wrapper.wrapper + aws_advanced_python_wrapper.aio.plugin_service + aws_advanced_python_wrapper.aio.wrapper +forbidden_modules = + aws_advanced_python_wrapper.django + aws_advanced_python_wrapper.sqlalchemy_dialects + aws_advanced_python_wrapper.sqlalchemy diff --git a/aws_advanced_python_wrapper/aio/cluster_topology_monitor.py b/aws_advanced_python_wrapper/aio/cluster_topology_monitor.py index c520ff864..e220132a4 100644 --- a/aws_advanced_python_wrapper/aio/cluster_topology_monitor.py +++ b/aws_advanced_python_wrapper/aio/cluster_topology_monitor.py @@ -48,7 +48,7 @@ import weakref from time import perf_counter_ns from typing import (TYPE_CHECKING, Any, Awaitable, Callable, Dict, Optional, - Set, Tuple) + Set, Tuple, Union) from aws_advanced_python_wrapper.aio import topology_store from aws_advanced_python_wrapper.hostinfo import HostRole @@ -56,6 +56,8 @@ from aws_advanced_python_wrapper.utils.messages import Messages if TYPE_CHECKING: + from concurrent.futures import Future + from aws_advanced_python_wrapper.aio.plugin_service import \ AsyncPluginService from aws_advanced_python_wrapper.aio.topology_store import TopologyKey @@ -127,6 +129,7 @@ def __init__( self._probe_host = probe_host self._task: Optional[asyncio.Task[None]] = None + self._scheduled: Set[Union[asyncio.Task[None], Future[None]]] = set() self._stop_event = asyncio.Event() self._last_known_writer: Optional[str] = None self._high_refresh_until_ns: int = 0 @@ -809,17 +812,21 @@ def _schedule(self, coro: Awaitable[None]) -> bool: return False try: if loop is asyncio.get_running_loop(): - loop.create_task(coro) # type: ignore[arg-type] + self._keep_until_done(loop.create_task(coro)) # type: ignore[arg-type] return True except RuntimeError: pass try: - asyncio.run_coroutine_threadsafe(coro, loop) # type: ignore[arg-type] + self._keep_until_done(asyncio.run_coroutine_threadsafe(coro, loop)) # type: ignore[arg-type] return True except RuntimeError: coro.close() # type: ignore[attr-defined] return False + def _keep_until_done(self, work: Union[asyncio.Task[None], Future[None]]) -> None: + self._scheduled.add(work) + work.add_done_callback(self._scheduled.discard) + async def _reset(self) -> None: """Drop everything tied to the pre-switchover cluster. diff --git a/aws_advanced_python_wrapper/aio/driver_dialect/aiomysql.py b/aws_advanced_python_wrapper/aio/driver_dialect/aiomysql.py index deff2033f..33eef690f 100644 --- a/aws_advanced_python_wrapper/aio/driver_dialect/aiomysql.py +++ b/aws_advanced_python_wrapper/aio/driver_dialect/aiomysql.py @@ -259,7 +259,7 @@ async def set_read_only(self, conn: Any, read_only: bool) -> None: "SET SESSION TRANSACTION READ WRITE" ) # Stash intent on the conn so is_read_only can read it back. - conn._aws_read_only = bool(read_only) # type: ignore[attr-defined] + conn._aws_read_only = bool(read_only) async def can_execute_query(self, conn: Any) -> bool: # aiomysql exposes ``closed`` (no ``open`` -- see is_closed). diff --git a/aws_advanced_python_wrapper/aio/failover_plugin.py b/aws_advanced_python_wrapper/aio/failover_plugin.py index 05d48916e..a9bc2c99f 100644 --- a/aws_advanced_python_wrapper/aio/failover_plugin.py +++ b/aws_advanced_python_wrapper/aio/failover_plugin.py @@ -805,7 +805,7 @@ async def _open_connection( target, self._plugin_service.props, self) def _build_target_props(self, target: HostInfo) -> Properties: - props_copy = self._plugin_service.props.copy() # type: ignore[attr-defined] + props_copy = self._plugin_service.props.copy() props_copy["host"] = target.host if target.is_port_specified(): props_copy["port"] = str(target.port) diff --git a/aws_advanced_python_wrapper/aio/fastest_response_strategy_plugin.py b/aws_advanced_python_wrapper/aio/fastest_response_strategy_plugin.py index de97d1da7..cf6187b28 100644 --- a/aws_advanced_python_wrapper/aio/fastest_response_strategy_plugin.py +++ b/aws_advanced_python_wrapper/aio/fastest_response_strategy_plugin.py @@ -576,7 +576,7 @@ async def measure_and_cache( best: Optional[HostInfo] = None best_ns: int = _MAX_RESPONSE_NS - for host, r in zip(candidates, results): + for host, r in zip(candidates, results, strict=False): if isinstance(r, BaseException): continue if not isinstance(r, int) or r >= _MAX_RESPONSE_NS: diff --git a/aws_advanced_python_wrapper/aio/plugin_factory.py b/aws_advanced_python_wrapper/aio/plugin_factory.py index 41c16df97..67dafe16b 100644 --- a/aws_advanced_python_wrapper/aio/plugin_factory.py +++ b/aws_advanced_python_wrapper/aio/plugin_factory.py @@ -381,7 +381,7 @@ def sort_factories_by_weight( last_weight = w return [f for _, f in sorted( - zip(effective, factories), key=lambda pair: pair[0])] + zip(effective, factories, strict=False), key=lambda pair: pair[0])] def build_async_plugins( diff --git a/aws_advanced_python_wrapper/aio/read_write_splitting_plugin.py b/aws_advanced_python_wrapper/aio/read_write_splitting_plugin.py index 250ccafc4..7f6b64862 100644 --- a/aws_advanced_python_wrapper/aio/read_write_splitting_plugin.py +++ b/aws_advanced_python_wrapper/aio/read_write_splitting_plugin.py @@ -570,7 +570,7 @@ async def _open( "reader/writer connection.") from aws_advanced_python_wrapper.utils.properties import Properties - props_copy: Properties = Properties(self._plugin_service.props.copy()) # type: ignore[attr-defined] + props_copy: Properties = Properties(self._plugin_service.props.copy()) props_copy["host"] = target.host if target.is_port_specified(): props_copy["port"] = str(target.port) diff --git a/aws_advanced_python_wrapper/aurora_connection_tracker_plugin.py b/aws_advanced_python_wrapper/aurora_connection_tracker_plugin.py index 80453d982..c7e58fc75 100644 --- a/aws_advanced_python_wrapper/aurora_connection_tracker_plugin.py +++ b/aws_advanced_python_wrapper/aurora_connection_tracker_plugin.py @@ -224,7 +224,7 @@ def _task(connections_list: list): def _invalidate_connections(self, connections_list: list): invalidate_connection_thread: Thread = Thread(daemon=True, target=self._task, - args=[connections_list]) # type: ignore[arg-type] + args=[connections_list]) invalidate_connection_thread.start() def log_opened_connections(self): diff --git a/aws_advanced_python_wrapper/blue_green_plugin.py b/aws_advanced_python_wrapper/blue_green_plugin.py index 5fb8d7523..e24c78a61 100644 --- a/aws_advanced_python_wrapper/blue_green_plugin.py +++ b/aws_advanced_python_wrapper/blue_green_plugin.py @@ -1759,7 +1759,7 @@ def _get_post_status_connect_routings(self) -> List[ConnectRouting]: iam_hosts = (green_host_info,) if blue_host_info is None else (green_host_info, blue_host_info) iam_auth_success_handler = None if is_blue_host_instance \ - else lambda iam_host: self._register_iam_host(green_host, iam_host) + else self._make_iam_success_handler(green_host) host_substitute_routing = SubstituteConnectRouting( green_ip_host_info, blue_host, role, iam_hosts, iam_auth_success_handler) interim_status = self._interim_statuses[role.value] @@ -1776,6 +1776,9 @@ def _get_post_status_connect_routings(self) -> List[ConnectRouting]: return routings + def _make_iam_success_handler(self, green_host: str) -> Callable[[str], None]: + return lambda iam_host: self._register_iam_host(green_host, iam_host) + def _is_already_successfully_connected(self, connect_host: str, iam_host: str): success_hosts = self._iam_auth_success_hosts.compute_if_absent(connect_host, lambda _: ConcurrentSet()) return success_hosts is not None and iam_host in success_hosts diff --git a/aws_advanced_python_wrapper/custom_endpoint_plugin.py b/aws_advanced_python_wrapper/custom_endpoint_plugin.py index 08361ae0d..9e96fd8fa 100644 --- a/aws_advanced_python_wrapper/custom_endpoint_plugin.py +++ b/aws_advanced_python_wrapper/custom_endpoint_plugin.py @@ -89,7 +89,7 @@ def from_db_cluster_endpoint(cls, endpoint_response_info: Dict[str, Union[str, L ) def __eq__(self, other: object): - if self is object: + if self is other: return True if not isinstance(other, CustomEndpointInfo): return False diff --git a/aws_advanced_python_wrapper/failover_v2_plugin.py b/aws_advanced_python_wrapper/failover_v2_plugin.py index 2aa6b2cda..da26ce9dc 100644 --- a/aws_advanced_python_wrapper/failover_v2_plugin.py +++ b/aws_advanced_python_wrapper/failover_v2_plugin.py @@ -288,7 +288,7 @@ def _get_reader_failover_connection(self) -> ReaderFailoverResult: remaining_readers.remove(reader_candidate) self._plugin_service.driver_dialect.execute( - DbApiMethod.CONNECTION_CLOSE.method_name, lambda: candidate_conn.close(), conn=candidate_conn) + DbApiMethod.CONNECTION_CLOSE.method_name, candidate_conn.close, conn=candidate_conn) if role == HostRole.WRITER: reader_candidates.remove(reader_candidate) @@ -308,7 +308,7 @@ def _get_reader_failover_connection(self) -> ReaderFailoverResult: return ReaderFailoverResult(candidate_conn, updated_host_info) self._plugin_service.driver_dialect.execute( - DbApiMethod.CONNECTION_CLOSE.method_name, lambda: candidate_conn.close(), conn=candidate_conn) + DbApiMethod.CONNECTION_CLOSE.method_name, candidate_conn.close, conn=candidate_conn) if role == HostRole.WRITER: is_original_writer_still_writer = True except Exception: diff --git a/aws_advanced_python_wrapper/fastest_response_strategy_plugin.py b/aws_advanced_python_wrapper/fastest_response_strategy_plugin.py index 3d15e6b1b..89ef15566 100644 --- a/aws_advanced_python_wrapper/fastest_response_strategy_plugin.py +++ b/aws_advanced_python_wrapper/fastest_response_strategy_plugin.py @@ -279,6 +279,7 @@ def run(self): except Exception: # Do nothing pass + self._monitoring_conn = None if context is not None: context.close_context() diff --git a/aws_advanced_python_wrapper/host_list_provider.py b/aws_advanced_python_wrapper/host_list_provider.py index e136a20f7..ca419467f 100644 --- a/aws_advanced_python_wrapper/host_list_provider.py +++ b/aws_advanced_python_wrapper/host_list_provider.py @@ -144,9 +144,6 @@ def initial_connection_host_info(self) -> Optional[HostInfo]: def initial_connection_host_info(self, value: HostInfo): ... - def is_static_host_list_provider(self) -> bool: - ... - class RdsHostListProvider(DynamicHostListProvider, HostListProvider): _MONITOR_CLEANUP_NANO: ClassVar[int] = 15 * 60 * 1_000_000_000 # 15 minutes diff --git a/aws_advanced_python_wrapper/hostinfo.py b/aws_advanced_python_wrapper/hostinfo.py index 3aa895de9..271222090 100644 --- a/aws_advanced_python_wrapper/hostinfo.py +++ b/aws_advanced_python_wrapper/hostinfo.py @@ -62,7 +62,7 @@ def __init__( self.last_update_time = last_update_time def __eq__(self, other: object): - if self is object: + if self is other: return True if not isinstance(other, HostInfo): return False diff --git a/aws_advanced_python_wrapper/plugin_service.py b/aws_advanced_python_wrapper/plugin_service.py index 469303799..68420e4e5 100644 --- a/aws_advanced_python_wrapper/plugin_service.py +++ b/aws_advanced_python_wrapper/plugin_service.py @@ -76,7 +76,7 @@ from aws_advanced_python_wrapper.host_availability import HostAvailability from aws_advanced_python_wrapper.host_list_provider import ( ConnectionStringHostListProvider, HostListProvider, - HostListProviderService, StaticHostListProvider) + HostListProviderService) from aws_advanced_python_wrapper.host_monitoring_plugin import \ HostMonitoringPluginFactory from aws_advanced_python_wrapper.host_monitoring_v2_plugin import \ @@ -750,9 +750,6 @@ def identify_connection(self, connection: Optional[Connection] = None) -> Option except Exception as e: raise AwsWrapperError(Messages.get("PluginServiceImpl.ErrorIdentifyConnection")) from e - def is_static_host_list_provider(self) -> bool: - return self._host_list_provider is StaticHostListProvider - def is_network_exception(self, error: Optional[Exception] = None, sql_state: Optional[str] = None) -> bool: return self._exception_manager.is_network_exception( dialect=self.database_dialect, error=error, sql_state=sql_state) diff --git a/aws_advanced_python_wrapper/read_write_splitting_plugin.py b/aws_advanced_python_wrapper/read_write_splitting_plugin.py index a166a12b5..88b7d13ab 100644 --- a/aws_advanced_python_wrapper/read_write_splitting_plugin.py +++ b/aws_advanced_python_wrapper/read_write_splitting_plugin.py @@ -458,10 +458,7 @@ def connect( current_conn = connect_func() - if not is_initial_connection or ( - self._host_list_provider_service is not None - and self._host_list_provider_service.is_static_host_list_provider() - ): + if not is_initial_connection: return current_conn current_role = self._plugin_service.get_host_role(current_conn) diff --git a/aws_advanced_python_wrapper/sqlalchemy_dialects/_exception_handling.py b/aws_advanced_python_wrapper/sqlalchemy_dialects/_exception_handling.py index 0bea34f93..2ca2ecd69 100644 --- a/aws_advanced_python_wrapper/sqlalchemy_dialects/_exception_handling.py +++ b/aws_advanced_python_wrapper/sqlalchemy_dialects/_exception_handling.py @@ -133,10 +133,10 @@ def _driver_error_module(self): """ return None - def do_execute( # type: ignore[no-untyped-def] + def do_execute( self, cursor, statement, parameters, context=None): try: - super().do_execute( # type: ignore[misc] + super().do_execute( cursor, statement, parameters, context) except Exception as e: normalized = _normalize_driver_error(e, self._driver_error_module()) @@ -144,10 +144,10 @@ def do_execute( # type: ignore[no-untyped-def] raise normalized from e raise - def do_executemany( # type: ignore[no-untyped-def] + def do_executemany( self, cursor, statement, parameters, context=None): try: - super().do_executemany( # type: ignore[misc] + super().do_executemany( cursor, statement, parameters, context) except Exception as e: normalized = _normalize_driver_error(e, self._driver_error_module()) @@ -177,10 +177,10 @@ def _driver_error_module(self): """See :meth:`_DriverErrorNormalizeMixin._driver_error_module`.""" return None - def do_execute( # type: ignore[no-untyped-def] + def do_execute( self, cursor, statement, parameters, context=None): try: - super().do_execute( # type: ignore[misc] + super().do_execute( cursor, statement, parameters, context) except Exception as e: normalized = _normalize_driver_error(e, self._driver_error_module()) @@ -188,10 +188,10 @@ def do_execute( # type: ignore[no-untyped-def] raise normalized from e raise - def do_executemany( # type: ignore[no-untyped-def] + def do_executemany( self, cursor, statement, parameters, context=None): try: - super().do_executemany( # type: ignore[misc] + super().do_executemany( cursor, statement, parameters, context) except Exception as e: normalized = _normalize_driver_error(e, self._driver_error_module()) diff --git a/aws_advanced_python_wrapper/sqlalchemy_dialects/mysql_async.py b/aws_advanced_python_wrapper/sqlalchemy_dialects/mysql_async.py index 58d056caf..7282db690 100644 --- a/aws_advanced_python_wrapper/sqlalchemy_dialects/mysql_async.py +++ b/aws_advanced_python_wrapper/sqlalchemy_dialects/mysql_async.py @@ -162,7 +162,7 @@ def get_readonly(self, dbapi_conn: Any) -> bool: return bool(getattr(wrapper, "read_only", False)) @classmethod - def import_dbapi(cls) -> Any: # type: ignore[override] + def import_dbapi(cls) -> Any: # Parent's return type hint is SA's AsyncAdapt_aiomysql_dbapi class # specifically; ours is a shim-compatible duck-type. Use Any to # avoid variance grief with mypy. diff --git a/aws_advanced_python_wrapper/stale_dns_plugin.py b/aws_advanced_python_wrapper/stale_dns_plugin.py index 511838b8c..287a1d93b 100644 --- a/aws_advanced_python_wrapper/stale_dns_plugin.py +++ b/aws_advanced_python_wrapper/stale_dns_plugin.py @@ -198,9 +198,6 @@ def init_host_provider( init_host_provider_func() - if self._host_list_provider_service.is_static_host_list_provider(): - raise Exception(Messages.get_formatted("StaleDnsPlugin.RequireDynamicProvider")) - def notify_host_list_changed(self, changes: Dict[str, Set[HostEvent]]): self._stale_dns_helper.notify_host_list_changed(changes) diff --git a/aws_advanced_python_wrapper/utils/telemetry/open_telemetry.py b/aws_advanced_python_wrapper/utils/telemetry/open_telemetry.py index 0fccbd3ae..064eb0b94 100644 --- a/aws_advanced_python_wrapper/utils/telemetry/open_telemetry.py +++ b/aws_advanced_python_wrapper/utils/telemetry/open_telemetry.py @@ -46,7 +46,7 @@ def __init__(self, tracer: Tracer, name: str, trace_level: TelemetryTraceLevel, self._meter: Meter self._token: Optional[object] = None - current_span: Span = trace.get_current_span() # type: ignore[assignment] + current_span: trace_api.Span = trace.get_current_span() is_root = (current_span is None or current_span == trace.INVALID_SPAN) if is_root and trace_level == TelemetryTraceLevel.NESTED: diff --git a/docs/examples/MySQLSimpleReadWriteSplitting.py b/docs/examples/MySQLSimpleReadWriteSplitting.py index 20042a7a5..0e4acc7c3 100644 --- a/docs/examples/MySQLSimpleReadWriteSplitting.py +++ b/docs/examples/MySQLSimpleReadWriteSplitting.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: from aws_advanced_python_wrapper.pep249 import Connection -import mysql.connector # type: ignore +import mysql.connector from aws_advanced_python_wrapper import AwsWrapperConnection, release_resources from aws_advanced_python_wrapper.errors import ( diff --git a/docs/examples/PGSimpleReadWriteSplitting.py b/docs/examples/PGSimpleReadWriteSplitting.py index 810c4af19..1bd9a69e3 100644 --- a/docs/examples/PGSimpleReadWriteSplitting.py +++ b/docs/examples/PGSimpleReadWriteSplitting.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: from aws_advanced_python_wrapper.pep249 import Connection -import psycopg # type: ignore +import psycopg from aws_advanced_python_wrapper import AwsWrapperConnection, release_resources from aws_advanced_python_wrapper.errors import ( diff --git a/mypy.ini b/mypy.ini index 5cee42b18..a671222fa 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,4 +1,7 @@ [mypy] +strict_equality = True +warn_unused_ignores = True +enable_error_code = ignore-without-code, unused-awaitable exclude = (?x)( debug_integration_.*\.py$ | MySQLFailover\.py diff --git a/poetry.lock b/poetry.lock index 95728827a..780a18f20 100644 --- a/poetry.lock +++ b/poetry.lock @@ -978,6 +978,18 @@ files = [ {file = "classify_imports-4.2.0.tar.gz", hash = "sha256:7abfb7ea92149b29d046bd34573d247ba6e68cc28100c801eba4af17964fc40e"}, ] +[[package]] +name = "click" +version = "8.5.1" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "click-8.5.1-py3-none-any.whl", hash = "sha256:8bb5376d2006950386f8c6427613334a2acadc5f559cb80e638d00b4df957e37"}, + {file = "click-8.5.1.tar.gz", hash = "sha256:9bbfada76703fd1d784b83eea012e3e8c6a001a876543ef104fa56aaaeb072b4"}, +] + [[package]] name = "colorama" version = "0.4.6" @@ -1582,6 +1594,268 @@ markers = {dev = "platform_machine == \"aarch64\" or platform_machine == \"ppc64 docs = ["Sphinx", "furo"] test = ["objgraph", "psutil", "setuptools"] +[[package]] +name = "grimp" +version = "3.18" +description = "Builds a queryable graph of the imports within one or more Python packages." +optional = false +python-versions = ">=3.10" +groups = ["dev"] +markers = "python_version < \"3.13\"" +files = [ + {file = "grimp-3.18-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:dab055e5be32395646488733c71a0ae2fd5cde7d056968e5764b69438361961b"}, + {file = "grimp-3.18-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:471c907f2def507e66d3a0141c9869d6cc71c6a044f32000e0798183cabe25d8"}, + {file = "grimp-3.18-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:1affae580e1753e9e4309e31c3cfdb63066462643722d1df1b0332ae09b2b712"}, + {file = "grimp-3.18-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:13e3c4462f6f982bcaa4242cc0c42a4f70a88b1072ce764f6ebdc3a239d50ec9"}, + {file = "grimp-3.18-cp310-cp310-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:f73b9b0fc56aa736c064affd286ae2546461a6348d7174af37d85ebf5e282cd5"}, + {file = "grimp-3.18-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:ae82abfcb5899d8f533d749028d41ed34d5c3a160a3fc9b001ec01b5acf7d630"}, + {file = "grimp-3.18-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:30701770d220ccf6b78fb986077d83252b038bd5fea8a0342718d77b433d21a8"}, + {file = "grimp-3.18-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e699e4739feab35de6879975ede63203dbbd0098bd5f3222363a6bf60667861b"}, + {file = "grimp-3.18-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2dcbb5e564e91f9f400ed6e82c665669f871675d3ac0513935a1d4240b1d3ffd"}, + {file = "grimp-3.18-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aec6ece10527df0faf90a58713b26dd3e8d722c2e0164cd9e4f358e4d0e5e069"}, + {file = "grimp-3.18-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cdd3c34b3f907d8f1bf936bc30ad93e486c25d143f12c30f504a4cb66af28c3e"}, + {file = "grimp-3.18-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e10e1ac562117bbe48b2833307bdfc2b954ed47b2527586da5b41d135464cd70"}, + {file = "grimp-3.18-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a603b6117b044232a9f62dcbb6e8fce379f8ab94dd42008bf3dc3c64dec3d838"}, + {file = "grimp-3.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c1cb1bdf285ec9d39035400375ad91c381e99b4cabf9f6b34d9fe3560d2a88a"}, + {file = "grimp-3.18-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f51866f2c475586caaf64a64b3658e122326f9c611b5e7533c94d3f00f18018a"}, + {file = "grimp-3.18-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:d89b8b86744f412c5256084fd18dae591bda5696ecc6db21829211a517ef6fb4"}, + {file = "grimp-3.18-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:29e37d82af9b685233dbe46bbdfb0ee4c8a4b07d12e199053095e7da6826ea5a"}, + {file = "grimp-3.18-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c27a748a945a65ba62bd1484b7a3c4a64d0a21ed18ee1d0c29ff71b0cc61044a"}, + {file = "grimp-3.18-cp310-cp310-win32.whl", hash = "sha256:c2ccc9dc88e9b0de7862df57e66d820a418ed21932af7cf9f4e6329953288593"}, + {file = "grimp-3.18-cp310-cp310-win_amd64.whl", hash = "sha256:9c9ac53edc63ffd77e739dbceb675b822402f6e2be7dcd4fb77419c0a073c006"}, + {file = "grimp-3.18-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:fa55b7f9c61d6f3b541cb5902d7ac6ccfb96eaf3160043f8561e2f212991b74a"}, + {file = "grimp-3.18-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7e8ebb6c2c15b1134b1ab5f8a93276eb49912745e7186abac77a550a981c4d44"}, + {file = "grimp-3.18-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:90854aad6ab70ddcdb3717604af63906be196ec3cc3da0b0ed9b215c82b6a7a2"}, + {file = "grimp-3.18-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:80eb43bab85d0e45b6cdb02315bee1fdd76a131dae3b6491a2c9dacdd7390eeb"}, + {file = "grimp-3.18-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:a3d88c8e9f005f14c1931c3f3a71fe54b4babbb3f27b54a353f2ce624ff0efef"}, + {file = "grimp-3.18-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:48d1c17dd93c8a68beaf35dbb8f79da767b7a63b0ab86a5a02beafd0b54ae619"}, + {file = "grimp-3.18-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:c4a66143bd591902d13d0b3f052bfe025faa3864494ad4c7bfba1d85fba73024"}, + {file = "grimp-3.18-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0171d8a516ed49d3dda228ec5e7a2ad64016d6f48ec6d15fc606173b39e18d1e"}, + {file = "grimp-3.18-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41d777c8b64a8d1e68522278d56b6857a021b10159d0c25e468fef0c0a82288e"}, + {file = "grimp-3.18-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4c759eac578bbef51285474e2c58dcbcb5bc2f7230080bb4b89bafce6d383006"}, + {file = "grimp-3.18-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cb8017c9577575e1b514318e46b3e6dc4c786f5fe2f0772998c791e794d74dea"}, + {file = "grimp-3.18-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:484ddda543a7d1d6f88dc4039a6b3f8662e67d052eaeea9e3d95ae617186c5fa"}, + {file = "grimp-3.18-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b2815f6cc16bd6fa9a8e204e81c69bd88d6d90a55001fb874d55c645cf58956"}, + {file = "grimp-3.18-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28cef55938723bb391fbcf0fa5e0ddf8a8e62b71b475baf54a5a735d12df6c8e"}, + {file = "grimp-3.18-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:08b8950d933838e7a0e5cf2248eaceb9f4936ec50284811724319acc3d41b3b2"}, + {file = "grimp-3.18-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:55c5e86a133d3a48631e5307acb8c7184fa9a96d29a0338d7a0411a9adc99ffa"}, + {file = "grimp-3.18-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:80f7f1ef06fb4dfb3dcc85fbcc031843c33b0bcddd9b4543c734e3b9bbe68ec9"}, + {file = "grimp-3.18-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9c050be0ade2b9f3c59bf0b664ba28fb66b5cf8f770427400ce0a7ed5ddbd5d2"}, + {file = "grimp-3.18-cp311-cp311-win32.whl", hash = "sha256:5655d875e40514ae4195a04eb96b6d9de188d6a520fc57e50a07d850e542b307"}, + {file = "grimp-3.18-cp311-cp311-win_amd64.whl", hash = "sha256:55650ec3bfdbc46cf673a3282b801c1b3799865c1769769621a77cfbfac762a8"}, + {file = "grimp-3.18-cp311-cp311-win_arm64.whl", hash = "sha256:a61173949e1dae14224f7084057caaf6ecf9c56cb39f73536aac094ff8cf0108"}, + {file = "grimp-3.18-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:cad017a08dd7a7387b5208a640d4eee90a4152433080626aad09e6ce2d56a07d"}, + {file = "grimp-3.18-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4482b0551ff5596c5b578ae6820fd32a8e0db278c314eb24e7cfffd84f20cf06"}, + {file = "grimp-3.18-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:43d38ab816a9e5d3ed5e8448468e6ed61bccc491007bdafb10f1b2e433fcd215"}, + {file = "grimp-3.18-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:4d3bf444df87c4f3a2fe9a8d7ee95e6f28d37c961252821abc93ff872ee87097"}, + {file = "grimp-3.18-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:26cec100e8af7e8c21bee1fb93c2c0e00ef468c5ceb42f03b4cd26f556e5ea67"}, + {file = "grimp-3.18-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:c80ec28572574af7f867bc39b05a1768a295ffb3b73aa49ac6a188ae57b3c66d"}, + {file = "grimp-3.18-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3b855e27874b633fa3a52e357b5804507fbd877ff097468197a2a463fd2c81b7"}, + {file = "grimp-3.18-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c046c18afd7123ef20abe3052b971c7645b1483dbde0b527ff0636f87077a77a"}, + {file = "grimp-3.18-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ca16afcf41957c89bf67970e08ffc69fbb339c1ebc84b6a728e2027914a0a9a"}, + {file = "grimp-3.18-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:256a59bc8a8518dad521bcbd5d0d97398cb4e85304298a56950b504ce27a3818"}, + {file = "grimp-3.18-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5760ae67db4a230e34e37a743facee2daab407176b1de8ad7a3e5fe87de1315b"}, + {file = "grimp-3.18-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3a86f60ce34e923e4a78de33621a1d0210eb0c2023d273330adf071937aec96f"}, + {file = "grimp-3.18-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:01ce8ac303b53c8042bbb01ff1b68e7f30e26ba43c86f0708b83de1bffdb7fce"}, + {file = "grimp-3.18-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89a1b57efd0b071ab7c30f1cb42db18255a7160f64ba800f8b15d854a6b4bd50"}, + {file = "grimp-3.18-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:95d9363c23f3762eca01ce786253f238e50aff481727315e46b8c733b7cd22d2"}, + {file = "grimp-3.18-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:c11915eeb8cb33fff0aff7e5c2bd6e76805ff05fee5791482bf00dfa8b5a5704"}, + {file = "grimp-3.18-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:43509137a39e6c6967f3dcc5203b677b789363521179796c026a3a918e3c4040"}, + {file = "grimp-3.18-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1e4e8b25cefcd3ceccde8e2447144c7fbaa14647f6977401773b80e26212db15"}, + {file = "grimp-3.18-cp312-cp312-win32.whl", hash = "sha256:d41e39388f960b8e2839a9749fc7163faedb8650d8cf6d5aed6067c5e0393757"}, + {file = "grimp-3.18-cp312-cp312-win_amd64.whl", hash = "sha256:8bd7a38d3d7cf0844c1c786453726a8d35dee12e724b3ff8553f9cf38081b258"}, + {file = "grimp-3.18-cp312-cp312-win_arm64.whl", hash = "sha256:eb85a21ea7fed7335b6fcc6adf7335fe904b7cef37243092104d4cf0380a4587"}, + {file = "grimp-3.18-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:3965804099c7d87ca910f5215dd8b85abcb8ed19c4a1f111626b756b377d7416"}, + {file = "grimp-3.18-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4b791f9eadd965874682382214c4e3fd79b52476dea4e06b6043f4ecc3d6ef16"}, + {file = "grimp-3.18-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b3cdd4ab37d167faaed3fe4c4075e9598523d48c4e604ce36aec99147834a797"}, + {file = "grimp-3.18-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:90a837d042a64500536bd99ee41cf04e1b16f2e4eb378b8750b9f9366bc8533e"}, + {file = "grimp-3.18-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:4e20504afdd0faa2fac8941d4c72fad40863619748d96abe7073caa7cb4f13c2"}, + {file = "grimp-3.18-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:64a250970137e097ce7b97b23014448856846af83934b054423a515d1bf87c35"}, + {file = "grimp-3.18-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a089f692d22fe5f5dba1e5c5c2cbd0c9f4b7ed420e0f3ed6e8efd2fc109ca137"}, + {file = "grimp-3.18-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4426c7c57ade9ae8e323765b37b4c785b6e2cb374038b42d6b36110a50c4af46"}, + {file = "grimp-3.18-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2c59b458c6e07d90594b25076d6887847957c3c189e38a9c6a81cbefaeb13c6e"}, + {file = "grimp-3.18-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d107902da5048aca9be26111b8379f50e02dbdad4dfe54775ec8a2cb365018ef"}, + {file = "grimp-3.18-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edf249c111e5e6e9fcc1bea1dc3f3e6069fac18bddda9b65ec8434da883948ab"}, + {file = "grimp-3.18-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8785c2ddd195f684f9b0adae6d800bd2ca817822d7f5d4ee10f58abf1fb6ae25"}, + {file = "grimp-3.18-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fc8e05fb0014ee401ae9af5360cd367679e822dcf68ef4bd63aca2e3c3e2d47b"}, + {file = "grimp-3.18-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:035ea5851a421c46d77cd041c8d7a9be9e7a2a395c8e7b028a0f95fbb79322c0"}, + {file = "grimp-3.18-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ea3ccde88a5dd09488607a6819bd74c4ab5feca04a0c326c048ed4d06959114b"}, + {file = "grimp-3.18-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:515d69d7ca24d6d3ad09f9fe0c6a176165fc79948df0f9d75e5a1fbdb4a28f31"}, + {file = "grimp-3.18-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:92d5bebf41e1506f72b80500a335538022f702a5565d64765ba0c46ed15d00bf"}, + {file = "grimp-3.18-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:69256958d3b8b7a0298e028ee4a9cb40e0baf0b01b99eecbf6e1f57bdec89da0"}, + {file = "grimp-3.18-cp313-cp313-win32.whl", hash = "sha256:22f1be5207d1244d90f502285c6ee0304a025633c381e44a796e6bcd41b13771"}, + {file = "grimp-3.18-cp313-cp313-win_amd64.whl", hash = "sha256:2aa75b562f134fab37d64b778b5152bef0be27549cdc2084feb5dae0329f3fff"}, + {file = "grimp-3.18-cp313-cp313-win_arm64.whl", hash = "sha256:a2fe4fb3529b3e68e70cf1bb026effd129e6f3887f5236c6062b89680f9214bf"}, + {file = "grimp-3.18-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:6e26c3020843ceeda2bb699ea09e27b6654f7823b51e779b9c607e204b34e1f4"}, + {file = "grimp-3.18-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:7bc0587c8622e1275e217e924c27e54420f7a06db88d133f4adad18a0298b040"}, + {file = "grimp-3.18-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5083d474794a20d8b3d53c2955d9cc6e590fe3d55a467ec6e4940d2d1413e5d3"}, + {file = "grimp-3.18-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:e3e101de453ba3a5ed7e6776857e12e75913a71254779240b952b00fb99be327"}, + {file = "grimp-3.18-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:d5ca964848d32b871a6b5755ec9e2c8499945268fb07065805616c2f0ccc7b94"}, + {file = "grimp-3.18-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:742661cf3af03b9cae83abbd47a86e3fee2e5241c9c0ca1506ee3a2d9d21c835"}, + {file = "grimp-3.18-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:cc513ef2584df912b7bc165a7a1d549cf8f6032e80fc11cf947ca9c2fcf3c5a2"}, + {file = "grimp-3.18-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:47ff6d75a2b8db5c0b98be66be74ff7d7ba6d603feca3b5cbe6684a849ffb08c"}, + {file = "grimp-3.18-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1453b4b00c324cdaabb5c70f57d45a84882dd877883cefbda859fd66b400bcd6"}, + {file = "grimp-3.18-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d2611d37e446eee05e6621a28e4ae7b612899715cae637037404e7a0d91f327b"}, + {file = "grimp-3.18-cp314-cp314-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:438544f3e7aaed32ddc09d8a8f6685e67e7ce43f0931f7149426fb7b483a6df6"}, + {file = "grimp-3.18-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00f68805578f97941da62ea6f77c1df18e7b9e405cdc673c1f93450594b832aa"}, + {file = "grimp-3.18-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e639ff9e2fc9f0ad6c038f03746e61f671a1520eac1a8c0c7b35e2f047405e97"}, + {file = "grimp-3.18-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca1231a495d685c91c4aabb28a515e7b57e10bc2a3e9b177d88182e038cdc0cc"}, + {file = "grimp-3.18-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e02c80058b07e63151a88d562cef78e128f6e3d3f0e82cbd4f41bfc4cd3016b0"}, + {file = "grimp-3.18-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:82e3eed4ce2488eacca6b32c57116ad2eeb9937320dadc1a8e75e1135afbe6ff"}, + {file = "grimp-3.18-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:026fb12839d4b6b7108b9684e234772f881026239945d94016eabe60a24ea405"}, + {file = "grimp-3.18-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:15c97cd94795ebce57acd6190f25003d343e8cece486d9978df03b29dd53410c"}, + {file = "grimp-3.18-cp314-cp314-win32.whl", hash = "sha256:3bfb79295c12fe96b9ec87590768c52eddde62382de1babc4c6e83f9deced86f"}, + {file = "grimp-3.18-cp314-cp314-win_amd64.whl", hash = "sha256:103aa8031f3e08353716618f47f16ae9e91e7add2f64fff77d02cada62f04728"}, + {file = "grimp-3.18-cp314-cp314-win_arm64.whl", hash = "sha256:932e992a798c4b69ad77957cc09517c22cd1aa3b07cc85aba41e14406cb1a42f"}, + {file = "grimp-3.18-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:73633cf2c822f34a38dd77e34e015afd6fc489998abeab8b91a7149fc63c1a1b"}, + {file = "grimp-3.18-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1d7418bc8b511a12e21099b43349588785254d3d38ecf0dac88aa927c91ebc47"}, + {file = "grimp-3.18-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:34090d38fba4223a6a9a5cc8f5c7523fdd9db7dfaef80dd90376d45242e59704"}, + {file = "grimp-3.18-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:3463911ead5015eaa91da3721b84c900cdcaec22d149133827a76ea86d798cb1"}, + {file = "grimp-3.18-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:b989ad42e66d2ffb75dddfbc14bb980790fbbce6f58fdccc3df99cebf4661689"}, + {file = "grimp-3.18-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4390a69445c586c1ad1c4aaab9e3ec44fcd3f662c04476dbb77b3b6dde5ed6ac"}, + {file = "grimp-3.18-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a34f3414a8f944d1b30b958fe571f5ca07cd6fa8fd7dcffea89e995a6cd5ee0f"}, + {file = "grimp-3.18-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:98e62116c9a323f00b580b6d9a4aade24d047bdf37b3a4f5098098aa055063be"}, + {file = "grimp-3.18-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ecaf989c284fbd0abc8710b79565b5ac2165b9d74e77ced52463c576e5b00a0"}, + {file = "grimp-3.18-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:07abd5b67a0d2b8d1809cdea9f18d83c8a92525dc54b50726a30cfe89eb66d55"}, + {file = "grimp-3.18-cp314-cp314t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9a59c0727f35f765a93c20cc0141fbab5bad4ae58b5fb80c9b7ed4e7ac3b3554"}, + {file = "grimp-3.18-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0040681a32586afc227016164ff3df7a20a628beec89b6ea61c2c0698a8dbfa7"}, + {file = "grimp-3.18-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bb021eb3e3634d109aba8f4f06f702da1574de12eb9171fb115bcc77bca69f56"}, + {file = "grimp-3.18-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ba3160f9ee8a1c4c2be7ea7354930c0a8154a3eae543544d3a9acd098449b70"}, + {file = "grimp-3.18-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:848f21c262f5090fe048857f0a35999516607dd54c588474200a311d337fc4fb"}, + {file = "grimp-3.18-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:3b3f3d25fcb497c30f8c4d6ef076ddcd5214819ce7b15b5cd4a6038a3e2c4f51"}, + {file = "grimp-3.18-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:8762c40283e9f24cfc58ccdb1b1416915b0c9e7abc20918850e5f690d740eb37"}, + {file = "grimp-3.18-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b855cffdb769994c54800286a72dfa3894d15728dc41eccb42315dce3e6f8232"}, + {file = "grimp-3.18-cp314-cp314t-win32.whl", hash = "sha256:0c18c304540366f4da39fa16dd4fdce4fcf1f82ae812c4fb686defd399db6851"}, + {file = "grimp-3.18-cp314-cp314t-win_amd64.whl", hash = "sha256:0461322a58d7fe66485cc2ddbf725f8bb6c2f3b805826746e208d78e5e4b17d6"}, + {file = "grimp-3.18-cp314-cp314t-win_arm64.whl", hash = "sha256:a79cde5a2052c0c22dfd5ce0e3cb2fa0ef68625c480d779bd331f9d0bf3459f3"}, + {file = "grimp-3.18-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:3a53760b5623c7a0a48caf5981355953f2c2a33c6d78593aad77f40c9070f526"}, + {file = "grimp-3.18-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:18b0901afede6f7f630d285da0f68ec462830550d6e7760ad04dd3cfe94830fa"}, + {file = "grimp-3.18-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd8e76d4e7df434abf383a9ec9aeffa20162b46944f0ba7a8854eaec604e97d5"}, + {file = "grimp-3.18-cp315-cp315-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:4f0f47e58d205decaac5b2189b0225ba7a2c30f631cd57525f705f9e5193b30e"}, + {file = "grimp-3.18-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3586faa07635845a7d541844ea4969af365cebe9cfaa405e7a504f51a04a3b82"}, + {file = "grimp-3.18-cp315-cp315-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:73d06cc1c29b3e96558e2f929a0253b4fc45e12a32d1b2dac0b950575fd7ff95"}, + {file = "grimp-3.18-cp315-cp315-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:45dda7406194bd486b1f43674fbbdeaf5c6b66696647944652f4ef205aff1792"}, + {file = "grimp-3.18-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4647f81d393909e903b0cb4ce910b65c1f85c26bd20ea6addbd83c87eee5a1a7"}, + {file = "grimp-3.18-cp315-cp315-win32.whl", hash = "sha256:fddfc9e1004238f5118389db8b4af28bb197846d2fb7f3d55000902aeb14e970"}, + {file = "grimp-3.18-cp315-cp315-win_amd64.whl", hash = "sha256:9172763b79dfc1880a2833594d7b008b7afeff3236b2fa3c33ffd8f6cc6b3eae"}, + {file = "grimp-3.18-cp315-cp315-win_arm64.whl", hash = "sha256:f52b5cce5bfa785f1e91c952124c8a264789acd25240a2478636db0c9b61dab3"}, + {file = "grimp-3.18-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:050332a3e09da40624d147d0b8521fad50a9d205ab228737965a388cd252eb56"}, + {file = "grimp-3.18-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:be75ccc563e7452949c7330ed06d8d128eaaff4433fdc09dde363ecd35552219"}, + {file = "grimp-3.18-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a578687f1a54c9b114199d56574306599ca08f1b6a95b81f4ef0c60a7aede475"}, + {file = "grimp-3.18-cp315-cp315t-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:2506958d0b6fe01759cb633d39489bd09f1fb0ce4b9a9228d9ce9ac00863cca1"}, + {file = "grimp-3.18-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:eb12a7c3e3f0e5a60265e8264a71b35a5fb0db80fee55d4cc7a312e992fc1c36"}, + {file = "grimp-3.18-cp315-cp315t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d91b8b9eaf74953133b9516715bcbc274ebbcf925c8b8ce17ad5f0a433a8a75d"}, + {file = "grimp-3.18-cp315-cp315t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1bf220bf26eb007010772601b1143262d0faeb2d6161191ba2684abd5ccf5b4b"}, + {file = "grimp-3.18-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d26b386fbb260be374bf8e4b5250ee608f4a0b0597c428b6ede3fdde6308b258"}, + {file = "grimp-3.18-cp315-cp315t-win32.whl", hash = "sha256:a004d7cb708d784407d42073babb82e10dfe472652b4973e4706bb8ab36cd1c1"}, + {file = "grimp-3.18-cp315-cp315t-win_amd64.whl", hash = "sha256:982d1720ae596243a9582c264838498ddc920f3f0d0be24b3d91288c14e5ffad"}, + {file = "grimp-3.18-cp315-cp315t-win_arm64.whl", hash = "sha256:c0ec5074186acac4c6915b1557c12fd9594c7973a141c1f23edcdc6671fd341e"}, + {file = "grimp-3.18.tar.gz", hash = "sha256:581d3f0cd09983bbffa4507791baec8c4b56daf84a423c4e19b2b6f4888fd71d"}, +] + +[[package]] +name = "grimp" +version = "3.20" +description = "Builds a queryable graph of the imports within one or more Python packages." +optional = false +python-versions = ">=3.11" +groups = ["dev"] +markers = "python_version >= \"3.13\"" +files = [ + {file = "grimp-3.20-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6426a6529a771a11d8c4d1e8af982f35709de2ce506d2d4acaff9d5b38ed4998"}, + {file = "grimp-3.20-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:32620f0f41b73fbaa1b2f63ea483a5ffbb32bdb8c2092781ad6e529dd3c8d647"}, + {file = "grimp-3.20-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:876171ff6fc72602897cd8829c3da7d5b74d60f13a661ba4ce8ce400d059d036"}, + {file = "grimp-3.20-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:0d571ab89b485d066eb828f0c1c375beea11ed6af1b7b531f53c85f6763595e7"}, + {file = "grimp-3.20-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:02f226dd2958d456ae3cd04265fdaa0bd0d64aaea9a23cbefba343c431054871"}, + {file = "grimp-3.20-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:84dffe49951a68d9dae83a5fc17f24efb7f83f609e7c84a4d9ace05588283d99"}, + {file = "grimp-3.20-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:e33a8a9c7442ea8f88a2483e048100c1c9f573fc6ecd0f81fb8a8488bf8c1031"}, + {file = "grimp-3.20-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9638048d94b826b5fb9d960e3f72586bb0e51b2a79923f6d687160fef2263930"}, + {file = "grimp-3.20-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2cbd95c0dd3758b8d2e2c20bfc601cbcdf86da3cbd30cc8a63e0fdf7d16f51d9"}, + {file = "grimp-3.20-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:d330cc8826aa29aec2bf8d983102d2223de9b4146ee4374f9737c55511f9ae62"}, + {file = "grimp-3.20-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:2afe63230aa7195815bc903e4c0fa1db6f52212f934380f1145e9aaeb08a16d3"}, + {file = "grimp-3.20-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:96d6362df53ce4c7f92f99b283f154ba6b28fd64b0cd10df8c290875be2ae4c1"}, + {file = "grimp-3.20-cp311-cp311-win32.whl", hash = "sha256:bb69a725f0bf99034be2d5ed8474f1c9075d67f2e20dd0a66f1895f3bf9a997b"}, + {file = "grimp-3.20-cp311-cp311-win_amd64.whl", hash = "sha256:6660cf5620bdcd7d44cad4cd53d77e28156a6dbdf8572a30776245a7d02bea27"}, + {file = "grimp-3.20-cp311-cp311-win_arm64.whl", hash = "sha256:1a5cf0609112ccc59f4f3aee3fb149393bac80848b9a4dc365acfd2667fd0b70"}, + {file = "grimp-3.20-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:96cfad40261de49394fcd4cea3aaf3100a2b1b74eadc42ec22937fb0b209a655"}, + {file = "grimp-3.20-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e8721f396c9e853b2807abd1e5a5757944d981829dddce8e4def94b116c7e6f3"}, + {file = "grimp-3.20-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5ed8fddaa9db627e57d9f3cc9cb694854712cd3b8988b420eac8db3845f7dee5"}, + {file = "grimp-3.20-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:4ba157d97ea39e0d60c9cd7c417448f94ce9988d2f3024bc193beea25d769352"}, + {file = "grimp-3.20-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:8b2d7944997473e52f91a4540fd094e6b9327f72840fb84cd72c9c7116d15687"}, + {file = "grimp-3.20-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:d7009ae88882afd89f66bf800f184d8fce4ee362a30768a2046a007d047e13c7"}, + {file = "grimp-3.20-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:5d0a36f0315efd095a3562261ad0f1bb9cec25104f1d258f636fcad4b1035112"}, + {file = "grimp-3.20-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b1a288f453839f93747864c4cab5e09dfb00f162e45294a8fc5c3634756b35c5"}, + {file = "grimp-3.20-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a34103f253057ba4d052ddb7cf0bb5ec4c254cb68355c0a6a41fa735434c5233"}, + {file = "grimp-3.20-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:e8e8124315e7640ecbf8c43596bedbe9bd2e98fb0657024af300700cfb41b243"}, + {file = "grimp-3.20-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3584cd868cebb77d7993b2539575477bee4e156d7e8b9840644ccc491731a3c5"}, + {file = "grimp-3.20-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a309cdb1ef2f840305e3214e88ecb08da3651867a747d01f20fb93096d1f6f40"}, + {file = "grimp-3.20-cp312-cp312-win32.whl", hash = "sha256:978a6cbddfa1c289988cf0dea19a831adf80b6b330911e8a3bb1b72d3401539b"}, + {file = "grimp-3.20-cp312-cp312-win_amd64.whl", hash = "sha256:ab528f0b33485df38c12ff0906f6a7d719eb6e6027859f464cfd08abbd430b7f"}, + {file = "grimp-3.20-cp312-cp312-win_arm64.whl", hash = "sha256:8d47c1e1d8a5659b1c35c9e3a43d0ccec6802ae5581924dc466f421314bb59b4"}, + {file = "grimp-3.20-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:a5ad98fe1421c1007508a6bce595630385920340fbc2b43588c80ad73cefcb92"}, + {file = "grimp-3.20-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7da53af57d8f8789655e513f57332ab7604cd89b6c80c6e9ad4d8caa5f7ac630"}, + {file = "grimp-3.20-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b0f23e00bdbb0eed99c6696037fae5c62feec1f5af4ce041fbc575ed448d4ee0"}, + {file = "grimp-3.20-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:6df4a0e4b2749f0eb66550d91107548ef9dfe7a3a9f03a3f925f25ebdb358187"}, + {file = "grimp-3.20-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:082e69ababe4a63904aba4e234faa51e2861bfb627d2459fd4dee86954ca0141"}, + {file = "grimp-3.20-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fc03b7acba0c9eb273a0b2165046caf20576e26bf022a88dd458b6e1cfcb6a7f"}, + {file = "grimp-3.20-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:633cca13858b41998dfa94e0208eb504ed5e956e0b5fcd1e8a4c9e47c5c76162"}, + {file = "grimp-3.20-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bb11c66536376d607bf166a475f24ba5f9462c8ed22958a5cd03816a1a83bd4f"}, + {file = "grimp-3.20-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ab94d8cacb6243d7c611f39cb41085e3d2649c017d6972b1decfce01ae532777"}, + {file = "grimp-3.20-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:e56041d766bebec55f57556768f15e3d19b41feb1c48d4ce44ff8d4dff8179f7"}, + {file = "grimp-3.20-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:8f965437ee431b8d9365ad1afe6ad2daf9840de828996fcd866324ba2a8dc532"}, + {file = "grimp-3.20-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7845cc11960e8c554d7861df28b494e851794943b7ebdde90d5ec61a3fbc79b8"}, + {file = "grimp-3.20-cp313-cp313-win32.whl", hash = "sha256:14cffc84e41381bd7e1fd4a6081e269ea5fa14fd74f6e7341d3dbfac0afdf72a"}, + {file = "grimp-3.20-cp313-cp313-win_amd64.whl", hash = "sha256:85f83e6a030c183693fbe29f40783743b2f1a57606859a262d6696ee6fd154ec"}, + {file = "grimp-3.20-cp313-cp313-win_arm64.whl", hash = "sha256:525245aa57a5bc841bd3af154b4bd20c3f290386b4e03cc103da9d655ac58289"}, + {file = "grimp-3.20-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:e6fac8ce1ee39208a23047695ca8d058eb70df563640ee15de68f2afaafa6fab"}, + {file = "grimp-3.20-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:27dcc731204b9cdababe698676536e313499e8683ff72cf66e133c5e4813d759"}, + {file = "grimp-3.20-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:4f4cf78fb13cfc4c47eb1985ba90c166613a55d6430de39b7eae0f16f822a7af"}, + {file = "grimp-3.20-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:07f3874502d559a45bf4885e741bff26c82d386273b7adfd9e80634fec5aa0b0"}, + {file = "grimp-3.20-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:b482ff3c5ffa1d00a116d8943446e68ecb1b71d9ce4d9769e305d41cd9eee0d5"}, + {file = "grimp-3.20-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:b73181b538286336b1225a13ffd5440f4c0a2eb3a05fb8b7d35b9b874ecf3ff7"}, + {file = "grimp-3.20-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:eedaccc6933402a8b0f85a68e608f946899f514b33f1ca7ac066b712358f5d47"}, + {file = "grimp-3.20-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5bd013cbb5c145cdb7759f28b73b39bc9ba75aa293bfe12e674c8c62f3311b91"}, + {file = "grimp-3.20-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:29985c6e118019bfd0e0da16e7b27792a0b44fb44ce97af75b36949456935ade"}, + {file = "grimp-3.20-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:1021f210bdf83e59bb4a9aa08ff9cfb9210f9b099f730ed1511dc3302e5904d5"}, + {file = "grimp-3.20-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:bcc793720b606e767d72e47a0c84b6c1e1a7e90d8200ad96b6c1eadafcd7bfb9"}, + {file = "grimp-3.20-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:965e0a162b6a8f99a3cbf3089d5975e5e82c47e59821b17609c16f24ee3b62bb"}, + {file = "grimp-3.20-cp314-cp314-win32.whl", hash = "sha256:dd287407ea542e3f467b8673fd2bfe31b41a3f6e5cc31f8e0b4017c997f0839a"}, + {file = "grimp-3.20-cp314-cp314-win_amd64.whl", hash = "sha256:df3b26d591417f305be9463e93f27fcc5b17e8c17529ef292886bc0bfe21f216"}, + {file = "grimp-3.20-cp314-cp314-win_arm64.whl", hash = "sha256:bb07b50279b08d29ec91469f6b39930eee597a0690dccf911239ed5083a641e8"}, + {file = "grimp-3.20-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:1a2fcfb6db4cdb386e7df8b097f7c9566c36f90bb7cbcfff4950fd035f13191c"}, + {file = "grimp-3.20-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:fc2f1836d001ac0ca7244c282e2e0a8114b31bfd2ef9ffec43cc3c3858543cb4"}, + {file = "grimp-3.20-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2fe5719edd628ca50c1c28332749da6e81fea163d7dec42d304ff93397b9a2db"}, + {file = "grimp-3.20-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:a47db007d8eed48071250af906d762ea41ae3e65673ae03cbc5aaae8aded3b12"}, + {file = "grimp-3.20-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:c9bf4965bf2f880ff722a635f027fa413aa226406d10b64b2da6a4f68c632f25"}, + {file = "grimp-3.20-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:1eb0945be387d9c597d18f35b386b64cda1b732c542ab1cc39f962d43c2c4518"}, + {file = "grimp-3.20-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:f494a4f10ceeb9de17d953b8df472e6a3f9db6d69b762c366fd48158257cb5ab"}, + {file = "grimp-3.20-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c8b0ad7e7842456a33188e4684d73083467f3399ea2b88b7ba06a0bed9a16139"}, + {file = "grimp-3.20-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bb9d6a147b8cba2105ce3c62fc487980e160bd48f875c59661cb6502c4f1d2d8"}, + {file = "grimp-3.20-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:e159609e79adc28303b170940fc6377609ef2d477877616a3f66dbbe81531b00"}, + {file = "grimp-3.20-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:e4f13e5138bc0cbe538075dc3df4883900386f87e1d17c251d1aa83c2504bab3"}, + {file = "grimp-3.20-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:23423a85da1db067ca84c5b9393bff005478954043df65966cbe98d8b1e27289"}, + {file = "grimp-3.20-cp314-cp314t-win32.whl", hash = "sha256:1a40343cb35b683bdd3f54f4597863a4647faa4cafcfa5e6b832b66af22c3897"}, + {file = "grimp-3.20-cp314-cp314t-win_amd64.whl", hash = "sha256:db9cb40b4e1943f645982d8a6d697837d6b00b25d55b1781a2578ce9a1ae2c49"}, + {file = "grimp-3.20-cp314-cp314t-win_arm64.whl", hash = "sha256:00b7421cfd0307e8ff6749a30fdd89502b74916c55c5c38c0e16f512a1b661eb"}, + {file = "grimp-3.20-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:4a1248b328a9c47cd1cb193ff042f3de87c19f751f95280f82db5676d861ebfb"}, + {file = "grimp-3.20-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:c704da65e15e805f0aaf49b6edf68587bf1941dfc53f873cf159c4097c263cd1"}, + {file = "grimp-3.20-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9bf3bfb6d19b5203f44bbd4dea60b708fb2e282caf19914862eff955a6ab0a44"}, + {file = "grimp-3.20-cp315-cp315-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:41b85c0169ab65e3fe3ed6bc291732d21d1ef192a3eafc40c34b1095dba7d814"}, + {file = "grimp-3.20-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:05441560b358a5456225d2e3aafc581001d748146372297153adf4ed49721307"}, + {file = "grimp-3.20-cp315-cp315-win32.whl", hash = "sha256:50d8a07e0072dd7a65c5641080b2245920369eea1292a68c22ab9d67fb4e4045"}, + {file = "grimp-3.20-cp315-cp315-win_amd64.whl", hash = "sha256:82563791b748df48d7f80b3ef65d9c25c24b7acff7507fcbd97f028e7fcc6cdb"}, + {file = "grimp-3.20-cp315-cp315-win_arm64.whl", hash = "sha256:7d185ac1ed79b7fa5ddd7152b4a51c939b5ada823c0a160fea263b33c871d84e"}, + {file = "grimp-3.20-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:05fd41fdc55cb6b4067ca3d7f102ccc561af3324662dea2ef8266f2b246c9a7f"}, + {file = "grimp-3.20-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:d05617879a3e92bd0be3ffdd909a4b45682fb4ca9c414b8b42b79ad35297db25"}, + {file = "grimp-3.20-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9db891fd3fa21b9a809db1d8f7cd053998ab3e57d21518bd806e47d07f4383f9"}, + {file = "grimp-3.20-cp315-cp315t-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:2b11f90e86240ded60795668acc130e6a6bb9d4292d7cca260ecb65c2e278f5b"}, + {file = "grimp-3.20-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c208c8636f13063c31af8b9262decf70266b7d85f63e6205c1df7acf38fe129a"}, + {file = "grimp-3.20-cp315-cp315t-win32.whl", hash = "sha256:24f6a94fb4846c0e472f017d1cec1f37bac7b3d901a49a3773ec70c1eebeb5a8"}, + {file = "grimp-3.20-cp315-cp315t-win_amd64.whl", hash = "sha256:efecc5733468189a0a71cd4f1b2c54d9c3b5dcffd1b7630824bbcd7fdc696814"}, + {file = "grimp-3.20-cp315-cp315t-win_arm64.whl", hash = "sha256:c56f80fdc44ff40a0b3d8bbebe5fbe47a345b237189c108d33d95444df19623a"}, + {file = "grimp-3.20.tar.gz", hash = "sha256:f6e3052d9ce85af2d930ad5285d2ed5311ead2af1542add9f72e587ef679c25b"}, +] + [[package]] name = "grpcio" version = "1.81.1" @@ -1664,6 +1938,28 @@ files = [ [package.extras] all = ["mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] +[[package]] +name = "import-linter" +version = "2.15" +description = "Lint your Python architecture" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "import_linter-2.15-py3-none-any.whl", hash = "sha256:9aaf16a88ac1e99d5a464cd7f66b6a05f7060bfa761162e0ed441773a267ed3b"}, + {file = "import_linter-2.15.tar.gz", hash = "sha256:1da912bea5e172a82a3ce617b5543f75cf64dc0d8f4d9b46c5578b68ccb81590"}, +] + +[package.dependencies] +click = ">=6" +grimp = ">=3.17" +rich = ">=14.2.0" +tomli = {version = ">=1.2.1", markers = "python_version < \"3.11\""} +typing-extensions = ">=3.10.0.0" + +[package.extras] +ui = ["fastapi (>=0.113)", "uvicorn (>=0.17.1)"] + [[package]] name = "iniconfig" version = "2.0.0" @@ -1860,6 +2156,31 @@ files = [ {file = "librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1"}, ] +[[package]] +name = "markdown-it-py" +version = "4.3.0" +description = "Python port of markdown-it. Markdown parsing, done right!" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "markdown_it_py-4.3.0-py3-none-any.whl", hash = "sha256:7aa1511a46c39138de78d9eba92ce47e63124d8003fc98b3a351909e04239efa"}, + {file = "markdown_it_py-4.3.0.tar.gz", hash = "sha256:91a58fa5b72c71a40cf7177250fd767480d7a2bb3ac426ccfb76fb90305fdaaa"}, +] + +[package.dependencies] +mdurl = ">=0.1,<1.0" + +[package.extras] +benchmarking = ["psutil", "pytest", "pytest-benchmark"] +compare = ["markdown (>=3.4,<4.0)", "markdown-it-pyrs", "mistletoe (>=1.0,<2.0)", "mistune (>=3.0,<4.0)", "panflute (>=2.3,<3.0)"] +coverage = ["coverage", "pytest-cov"] +linkify = ["linkify-it-py (>=1,<3)"] +plugins = ["mdit-py-plugins (>=0.5.0)"] +profiling = ["gprof2dot"] +rtd = ["ipykernel", "jupyter_sphinx", "mdit-py-plugins (>=0.5.0)", "myst-parser", "pyyaml", "sphinx", "sphinx-book-theme (>=1.0,<2.0)", "sphinx-copybutton", "sphinx-design"] +testing = ["flit_core (>=3.4,<5)", "pytest", "pytest-regressions", "pytest-timeout", "requests"] + [[package]] name = "markupsafe" version = "2.1.5" @@ -1942,6 +2263,18 @@ files = [ {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, ] +[[package]] +name = "mdurl" +version = "0.1.2" +description = "Markdown URL utilities" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, + {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, +] + [[package]] name = "multidict" version = "6.9.1" @@ -2781,7 +3114,7 @@ version = "2.21.0" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.9" -groups = ["test"] +groups = ["dev", "test"] files = [ {file = "pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9"}, {file = "pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c"}, @@ -2998,6 +3331,53 @@ files = [ {file = "ResourceBundle-2.1.0.tar.gz", hash = "sha256:32bcbfd8af9c0331c19e6851db58774bf84c54433c1d2378fc9a4cc4cbb3b00c"}, ] +[[package]] +name = "rich" +version = "15.0.0" +description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +optional = false +python-versions = ">=3.9.0" +groups = ["dev"] +files = [ + {file = "rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb"}, + {file = "rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36"}, +] + +[package.dependencies] +markdown-it-py = ">=2.2.0" +pygments = ">=2.13.0,<3.0.0" + +[package.extras] +jupyter = ["ipywidgets (>=7.5.1,<9)"] + +[[package]] +name = "ruff" +version = "0.17.6" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "ruff-0.17.6-py3-none-linux_armv6l.whl", hash = "sha256:084d9c8f5ec718e7eba007dba339e7cb4f7571d2f267558ae080bf428fb6a69b"}, + {file = "ruff-0.17.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9d44ef2140402043fd6f689ef541858b80883a8b0a02e38539ef0614ebe57d0c"}, + {file = "ruff-0.17.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:9fbddc08577592e283c265d865e0182de6e33db185494db7b06290d989d888e5"}, + {file = "ruff-0.17.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:435241c61af5909a022f76219d3d1bf24730dc1bf0acabb5ddf4b569ab3cbb30"}, + {file = "ruff-0.17.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d006bbb2945edb17b0ce6a0c1b5f5a8d81ba11dbac294a0a925effa22ce34feb"}, + {file = "ruff-0.17.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd661702202a89c00a4c9d0339008805fa5876bfa1c57e165495c2e62230dfbf"}, + {file = "ruff-0.17.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6a12c50a33936dc00db2be21ba25fb168a8b95c55eda2a3ac85005af69885e4b"}, + {file = "ruff-0.17.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b5aba93b3db4b70c5697e4fee6e0d5b9c8452a9a3a03679611cadc25915a2173"}, + {file = "ruff-0.17.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa3b08254a732acba246891089a152c47c5733dc36b8ecb76ce8602f8326e5e4"}, + {file = "ruff-0.17.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:0692088e6b33455572fb18465e891b443f196e98dc1986825685c77ff6f4c5ac"}, + {file = "ruff-0.17.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:fb589e032806bb942e4fb526f30b80a1a64112147ed9f1d38cc3de2e255b6f45"}, + {file = "ruff-0.17.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1939b3d701c7b6981b7cf93473de5bf88b129b9ba84efaed5154cc517c44634d"}, + {file = "ruff-0.17.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1a0bea6aa1216e0ec4cd35d3dbccec0d772a7c2aad28ec9c6e82571dff2c20b0"}, + {file = "ruff-0.17.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:3db61f5015600543a581b07fa7f6f64afa0eeedefe16034cadd88c4074087582"}, + {file = "ruff-0.17.6-py3-none-win32.whl", hash = "sha256:c2f4af6670b7a0501904e881bb3f1f24bd0d964dec1eedbd85f0eb73786e1128"}, + {file = "ruff-0.17.6-py3-none-win_amd64.whl", hash = "sha256:9cd2fd9923e9806b8b6b67a3469e2258e84bd4d21e45d5a1a690afdfb9c8e57d"}, + {file = "ruff-0.17.6-py3-none-win_arm64.whl", hash = "sha256:d8b14e1473dc86ab9069cf7a2ba5041dc012f59110201844ed04cfddf07055a0"}, + {file = "ruff-0.17.6.tar.gz", hash = "sha256:2b04276561331300325040bdca21460770029ec574d4c479099e39e8ad1ed43c"}, +] + [[package]] name = "s3transfer" version = "0.19.0" @@ -4004,4 +4384,4 @@ propcache = ">=0.2.1" [metadata] lock-version = "2.1" python-versions = "^3.10.0" -content-hash = "7e7c22d4a338ce64153f32009989b79d2bec995189830d6441d6e22a5c9f1a4e" +content-hash = "cb48804aa0fab678e9af029e5d2dc681061348a8c13959acc209046bf10c3cc8" diff --git a/pyproject.toml b/pyproject.toml index f705d02be..ffb367294 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,8 @@ aiomysql = ">=0.2" aiohttp = ">=3" boto3-stubs = "^1.43.0" types_aws_xray_sdk = "^2.13.0" +ruff = "^0.17.6" +import-linter = "~2.15" [tool.poetry.group.test.dependencies] boto3 = "^1.42.95" @@ -92,6 +94,32 @@ greenlet = ">=3" sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER" no_lines_before = "LOCALFOLDER" +[tool.ruff] +target-version = "py310" +line-length = 150 +extend-exclude = ["docs/examples"] + +[tool.ruff.lint] +select = ["B", "ASYNC", "RUF006", "TID251"] +ignore = ["B904", "B007", "B008", "B024", "B027", "ASYNC110"] + +[tool.ruff.lint.flake8-tidy-imports.banned-api] +"psycopg".msg = "Shared code is driver-agnostic; add a DriverDialect method instead." +"mysql".msg = "Shared code is driver-agnostic; add a DriverDialect method instead." +"aiomysql".msg = "Shared code is driver-agnostic; add an AsyncDriverDialect method instead." + +[tool.ruff.lint.per-file-ignores] +"aws_advanced_python_wrapper/*driver_dialect*.py" = ["TID251"] +"aws_advanced_python_wrapper/aio/driver_dialect/*" = ["TID251"] +"aws_advanced_python_wrapper/psycopg.py" = ["TID251"] +"aws_advanced_python_wrapper/mysql_connector.py" = ["TID251"] +"aws_advanced_python_wrapper/aio/psycopg.py" = ["TID251"] +"aws_advanced_python_wrapper/aio/aiomysql.py" = ["TID251"] +"aws_advanced_python_wrapper/utils/*exception_handler*.py" = ["TID251"] +"aws_advanced_python_wrapper/sqlalchemy_dialects/*" = ["TID251"] +"aws_advanced_python_wrapper/django/*" = ["TID251"] +"tests/**" = ["TID251"] + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/tests/integration/container/test_autoscaling_async.py b/tests/integration/container/test_autoscaling_async.py index 285cccccc..1a516abf8 100644 --- a/tests/integration/container/test_autoscaling_async.py +++ b/tests/integration/container/test_autoscaling_async.py @@ -16,7 +16,6 @@ import asyncio from datetime import datetime, timedelta -from time import sleep from typing import TYPE_CHECKING, List import pytest @@ -154,7 +153,7 @@ async def inner(): stop_time = datetime.now() + timedelta(minutes=5) while datetime.now() <= stop_time and len(rds_utils.get_instance_ids()) != original_cluster_size: - sleep(5) + await asyncio.sleep(5) if len(rds_utils.get_instance_ids()) != original_cluster_size: pytest.fail("The deleted instance is still in the cluster topology") diff --git a/tests/integration/container/test_basic_connectivity.py b/tests/integration/container/test_basic_connectivity.py index 5b2b1c57b..96f59c9f5 100644 --- a/tests/integration/container/test_basic_connectivity.py +++ b/tests/integration/container/test_basic_connectivity.py @@ -125,8 +125,7 @@ def test_proxied_wrapper_connection_failed( try: AwsWrapperConnection.connect(target_driver_connect, **conn_utils.get_proxy_connect_params(), **props) - # Should not be here since proxy is blocking db connectivity - assert False + pytest.fail("Should not be here since proxy is blocking db connectivity") except Exception: # That is expected exception. Test pass. diff --git a/tests/integration/container/test_basic_connectivity_async.py b/tests/integration/container/test_basic_connectivity_async.py index 2a847a322..d35b55745 100644 --- a/tests/integration/container/test_basic_connectivity_async.py +++ b/tests/integration/container/test_basic_connectivity_async.py @@ -138,8 +138,7 @@ async def inner() -> None: connect_params=conn_utils.get_proxy_connect_params(), **dict(props)) - # Should not be here since proxy is blocking db connectivity - assert False + pytest.fail("Should not be here since proxy is blocking db connectivity") except Exception: # That is expected exception. Test pass. diff --git a/tests/integration/container/test_blue_green_deployment.py b/tests/integration/container/test_blue_green_deployment.py index 96a307af8..b1fd314eb 100644 --- a/tests/integration/container/test_blue_green_deployment.py +++ b/tests/integration/container/test_blue_green_deployment.py @@ -562,8 +562,8 @@ def direct_topology_monitor( version = record[6] is_green = BlueGreenRole.parse_role(role, version) == BlueGreenRole.TARGET - def _log_and_return_time(_) -> int: - self.logger.debug(f"[DirectTopology] @ {host_id}] Status changed to: {status}.") + def _log_and_return_time(changed_status) -> int: + self.logger.debug(f"[DirectTopology] @ {host_id}] Status changed to: {changed_status}.") return perf_counter_ns() if is_green: diff --git a/tests/integration/container/test_blue_green_deployment_async.py b/tests/integration/container/test_blue_green_deployment_async.py index 38902efda..cac7e71c1 100644 --- a/tests/integration/container/test_blue_green_deployment_async.py +++ b/tests/integration/container/test_blue_green_deployment_async.py @@ -747,8 +747,8 @@ async def _execute_topology(c: Any) -> None: version = record[6] is_green = BlueGreenRole.parse_role(role, version) == BlueGreenRole.TARGET - def _log_and_return_time(_: Any) -> int: - self.logger.debug(f"[AsyncDirectTopology @ {host_id}] Status changed to: {status}.") + def _log_and_return_time(changed_status: Any) -> int: + self.logger.debug(f"[AsyncDirectTopology @ {host_id}] Status changed to: {changed_status}.") return perf_counter_ns() if is_green: diff --git a/tests/integration/container/test_failover_performance_async.py b/tests/integration/container/test_failover_performance_async.py index 8e361ac0a..e22714a21 100644 --- a/tests/integration/container/test_failover_performance_async.py +++ b/tests/integration/container/test_failover_performance_async.py @@ -292,7 +292,7 @@ async def _open_connect_with_retry_async( if conn is None: pytest.fail(f"Unable to connect to {connect_params}") - return conn # type: ignore[return-value] + return conn def _stop_network_thread(self, test_environment: TestEnvironment, sleep_delay_seconds: int, downtime: AtomicInt) -> None: diff --git a/tests/integration/container/test_read_write_splitting.py b/tests/integration/container/test_read_write_splitting.py index fcaf33ec1..a8740443c 100644 --- a/tests/integration/container/test_read_write_splitting.py +++ b/tests/integration/container/test_read_write_splitting.py @@ -412,7 +412,7 @@ def test_set_read_only_true_in_transaction( if test_driver == TestDriver.MYSQL: conn.read_only = True elif test_driver == TestDriver.PG: - with pytest.raises(Exception): + with pytest.raises(Exception): # noqa: B017 conn.read_only = True assert conn.read_only is False @@ -1127,13 +1127,13 @@ def test_pooled_connection__different_users( assert privileged_driver_conn is not limited_driver_conn with conn2.cursor() as cursor2: - with pytest.raises(Exception): + with pytest.raises(Exception): # noqa: B017 # The limited user does not have create permissions on the default database, so this should fail cursor2.execute( f"CREATE DATABASE {limited_user_new_db}" ) - with pytest.raises(Exception): + with pytest.raises(Exception): # noqa: B017 AwsWrapperConnection.connect( target_driver_connect, **wrong_user_right_password_props, diff --git a/tests/integration/container/test_read_write_splitting_async.py b/tests/integration/container/test_read_write_splitting_async.py index eab162caf..495316804 100644 --- a/tests/integration/container/test_read_write_splitting_async.py +++ b/tests/integration/container/test_read_write_splitting_async.py @@ -478,7 +478,7 @@ async def inner(): if test_driver == TestDriver.MYSQL_ASYNC: await conn.set_read_only(True) elif test_driver == TestDriver.PG_ASYNC: - with pytest.raises(Exception): + with pytest.raises(Exception): # noqa: B017 await conn.set_read_only(True) assert conn.read_only is False @@ -1285,13 +1285,13 @@ async def inner(): assert privileged_driver_conn is not limited_driver_conn async with conn2.cursor() as cursor2: - with pytest.raises(Exception): + with pytest.raises(Exception): # noqa: B017 # The limited user does not have create permissions on the default database, so this should fail await cursor2.execute( f"CREATE DATABASE {limited_user_new_db}" ) - with pytest.raises(Exception): + with pytest.raises(Exception): # noqa: B017 await connect_async( test_driver=test_driver, connect_params=wrong_user_right_password_props, diff --git a/tests/unit/test_aio_aurora_initial_connection.py b/tests/unit/test_aio_aurora_initial_connection.py index 59fc5378b..42c41165c 100644 --- a/tests/unit/test_aio_aurora_initial_connection.py +++ b/tests/unit/test_aio_aurora_initial_connection.py @@ -361,7 +361,7 @@ def test_network_exception_retries_then_raises(): strategy_pick=reader, ) driver_dialect.connect.side_effect = RuntimeError("network-down") - svc.is_network_exception = MagicMock(return_value=True) # type: ignore[method-assign] + svc.is_network_exception = MagicMock(return_value=True) host = _cluster_host_info(_READER_CLUSTER) @@ -396,10 +396,10 @@ def test_availability_marked_when_verification_fails_after_connecting(): strategy_pick=reader, ) # Candidate connect succeeds; the role probe then fails with a network error. - svc.connect = AsyncMock(return_value=MagicMock(name="instance_conn")) # type: ignore[method-assign] - svc.get_host_role = AsyncMock( # type: ignore[method-assign] + svc.connect = AsyncMock(return_value=MagicMock(name="instance_conn")) + svc.get_host_role = AsyncMock( side_effect=RuntimeError("probe failed")) - svc.is_network_exception = MagicMock(return_value=True) # type: ignore[method-assign] + svc.is_network_exception = MagicMock(return_value=True) host = _cluster_host_info(_READER_CLUSTER) @@ -436,7 +436,7 @@ def test_login_exception_raises_without_retrying(): strategy_pick=reader, ) driver_dialect.connect.side_effect = RuntimeError("bad password") - svc.is_login_exception = MagicMock(return_value=True) # type: ignore[method-assign] + svc.is_login_exception = MagicMock(return_value=True) host = _cluster_host_info(_READER_CLUSTER) @@ -497,7 +497,7 @@ def test_instance_connect_skips_this_plugin(): writer = _writer_host() plugin, svc, driver_dialect = _build( all_hosts=(writer,), role=HostRole.WRITER, strategy_pick=writer) - svc.connect = AsyncMock(return_value=MagicMock(name="instance_conn")) # type: ignore[method-assign] + svc.connect = AsyncMock(return_value=MagicMock(name="instance_conn")) host = _cluster_host_info(_WRITER_CLUSTER) @@ -529,7 +529,7 @@ def test_stale_topology_uses_is_rds_instance_not_cluster_dns(): port=5432, role=HostRole.WRITER) plugin, svc, driver_dialect = _build( all_hosts=(custom_cluster_host,), role=HostRole.WRITER) - svc.connect = AsyncMock(name="should_not_be_used") # type: ignore[method-assign] + svc.connect = AsyncMock(name="should_not_be_used") cluster_conn = MagicMock(name="cluster_conn") host = _cluster_host_info(_WRITER_CLUSTER) diff --git a/tests/unit/test_aio_auth_plugins.py b/tests/unit/test_aio_auth_plugins.py index f649a2f16..e4f5ed4e9 100644 --- a/tests/unit/test_aio_auth_plugins.py +++ b/tests/unit/test_aio_auth_plugins.py @@ -511,7 +511,7 @@ def _boom(*args, **kwargs): {"Error": {"Code": "ResourceNotFoundException", "Message": "nope"}}, "GetSecretValue") - plugin._fetch_secret_blocking = _boom # type: ignore[assignment] + plugin._fetch_secret_blocking = _boom host = HostInfo(host="h", port=5432) with pytest.raises(AwsWrapperError): diff --git a/tests/unit/test_aio_contracts.py b/tests/unit/test_aio_contracts.py index dbc438d45..58c6aec3d 100644 --- a/tests/unit/test_aio_contracts.py +++ b/tests/unit/test_aio_contracts.py @@ -236,13 +236,13 @@ async def _body() -> _FakeAsyncConnection: def test_async_driver_dialect_is_abstract(): """AsyncDriverDialect cannot be instantiated directly.""" with pytest.raises(TypeError): - AsyncDriverDialect() # type: ignore[abstract] + AsyncDriverDialect() def test_async_plugin_is_abstract(): """AsyncPlugin cannot be instantiated directly (subscribed_methods is abstract).""" with pytest.raises(TypeError): - AsyncPlugin() # type: ignore[abstract] + AsyncPlugin() def test_async_plugin_default_behaviors(): diff --git a/tests/unit/test_aio_failover_plugin.py b/tests/unit/test_aio_failover_plugin.py index 59007e100..964bb9f1f 100644 --- a/tests/unit/test_aio_failover_plugin.py +++ b/tests/unit/test_aio_failover_plugin.py @@ -275,7 +275,7 @@ def test_reader_failover_uses_service_host_list_provider(): aurora = MagicMock() aurora.force_refresh = AsyncMock(return_value=(w, r)) svc.host_list_provider = aurora - plugin._failover_reader = AsyncMock() # type: ignore[method-assign] + plugin._failover_reader = AsyncMock() asyncio.run(plugin._do_failover(driver_dialect=driver_dialect)) @@ -513,7 +513,7 @@ def test_failover_raises_transaction_unknown_when_mid_transaction(): # this while the connection was healthy). svc._is_in_transaction = True - plugin._do_failover = AsyncMock() # type: ignore[method-assign] + plugin._do_failover = AsyncMock() async def _raising(): raise Exception("network failure") @@ -531,7 +531,7 @@ def test_failover_raises_failover_success_when_not_in_transaction(): svc.is_read_only_connection_exception = MagicMock(return_value=False) svc._is_in_transaction = False # not mid-transaction - plugin._do_failover = AsyncMock() # type: ignore[method-assign] + plugin._do_failover = AsyncMock() async def _raising(): raise Exception("network failure") @@ -551,7 +551,7 @@ def test_failover_raises_failover_success_when_dialect_reports_not_in_transactio svc._current_connection = MagicMock(name="old_conn") driver_dialect.is_in_transaction = AsyncMock(return_value=False) - plugin._do_failover = AsyncMock() # type: ignore[method-assign] + plugin._do_failover = AsyncMock() async def _raising(): raise Exception("network failure") @@ -570,7 +570,7 @@ def test_failover_txn_probe_errors_treated_as_not_in_txn(): svc._current_connection = MagicMock(name="old_conn") driver_dialect.is_in_transaction = AsyncMock(side_effect=RuntimeError("probe broke")) - plugin._do_failover = AsyncMock() # type: ignore[method-assign] + plugin._do_failover = AsyncMock() async def _raising(): raise Exception("network failure") @@ -586,7 +586,7 @@ def test_failover_no_current_connection_treated_as_not_in_txn(): svc.is_read_only_connection_exception = MagicMock(return_value=False) # No current_connection seeded. - plugin._do_failover = AsyncMock() # type: ignore[method-assign] + plugin._do_failover = AsyncMock() async def _raising(): raise Exception("network failure") @@ -664,7 +664,7 @@ def test_reader_failover_uses_configured_strategy(): svc.get_host_info_by_strategy = MagicMock(return_value=reader) # Role probe must succeed as READER (a failed probe now DROPS the # candidate, sync failover_v2:288-289). - svc.get_host_role = AsyncMock(return_value=HostRole.READER) # type: ignore[method-assign] + svc.get_host_role = AsyncMock(return_value=HostRole.READER) plugin._open_connection = AsyncMock(return_value=MagicMock()) asyncio.run(plugin._do_failover(driver_dialect=dd)) @@ -703,7 +703,7 @@ def test_reader_failover_cycles_through_candidates(): svc.get_host_info_by_strategy = MagicMock(side_effect=[r1, r2]) # Role probe must succeed as READER (a failed probe now DROPS the # candidate, sync failover_v2:288-289). - svc.get_host_role = AsyncMock(return_value=HostRole.READER) # type: ignore[method-assign] + svc.get_host_role = AsyncMock(return_value=HostRole.READER) attempts = [] @@ -713,7 +713,7 @@ async def _open(target, _driver_dialect): raise OSError("r1 down") return MagicMock() - plugin._open_connection = _open # type: ignore[method-assign] + plugin._open_connection = _open asyncio.run(plugin._do_failover(driver_dialect=dd)) @@ -747,7 +747,7 @@ def test_reader_failover_falls_back_to_original_writer_in_reader_or_writer_mode( svc.get_host_info_by_strategy = MagicMock(side_effect=[r1, None]) # The original-writer probe must succeed (a failed probe now moves on # without accepting, sync failover_v2:307-308). READER = demoted writer. - svc.get_host_role = AsyncMock(return_value=HostRole.READER) # type: ignore[method-assign] + svc.get_host_role = AsyncMock(return_value=HostRole.READER) attempts = [] @@ -757,7 +757,7 @@ async def _open(target, _driver_dialect): raise OSError("r1 down") return MagicMock() - plugin._open_connection = _open # type: ignore[method-assign] + plugin._open_connection = _open asyncio.run(plugin._do_failover(driver_dialect=dd)) @@ -776,7 +776,7 @@ def test_reader_failover_leaves_unreachable_reader_candidates_available(): svc._all_hosts = (w, r1, r2) svc._current_host_info = r1 # Select like the random selector: only readers marked available. - svc.get_host_info_by_strategy = ( # type: ignore[method-assign] + svc.get_host_info_by_strategy = ( lambda role, strategy, hosts=None: next( (h for h in hosts if h.role == role and h.get_availability() == HostAvailability.AVAILABLE), None)) @@ -789,7 +789,7 @@ async def _open(target, _driver_dialect): raise OSError(f"{target.host} unreachable") return MagicMock() - plugin._open_connection = _open # type: ignore[method-assign] + plugin._open_connection = _open asyncio.run(plugin._do_failover(driver_dialect=driver_dialect)) @@ -811,7 +811,7 @@ def test_reader_failover_leaves_unreachable_original_writer_available(): async def _open(target, _driver_dialect): raise OSError(f"{target.host} unreachable") - plugin._open_connection = _open # type: ignore[method-assign] + plugin._open_connection = _open with pytest.raises(FailoverFailedError): asyncio.run(plugin._do_failover(driver_dialect=driver_dialect)) @@ -895,7 +895,7 @@ def test_failover_emits_writer_triggered_counter_on_writer_path(): plugin, svc, _, driver_dialect, counters = _build_plugin_with_counters( mode="strict_writer") # Force a successful writer reconnect. - plugin._open_connection = AsyncMock( # type: ignore[method-assign] + plugin._open_connection = AsyncMock( return_value=MagicMock(name="new_conn")) asyncio.run(plugin._do_failover(driver_dialect=driver_dialect)) @@ -915,7 +915,7 @@ def test_failover_emits_reader_triggered_counter_on_reader_path(): svc.get_host_info_by_strategy = MagicMock(return_value=reader_host) # STRICT_READER data-plane-verifies the candidate role (sync parity). svc.get_host_role = AsyncMock(return_value=HostRole.READER) - plugin._open_connection = AsyncMock( # type: ignore[method-assign] + plugin._open_connection = AsyncMock( return_value=MagicMock(name="new_conn")) asyncio.run(plugin._do_failover(driver_dialect=driver_dialect)) @@ -929,7 +929,7 @@ def test_failover_emits_writer_failed_counter_on_exhausted_deadline(): plugin, svc, hlp, driver_dialect, counters = _build_plugin_with_counters( mode="strict_writer") # Make every open fail so we hit the FailoverFailedError path. - plugin._open_connection = AsyncMock( # type: ignore[method-assign] + plugin._open_connection = AsyncMock( side_effect=OSError("refused")) with pytest.raises(FailoverFailedError): @@ -982,7 +982,7 @@ def test_failover_does_not_hang_when_open_connection_blocks(): async def _hang(*args: Any, **kwargs: Any) -> Any: await asyncio.sleep(30) - plugin._open_connection = _hang # type: ignore[method-assign] + plugin._open_connection = _hang start = time.monotonic() with pytest.raises(FailoverFailedError): @@ -1011,7 +1011,7 @@ async def _body() -> None: async def _open(host, _dd): return conns[host.host] - plugin._open_connection = _open # type: ignore[method-assign] + plugin._open_connection = _open svc.get_host_info_by_strategy = MagicMock(return_value=stale_reader) async def _role(conn): @@ -1019,8 +1019,8 @@ async def _role(conn): # was demoted (probes READER). return HostRole.WRITER if conn is reader_conn else HostRole.READER - svc.get_host_role = _role # type: ignore[method-assign] - svc.set_current_connection = AsyncMock() # type: ignore[method-assign] + svc.get_host_role = _role + svc.set_current_connection = AsyncMock() await plugin._do_failover(driver_dialect=driver_dialect) @@ -1046,11 +1046,11 @@ async def _body() -> None: mode="strict_reader", topology=(writer, stale_reader), timeout_sec=0.5) - plugin._open_connection = AsyncMock( # type: ignore[method-assign] + plugin._open_connection = AsyncMock( return_value=MagicMock(name="conn")) svc.get_host_info_by_strategy = MagicMock(return_value=stale_reader) svc.get_host_role = AsyncMock(return_value=HostRole.WRITER) - svc.set_current_connection = AsyncMock() # type: ignore[method-assign] + svc.set_current_connection = AsyncMock() with pytest.raises(FailoverFailedError): await plugin._do_failover(driver_dialect=driver_dialect) @@ -1080,7 +1080,7 @@ async def _body() -> None: async def _fake_failover(driver_dialect=None, **_kw): svc._current_connection = failover_conn - plugin._do_failover = _fake_failover # type: ignore[method-assign] + plugin._do_failover = _fake_failover async def _dial(): raise ConnectionError("boom") @@ -1112,7 +1112,7 @@ async def _body() -> None: async def _fake_failover(driver_dialect=None, **_kw): svc._current_connection = failover_conn - plugin._do_failover = _fake_failover # type: ignore[method-assign] + plugin._do_failover = _fake_failover dialed = {"n": 0} async def _dial(): diff --git a/tests/unit/test_aio_federated_okta.py b/tests/unit/test_aio_federated_okta.py index dc1542e75..0ba75d554 100644 --- a/tests/unit/test_aio_federated_okta.py +++ b/tests/unit/test_aio_federated_okta.py @@ -694,7 +694,7 @@ async def _body(): def _capture(host, port, user, region, token, ttl_sec=None): captured["ttl"] = ttl_sec - plugin._store_rds_token = _capture # type: ignore[assignment] + plugin._store_rds_token = _capture with patch.object( AsyncFederatedAuthPlugin, "_fetch_saml_assertion", diff --git a/tests/unit/test_aio_host_list_provider_monitor_wiring.py b/tests/unit/test_aio_host_list_provider_monitor_wiring.py index 7c8c4cd48..e9e4cb87c 100644 --- a/tests/unit/test_aio_host_list_provider_monitor_wiring.py +++ b/tests/unit/test_aio_host_list_provider_monitor_wiring.py @@ -62,7 +62,7 @@ async def _body(): monitor = provider._get_or_create_monitor() assert isinstance(monitor, AsyncClusterTopologyMonitor) spy = AsyncMock(wraps=monitor.force_refresh_with_connection) - monitor.force_refresh_with_connection = spy # type: ignore[method-assign] + monitor.force_refresh_with_connection = spy topology = await provider.force_refresh(object()) @@ -151,11 +151,11 @@ async def _body(): def _broken_monitor(): monitor = real_get_monitor() - monitor.force_refresh_with_connection = AsyncMock( # type: ignore[method-assign] + monitor.force_refresh_with_connection = AsyncMock( side_effect=RuntimeError("monitor boom")) return monitor - provider._get_or_create_monitor = _broken_monitor # type: ignore[method-assign] + provider._get_or_create_monitor = _broken_monitor topology = await provider.force_refresh(object()) assert len(topology) == 1 diff --git a/tests/unit/test_aio_limitless_monitor.py b/tests/unit/test_aio_limitless_monitor.py index 99fdc7a01..69551503a 100644 --- a/tests/unit/test_aio_limitless_monitor.py +++ b/tests/unit/test_aio_limitless_monitor.py @@ -123,7 +123,7 @@ def test_cache_get_returns_copy_not_reference() -> None: hosts = [HostInfo("r1", 5432, role=HostRole.WRITER)] AsyncLimitlessRouterCache.put("c", hosts) result = AsyncLimitlessRouterCache.get("c") - result.append(HostInfo("r2", 5432)) # type: ignore[arg-type] + result.append(HostInfo("r2", 5432)) # Mutating the result must not affect the cached copy. assert len(AsyncLimitlessRouterCache.get("c")) == 1 @@ -353,7 +353,7 @@ def test_monitor_probe_props_strip_prefix_and_force_no_wait() -> None: assert "limitless-router-monitor-connect_timeout" not in m._properties # ...and WAIT_FOR_ROUTER_INFO is forced False so the probe never # re-triggers router discovery. - assert WrapperProperties.WAIT_FOR_ROUTER_INFO.get(m._properties) is False + assert m._properties.get(WrapperProperties.WAIT_FOR_ROUTER_INFO.name) is False def test_monitor_refresh_swallows_probe_failures() -> None: diff --git a/tests/unit/test_aio_monitor_lifecycle_regressions.py b/tests/unit/test_aio_monitor_lifecycle_regressions.py index 2c86badfe..404e54953 100644 --- a/tests/unit/test_aio_monitor_lifecycle_regressions.py +++ b/tests/unit/test_aio_monitor_lifecycle_regressions.py @@ -24,6 +24,8 @@ import weakref from unittest.mock import AsyncMock, MagicMock +import pytest + from aws_advanced_python_wrapper.aio import topology_store from aws_advanced_python_wrapper.aio.cluster_topology_monitor import \ AsyncClusterTopologyMonitor @@ -69,7 +71,7 @@ def test_stop_on_a_closed_loop_does_not_raise() -> None: loop.close() # A waiter is parked on the stop event, and the loop is gone. - assert monitor._stop_event._waiters # type: ignore[attr-defined] + assert monitor._stop_event._waiters monitor.stop() # must not raise @@ -93,6 +95,32 @@ def test_the_monitor_does_not_keep_its_event_loop_alive() -> None: assert ref() is None, "the monitor is still holding its event loop" +@pytest.mark.parametrize("from_another_thread", [False, True]) +def test_a_scheduled_task_is_kept_until_it_finishes(from_another_thread: bool) -> None: + async def _body() -> None: + monitor = _monitor() + await _start_and_park(monitor) + started = asyncio.Event() + + async def scheduled_work() -> None: + started.set() + await asyncio.get_running_loop().create_future() + + if from_another_thread: + assert await asyncio.to_thread(monitor._schedule, scheduled_work()) is True + else: + assert monitor._schedule(scheduled_work()) is True + await started.wait() + gc.collect() + pending = [task for task in asyncio.all_tasks() if getattr(task.get_coro(), "__name__", None) == "scheduled_work"] + assert len(pending) == 1 + pending[0].cancel() + await asyncio.gather(*pending, return_exceptions=True) + await monitor.aclose() + + asyncio.run(_body()) + + def test_a_reset_discards_a_publication_that_began_before_it() -> None: """A refresh in flight when a blue/green reset lands describes the pre-switchover cluster, so publishing it afterwards restores the host list diff --git a/tests/unit/test_aio_plugin_manager.py b/tests/unit/test_aio_plugin_manager.py index dceb0745f..3bbfcd1a3 100644 --- a/tests/unit/test_aio_plugin_manager.py +++ b/tests/unit/test_aio_plugin_manager.py @@ -242,7 +242,7 @@ def test_plugin_manager_preserves_user_plugin_order(): def test_connect_walks_pipeline_in_order_and_default_plugin_opens_connection(): log: List[str] = [] svc = _mk_service() - dialect: FakeAsyncDriverDialect = svc.driver_dialect # type: ignore[assignment] + dialect: FakeAsyncDriverDialect = svc.driver_dialect a = RecorderPlugin("A", log) b = RecorderPlugin("B", log) mgr = AsyncPluginManager(svc, _props(), plugins=[a, b]) diff --git a/tests/unit/test_aio_read_write_splitting.py b/tests/unit/test_aio_read_write_splitting.py index d76d54d48..7d7373206 100644 --- a/tests/unit/test_aio_read_write_splitting.py +++ b/tests/unit/test_aio_read_write_splitting.py @@ -594,7 +594,7 @@ def test_set_read_only_true_falls_back_to_current_when_no_reader(): dd.is_in_transaction = AsyncMock(return_value=False) dd.is_closed = AsyncMock(return_value=False) # current connection still usable # No reader can be opened. - plugin._switch_to_reader = AsyncMock( # type: ignore[method-assign] + plugin._switch_to_reader = AsyncMock( side_effect=ReadWriteSplittingError("Could not open a reader connection")) async def _run(): @@ -614,7 +614,7 @@ def test_set_read_only_true_propagates_when_current_also_dead(): plugin, svc, hlp, dd, _ = _build() dd.is_in_transaction = AsyncMock(return_value=False) dd.is_closed = AsyncMock(return_value=True) # current connection is dead too - plugin._switch_to_reader = AsyncMock( # type: ignore[method-assign] + plugin._switch_to_reader = AsyncMock( side_effect=ReadWriteSplittingError("Could not open a reader connection")) async def _run(): @@ -803,7 +803,7 @@ def test_swap_to_reader_releases_provider_pooled_writer_conn(): provider_manager.get_connection_provider = MagicMock( return_value=MagicMock(name="pooled_provider")) provider_manager.default_provider = MagicMock(name="default_provider") - svc.get_connection_provider_manager = MagicMock( # type: ignore[method-assign] + svc.get_connection_provider_manager = MagicMock( return_value=provider_manager) svc.get_host_info_by_strategy = MagicMock(return_value=reader) @@ -892,7 +892,7 @@ def _build_with_counters(topology=None): writer_conn = MagicMock(name="writer_conn") svc._current_connection = writer_conn svc.set_target_driver_func(MagicMock(name="target_driver_func")) - svc.get_host_info_by_strategy = MagicMock( # type: ignore[method-assign] + svc.get_host_info_by_strategy = MagicMock( side_effect=lambda role, strategy, candidates: ( next((h for h in (candidates or ()) if h.role == role), None))) diff --git a/tests/unit/test_aio_sliding_expiration_cache.py b/tests/unit/test_aio_sliding_expiration_cache.py index feac5a49d..42d7c9a50 100644 --- a/tests/unit/test_aio_sliding_expiration_cache.py +++ b/tests/unit/test_aio_sliding_expiration_cache.py @@ -15,7 +15,6 @@ from __future__ import annotations import asyncio -import time from aws_advanced_python_wrapper.aio.storage.sliding_expiration_cache_async import ( AsyncSlidingExpirationCache, CacheItem) @@ -135,7 +134,7 @@ async def factory(key): # Use a very short expiration so the entry is expired immediately await cache.compute_if_absent("k", factory, item_expiration_ns=1) # Sleep enough to surely exceed 1 ns - time.sleep(0.001) + await asyncio.sleep(0.001) # Trigger cleanup by inserting another key (cleanup runs inline) await cache.compute_if_absent("k2", factory, item_expiration_ns=10**12) assert disposed == [5] @@ -165,7 +164,7 @@ async def factory(key): return 3 await cache.compute_if_absent("k", factory, item_expiration_ns=1) - time.sleep(0.001) + await asyncio.sleep(0.001) await cache.compute_if_absent("k2", factory, item_expiration_ns=10**12) assert disposed == [] assert "k" in cache # not disposed because should_dispose returned False diff --git a/tests/unit/test_aio_sqlalchemy_dialect.py b/tests/unit/test_aio_sqlalchemy_dialect.py index 28a1c5a4a..a897dd6fb 100644 --- a/tests/unit/test_aio_sqlalchemy_dialect.py +++ b/tests/unit/test_aio_sqlalchemy_dialect.py @@ -302,7 +302,7 @@ class _Dialect(_AsyncDriverErrorNormalizeMixin, _Parent): class _ParentRaises: def do_execute(self, *a, **k): - raise raised + raise raised # noqa: B023 class _DialectRaises(_AsyncDriverErrorNormalizeMixin, _ParentRaises): pass diff --git a/tests/unit/test_aio_stale_dns_plugin.py b/tests/unit/test_aio_stale_dns_plugin.py index a0cfd67b3..62569c577 100644 --- a/tests/unit/test_aio_stale_dns_plugin.py +++ b/tests/unit/test_aio_stale_dns_plugin.py @@ -154,7 +154,7 @@ def test_execute_swallows_refresh_failures(): """A refresh failure must not break the query (sync wraps the refresh in try/except and passes through).""" plugin, svc, _ = _build() - svc.refresh_host_list = AsyncMock( # type: ignore[method-assign] + svc.refresh_host_list = AsyncMock( side_effect=RuntimeError("refresh-down")) async def _work(): diff --git a/tests/unit/test_aio_topology_storage.py b/tests/unit/test_aio_topology_storage.py index 03beb7152..acecc96f3 100644 --- a/tests/unit/test_aio_topology_storage.py +++ b/tests/unit/test_aio_topology_storage.py @@ -140,7 +140,7 @@ def test_refresh_returns_the_stored_topology_without_querying(): returned and the monitor is what keeps it fresh.""" prov = _aurora() conn = MagicMock() - prov._topology_utils.query_for_topology = AsyncMock( # type: ignore[method-assign] + prov._topology_utils.query_for_topology = AsyncMock( side_effect=AssertionError("must not query when topology is stored")) async def _run(): @@ -211,7 +211,7 @@ class _NoWeakRef: __slots__ = () loop = _NoWeakRef() - token = loop_token(loop) # type: ignore[arg-type] + token = loop_token(loop) assert token == f"id:{id(loop)}" diff --git a/tests/unit/test_aio_wrapper.py b/tests/unit/test_aio_wrapper.py index 4de7f0387..2dcc00075 100644 --- a/tests/unit/test_aio_wrapper.py +++ b/tests/unit/test_aio_wrapper.py @@ -449,7 +449,7 @@ def test_set_read_only_in_user_transaction_does_not_rollback_and_propagates(): svc._session_state_service.set_read_only = MagicMock() async def _body() -> None: - with pytest.raises(Exception): + with pytest.raises(Exception, match="INTRANS"): await wrapper.set_read_only(True) raw_conn.rollback.assert_not_called() # user txn NOT rolled back diff --git a/tests/unit/test_blue_green_plugin.py b/tests/unit/test_blue_green_plugin.py index df4247aa1..b18ca27bc 100644 --- a/tests/unit/test_blue_green_plugin.py +++ b/tests/unit/test_blue_green_plugin.py @@ -19,7 +19,8 @@ from aws_advanced_python_wrapper.blue_green_plugin import ( BlueGreenPhase, BlueGreenRole, BlueGreenStatus, BlueGreenStatusMonitor, - SubstituteConnectRouting, SuspendUntilCorrespondingHostFoundConnectRouting) + BlueGreenStatusProvider, SubstituteConnectRouting, + SuspendUntilCorrespondingHostFoundConnectRouting) from aws_advanced_python_wrapper.database_dialect import BlueGreenDialect from aws_advanced_python_wrapper.federated_plugin import FederatedAuthPlugin from aws_advanced_python_wrapper.hostinfo import HostInfo @@ -29,6 +30,7 @@ from aws_advanced_python_wrapper.utils.messages import Messages from aws_advanced_python_wrapper.utils.properties import (Properties, WrapperProperties) +from aws_advanced_python_wrapper.utils.rds_utils import RdsUtils BG_ID = "1" PORT = 3306 @@ -113,3 +115,29 @@ def test_suspend_until_corresponding_host_found_continues_when_a_host_given_in_u routing = SuspendUntilCorrespondingHostFoundConnectRouting(BLUE_HOST, BlueGreenRole.SOURCE, BG_ID) assert routing.apply(MagicMock(), HostInfo(BLUE_HOST.upper(), PORT), props, True, MagicMock(), plugin_service) is None + + +def test_post_status_routings_register_iam_success_for_their_own_green_host(): + blue_reader = "database-1.cluster-ro-c1a2b3c4d5e6.us-east-1.rds.amazonaws.com" + green_reader = "database-1-green-abc123.cluster-ro-c1a2b3c4d5e6.us-east-1.rds.amazonaws.com" + provider = BlueGreenStatusProvider.__new__(BlueGreenStatusProvider) + provider._blue_dns_update_completed = False + provider._all_green_hosts_changed_name = False + provider._green_dns_removed = True + provider._rds_utils = RdsUtils() + provider._host_ip_addresses = {} + provider._iam_auth_success_hosts = ConcurrentDict() + provider._interim_statuses = [MagicMock(port=PORT), None] + provider._roles_by_host = {BLUE_HOST: BlueGreenRole.SOURCE, blue_reader: BlueGreenRole.SOURCE} + provider._corresponding_hosts = { + BLUE_HOST: (HostInfo(BLUE_HOST, PORT), HostInfo(GREEN_HOST, PORT)), + blue_reader: (HostInfo(blue_reader, PORT), HostInfo(green_reader, PORT)), + } + provider._register_iam_host = MagicMock() + registered = {} + + for routing in provider._get_post_status_connect_routings(): + routing._iam_auth_success_handler("iam-host") + registered[routing._endpoint.split(":")[0]] = provider._register_iam_host.call_args.args[0] + + assert registered == {BLUE_HOST: GREEN_HOST, blue_reader: green_reader} diff --git a/tests/unit/test_cluster_topology_monitor_panic_exit.py b/tests/unit/test_cluster_topology_monitor_panic_exit.py index e85fbda44..6c6931d15 100644 --- a/tests/unit/test_cluster_topology_monitor_panic_exit.py +++ b/tests/unit/test_cluster_topology_monitor_panic_exit.py @@ -192,8 +192,8 @@ def _topology_with_writer(self, writer: HostInfo) -> Tuple[HostInfo, ...]: def test_writer_change_signals_exit_when_regions_inaccessible(self, monkeypatch): monitor = _bare_monitor() - monitor._update_topology_cache = MagicMock() # type: ignore[method-assign] - monitor._record_reader_topology = MagicMock() # type: ignore[method-assign] + monitor._update_topology_cache = MagicMock() + monitor._record_reader_topology = MagicMock() worker = self._worker( monitor, some_regions_inaccessible=True, baseline_writer=WRITER) @@ -211,8 +211,8 @@ def test_writer_change_signals_exit_when_regions_inaccessible(self, monkeypatch) def test_writer_change_does_not_signal_when_all_regions_accessible(self, monkeypatch): monitor = _bare_monitor() - monitor._update_topology_cache = MagicMock() # type: ignore[method-assign] - monitor._record_reader_topology = MagicMock() # type: ignore[method-assign] + monitor._update_topology_cache = MagicMock() + monitor._record_reader_topology = MagicMock() worker = self._worker( monitor, some_regions_inaccessible=False, baseline_writer=WRITER) @@ -231,8 +231,8 @@ def test_writer_change_does_not_signal_when_all_regions_accessible(self, monkeyp def test_no_signal_when_writer_unchanged(self, monkeypatch): monitor = _bare_monitor() - monitor._update_topology_cache = MagicMock() # type: ignore[method-assign] - monitor._record_reader_topology = MagicMock() # type: ignore[method-assign] + monitor._update_topology_cache = MagicMock() + monitor._record_reader_topology = MagicMock() worker = self._worker( monitor, some_regions_inaccessible=True, baseline_writer=WRITER) @@ -249,8 +249,8 @@ def test_no_signal_when_writer_unchanged(self, monkeypatch): def test_only_first_observer_wins_cas(self, monkeypatch): monitor = _bare_monitor() - monitor._update_topology_cache = MagicMock() # type: ignore[method-assign] - monitor._record_reader_topology = MagicMock() # type: ignore[method-assign] + monitor._update_topology_cache = MagicMock() + monitor._record_reader_topology = MagicMock() # A different worker already recorded an observed writer change. already = HostInfo("writer3.xyz.us-east-1.rds.amazonaws.com", 5432, HostRole.WRITER) monitor._reader_observed_writer_host_info.set(already) @@ -272,7 +272,7 @@ class TestCheckForStableReaderTopologies: def _prime(self, monitor, hosts, *, monkeypatch, stored=None): stored = hosts if stored is None else stored monkeypatch.setattr(monitor, "_get_stored_hosts", lambda: stored, raising=False) - monitor._update_topology_cache = MagicMock() # type: ignore[method-assign] + monitor._update_topology_cache = MagicMock() def test_waits_until_every_monitored_reader_completed_a_cycle(self, monkeypatch): monitor = _bare_monitor() @@ -316,7 +316,7 @@ def test_starts_timer_when_agreement_first_reached(self, monkeypatch): _host_and_port(READER_A): hosts, _host_and_port(READER_B): hosts, } - monitor.get_stable_topologies_duration_ns = lambda: 10 ** 12 # type: ignore[method-assign] + monitor.get_stable_topologies_duration_ns = lambda: 10 ** 12 monitor._check_for_stable_reader_topologies() @@ -336,7 +336,7 @@ def test_harvests_after_stability_duration_elapses(self, monkeypatch): } # Timer already started far enough in the past that stability elapsed. monitor._stable_topologies_start_nano = 1 - monitor.get_stable_topologies_duration_ns = lambda: 0 # type: ignore[method-assign] + monitor.get_stable_topologies_duration_ns = lambda: 0 # A harvested reader connection is available and gets adopted. holder = ThreadSafeConnectionHolder(MagicMock()) monitor._host_threads_connections = {_host_and_port(READER_A): (READER_A, holder)} @@ -363,7 +363,7 @@ def test_skips_harvest_when_monitoring_connection_already_present(self, monkeypa _host_and_port(READER_B): hosts, } monitor._stable_topologies_start_nano = 1 - monitor.get_stable_topologies_duration_ns = lambda: 0 # type: ignore[method-assign] + monitor.get_stable_topologies_duration_ns = lambda: 0 # Monitoring connection already established → no harvest needed. monitor._monitoring_connection = ThreadSafeConnectionHolder(MagicMock()) @@ -390,7 +390,7 @@ def test_stability_only_requires_monitored_hosts(self, monkeypatch): # Only the monitored host (READER_A) completed a cycle. monitor._completed_one_cycle = {_host_and_port(READER_A): True} monitor._reader_topologies_by_id = {_host_and_port(READER_A): (READER_A,)} - monitor.get_stable_topologies_duration_ns = lambda: 10 ** 12 # type: ignore[method-assign] + monitor.get_stable_topologies_duration_ns = lambda: 10 ** 12 monitor._check_for_stable_reader_topologies() diff --git a/tests/unit/test_connection_provider.py b/tests/unit/test_connection_provider.py index bfda70ade..694ab5705 100644 --- a/tests/unit/test_connection_provider.py +++ b/tests/unit/test_connection_provider.py @@ -199,4 +199,4 @@ def test_driver_connection_provider_accepted_strategies_returns_mapping(): # Mapping is read-only import pytest with pytest.raises(TypeError): - strategies["new_strategy"] = None # type: ignore[index] + strategies["new_strategy"] = None diff --git a/tests/unit/test_failover_plugin.py b/tests/unit/test_failover_plugin.py index 2ba1bdbb5..dccfdf7fd 100644 --- a/tests/unit/test_failover_plugin.py +++ b/tests/unit/test_failover_plugin.py @@ -33,8 +33,6 @@ from aws_advanced_python_wrapper.failover_result import (ReaderFailoverResult, WriterFailoverResult) from aws_advanced_python_wrapper.host_availability import HostAvailability -from aws_advanced_python_wrapper.host_list_provider import \ - HostListProviderService from aws_advanced_python_wrapper.hostinfo import HostInfo from aws_advanced_python_wrapper.pep249 import Error from aws_advanced_python_wrapper.utils.notifications import HostEvent @@ -100,9 +98,7 @@ def test_init_host_provider_failover_disabled(plugin_service_mock, host_list_pro WrapperProperties.ENABLE_FAILOVER.set(properties, "False") plugin = FailoverPlugin(plugin_service_mock, properties) - with mock.patch.object(HostListProviderService, "is_static_host_list_provider") as method_mock: - plugin.init_host_provider(properties, host_list_provider_service_mock, init_host_provider_func_mock) - method_mock.assert_not_called() + plugin.init_host_provider(properties, host_list_provider_service_mock, init_host_provider_func_mock) def test_init_host_provider_with_static_host_provider(plugin_service_mock, host_list_provider_service_mock, @@ -114,10 +110,8 @@ def test_init_host_provider_with_static_host_provider(plugin_service_mock, host_ plugin.init_host_provider(properties, host_list_provider_service_mock, init_host_provider_func_mock) plugin._host_list_provider_service.host_list_provider = host_list_provider_mock - with mock.patch.object(HostListProviderService, "is_static_host_list_provider") as method_mock: - plugin.init_host_provider(properties, host_list_provider_service_mock, init_host_provider_func_mock) - plugin._host_list_provider_service.host_list_provider = host_list_provider_mock - method_mock.assert_not_called() + plugin.init_host_provider(properties, host_list_provider_service_mock, init_host_provider_func_mock) + plugin._host_list_provider_service.host_list_provider = host_list_provider_mock assert host_list_provider_service_mock.host_list_provider == host_list_provider_mock diff --git a/tests/unit/test_host_response_time_monitor.py b/tests/unit/test_host_response_time_monitor.py index 37d81b1b5..904862a69 100644 --- a/tests/unit/test_host_response_time_monitor.py +++ b/tests/unit/test_host_response_time_monitor.py @@ -73,11 +73,12 @@ def test_run_host_available(mock_conn, mock_plugin_service, host_info, props): mock_plugin_service.force_connect.assert_called() mock_conn.close.assert_called_once() - monitor._is_stopped.is_set() - monitor._monitoring_conn is None + assert monitor._is_stopped.is_set() + assert monitor._monitoring_conn is None def test_run_interrupted(mocker, mock_plugin_service, host_info, props): + mocker.patch("aws_advanced_python_wrapper.fastest_response_strategy_plugin.Thread") mocker.patch( "aws_advanced_python_wrapper.fastest_response_strategy_plugin.HostResponseTimeMonitor._open_connection", side_effect=InterruptedError()) monitor: HostResponseTimeMonitor = HostResponseTimeMonitor( @@ -85,29 +86,29 @@ def test_run_interrupted(mocker, mock_plugin_service, host_info, props): host_info, props, 1_000) + monitor.run() + mock_plugin_service.driver_dialect.ping.assert_not_called() mock_plugin_service.force_connect.assert_not_called() + assert monitor._is_stopped.is_set() + assert monitor._monitoring_conn is None - monitor._is_stopped.is_set() - monitor._monitoring_conn is None - - -def test_connect_interrupted(mocker, mock_conn, mock_plugin_service, host_info, props, mock_driver_dialect): - exception = Exception("Test Exception") - plugin_service = mocker.MagicMock() - plugin_service.driver_dialect = mock_driver_dialect +def test_connect_interrupted(mocker, mock_conn, mock_plugin_service, host_info, props): + mocker.patch("aws_advanced_python_wrapper.fastest_response_strategy_plugin.Thread") monitor: HostResponseTimeMonitor = HostResponseTimeMonitor( mock_plugin_service, host_info, props, 1_000) def force_connect_side_effect(host_info, properties, timeout_event) -> Connection: - monitor._monitoring_conn = mock_conn - raise exception + raise Exception("Test Exception") mock_plugin_service.force_connect.side_effect = force_connect_side_effect - monitor._is_stopped.is_set() - monitor._monitoring_conn is None + monitor._open_connection() + + mock_conn.close.assert_called_once() + assert monitor._monitoring_conn is None + assert not monitor._is_stopped.is_set() diff --git a/tests/unit/test_iam_plugin.py b/tests/unit/test_iam_plugin.py index 65b42e735..42028b703 100644 --- a/tests/unit/test_iam_plugin.py +++ b/tests/unit/test_iam_plugin.py @@ -197,7 +197,7 @@ def test_connect_expired_token_in_cache(mocker, mock_plugin_service, mock_sessio mock_func.side_effect = Exception("generic exception") target_plugin: IamAuthPlugin = IamAuthPlugin(mock_plugin_service) - with pytest.raises(Exception): + with pytest.raises(Exception, match="generic exception"): target_plugin.connect( target_driver_func=mocker.MagicMock(), driver_dialect=mock_dialect, diff --git a/tests/unit/test_read_write_splitting_plugin.py b/tests/unit/test_read_write_splitting_plugin.py index 200032861..24e3bd2ed 100644 --- a/tests/unit/test_read_write_splitting_plugin.py +++ b/tests/unit/test_read_write_splitting_plugin.py @@ -284,7 +284,6 @@ def get_host_role_side_effect(conn): plugin_service_mock.get_host_role.side_effect = get_host_role_side_effect plugin_service_mock.initial_connection_host_info = reader_host_incorrect_role - host_list_provider_service_mock.is_static_host_list_provider.return_value = False connect_func_mock.return_value = reader_conn_mock conn = plugin.connect( @@ -497,7 +496,6 @@ def get_host_role_side_effect(conn): return HostRole.WRITER plugin_service_mock.get_host_role.side_effect = get_host_role_side_effect - host_list_provider_service_mock.is_static_host_list_provider.return_value = False connect_func_mock.return_value = reader_conn_mock diff --git a/tests/unit/test_round_robin_host_selector.py b/tests/unit/test_round_robin_host_selector.py index bad282a05..446148bc7 100644 --- a/tests/unit/test_round_robin_host_selector.py +++ b/tests/unit/test_round_robin_host_selector.py @@ -112,7 +112,7 @@ def test_setup_empty_host(round_robin_host_selector, default_props, hosts_list_1 default_props[WrapperProperties.ROUND_ROBIN_HOST_WEIGHT_PAIRS.name] = host_weights with pytest.raises(AwsWrapperError): - round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props).host + round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props) def test_setup_empty_weight(round_robin_host_selector, default_props, hosts_list_123): @@ -152,7 +152,7 @@ def test_setup_bad_weight_format(round_robin_host_selector, default_props, hosts default_props[WrapperProperties.ROUND_ROBIN_HOST_WEIGHT_PAIRS.name] = host_weights with pytest.raises(AwsWrapperError): - round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props).host + round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props) def test_setup_float_weights(round_robin_host_selector, default_props, hosts_list_123): @@ -169,7 +169,7 @@ def test_setup_float_default_weight(round_robin_host_selector, default_props, ho default_props[WrapperProperties.ROUND_ROBIN_HOST_WEIGHT_PAIRS.name] = "1.123" with pytest.raises(AwsWrapperError): - round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props).host + round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props) def test_setup_negative_weight(round_robin_host_selector, default_props, hosts_list_123): @@ -186,21 +186,21 @@ def test_setup_negative_default_weight(round_robin_host_selector, default_props, default_props[WrapperProperties.ROUND_ROBIN_HOST_WEIGHT_PAIRS.name] = "-1" with pytest.raises(AwsWrapperError): - round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props).host + round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props) def test_setup_parse_weight_error(round_robin_host_selector, default_props, hosts_list_123): default_props[WrapperProperties.ROUND_ROBIN_HOST_WEIGHT_PAIRS.name] = "instance-0:1,instance-1:1a" with pytest.raises(AwsWrapperError): - round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props).host + round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props) def test_setup_parse_default_weight_error(round_robin_host_selector, default_props, hosts_list_123): default_props[WrapperProperties.ROUND_ROBIN_HOST_WEIGHT_PAIRS.name] = "1a" with pytest.raises(AwsWrapperError): - round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props).host + round_robin_host_selector.get_host(hosts_list_123, HostRole.READER, default_props) def test_get_host_no_readers(round_robin_host_selector, default_props, writer_hosts_list): diff --git a/tests/unit/test_stale_dns_plugin.py b/tests/unit/test_stale_dns_plugin.py new file mode 100644 index 000000000..dc76cd8f4 --- /dev/null +++ b/tests/unit/test_stale_dns_plugin.py @@ -0,0 +1,27 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from aws_advanced_python_wrapper.stale_dns_plugin import StaleDnsPlugin +from aws_advanced_python_wrapper.utils.properties import Properties + + +def test_init_host_provider_stores_service_and_calls_init_func(mocker): + plugin = StaleDnsPlugin(mocker.MagicMock()) + host_list_provider_service = mocker.MagicMock() + init_host_provider_func = mocker.MagicMock() + + plugin.init_host_provider(Properties(), host_list_provider_service, init_host_provider_func) + + init_host_provider_func.assert_called_once() + assert plugin._host_list_provider_service is host_list_provider_service