diff --git a/coolamqp/clustering/events.py b/coolamqp/clustering/events.py index 0e3894251f578b8c221094e6967bef9897358cec..872fdc4c3584c1cd32e285491aeb5cd3a417dcb8 100644 --- a/coolamqp/clustering/events.py +++ b/coolamqp/clustering/events.py @@ -41,7 +41,7 @@ class MessageReceived(ReceivedMessage, Event): Something that works as an ersatz ReceivedMessage, but is an event """ - def __init__(self, msg): + def __init__(self, msg): # type: (ReceivedMessage) -> None """:type msg: ReceivedMessage""" ReceivedMessage.__init__(self, msg.body, msg.exchange_name, msg.routing_key, diff --git a/coolamqp/clustering/single.py b/coolamqp/clustering/single.py index e66c35e16c68f5090694d0280960da7137ceeeaa..8922b39061d7745da2f0a1cd73ddd1f66a834e69 100644 --- a/coolamqp/clustering/single.py +++ b/coolamqp/clustering/single.py @@ -14,8 +14,12 @@ class SingleNodeReconnector(object): Connection to one node. It will do it's best to remain alive. """ - def __init__(self, node_def, attache_group, listener_thread, extra_properties=None, - log_frames=None, name=None): + def __init__(self, node_def, # type: coolamqp.objects.NodeDefinition + attache_group, # type: coolamqp.attaches.AttacheGroup + listener_thread, # type: coolamqp.uplink.ListenerThread + extra_properties=None, # type: tp.Dict[bytes, tp.Tuple[tp.Any, str]] + log_frames=None, # type: tp.Callable[] + name=None): self.listener_thread = listener_thread self.node_def = node_def self.attache_group = attache_group diff --git a/coolamqp/uplink/connection/connection.py b/coolamqp/uplink/connection/connection.py index bb67d25d2263c93cacfcc4e68ca54df378909a9e..c5fec4920e5d1cf06b8d082d4bc14f0bce96f860 100644 --- a/coolamqp/uplink/connection/connection.py +++ b/coolamqp/uplink/connection/connection.py @@ -6,7 +6,7 @@ import logging import socket import time import uuid - +import typing as tp import monotonic from coolamqp.exceptions import ConnectionDead diff --git a/coolamqp/uplink/listener/thread.py b/coolamqp/uplink/listener/thread.py index 10ec8f856275c2deb0ec51243d791c9253132a25..c7e03a5de12248c496664c8fea2dc6c309509701 100644 --- a/coolamqp/uplink/listener/thread.py +++ b/coolamqp/uplink/listener/thread.py @@ -2,6 +2,7 @@ from __future__ import absolute_import, division, print_function import threading +import typing as tp from coolamqp.objects import Callable from coolamqp.uplink.listener.epoll_listener import EpollListener @@ -14,7 +15,7 @@ class ListenerThread(threading.Thread): It automatically picks the best listener for given platform. """ - def __init__(self, name=None): + def __init__(self, name=None): # type: (tp.Optional[str]) -> None threading.Thread.__init__(self, name='coolamqp/ListenerThread') self.daemon = True self.name = name or 'CoolAMQP' diff --git a/setup.py b/setup.py index 3a2d02482b30353ba7a76a0d1eb01057b0828f50..e6a2d15247d116fcd8fadf2eb8ae154fe0895cc2 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup(keywords=['amqp', 'rabbitmq', 'client', 'network', 'ha', 'high availabilit Also, handles your reconnects and transactionality THE RIGHT WAY, though somewhat opinionated''', install_requires=['six', 'monotonic', 'futures', 'typing'], # per coverage version for codeclimate-reporter - tests_require=["nose2", 'coverage>=4.0,<4.4', "nose2[coverage_plugin]"], + tests_require=["nose2", "nose2[coverage_plugin]"], test_suite='nose2.collector.collector' )