Skip to content

Commit 3486638

Browse files
committed
chore: ignore certain files from mypy linting
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.
1 parent a4efa33 commit 3486638

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

docs/lib/libpq_docs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# mypy: ignore-errors
12
"""
23
Sphinx plugin to link to the libpq documentation.
34

docs/lib/pg3_docs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# mypy: ignore-errors
12
"""
23
Customisation for docs generation.
34
"""

docs/lib/sql_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# mypy: ignore-errors
22
"""
33
sql role
44
~~~~~~~~

psycopg/psycopg/pq/pq_ctypes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# mypy: ignore-errors
2+
13
"""
24
libpq Python wrapper using ctypes bindings.
35

psycopg_c/build_backend/psycopg_build_ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _setup_ext_build(self) -> None:
4949
# In the sdist there are not .pyx, only c, so we don't need Cython.
5050
# Otherwise Cython is a requirement and it is used to compile pyx to c.
5151
if os.path.exists("psycopg_c/_psycopg.pyx"):
52-
from Cython.Build import cythonize # type: ignore[import-untyped]
52+
from Cython.Build import cythonize # type: ignore
5353

5454
for ext in self.distribution.ext_modules:
5555
for i in range(len(ext.sources)):

pyproject.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,23 @@ show_error_codes = true
3737
disable_bytearray_promotion = true
3838
disable_memoryview_promotion = true
3939
strict = true
40+
exclude = '''(?x)(
41+
^ build/
42+
| docs/lib/.*\.py
43+
| psycopg/build/
44+
| psycopg_binary/build/
45+
| psycopg_c/build/
46+
| psycopg_pool/build/
47+
| tools/build/pg_config_vcpkg_stub/build/
48+
)'''
4049

4150
[[tool.mypy.overrides]]
4251
module = [
43-
"shapely.*",
4452
"numpy.*",
53+
"shapely.*",
4554
]
4655
ignore_missing_imports = true
4756

48-
[[tool.mypy.overrides]]
49-
module = "uvloop"
50-
ignore_missing_imports = true
51-
5257
[[tool.mypy.overrides]]
5358
module = "tests.*"
5459
check_untyped_defs = true

tools/update_backer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
r"""Add or edit github users in the backers file
2+
# mypy: ignore-errors
3+
"""Add or edit github users in the backers file
34
"""
45

56
import sys

0 commit comments

Comments
 (0)