summaryrefslogtreecommitdiff
path: root/setup.cfg
diff options
context:
space:
mode:
authorChandan Singh <chandan@chandansingh.net>2019-06-30 02:43:56 +0100
committerChandan Singh <chandan@chandansingh.net>2019-09-02 21:56:34 +0100
commit419a3afbe6e774c9182001977874c8ea08a9f49d (patch)
tree18d3c0f24179ae843caa76db46d4c38478e81dd7 /setup.cfg
parent3641578dcac7bd514f8e074835841f381a36c877 (diff)
downloadbuildstream-419a3afbe6e774c9182001977874c8ea08a9f49d.tar.gz
Add initial mypy configuration and types
As a first step, add type hints to variables whose type `mypy` cannot infer automatically. This is the minimal set of type hints that allow running `mypy` without any arguments, and having it not fail. We currently ignore C extensions that mypy can't process directly. Later, we can look into generating stubs for such modules (potentially automatically).
Diffstat (limited to 'setup.cfg')
-rw-r--r--setup.cfg19
1 files changed, 19 insertions, 0 deletions
diff --git a/setup.cfg b/setup.cfg
index 4a0dfb54d..7a62f9282 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -29,3 +29,22 @@ markers =
max-line-length = 119
ignore = E129,E125,W504,W605
exclude = .git/**,.tox/**,.eggs/**,build/**,doc/source/conf.py,src/buildstream/_fuse/fuse.py,src/buildstream/_protos/**/*py,tmp/**
+
+[mypy]
+files = src
+warn_unused_configs = True
+warn_no_return = True
+
+# Ignore missing stubs for third-party packages.
+# In future, these should be re-enabled if/when stubs for them become available.
+[mypy-copyreg,arpy,grpc,pluginbase,psutil,py,pyroaring,pytest,_pytest.*,ruamel]
+ignore_missing_imports=True
+
+# Ignore missing stubs for Cythonized modules.
+# In future, these should be re-enabled by writing stubs for them.
+[mypy-buildstream.node,buildstream._loader.*,buildstream._types,buildstream._utils,buildstream._variables]
+ignore_missing_imports=True
+
+# Ignore issues with generated files and vendored code
+[mypy-buildstream._protos.*,buildstream._fuse.*,buildstream._version]
+ignore_errors = True