From 0f89c82b622aa197eae54631f1c0261f0f3012e1 Mon Sep 17 00:00:00 2001 From: Semyon Moroz Date: Sat, 21 Jun 2025 17:55:26 +0000 Subject: [PATCH] [ldap3] Add missing stubs (#14271) --- stubs/ldap3/@tests/stubtest_allowlist.txt | 1 + stubs/ldap3/METADATA.toml | 2 -- stubs/ldap3/ldap3/utils/asn1.pyi | 4 ++++ stubs/ldap3/ldap3/version.pyi | 12 +++++++++--- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 stubs/ldap3/@tests/stubtest_allowlist.txt diff --git a/stubs/ldap3/@tests/stubtest_allowlist.txt b/stubs/ldap3/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000..c1fe27b11 --- /dev/null +++ b/stubs/ldap3/@tests/stubtest_allowlist.txt @@ -0,0 +1 @@ +ldap3.utils.ordDict # file is available only in Python 2.6 diff --git a/stubs/ldap3/METADATA.toml b/stubs/ldap3/METADATA.toml index 76740bed3..47c015f41 100644 --- a/stubs/ldap3/METADATA.toml +++ b/stubs/ldap3/METADATA.toml @@ -1,10 +1,8 @@ version = "2.9.*" upstream_repository = "https://github.com/cannatag/ldap3" requires = ["types-pyasn1"] -partial_stub = true [tool.stubtest] -ignore_missing_stub = true apt_dependencies = ["libkrb5-dev"] # No need to install on the CI. Leaving here as information for MacOs/Windows contributors. # brew_dependencies = ["krb5"] diff --git a/stubs/ldap3/ldap3/utils/asn1.pyi b/stubs/ldap3/ldap3/utils/asn1.pyi index e29518128..4d4abfcea 100644 --- a/stubs/ldap3/ldap3/utils/asn1.pyi +++ b/stubs/ldap3/ldap3/utils/asn1.pyi @@ -4,6 +4,7 @@ from typing import Any, Final, TypeVar, overload from typing_extensions import TypeAlias from pyasn1.codec.ber.encoder import AbstractItemEncoder +from pyasn1.type.tag import TagSet # Use _typeshed._SupportsGetItemBuffer after PEP 688 _SupportsGetItemBuffer: TypeAlias = SliceableBuffer | IndexableBuffer @@ -19,6 +20,9 @@ class LDAPBooleanEncoder(AbstractItemEncoder): # Requires pyasn1 > 0.3.7 def encodeValue(self, value: bool | int, asn1Spec: Unused, encodeFun: Unused, **options: Unused): ... +customTagMap: dict[TagSet, AbstractItemEncoder] +customTypeMap: dict[int, AbstractItemEncoder] + def compute_ber_size(data): ... def decode_message_fast(message): ... @overload diff --git a/stubs/ldap3/ldap3/version.pyi b/stubs/ldap3/ldap3/version.pyi index 50be840c1..5939bd051 100644 --- a/stubs/ldap3/ldap3/version.pyi +++ b/stubs/ldap3/ldap3/version.pyi @@ -1,3 +1,9 @@ -__url__: str -__description__: str -__status__: str +from typing import Final + +__version__: Final[str] +__author__: Final[str] +__email__: Final[str] +__url__: Final[str] +__description__: Final[str] +__status__: Final[str] +__license__: Final[str]