diff options
author | Benjamin Schubert <contact@benschubert.me> | 2020-08-29 10:34:24 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2020-08-30 15:36:34 +0000 |
commit | c50e755911243d6110256a6fc7f011f4a2a323f4 (patch) | |
tree | 656e86287b4bf0d193aa1d447fc17ea6821c1d38 | |
parent | db537b1b23a0d52a764a1e03111a9ebdcc278fa4 (diff) | |
download | buildstream-c50e755911243d6110256a6fc7f011f4a2a323f4.tar.gz |
_loader: Add type information for the loader package's cython files
This helps with type checking and give better feedback to mypy
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | src/buildstream/_loader/_loader.pyi | 1 | ||||
-rw-r--r-- | src/buildstream/_loader/loadelement.pyi | 13 |
3 files changed, 15 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] +[mypy-buildstream.node,buildstream._types,buildstream._utils] ignore_missing_imports=True # Ignore issues with generated files and vendored code diff --git a/src/buildstream/_loader/_loader.pyi b/src/buildstream/_loader/_loader.pyi new file mode 100644 index 000000000..c4281b4b9 --- /dev/null +++ b/src/buildstream/_loader/_loader.pyi @@ -0,0 +1 @@ +def valid_chars_name(name: str) -> bool: ... diff --git a/src/buildstream/_loader/loadelement.pyi b/src/buildstream/_loader/loadelement.pyi new file mode 100644 index 000000000..67b14df8f --- /dev/null +++ b/src/buildstream/_loader/loadelement.pyi @@ -0,0 +1,13 @@ +from typing import List + +from ..node import Node, ProvenanceInformation + +def extract_depends_from_node(node: Node) -> List[Dependency]: ... + +class Dependency: ... + +class LoadElement: + first_pass: bool + kind: str + name: str + provenance: ProvenanceInformation |