Skip to content

Resolve some stubtest allowlist entries by marking params as keyword-only #12581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions stubs/caldav/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# **kwargs replaced with actual arguments in stubs
caldav.DAVClient.calendar
# Passes its *args after a kwarg, which is a SyntaxError, so we allow kwargs only
caldav.DAVClient.principal
caldav.davclient.DAVClient.calendar
caldav.davclient.DAVClient.principal

# Initialized in class, but immediately overwritten in __init__
Expand Down
3 changes: 2 additions & 1 deletion stubs/caldav/caldav/davclient.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ class DAVClient:
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def principal(self, *, url: str | ParseResult | SplitResult | URL | None = ...) -> Principal: ...
def principal(self, *, url: str | ParseResult | SplitResult | URL | None = None) -> Principal: ...
def calendar(
self,
*,
url: str | ParseResult | SplitResult | URL | None = ...,
parent: DAVObject | None = ...,
name: str | None = ...,
Expand Down
6 changes: 0 additions & 6 deletions stubs/pyasn1/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@ pyasn1.codec.native.encoder.SetEncoder.protoDict
# Attempted "__ne__" operation on ASN.1 schema object
pyasn1.type.base
pyasn1.type.univ

# Specifying kwargs
pyasn1.codec.ber.decoder.Decoder.__call__
pyasn1.codec.ber.decoder.StreamingDecoder.__init__
pyasn1.codec.native.decoder.Decoder.__init__
pyasn1.codec.native.encoder.Encoder.__init__
4 changes: 2 additions & 2 deletions stubs/pyasn1/pyasn1/codec/ber/decoder.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ decode: Decoder
class StreamingDecoder:
SINGLE_ITEM_DECODER: type[SingleItemDecoder]

def __init__(self, substrate, asn1Spec=None, tagMap=..., typeMap=..., **ignored: Unused) -> None: ...
def __init__(self, substrate, asn1Spec=None, *, tagMap=..., typeMap=..., **ignored: Unused) -> None: ...
def __iter__(self): ...

class Decoder:
STREAMING_DECODER: type[StreamingDecoder]

@classmethod
def __call__(cls, substrate, asn1Spec=None, tagMap=..., typeMap=..., **ignored: Unused): ...
def __call__(cls, substrate, asn1Spec=None, *, tagMap=..., typeMap=..., **ignored: Unused): ...
2 changes: 1 addition & 1 deletion stubs/pyasn1/pyasn1/codec/native/decoder.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SingleItemDecoder:
class Decoder:
SINGLE_ITEM_DECODER: type[SingleItemDecoder]

def __init__(self, tagMap=..., typeMap=..., **options: Unused) -> None: ...
def __init__(self, *, tagMap=..., typeMap=..., **options: Unused) -> None: ...
def __call__(self, pyObject, asn1Spec=None, **kwargs): ...

decode: Decoder
2 changes: 1 addition & 1 deletion stubs/pyasn1/pyasn1/codec/native/encoder.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SingleItemEncoder:
class Encoder:
SINGLE_ITEM_ENCODER: type[SingleItemEncoder]

def __init__(self, tagMap=..., typeMap=..., **options: Unused): ...
def __init__(self, *, tagMap=..., typeMap=..., **options: Unused): ...
def __call__(self, pyObject, asn1Spec=None, **options): ...

encode: SingleItemEncoder