# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['aio_pika', 'aio_pika.patterns']

package_data = \
{'': ['*']}

install_requires = \
['aiormq>=6.7.1,<6.8.0', 'yarl']

extras_require = \
{':python_version < "3.8"': ['typing_extensions']}

setup_kwargs = {
    'name': 'aio-pika',
    'version': '9.0.4',
    'description': 'Wrapper around the aiormq for asyncio and humans',
    'long_description': '.. _documentation: https://aio-pika.readthedocs.org/\n.. _adopted official RabbitMQ tutorial: https://aio-pika.readthedocs.io/en/latest/rabbitmq-tutorial/1-introduction.html\n\naio-pika\n========\n\n.. image:: https://readthedocs.org/projects/aio-pika/badge/?version=latest\n    :target: https://aio-pika.readthedocs.org/\n    :alt: ReadTheDocs\n\n.. image:: https://coveralls.io/repos/github/mosquito/aio-pika/badge.svg?branch=master\n    :target: https://coveralls.io/github/mosquito/aio-pika\n    :alt: Coveralls\n\n.. image:: https://github.com/mosquito/aio-pika/workflows/tests/badge.svg\n    :target: https://github.com/mosquito/aio-pika/actions?query=workflow%3Atests\n    :alt: Github Actions\n\n.. image:: https://img.shields.io/pypi/v/aio-pika.svg\n    :target: https://pypi.python.org/pypi/aio-pika/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/wheel/aio-pika.svg\n    :target: https://pypi.python.org/pypi/aio-pika/\n\n.. image:: https://img.shields.io/pypi/pyversions/aio-pika.svg\n    :target: https://pypi.python.org/pypi/aio-pika/\n\n.. image:: https://img.shields.io/pypi/l/aio-pika.svg\n    :target: https://pypi.python.org/pypi/aio-pika/\n\n\nA wrapper around `aiormq`_ for asyncio and humans.\n\nCheck out the examples and the tutorial in the `documentation`_.\n\nIf you are a newcomer to RabbitMQ, please start with the `adopted official RabbitMQ tutorial`_.\n\n.. _aiormq: http://github.com/mosquito/aiormq/\n\n.. note::\n   Since version ``5.0.0`` this library doesn\'t use ``pika`` as AMQP connector.\n   Versions below ``5.0.0`` contains or requires ``pika``\'s source code.\n\n.. note::\n   The version 7.0.0 has breaking API changes, see CHANGELOG.md\n   for migration hints.\n\n\nFeatures\n--------\n\n* Completely asynchronous API.\n* Object oriented API.\n* Transparent auto-reconnects with complete state recovery with `connect_robust`\n  (e.g. declared queues or exchanges, consuming state and bindings).\n* Python 3.7+ compatible.\n* For python 3.5 users available `aio-pika<7`\n* Transparent `publisher confirms`_ support\n* `Transactions`_ support\n* Completely type-hints coverage.\n\n\n.. _Transactions: https://www.rabbitmq.com/semantics.html\n.. _publisher confirms: https://www.rabbitmq.com/confirms.html\n\n\nInstallation\n------------\n\n.. code-block:: shell\n\n    pip install aio-pika\n\n\nUsage example\n-------------\n\nSimple consumer:\n\n.. code-block:: python\n\n    import asyncio\n    import aio_pika\n    import aio_pika.abc\n\n\n    async def main(loop):\n        # Connect with the givien parameters is also valiable.\n        # aio_pika.connect_robust(host="host", login="login", password="password")\n        # You can only choose one option to create a connection, url or kw-based params.\n        connection = await aio_pika.connect_robust(\n            "amqp://guest:guest@127.0.0.1/", loop=loop\n        )\n\n        async with connection:\n            queue_name = "test_queue"\n\n            # Creating channel\n            channel: aio_pika.abc.AbstractChannel = await connection.channel()\n\n            # Declaring queue\n            queue: aio_pika.abc.AbstractQueue = await channel.declare_queue(\n                queue_name,\n                auto_delete=True\n            )\n\n            async with queue.iterator() as queue_iter:\n                # Cancel consuming after __aexit__\n                async for message in queue_iter:\n                    async with message.process():\n                        print(message.body)\n\n                        if queue.name in message.body.decode():\n                            break\n\n\n    if __name__ == "__main__":\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(main(loop))\n        loop.close()\n\nSimple publisher:\n\n.. code-block:: python\n\n    import asyncio\n    import aio_pika\n    import aio_pika.abc\n\n\n    async def main(loop):\n        # Explicit type annotation\n        connection: aio_pika.RobustConnection = await aio_pika.connect_robust(\n            "amqp://guest:guest@127.0.0.1/", loop=loop\n        )\n\n        routing_key = "test_queue"\n\n        channel: aio_pika.abc.AbstractChannel = await connection.channel()\n\n        await channel.default_exchange.publish(\n            aio_pika.Message(\n                body=\'Hello {}\'.format(routing_key).encode()\n            ),\n            routing_key=routing_key\n        )\n\n        await connection.close()\n\n\n    if __name__ == "__main__":\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(main(loop))\n        loop.close()\n\n\nGet single message example:\n\n.. code-block:: python\n\n    import asyncio\n    from aio_pika import connect_robust, Message\n\n\n    async def main(loop):\n        connection = await connect_robust(\n            "amqp://guest:guest@127.0.0.1/",\n            loop=loop\n        )\n\n        queue_name = "test_queue"\n        routing_key = "test_queue"\n\n        # Creating channel\n        channel = await connection.channel()\n\n        # Declaring exchange\n        exchange = await channel.declare_exchange(\'direct\', auto_delete=True)\n\n        # Declaring queue\n        queue = await channel.declare_queue(queue_name, auto_delete=True)\n\n        # Binding queue\n        await queue.bind(exchange, routing_key)\n\n        await exchange.publish(\n            Message(\n                bytes(\'Hello\', \'utf-8\'),\n                content_type=\'text/plain\',\n                headers={\'foo\': \'bar\'}\n            ),\n            routing_key\n        )\n\n        # Receiving message\n        incoming_message = await queue.get(timeout=5)\n\n        # Confirm message\n        await incoming_message.ack()\n\n        await queue.unbind(exchange, routing_key)\n        await queue.delete()\n        await connection.close()\n\n\n    if __name__ == "__main__":\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(main(loop))\n\n\nThere are more examples and the RabbitMQ tutorial in the `documentation`_.\n\n\nVersioning\n==========\n\nThis software follows `Semantic Versioning`_\n\n\nFor contributors\n----------------\n\nSetting up development environment\n__________________________________\n\nClone the project:\n\n.. code-block:: shell\n\n    git clone https://github.com/mosquito/aio-pika.git\n    cd aio-pika\n\nCreate a new virtualenv for `aio-pika`_:\n\n.. code-block:: shell\n\n    python3 -m venv env\n    source env/bin/activate\n\nInstall all requirements for `aio-pika`_:\n\n.. code-block:: shell\n\n    pip install -e \'.[develop]\'\n\n\nRunning Tests\n_____________\n\n**NOTE: In order to run the tests locally you need to run a RabbitMQ instance with default user/password (guest/guest) and port (5672).**\n\n* ProTip: Use Docker for this:\n\n.. code-block:: bash\n\n    docker run -d -p 5671:5671 -p 5672:5672 -p 15671:15671 -p 15672:15672 mosquito/aiormq-rabbitmq\n\nTo test just run:\n\n.. code-block:: bash\n\n    make test\n\n\nEditing Documentation\n_____________________\n\nTo iterate quickly on the documentation live in your browser, try:\n\n.. code-block:: bash\n\n    nox -s docs -- serve\n\nCreating Pull Requests\n______________________\n\nPlease feel free to create pull requests, but you should describe your use cases and add some examples.\n\nChanges should follow a few simple rules:\n\n* When your changes break the public API, you must increase the major version.\n* When your changes are safe for public API (e.g. added an argument with default value)\n* You have to add test cases (see `tests/` folder)\n* You must add docstrings\n* Feel free to add yourself to `"thank\'s to" section`_\n\n\n.. _"thank\'s to" section: https://github.com/mosquito/aio-pika/blob/master/docs/source/index.rst#thanks-for-contributing\n.. _Semantic Versioning: http://semver.org/\n.. _aio-pika: https://github.com/mosquito/aio-pika/\n',
    'author': 'Dmitry Orlov',
    'author_email': 'me@mosquito.su',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'https://github.com/mosquito/aio-pika',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'extras_require': extras_require,
    'python_requires': '>=3.7,<4.0',
}


setup(**setup_kwargs)
