Skip to content
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

drop 3.5 support #363

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
182 changes: 0 additions & 182 deletions .drone.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ jobs:

matrix:
toxenv:
- py35
- py36
- py37
- py38
- py39
- py35-uvloop
- py36-uvloop
- py37-uvloop
- py38-uvloop
Expand Down
9 changes: 5 additions & 4 deletions aio_pika/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import aiormq
import aiormq.types
from pamqp import commands
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other files you are making import pamqp.commands, - I think it worth to do the same here so that it'll be the same everywhere.


from .exchange import Exchange, ExchangeType
from .message import IncomingMessage
Expand Down Expand Up @@ -335,7 +336,7 @@ async def set_qos(
global_: bool = False,
timeout: TimeoutType = None,
all_channels: bool = None,
) -> aiormq.spec.Basic.QosOk:
) -> commands.Basic.QosOk:
if all_channels is not None:
warn('Use "global_" instead of "all_channels"', DeprecationWarning)
global_ = all_channels
Expand All @@ -356,7 +357,7 @@ async def queue_delete(
if_unused: bool = False,
if_empty: bool = False,
nowait: bool = False,
) -> aiormq.spec.Queue.DeleteOk:
) -> commands.Queue.DeleteOk:
return await asyncio.wait_for(
self.channel.queue_delete(
queue=queue_name,
Expand All @@ -373,7 +374,7 @@ async def exchange_delete(
timeout: TimeoutType = None,
if_unused: bool = False,
nowait: bool = False,
) -> aiormq.spec.Exchange.DeleteOk:
) -> commands.Exchange.DeleteOk:
return await asyncio.wait_for(
self.channel.exchange_delete(
exchange=exchange_name, if_unused=if_unused, nowait=nowait,
Expand All @@ -390,7 +391,7 @@ def transaction(self) -> Transaction:

return Transaction(self._channel)

async def flow(self, active: bool = True) -> aiormq.spec.Channel.FlowOk:
async def flow(self, active: bool = True) -> commands.Channel.FlowOk:
return await self.channel.flow(active=active)

def __del__(self):
Expand Down
8 changes: 2 additions & 6 deletions aio_pika/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@
ProtocolSyntaxError, PublishError,
)


PAMQP_EXCEPTIONS = (pamqp.exceptions.PAMQPException,) + tuple(
pamqp.specification.ERRORS.values(),
)

CONNECTION_EXCEPTIONS = (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ConnectionError can be removed because it inherits OSError which is already exists here.

RuntimeError,
ConnectionError,
OSError,
AMQPError,
) + PAMQP_EXCEPTIONS
pamqp.exceptions.PAMQPException
)


class MessageProcessError(AMQPError):
Expand Down
9 changes: 5 additions & 4 deletions aio_pika/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Optional, Union

import aiormq
import pamqp.commands

from .message import Message
from .types import TimeoutType
Expand Down Expand Up @@ -77,7 +78,7 @@ def __repr__(self):

async def declare(
self, timeout: TimeoutType = None
) -> aiormq.spec.Exchange.DeclareOk:
) -> pamqp.commands.Exchange.DeclareOk:
return await asyncio.wait_for(
self.channel.exchange_declare(
self.name,
Expand Down Expand Up @@ -109,7 +110,7 @@ async def bind(
*,
arguments: dict = None,
timeout: TimeoutType = None
) -> aiormq.spec.Exchange.BindOk:
) -> pamqp.commands.Exchange.BindOk:

""" A binding can also be a relationship between two exchanges.
This can be simply read as: this exchange is interested in messages
Expand Down Expand Up @@ -169,7 +170,7 @@ async def unbind(
routing_key: str = "",
arguments: dict = None,
timeout: TimeoutType = None,
) -> aiormq.spec.Exchange.UnbindOk:
) -> pamqp.commands.Exchange.UnbindOk:

""" Remove exchange-to-exchange binding for this
:class:`Exchange` instance
Expand Down Expand Up @@ -244,7 +245,7 @@ async def publish(

async def delete(
self, if_unused: bool = False, timeout: TimeoutType = None
) -> aiormq.spec.Exchange.DeleteOk:
) -> pamqp.commands.Exchange.DeleteOk:

""" Delete the queue

Expand Down
12 changes: 6 additions & 6 deletions aio_pika/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)
from warnings import warn

import aiormq
import pamqp.commands
from aiormq.types import DeliveredMessage

from .exceptions import MessageProcessError
Expand Down Expand Up @@ -369,9 +369,9 @@ def locked(self) -> bool:
return bool(self.__lock)

@property
def properties(self) -> aiormq.spec.Basic.Properties:
""" Build :class:`aiormq.spec.Basic.Properties` object """
return aiormq.spec.Basic.Properties(
def properties(self) -> pamqp.commands.Basic.Properties:
""" Build :class:`pamqp.commands.Basic.Properties` object """
return pamqp.commands.Basic.Properties(
content_type=self.content_type,
content_encoding=self.content_encoding,
headers=self.headers_raw,
Expand Down Expand Up @@ -499,11 +499,11 @@ def __init__(self, message: DeliveredMessage, no_ack: bool = False):
self.redelivered = None
self.message_count = None

if isinstance(message.delivery, aiormq.spec.Basic.GetOk):
if isinstance(message.delivery, pamqp.commands.Basic.GetOk):
self.message_count = message.delivery.message_count
self.delivery_tag = message.delivery.delivery_tag
self.redelivered = message.delivery.redelivered
elif isinstance(message.delivery, aiormq.spec.Basic.Deliver):
elif isinstance(message.delivery, pamqp.commands.Basic.Deliver):
self.consumer_tag = message.delivery.consumer_tag
self.delivery_tag = message.delivery.delivery_tag
self.redelivered = message.delivery.redelivered
Expand Down
Loading