summaryrefslogtreecommitdiff
path: root/src/buildstream/testing/_utils/site.py
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 /src/buildstream/testing/_utils/site.py
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 'src/buildstream/testing/_utils/site.py')
-rw-r--r--src/buildstream/testing/_utils/site.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buildstream/testing/_utils/site.py b/src/buildstream/testing/_utils/site.py
index d51d37525..b098b7d41 100644
--- a/src/buildstream/testing/_utils/site.py
+++ b/src/buildstream/testing/_utils/site.py
@@ -5,13 +5,14 @@ import os
import subprocess
import sys
import platform
+from typing import Optional # pylint: disable=unused-import
from buildstream import _site, utils, ProgramNotFoundError
from buildstream._platform import Platform
try:
- GIT = utils.get_host_tool('git')
+ GIT = utils.get_host_tool('git') # type: Optional[str]
HAVE_GIT = True
out = str(subprocess.check_output(['git', '--version']), "utf-8")
@@ -33,7 +34,7 @@ except ProgramNotFoundError:
GIT_ENV = dict()
try:
- BZR = utils.get_host_tool('bzr')
+ BZR = utils.get_host_tool('bzr') # type: Optional[str]
HAVE_BZR = True
BZR_ENV = {
"BZR_EMAIL": "Testy McTesterson <testy.mctesterson@example.com>"