Skip to content

Add entries to pika's stubtest_requirements #9826

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 2 commits into from
Feb 28, 2023
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
5 changes: 0 additions & 5 deletions stubs/pika/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
pika.compat.StringIO.seek
pika.compat.StringIO.truncate

# Requires external libraries to be installed.
pika\.adapters\.gevent_connection.*
pika\.adapters\.tornado_connection.*
pika\.adapters\.twisted_connection.*

# Stubtest doesn't understand that a property alias is also read-only.
pika.BlockingConnection.basic_nack
pika.BlockingConnection.consumer_cancel_notify
Expand Down
3 changes: 3 additions & 0 deletions stubs/pika/METADATA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ extra_description = """\
The `types-pika` package contains alternate, more complete type stubs, that \
are maintained outside of typeshed.\
"""

[tool.stubtest]
stubtest_requirements = ["gevent", "tornado", "twisted"]
8 changes: 4 additions & 4 deletions stubs/pika/pika/adapters/twisted_connection.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ from typing_extensions import TypeAlias
import pika.connection
from pika.adapters.utils import nbio_interface

DeferredQueue: TypeAlias = Any # TODO: twisted.internet.defer.DeferredQueue
Protocol: TypeAlias = Any # TODO: twisted.internet.protocol.Protocol
_DeferredQueue: TypeAlias = Any # TODO: twisted.internet.defer.DeferredQueue
_Protocol: TypeAlias = Any # TODO: twisted.internet.protocol.Protocol

LOGGER: Incomplete

class ClosableDeferredQueue(DeferredQueue):
class ClosableDeferredQueue(_DeferredQueue):
closed: Incomplete
def __init__(self, size: Incomplete | None = ..., backlog: Incomplete | None = ...) -> None: ...
def put(self, obj): ...
Expand Down Expand Up @@ -107,7 +107,7 @@ class _TwistedConnectionAdapter(pika.connection.Connection):
def connection_lost(self, error) -> None: ...
def data_received(self, data) -> None: ...

class TwistedProtocolConnection(Protocol):
class TwistedProtocolConnection(_Protocol):
ready: Incomplete
closed: Incomplete
def __init__(self, parameters: Incomplete | None = ..., custom_reactor: Incomplete | None = ...) -> None: ...
Expand Down