]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore: make code compatible with Mypy 1.14 and 1.16
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 2 Jun 2025 12:29:56 +0000 (13:29 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 2 Jun 2025 12:29:56 +0000 (13:29 +0100)
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.

pyproject.toml
tests/scripts/spiketest.py

index f684b648997390e0b1216f4a47e24b1fcc130851..bbd19b8efcde21b5585aba845b6d8852ec722abb 100644 (file)
@@ -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"
index 82d274fd8eff0ca5956e4497dad6a3317ad43070..b669913022884b945cb00f1b7269a807dbd1b1e4 100644 (file)
@@ -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()