pyproject: Add configuration for mypy to ignore some libraries

- This way, we know what we are overriding and can use type annotations for
libraries where they are available.

- Invocation of mypy tool on command line becomes straight forward.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2023-09-25 10:05:51 -07:00 committed by James Valleroy
parent bb7782a464
commit eba41aa295
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 25 additions and 1 deletions

View File

@ -25,7 +25,7 @@ static-type-check:
- apt-get update
- apt-get install -y mypy
script:
- mypy --ignore-missing-imports .
- mypy .
unit-tests:
stage: test

View File

@ -81,3 +81,27 @@ disable = [
"too-many-arguments", # Has not resulted in a refactoring
"too-many-ancestors", # Easy to hit when using Django
]
# Ignore missing type stubs for some libraries. Try to keep this list minimal
# and use type annotations where available.
[[tool.mypy.overrides]]
module = [
"aptsources.*",
"augeas.*",
"axes.*",
"captcha.*",
"cherrypy.*",
"configobj.*",
"dbus.*",
"django.*",
"gi.*",
"pam.*",
"pgi.*",
"plinth.tests.config_local",
"pytest_splinter.*",
"ruamel.*",
"selenium.*",
"splinter.*",
"stronghold.*",
]
ignore_missing_imports = true