diff mbox series

[libgpiod,17/22] bindings: python: tests: add type stubs for external modules

Message ID 20240927-vfazio-mypy-v1-17-91a7c2e20884@xes-inc.com
State Superseded
Headers show
Series bindings: python: conform to mypy and ruff linter recommendations | expand

Commit Message

Vincent Fazio Sept. 27, 2024, 6:53 p.m. UTC
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
---
 bindings/python/tests/gpiosim/_ext.pyi  | 21 +++++++++++++++++++++
 bindings/python/tests/procname/_ext.pyi |  1 +
 2 files changed, 22 insertions(+)

Comments

Bartosz Golaszewski Oct. 8, 2024, 1:30 p.m. UTC | #1
On Fri, Sep 27, 2024 at 8:57 PM Vincent Fazio <vfazio@xes-inc.com> wrote:
>
> Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>

Some details on what it is and what it does please.

> ---
>  bindings/python/tests/gpiosim/_ext.pyi  | 21 +++++++++++++++++++++
>  bindings/python/tests/procname/_ext.pyi |  1 +
>  2 files changed, 22 insertions(+)
>
> diff --git a/bindings/python/tests/gpiosim/_ext.pyi b/bindings/python/tests/gpiosim/_ext.pyi
> new file mode 100644
> index 0000000000000000000000000000000000000000..69d4b63cf54af25f9f029a68d36a9a63789ce132
> --- /dev/null
> +++ b/bindings/python/tests/gpiosim/_ext.pyi
> @@ -0,0 +1,21 @@
> +class Chip:
> +    def __init__(self) -> None: ...
> +    def set_label(self, label: str) -> None: ...
> +    def set_num_lines(self, num_lines: int) -> None: ...
> +    def set_line_name(self, offset: int, name: str) -> None: ...
> +    def set_hog(self, offset: int, name: str, direction: int) -> None: ...
> +    def enable(self) -> None: ...
> +    def get_value(set, offset: int) -> int: ...
> +    def set_pull(set, offset: int, pull: int) -> None: ...
> +    @property
> +    def dev_path(self) -> str: ...
> +    @property
> +    def name(self) -> str: ...
> +

Four spaces indents for consistency?

> +PULL_DOWN: int
> +PULL_UP: int
> +VALUE_INACTIVE: int
> +VALUE_ACTIVE: int
> +DIRECTION_INPUT: int
> +DIRECTION_OUTPUT_HIGH: int
> +DIRECTION_OUTPUT_LOW: int
> diff --git a/bindings/python/tests/procname/_ext.pyi b/bindings/python/tests/procname/_ext.pyi
> new file mode 100644
> index 0000000000000000000000000000000000000000..fdcd8ac15f2a0cb9b900ef272b2a10818c8eef4e
> --- /dev/null
> +++ b/bindings/python/tests/procname/_ext.pyi
> @@ -0,0 +1 @@
> +def set_process_name(name: str) -> None: ...
>
> --
> 2.34.1
>

Bart
diff mbox series

Patch

diff --git a/bindings/python/tests/gpiosim/_ext.pyi b/bindings/python/tests/gpiosim/_ext.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..69d4b63cf54af25f9f029a68d36a9a63789ce132
--- /dev/null
+++ b/bindings/python/tests/gpiosim/_ext.pyi
@@ -0,0 +1,21 @@ 
+class Chip:
+    def __init__(self) -> None: ...
+    def set_label(self, label: str) -> None: ...
+    def set_num_lines(self, num_lines: int) -> None: ...
+    def set_line_name(self, offset: int, name: str) -> None: ...
+    def set_hog(self, offset: int, name: str, direction: int) -> None: ...
+    def enable(self) -> None: ...
+    def get_value(set, offset: int) -> int: ...
+    def set_pull(set, offset: int, pull: int) -> None: ...
+    @property
+    def dev_path(self) -> str: ...
+    @property
+    def name(self) -> str: ...
+
+PULL_DOWN: int
+PULL_UP: int
+VALUE_INACTIVE: int
+VALUE_ACTIVE: int
+DIRECTION_INPUT: int
+DIRECTION_OUTPUT_HIGH: int
+DIRECTION_OUTPUT_LOW: int
diff --git a/bindings/python/tests/procname/_ext.pyi b/bindings/python/tests/procname/_ext.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..fdcd8ac15f2a0cb9b900ef272b2a10818c8eef4e
--- /dev/null
+++ b/bindings/python/tests/procname/_ext.pyi
@@ -0,0 +1 @@ 
+def set_process_name(name: str) -> None: ...