From: Daniele Varrazzo Date: Mon, 2 Jun 2025 12:29:56 +0000 (+0100) Subject: chore: make code compatible with Mypy 1.14 and 1.16 X-Git-Tag: 3.2.10~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4de2679590120b01430d7ed65324535e1546c2a;p=thirdparty%2Fpsycopg.git chore: make code compatible with Mypy 1.14 and 1.16 The master branch moved to a minimum 1.16, but Python 3.8 is only supported up to Mypy < 1.15. Therefore introduce an ignore[override] required in Mypy 1.16 but ignore the complaint of Mypy 1.14. --- diff --git a/pyproject.toml b/pyproject.toml index f684b6489..bbd19b8ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,6 +61,10 @@ check_untyped_defs = true disallow_untyped_defs = false disallow_untyped_calls = false +[[tool.mypy.overrides]] +module = "tests.scripts.spiketest" +warn_unused_ignores = false # for mypy 1.14 on Python 3.8 + [tool.codespell] ignore-words-list = "alot,ans,ba,fo,te,erro,varning" skip = "build,_build,.tox,.mypy_cache,.venv,pq.c,_psycopg.c,*.html" diff --git a/tests/scripts/spiketest.py b/tests/scripts/spiketest.py index 82d274fd8..b66991302 100644 --- a/tests/scripts/spiketest.py +++ b/tests/scripts/spiketest.py @@ -105,7 +105,7 @@ class DelayedConnection(psycopg.Connection[Row]): """A connection adding a delay to the connection time.""" @classmethod - def connect(cls, conninfo, conn_delay=0, **kwargs): + def connect(cls, conninfo, conn_delay=0, **kwargs): # type: ignore[override] t0 = time.time() conn = super().connect(conninfo, **kwargs) t1 = time.time()