From 1c08df207bf4584d0030ccc3a09f5c0afac4ff71 Mon Sep 17 00:00:00 2001 From: Tatsh Date: Tue, 6 May 2025 02:36:34 -0400 Subject: [PATCH] Add binaryornot stubs (#13920) --- stubs/binaryornot/@tests/stubtest_allowlist.txt | 1 + stubs/binaryornot/METADATA.toml | 2 ++ stubs/binaryornot/binaryornot/__init__.pyi | 5 +++++ stubs/binaryornot/binaryornot/check.pyi | 3 +++ stubs/binaryornot/binaryornot/helpers.pyi | 5 +++++ 5 files changed, 16 insertions(+) create mode 100644 stubs/binaryornot/@tests/stubtest_allowlist.txt create mode 100644 stubs/binaryornot/METADATA.toml create mode 100644 stubs/binaryornot/binaryornot/__init__.pyi create mode 100644 stubs/binaryornot/binaryornot/check.pyi create mode 100644 stubs/binaryornot/binaryornot/helpers.pyi diff --git a/stubs/binaryornot/@tests/stubtest_allowlist.txt b/stubs/binaryornot/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000..742a3bb53 --- /dev/null +++ b/stubs/binaryornot/@tests/stubtest_allowlist.txt @@ -0,0 +1 @@ +binaryornot\..+?\.logger diff --git a/stubs/binaryornot/METADATA.toml b/stubs/binaryornot/METADATA.toml new file mode 100644 index 000000000..bc45896c1 --- /dev/null +++ b/stubs/binaryornot/METADATA.toml @@ -0,0 +1,2 @@ +version = "0.4.*" +upstream_repository = "https://github.com/binaryornot/binaryornot" diff --git a/stubs/binaryornot/binaryornot/__init__.pyi b/stubs/binaryornot/binaryornot/__init__.pyi new file mode 100644 index 000000000..4c304c608 --- /dev/null +++ b/stubs/binaryornot/binaryornot/__init__.pyi @@ -0,0 +1,5 @@ +from typing import Final + +__author__: Final[str] +__email__: Final[str] +__version__: Final[str] diff --git a/stubs/binaryornot/binaryornot/check.pyi b/stubs/binaryornot/binaryornot/check.pyi new file mode 100644 index 000000000..8ebb58019 --- /dev/null +++ b/stubs/binaryornot/binaryornot/check.pyi @@ -0,0 +1,3 @@ +from _typeshed import StrOrBytesPath + +def is_binary(filename: StrOrBytesPath) -> bool: ... diff --git a/stubs/binaryornot/binaryornot/helpers.pyi b/stubs/binaryornot/binaryornot/helpers.pyi new file mode 100644 index 000000000..4534c3ffe --- /dev/null +++ b/stubs/binaryornot/binaryornot/helpers.pyi @@ -0,0 +1,5 @@ +from _typeshed import StrOrBytesPath + +def print_as_hex(s: str) -> None: ... +def get_starting_chunk(filename: StrOrBytesPath, length: int = 1024) -> bytes: ... +def is_binary_string(bytes_to_check: bytes | bytearray) -> bool: ...