From 2c0a1b2fdbe535328f90db0ab473d052c75f8f96 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 1 Dec 2025 02:10:55 +0100 Subject: [PATCH] chore: bump Mypy min required version to 1.19 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 | 2 +- psycopg/pyproject.toml | 5 +++-- psycopg_c/psycopg_c/_uuid.py | 4 +++- tests/constraints.txt | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c3adce41..c2a640dc5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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' }} diff --git a/psycopg/pyproject.toml b/psycopg/pyproject.toml index c0ce8d374..358a101d8 100644 --- a/psycopg/pyproject.toml +++ b/psycopg/pyproject.toml @@ -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", diff --git a/psycopg_c/psycopg_c/_uuid.py b/psycopg_c/psycopg_c/_uuid.py index ec6b5338f..0d63bf42d 100644 --- a/psycopg_c/psycopg_c/_uuid.py +++ b/psycopg_c/psycopg_c/_uuid.py @@ -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] diff --git a/tests/constraints.txt b/tests/constraints.txt index 4e9cbf6e0..2dea34be7 100644 --- a/tests/constraints.txt +++ b/tests/constraints.txt @@ -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 -- 2.47.3