]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore: bump Mypy min required version to 1.19
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 1 Dec 2025 01:10:55 +0000 (02:10 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 1 Dec 2025 01:35:45 +0000 (02:35 +0100)
Avoid installing Mypy as part of the tests extra: installation fails
because a binary librt is not available. As a consequence, avoid running
Mypy-based tests in test CI jobs on PyPy.

.github/workflows/tests.yml
psycopg/pyproject.toml
psycopg_c/psycopg_c/_uuid.py
tests/constraints.txt

index 3c3adce41c0b19df61fb6e01b44adfceb9f99b3a..c2a640dc5c1ec1badb326957ab218c370ba735e9 100644 (file)
@@ -120,7 +120,7 @@ jobs:
       - name: Exclude certain tests from pypy
         if: ${{ startsWith(matrix.python, 'pypy') }}
         run: |
-          echo "NOT_MARKERS=$NOT_MARKERS timing" >> $GITHUB_ENV
+          echo "NOT_MARKERS=$NOT_MARKERS timing mypy" >> $GITHUB_ENV
 
       - name: Configure to use the oldest dependencies
         if: ${{ matrix.ext == 'min' }}
index c0ce8d374cc43f91c5b0494e5ba6742f6dc409d0..358a101d80cd4933616eef88b716429a90596f13 100644 (file)
@@ -70,7 +70,8 @@ pool = [
 ]
 test = [
     "anyio >= 4.0",
-    "mypy >= 1.18.1",
+    # Mypy >= 1.19 depends on librt, not available for PyPy.
+    "mypy >= 1.19.0; implementation_name != \"pypy\"",
     "pproxy >= 2.7",
     "pytest >= 6.2.5",
     "pytest-cov >= 3.0",
@@ -85,7 +86,7 @@ dev = [
     "flake8 >= 4.0",
     "isort[colors] >= 6.0",
     "isort-psycopg",
-    "mypy >= 1.18.1",
+    "mypy >= 1.19.0",
     "pre-commit >= 4.0.1",
     "types-setuptools >= 57.4",
     "types-shapely >= 2.0",
index ec6b5338f79a6cc5478127c09475315b8e68955e..0d63bf42d4985bd340deddb6f5213725848deaa7 100644 (file)
@@ -25,4 +25,6 @@ class _WritableUUID(UUID):
     """
 
     __slots__ = ()  # Give the class the same memory layout of the base clasee
-    __setattr__ = object.__setattr__  # make the class writable
+
+    # Make the class writable.
+    __setattr__ = object.__setattr__  # type: ignore[assignment]
index 4e9cbf6e09810f1f281287b810414a476a2e938e..2dea34be70ed2d9991cf1a691fad52f852f2768e 100644 (file)
@@ -10,7 +10,7 @@ importlib-metadata == 1.4
 
 # From the 'test' extra
 anyio == 4.0
-mypy == 1.18.1
+mypy == 1.19.0
 pproxy == 2.7.0
 pytest == 6.2.5
 pytest-cov == 3.0.0