]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore: ignore certain files from mypy linting
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 27 Dec 2024 01:44:43 +0000 (02:44 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 9 Jan 2025 13:43:57 +0000 (14:43 +0100)
Something weird happens. Certain files pass mypy lint on their own, but
not in combination. This is mostly related to `psycopg/pq/pq_ctypes.py`
and `psycopg/pq/_pq_ctypes.py`. This problem seems largely related to
incomplete ctypes definitions.

docs/lib/libpq_docs.py
docs/lib/pg3_docs.py
docs/lib/sql_role.py
psycopg/psycopg/pq/pq_ctypes.py
psycopg_c/setup.py
pyproject.toml
tools/update_backer.py

index b638c63b4b08ea3f7475788d3ac5b84767457c7a..a5488d1515ba0ebbd055c4309b623dc59ea60005 100644 (file)
@@ -1,3 +1,4 @@
+# mypy: ignore-errors
 """
 Sphinx plugin to link to the libpq documentation.
 
index 674f2d7c00de222f6fab68885beb32523170021f..07fcea27c90576407b98ad18b9c259d8d0d45f4e 100644 (file)
@@ -1,3 +1,4 @@
+# mypy: ignore-errors
 """
 Customisation for docs generation.
 """
index a40c9f40419bf3ff3f4107989e7cd7f7b217572f..e87d6f5be7da286192053a31910ad8ffe4fce1d4 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# mypy: ignore-errors
 """
     sql role
     ~~~~~~~~
index 8335f87f7ffecd3aa038573439736979432227fe..27f0b0fed3cc633b01fe3ebd4883241ac1fed9e0 100644 (file)
@@ -1,3 +1,5 @@
+# mypy: ignore-errors
+
 """
 libpq Python wrapper using ctypes bindings.
 
index eeea1c94515be639916217b62b7687a3f185adec..b122ee2ec15b1f053cf7f7b0e667163ad5eedbc6 100644 (file)
@@ -42,7 +42,7 @@ class psycopg_build_ext(build_ext):
         # In the sdist there are not .pyx, only c, so we don't need Cython.
         # Otherwise Cython is a requirement and it is used to compile pyx to c.
         if os.path.exists("psycopg_c/_psycopg.pyx"):
-            from Cython.Build import cythonize
+            from Cython.Build import cythonize  # type: ignore
 
         # Add include and lib dir for the libpq.
         includedir = get_config("includedir")
@@ -97,5 +97,5 @@ pqext = Extension(
 
 setup(
     ext_modules=[pgext, pqext],
-    cmdclass={"build_ext": psycopg_build_ext},
+    cmdclass={"build_ext": psycopg_build_ext},  # type: ignore
 )
index 64d9ae427f0c1985f3e567ebb5380cf19a73f324..4e76bc8e648de0e1bf2adfd8e38ede586dce1eeb 100644 (file)
@@ -37,18 +37,23 @@ show_error_codes = true
 disable_bytearray_promotion = true
 disable_memoryview_promotion = true
 strict = true
+exclude = '''(?x)(
+    ^ build/
+    | docs/lib/.*\.py
+    | psycopg/build/
+    | psycopg_binary/build/
+    | psycopg_c/build/
+    | psycopg_pool/build/
+    | tools/build/pg_config_vcpkg_stub/build/
+)'''
 
 [[tool.mypy.overrides]]
 module = [
-    "shapely.*",
     "numpy.*",
+    "shapely.*",
 ]
 ignore_missing_imports = true
 
-[[tool.mypy.overrides]]
-module = "uvloop"
-ignore_missing_imports = true
-
 [[tool.mypy.overrides]]
 module = "tests.*"
 check_untyped_defs = true
index 00885276d3250564fb5744d394c8daeca3ed17d2..35cfc48fe3a72a6d07e9a31e9a225447d98a671c 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/env python3
-r"""Add or edit github users in the backers file
+# mypy: ignore-errors
+"""Add or edit github users in the backers file
 """
 
 import sys