From 419a3afbe6e774c9182001977874c8ea08a9f49d Mon Sep 17 00:00:00 2001 From: Chandan Singh Date: Sun, 30 Jun 2019 02:43:56 +0100 Subject: 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). --- setup.cfg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'setup.cfg') 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 -- cgit v1.2.1