zuul/zuul
Monty Taylor fb8f5a44bd
Use mypy to do static type checking
python3 includes support for optional type annotations which can be used by
static analysis tools to perform type checking. The mypy tool is a
static type checking tool that can also infer type information in many
cases, but which will use explicit type information if it is present.

Add mypy to test-requirements and to the pep8 job so that our pep8 job
can do more analysis work and less with the code style.

To support this, there were a few places in the current codebase that
needed an explicit type hint. For variables/attributes in 3.5 this is done via
comments. There is a conditional import that was confusion that just got
marked with an 'ignore'.

Our ansible action and lookup plugins confuse mypi with the way they
import the ansible base classes. That's ok - they confuse us with that
too. The .pyi files are 'typeshed' files, which are a way that one can
provide static type annotations without putting the information into the
file itself. mypy will always prefer a .pyi file over a .py file (since
the point of them is to be external annotion/interface description) So
in order to get mypy to not barf on the ansible import weirdness, just
add a corresponding empty .pyi file. We could potentially actually put
interface descriptions in them - but I don't think there is very much
value in that.

It should be amusing to at least someone that we have to flake8: noqa
an import from typing that was done to provide a type hint in a comment.

Change-Id: I6c4ac3dcfc6fd990e6c6886749de147ad28389d1
2017-07-27 14:34:07 -05:00
..
ansible Use mypy to do static type checking 2017-07-27 14:34:07 -05:00
cmd Fix zuul command default function 2017-07-17 08:07:01 +00:00
connection Remove use of six library 2017-06-19 10:34:57 -05:00
driver Use mypy to do static type checking 2017-07-27 14:34:07 -05:00
executor Undefine Zuul variables in Ansible when appropriate 2017-07-21 10:02:49 -07:00
lib Use mypy to do static type checking 2017-07-27 14:34:07 -05:00
manager Support dynamic dependent pipeline additions 2017-07-15 15:45:18 -07:00
merger Add support for zuul.d configuration split 2017-07-10 05:13:42 +00:00
reporter Return executor errors to user 2017-07-18 14:19:11 -07:00
source Remove use of six library 2017-06-19 10:34:57 -05:00
trigger Remove use of six library 2017-06-19 10:34:57 -05:00
web Add html based websocket client for console stream 2017-07-19 15:53:43 +02:00
__init__.py Initial commit. 2012-05-29 14:49:32 -07:00
change_matcher.py GitHub file matching support 2017-05-10 14:32:02 -07:00
configloader.py Merge "Remove ansible-role from implied role names" into feature/zuulv3 2017-07-19 23:32:57 +00:00
exceptions.py Support post jobs by supporting rev checkout 2016-07-12 12:51:51 +10:00
model.py Merge "Check out implicit branch in timer jobs" into feature/zuulv3 2017-07-21 03:49:52 +00:00
nodepool.py Improve safety around canceling node requests 2017-05-19 12:12:33 -07:00
rpcclient.py Add web-based console log streaming 2017-07-10 10:32:28 -04:00
rpclistener.py Add web-based console log streaming 2017-07-10 10:32:28 -04:00
scheduler.py Add html based websocket client for console stream 2017-07-19 15:53:43 +02:00
version.py Migrate to pbr. 2013-06-25 19:04:30 +00:00
webapp.py fix webapp tests for py3 2017-05-19 06:45:31 -07:00
zk.py Encoding changes in tests for py3 2017-05-19 06:45:31 -07:00