diff options
author | Benjamin Schubert <contact@benschubert.me> | 2020-08-29 10:22:49 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2020-08-30 15:36:34 +0000 |
commit | db537b1b23a0d52a764a1e03111a9ebdcc278fa4 (patch) | |
tree | edc5acf5b05ead982888941c290e10a506377175 | |
parent | 9c3d147a0267ebbe39e91ed7f638e2ed76494b51 (diff) | |
download | buildstream-db537b1b23a0d52a764a1e03111a9ebdcc278fa4.tar.gz |
_variables.pyi: Add type annotations for _variables.pyx
This enables type checking from mypy on the cython module
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | src/buildstream/_variables.pyi | 9 |
2 files changed, 10 insertions, 1 deletions
@@ -33,7 +33,7 @@ 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] +[mypy-buildstream.node,buildstream._loader.*,buildstream._types,buildstream._utils] ignore_missing_imports=True # Ignore issues with generated files and vendored code diff --git a/src/buildstream/_variables.pyi b/src/buildstream/_variables.pyi new file mode 100644 index 000000000..1e2f47325 --- /dev/null +++ b/src/buildstream/_variables.pyi @@ -0,0 +1,9 @@ +from typing import Optional + +from .node import MappingNode, Node + +class Variables: + def __init__(self, node: MappingNode) -> None: ... + def check(self) -> None: ... + def expand(self, node: Node) -> None: ... + def get(self, name: str) -> Optional[str]: ... |