Hello community, here is the log from the commit of package python-pika for openSUSE:Factory checked in at 2019-02-06 15:48:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pika (Old) and /work/SRC/openSUSE:Factory/.python-pika.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pika" Wed Feb 6 15:48:22 2019 rev:10 rq:671960 version:0.13.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pika/python-pika.changes 2018-10-01 08:17:06.825979539 +0200 +++ /work/SRC/openSUSE:Factory/.python-pika.new.28833/python-pika.changes 2019-02-06 15:48:24.491223211 +0100 @@ -1,0 +2,8 @@ +Thu Jan 31 08:49:58 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 0.13.0: + * AsyncioConnection, TornadoConnection and TwistedProtocolConnection are no longer auto-imported + * Python 3.7 support +- Drop merged patch 1119-increase_timeouts.patch + +------------------------------------------------------------------- Old: ---- 0.12.0.tar.gz 1119-increase_timeouts.patch New: ---- 0.13.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pika.spec ++++++ --- /var/tmp/diff_new_pack.z2lSIB/_old 2019-02-06 15:48:24.955222931 +0100 +++ /var/tmp/diff_new_pack.z2lSIB/_new 2019-02-06 15:48:24.955222931 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pika # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,14 +19,13 @@ %define mod_name pika %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-%{mod_name} -Version: 0.12.0 +Version: 0.13.0 Release: 0 Summary: Pika Python AMQP Client Library License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/pika/pika Source: https://github.com/pika/pika/archive/%{version}.tar.gz -Patch: 1119-increase_timeouts.patch BuildRequires: %{python_module Twisted} BuildRequires: %{python_module mock} BuildRequires: %{python_module nose} @@ -48,7 +47,6 @@ %prep %setup -q -n %{mod_name}-%{version} -%patch -p1 # acceptance needs running configured server rm -rf tests/acceptance/ sed -i -e 's:,tests/acceptance::' setup.cfg ++++++ 0.12.0.tar.gz -> 0.13.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/.github/ISSUE_TEMPLATE.md new/pika-0.13.0/.github/ISSUE_TEMPLATE.md --- old/pika-0.12.0/.github/ISSUE_TEMPLATE.md 1970-01-01 01:00:00.000000000 +0100 +++ new/pika-0.13.0/.github/ISSUE_TEMPLATE.md 2019-01-17 18:05:25.000000000 +0100 @@ -0,0 +1,15 @@ +Thank you for using Pika. + +GitHub issues are **strictly** used for actionable work and pull +requests. + +Pika's maintainers do NOT use GitHub issues for questions, root cause +analysis, conversations, code reviews, etc. + +Please direct all non-work issues to either the `pika-python` or +`rabbitmq-users` mailing list: + +* https://groups.google.com/forum/#!forum/pika-python +* https://groups.google.com/forum/#!forum/rabbitmq-users + +Thank you diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/.github/PULL_REQUEST_TEMPLATE.md new/pika-0.13.0/.github/PULL_REQUEST_TEMPLATE.md --- old/pika-0.12.0/.github/PULL_REQUEST_TEMPLATE.md 1970-01-01 01:00:00.000000000 +0100 +++ new/pika-0.13.0/.github/PULL_REQUEST_TEMPLATE.md 2019-01-17 18:05:25.000000000 +0100 @@ -0,0 +1,43 @@ +## Proposed Changes + +Please describe the big picture of your changes here to communicate to +the Pika team why we should accept this pull request. If it fixes a bug +or resolves a feature request, be sure to link to that issue. + +A pull request that doesn't explain **why** the change was made has a +much lower chance of being accepted. + +If English isn't your first language, don't worry about it and try to +communicate the problem you are trying to solve to the best of your +abilities. As long as we can understand the intent, it's all good. + +## Types of Changes + +What types of changes does your code introduce to this project? +_Put an `x` in the boxes that apply_ + +- [ ] Bugfix (non-breaking change which fixes issue #NNNN) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Documentation (correction or otherwise) +- [ ] Cosmetics (whitespace, appearance) + +## Checklist + +_Put an `x` in the boxes that apply. You can also fill these out after +creating the PR. If you're unsure about any of them, don't hesitate to +ask on the +[`pika-python`](https://groups.google.com/forum/#!forum/pika-python) +mailing list. We're here to help! This is simply a reminder of what we +are going to look for before merging your code._ + +- [ ] I have read the `CONTRIBUTING.md` document +- [ ] All tests pass locally with my changes +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have added necessary documentation (if appropriate) + +## Further Comments + +If this is a relatively large or complex change, kick off the discussion +by explaining why you chose the solution you did and what alternatives +you considered, etc. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/.travis.yml new/pika-0.13.0/.travis.yml --- old/pika-0.12.0/.travis.yml 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/.travis.yml 2019-01-17 18:05:25.000000000 +0100 @@ -8,11 +8,12 @@ - sourceline: deb https://packages.erlang-solutions.com/ubuntu trusty contrib key_url: https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc packages: + # apt-cache show erlang-nox=1:20.3-1 | grep Depends | tr ' ' '\n' | grep erlang | grep -v erlang-base-hipe | tr -d ',' | sed 's/$/=1:20.3-1/' - erlang-nox env: global: - - RABBITMQ_VERSION=3.7.4 + - RABBITMQ_VERSION=3.7.8 - RABBITMQ_DOWNLOAD_URL="https://github.com/rabbitmq/rabbitmq-server/releases/download/v$RABBITMQ_VERSION/rabbitmq-server-generic-unix-$RABBITMQ_VERSION.tar.xz" - RABBITMQ_TAR="rabbitmq-$RABBITMQ_VERSION.tar.xz" - PATH=$HOME/.local/bin:$PATH @@ -23,7 +24,7 @@ stages: - test - name: coverage - if: repo IS pika/pika + if: repo = pika/pika - name: deploy if: tag IS present @@ -59,14 +60,16 @@ jobs: include: + - python: pypy3 + - python: pypy - python: 2.7 - python: 3.4 - python: 3.5 - python: 3.6 - - python: 3.7-dev - - python: pypy - - python: pypy3 + - python: 3.7 + dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069) - stage: coverage + if: fork = false OR type != pull_request python: 3.6 services: [] install: @@ -82,7 +85,7 @@ - coverage report after_success: codecov - stage: deploy - if: repo IS pika/pika + if: repo = pika/pika python: 3.6 services: [] install: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/CHANGELOG.rst new/pika-0.13.0/CHANGELOG.rst --- old/pika-0.12.0/CHANGELOG.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/CHANGELOG.rst 2019-01-17 18:05:25.000000000 +0100 @@ -1,6 +1,14 @@ Version History =============== +0.13.0 2019-01-17 +----------------- + +`GitHub milestone <https://github.com/pika/pika/milestone/13>`_ + +- `AsyncioConnection`, `TornadoConnection` and `TwistedProtocolConnection` are no longer auto-imported (`PR <https://github.com/pika/pika/pull/1129>`_) +- Python `3.7` support (`Issue <https://github.com/pika/pika/issues/1107>`_) + 0.12.0 2018-06-19 ----------------- @@ -156,14 +164,14 @@ adapter. - Non-backward-compatible changes in `Channel.add_on_return_callback` callback's signature. -- The `AsynchoreConnection` adapter was retired +- The `AsyncoreConnection` adapter was retired **Details** Python 3.x: this release introduces python 3.x support. Tested on Python 3.3 and 3.4. -`AsynchoreConnection`: Retired this legacy adapter to reduce maintenance burden; +`AsyncoreConnection`: Retired this legacy adapter to reduce maintenance burden; the recommended replacement is the `SelectConnection` adapter. `SelectConnection`: ioloop was refactored for compatibility with other ioloops. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/CONTRIBUTING.md new/pika-0.13.0/CONTRIBUTING.md --- old/pika-0.12.0/CONTRIBUTING.md 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/CONTRIBUTING.md 2019-01-17 18:05:25.000000000 +0100 @@ -63,4 +63,6 @@ ## Code Formatting Please format your code using [yapf](http://pypi.python.org/pypi/yapf) -with ``google`` style prior to issuing your pull request. +with ``google`` style prior to issuing your pull request. *Note: only format those +lines that you have changed in your pull request. If you format an entire file and +change code outside of the scope of your PR, it will likely be rejected.* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/README.rst new/pika-0.13.0/README.rst --- old/pika-0.12.0/README.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/README.rst 2019-01-17 18:05:25.000000000 +0100 @@ -113,11 +113,13 @@ connection.add_callback_threadsafe(functools.partial(ack_message, channel, delivery_tag)) - When using a non-blocking connection adapter, such as - :py:class:`pika.AsyncioConnection` or :py:class:`pika.SelectConnection`, you - use the underlying asynchronous framework's native API for requesting an - ioloop-bound callback from another thread. For example, `SelectConnection`'s - `IOLoop` provides `add_callback_threadsafe()`, `Tornado`'s `IOLoop` has - `add_callback()`, while `asyncio`'s event loop exposes `call_soon_threadsafe()`. +:py:class:`pika.adapters.asyncio_connection.AsyncioConnection` or +:py:class:`pika.SelectConnection`, you use the underlying asynchronous +framework's native API for requesting an ioloop-bound callback from +another thread. For example, `SelectConnection`'s `IOLoop` provides +`add_callback_threadsafe()`, `Tornado`'s `IOLoop` has +`add_callback()`, while `asyncio`'s event loop exposes +`call_soon_threadsafe()`. This threadsafe callback request mechanism may also be used to delegate publishing of messages, etc., from a background thread to the connection adapter's @@ -131,7 +133,9 @@ *Pull requests that add or change code without coverage will most likely be rejected.* Additionally, please format your code using `yapf <http://pypi.python.org/pypi/yapf>`_ -with ``google`` style prior to issuing your pull request. +with ``google`` style prior to issuing your pull request. *Note: only format those +lines that you have changed in your pull request. If you format an entire file and +change code outside of the scope of your PR, it will likely be rejected.* .. |Version| image:: https://img.shields.io/pypi/v/pika.svg? :target: http://badge.fury.io/py/pika diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/docs/examples/asyncio_consumer.rst new/pika-0.13.0/docs/examples/asyncio_consumer.rst --- old/pika-0.12.0/docs/examples/asyncio_consumer.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/docs/examples/asyncio_consumer.rst 2019-01-17 18:05:25.000000000 +0100 @@ -59,8 +59,8 @@ """ LOGGER.info('Connecting to %s', self._url) - return adapters.AsyncioConnection(pika.URLParameters(self._url), - self.on_connection_open) + return adapters.asyncio_connection.AsyncioConnection(pika.URLParameters(self._url), + self.on_connection_open) def close_connection(self): """This method closes the connection to RabbitMQ.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/docs/examples/comparing_publishing_sync_async.rst new/pika-0.13.0/docs/examples/comparing_publishing_sync_async.rst --- old/pika-0.12.0/docs/examples/comparing_publishing_sync_async.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/docs/examples/comparing_publishing_sync_async.rst 2019-01-17 18:05:25.000000000 +0100 @@ -1,7 +1,7 @@ Comparing Message Publishing with BlockingConnection and SelectConnection ========================================================================= -For those doing simple, non-asynchronous programing, :py:meth:`pika.adapters.blocking_connection.BlockingConnection` proves to be the easiest way to get up and running with Pika to publish messages. +For those doing simple, non-asynchronous programming, :py:meth:`pika.adapters.blocking_connection.BlockingConnection` proves to be the easiest way to get up and running with Pika to publish messages. In the following example, a connection is made to RabbitMQ listening to port *5672* on *localhost* using the username *guest* and password *guest* and virtual host */*. Once connected, a channel is opened and a message is published to the *test_exchange* exchange using the *test_routing_key* routing key. The BasicProperties value passed in sets the message to delivery mode *1* (non-persisted) with a content-type of *text/plain*. Once the message is published, the connection is closed:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/docs/examples/heartbeat_and_blocked_timeouts.rst new/pika-0.13.0/docs/examples/heartbeat_and_blocked_timeouts.rst --- old/pika-0.12.0/docs/examples/heartbeat_and_blocked_timeouts.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/docs/examples/heartbeat_and_blocked_timeouts.rst 2019-01-17 18:05:25.000000000 +0100 @@ -4,9 +4,9 @@ This example demonstrates explicit setting of heartbeat and blocked connection timeouts. -Starting with RabbitMQ 3.5.5, the broker's default hearbeat timeout decreased from 580 seconds to 60 seconds. As a result, applications that perform lengthy processing in the same thread that also runs their Pika connection may experience unexpected dropped connections due to heartbeat timeout. Here, we specify an explicit lower bound for heartbeat timeout. +Starting with RabbitMQ 3.5.5, the broker's default heartbeat timeout decreased from 580 seconds to 60 seconds. As a result, applications that perform lengthy processing in the same thread that also runs their Pika connection may experience unexpected dropped connections due to heartbeat timeout. Here, we specify an explicit lower bound for heartbeat timeout. -When RabbitMQ broker is running out of certain resources, such as memory and disk space, it may block connections that are performing resource-consuming operations, such as publishing messages. Once a connection is blocked, RabbiMQ stops reading from that connection's socket, so no commands from the client will get through to te broker on that connection until the broker unblocks it. A blocked connection may last for an indefinite period of time, stalling the connection and possibly resulting in a hang (e.g., in BlockingConnection) until the connection is unblocked. Blocked Connectin Timeout is intended to interrupt (i.e., drop) a connection that has been blocked longer than the given timeout value. +When RabbitMQ broker is running out of certain resources, such as memory and disk space, it may block connections that are performing resource-consuming operations, such as publishing messages. Once a connection is blocked, RabbitMQ stops reading from that connection's socket, so no commands from the client will get through to the broker on that connection until the broker unblocks it. A blocked connection may last for an indefinite period of time, stalling the connection and possibly resulting in a hang (e.g., in BlockingConnection) until the connection is unblocked. Blocked Connection Timeout is intended to interrupt (i.e., drop) a connection that has been blocked longer than the given timeout value. Example of configuring hertbeat and blocked-connection timeouts:: @@ -15,7 +15,7 @@ def main(): - # NOTE: These paramerers work with all Pika connection types + # NOTE: These parameters work with all Pika connection types params = pika.ConnectionParameters(heartbeat_interval=600, blocked_connection_timeout=300) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/docs/examples/tls_server_uathentication.rst new/pika-0.13.0/docs/examples/tls_server_uathentication.rst --- old/pika-0.12.0/docs/examples/tls_server_uathentication.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/docs/examples/tls_server_uathentication.rst 2019-01-17 18:05:25.000000000 +0100 @@ -4,7 +4,7 @@ It was tested against RabbitMQ 3.6.10, using Python 3.6.1 and pre-release Pika `0.11.0` -Note the use of `ssl_version=ssl.PROTOCOL_TLSv1`. The recent verions of RabbitMQ disable older versions of +Note the use of `ssl_version=ssl.PROTOCOL_TLSv1`. The recent versions of RabbitMQ disable older versions of SSL due to security vulnerabilities. See https://www.rabbitmq.com/ssl.html for certificate creation and rabbitmq SSL configuration instructions. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/docs/examples/tornado_consumer.rst new/pika-0.13.0/docs/examples/tornado_consumer.rst --- old/pika-0.12.0/docs/examples/tornado_consumer.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/docs/examples/tornado_consumer.rst 2019-01-17 18:05:25.000000000 +0100 @@ -53,8 +53,8 @@ """ LOGGER.info('Connecting to %s', self._url) - return adapters.TornadoConnection(pika.URLParameters(self._url), - self.on_connection_open) + return adapters.tornado_connection.TornadoConnection(pika.URLParameters(self._url), + self.on_connection_open) def close_connection(self): """This method closes the connection to RabbitMQ.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/docs/intro.rst new/pika-0.13.0/docs/intro.rst --- old/pika-0.12.0/docs/intro.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/docs/intro.rst 2019-01-17 18:05:25.000000000 +0100 @@ -122,4 +122,4 @@ .. rubric:: Footnotes -.. [#f1] "more effective flow control mechanism that does not require cooperation from clients and reacts quickly to prevent the broker from exhausing memory - see http://www.rabbitmq.com/extensions.html#memsup" from http://lists.rabbitmq.com/pipermail/rabbitmq-announce/attachments/20100825/2c672695/attachment.txt +.. [#f1] "more effective flow control mechanism that does not require cooperation from clients and reacts quickly to prevent the broker from exhausting memory - see http://www.rabbitmq.com/extensions.html#memsup" from http://lists.rabbitmq.com/pipermail/rabbitmq-announce/attachments/20100825/2c672695/attachment.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/docs/modules/adapters/index.rst new/pika-0.13.0/docs/modules/adapters/index.rst --- old/pika-0.12.0/docs/modules/adapters/index.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/docs/modules/adapters/index.rst 2019-01-17 18:05:25.000000000 +0100 @@ -1,7 +1,7 @@ Connection Adapters =================== Pika uses connection adapters to provide a flexible method for adapting pika's -core communication to different IOLoop implementations. In addition to asynchronous adapters, there is the :class:`BlockingConnection <pika.adapters.blocking_connection.BlockingConnection>` adapter that provides a more idomatic procedural approach to using Pika. +core communication to different IOLoop implementations. In addition to asynchronous adapters, there is the :class:`BlockingConnection <pika.adapters.blocking_connection.BlockingConnection>` adapter that provides a more idiomatic procedural approach to using Pika. Adapters -------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/docs/version_history.rst new/pika-0.13.0/docs/version_history.rst --- old/pika-0.12.0/docs/version_history.rst 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/docs/version_history.rst 2019-01-17 18:05:25.000000000 +0100 @@ -1,6 +1,14 @@ Version History =============== +0.13.0 2019-01-17 +----------------- + +`GitHub milestone <https://github.com/pika/pika/milestone/13>`_ + +- `AsyncioConnection`, `TornadoConnection` and `TwistedProtocolConnection` are no longer auto-imported (`PR <https://github.com/pika/pika/pull/1129>`_) +- Python `3.7` support (`Issue <https://github.com/pika/pika/issues/1107>`_) + 0.12.0 2018-06-19 ----------------- @@ -156,14 +164,14 @@ adapter. - Non-backward-compatible changes in `Channel.add_on_return_callback` callback's signature. -- The `AsynchoreConnection` adapter was retired +- The `AsyncoreConnection` adapter was retired **Details** Python 3.x: this release introduces python 3.x support. Tested on Python 3.3 and 3.4. -`AsynchoreConnection`: Retired this legacy adapter to reduce maintenance burden; +`AsyncoreConnection`: Retired this legacy adapter to reduce maintenance burden; the recommended replacement is the `SelectConnection` adapter. `SelectConnection`: ioloop was refactored for compatibility with other ioloops. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/examples/twisted_service.py new/pika-0.13.0/examples/twisted_service.py --- old/pika-0.12.0/examples/twisted_service.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/examples/twisted_service.py 2019-01-17 18:05:25.000000000 +0100 @@ -92,7 +92,8 @@ if not exchange == '': yield self.channel.exchange_declare(exchange=exchange, exchange_type='topic', durable=True, auto_delete=False) - self.channel.queue_declare(queue=routing_key, durable=True) + yield self.channel.queue_declare(queue=routing_key, durable=True) + yield self.channel.queue_bind(queue=routing_key, exchange=exchange, routing_key=routing_key) (queue, consumer_tag,) = yield self.channel.basic_consume(queue=routing_key, no_ack=False) d = queue.get() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/pika/__init__.py new/pika-0.13.0/pika/__init__.py --- old/pika-0.12.0/pika/__init__.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/pika/__init__.py 2019-01-17 18:05:25.000000000 +0100 @@ -1,4 +1,4 @@ -__version__ = '0.12.0' +__version__ = '0.13.0' import logging from logging import NullHandler @@ -15,5 +15,3 @@ from pika.adapters import BaseConnection from pika.adapters import BlockingConnection from pika.adapters import SelectConnection -from pika.adapters import TornadoConnection -from pika.adapters import TwistedConnection diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/pika/adapters/__init__.py new/pika-0.13.0/pika/adapters/__init__.py --- old/pika-0.12.0/pika/adapters/__init__.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/pika/adapters/__init__.py 2019-01-17 18:05:25.000000000 +0100 @@ -19,22 +19,3 @@ from pika.adapters.blocking_connection import BlockingConnection from pika.adapters.select_connection import SelectConnection from pika.adapters.select_connection import IOLoop - -# Dynamically handle 3rd party library dependencies for optional imports -try: - from pika.adapters.asyncio_connection import AsyncioConnection -except ImportError: - AsyncioConnection = None - -try: - from pika.adapters.tornado_connection import TornadoConnection -except ImportError: - TornadoConnection = None - -try: - from pika.adapters.twisted_connection import TwistedConnection - from pika.adapters.twisted_connection import TwistedProtocolConnection -except ImportError: - TwistedConnection = None - TwistedProtocolConnection = None - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/pika/adapters/base_connection.py new/pika-0.13.0/pika/adapters/base_connection.py --- old/pika-0.12.0/pika/adapters/base_connection.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/pika/adapters/base_connection.py 2019-01-17 18:05:25.000000000 +0100 @@ -57,7 +57,7 @@ """ if parameters and not isinstance(parameters, connection.Parameters): raise ValueError( - 'Expected instance of Parameters, not %r' % parameters) + 'Expected instance of Parameters, not %r' % (parameters,)) # Let the developer know we could not import SSL if parameters and parameters.ssl and not ssl: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/pika/connection.py new/pika-0.13.0/pika/connection.py --- old/pika-0.12.0/pika/connection.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/pika/connection.py 2019-01-17 18:05:25.000000000 +0100 @@ -6,6 +6,7 @@ import logging import math import numbers +import os import platform import warnings import ssl @@ -944,8 +945,67 @@ self.socket_timeout = socket_timeout def _set_url_ssl_options(self, value): - """Deserialize and apply the corresponding query string arg""" - self.ssl_options = ast.literal_eval(value) + """Deserialize and apply the corresponding query string arg + + """ + opts = ast.literal_eval(value) + if opts is None: + if self.ssl_options is not None: + raise ValueError( + 'Specified ssl_options=None URL arg is inconsistent with ' + 'the specified https URL scheme.') + else: + # Note: this is the deprecated wrap_socket signature and info: + # + # Internally, function creates a SSLContext with protocol + # ssl_version and SSLContext.options set to cert_reqs. + # If parameters keyfile, certfile, ca_certs or ciphers are set, + # then the values are passed to SSLContext.load_cert_chain(), + # SSLContext.load_verify_locations(), and SSLContext.set_ciphers(). + # + # ssl.wrap_socket(sock, + # keyfile=None, + # certfile=None, + # server_side=False, # Not URL-supported + # cert_reqs=CERT_NONE, # Not URL-supported + # ssl_version=PROTOCOL_TLS, # Not URL-supported + # ca_certs=None, + # do_handshake_on_connect=True, # Not URL-supported + # suppress_ragged_eofs=True, # Not URL-supported + # ciphers=None + cxt = None + if 'ca_certs' in opts: + opt_ca_certs = opts['ca_certs'] + if os.path.isfile(opt_ca_certs): + cxt = ssl.create_default_context(cafile=opt_ca_certs) + elif os.path.isdir(opt_ca_certs): + cxt = ssl.create_default_context(capath=opt_ca_certs) + else: + LOGGER.warning('ca_certs is specified via ssl_options but ' + 'is neither a valid file nor directory: "%s"', + opt_ca_certs) + + if 'certfile' in opts: + if os.path.isfile(opts['certfile']): + keyfile = opts.get('keyfile') + password = opts.get('password') + cxt.load_cert_chain(opts['certfile'], keyfile, password) + else: + LOGGER.warning('certfile is specified via ssl_options but ' + 'is not a valid file: "%s"', + opts['certfile']) + + if 'ciphers' in opts: + opt_ciphers = opts['ciphers'] + if opt_ciphers is not None: + cxt.set_ciphers(opt_ciphers) + else: + LOGGER.warning('ciphers specified in ssl_options but ' + 'evaluates to None') + + server_hostname = opts.get('server_hostname') + self.ssl_options = pika.SSLOptions(context=cxt, + server_hostname=server_hostname) def _set_url_tcp_options(self, value): """Deserialize and apply the corresponding query string arg""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/pika/heartbeat.py new/pika-0.13.0/pika/heartbeat.py --- old/pika-0.12.0/pika/heartbeat.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/pika/heartbeat.py 2019-01-17 18:05:25.000000000 +0100 @@ -14,7 +14,7 @@ """ _CONNECTION_FORCED = 320 - _STALE_CONNECTION = "No activity or too many missed meartbeats in the last %i seconds" + _STALE_CONNECTION = "No activity or too many missed heartbeats in the last %i seconds" def __init__(self, connection, timeout): """Create an object that will check for activity on the provided diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/setup.py new/pika-0.13.0/setup.py --- old/pika-0.12.0/setup.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/setup.py 2019-01-17 18:05:25.000000000 +0100 @@ -16,7 +16,7 @@ setuptools.setup( name='pika', - version='0.12.0', + version='0.13.0', description='Pika Python AMQP Client Library', long_description=open('README.rst').read(), maintainer='Gavin M. Roy', @@ -39,6 +39,7 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: Jython', 'Programming Language :: Python :: Implementation :: PyPy', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/test-requirements.txt new/pika-0.13.0/test-requirements.txt --- old/pika-0.12.0/test-requirements.txt 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/test-requirements.txt 2019-01-17 18:05:25.000000000 +0100 @@ -3,4 +3,4 @@ mock nose tornado -twisted<15.4.0 +twisted diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/tests/acceptance/async_test_base.py new/pika-0.13.0/tests/acceptance/async_test_base.py --- old/pika-0.12.0/tests/acceptance/async_test_base.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/tests/acceptance/async_test_base.py 2019-01-17 18:05:25.000000000 +0100 @@ -238,17 +238,17 @@ def tornado_test(self): """TornadoConnection""" ioloop_factory = None - if adapters.TornadoConnection is not None: + if adapters.tornado_connection.TornadoConnection is not None: import tornado.ioloop ioloop_factory = tornado.ioloop.IOLoop - self.start(adapters.TornadoConnection, ioloop_factory) + self.start(adapters.tornado_connection.TornadoConnection, ioloop_factory) @unittest.skipIf(sys.version_info < (3, 4), "Asyncio available for Python 3.4+") def asyncio_test(self): """AsyncioConnection""" ioloop_factory = None - if adapters.AsyncioConnection is not None: + if adapters.asyncio_connection.AsyncioConnection is not None: import asyncio ioloop_factory = asyncio.new_event_loop - self.start(adapters.AsyncioConnection, ioloop_factory) + self.start(adapters.asyncio_connection.AsyncioConnection, ioloop_factory) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/tests/unit/base_connection_tests.py new/pika-0.13.0/tests/unit/base_connection_tests.py --- old/pika-0.12.0/tests/unit/base_connection_tests.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/tests/unit/base_connection_tests.py 2019-01-17 18:05:25.000000000 +0100 @@ -83,120 +83,3 @@ keepalive_call = mock.call.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) self.assertNotIn(keepalive_call, sock_mock.method_calls) - - def test_ssl_wrap_socket_with_none_ssl_options(self): - - params = pika.ConnectionParameters(ssl_options=None) - self.assertIsNone(params.ssl_options) - - with mock.patch('pika.connection.Connection.connect'): - conn = base_connection.BaseConnection(parameters=params) - - with mock.patch('pika.adapters.base_connection' - '.ssl.wrap_socket') as wrap_socket_mock: - sock_mock = mock.Mock() - conn._wrap_socket(sock_mock) - - wrap_socket_mock.assert_called_once_with( - sock_mock, do_handshake_on_connect=conn.DO_HANDSHAKE) - - def test_ssl_wrap_socket_with_dict_ssl_options(self): - - ssl_options = dict(ssl='options', handshake=False) - params = pika.ConnectionParameters(ssl_options=ssl_options) - self.assertEqual(params.ssl_options, ssl_options) - - with mock.patch('pika.connection.Connection.connect'): - conn = base_connection.BaseConnection(parameters=params) - - with mock.patch('pika.adapters.base_connection' - '.ssl.wrap_socket') as wrap_socket_mock: - sock_mock = mock.Mock() - conn._wrap_socket(sock_mock) - - wrap_socket_mock.assert_called_once_with( - sock_mock, - do_handshake_on_connect=conn.DO_HANDSHAKE, - ssl='options', - handshake=False) - - @mock.patch('ssl.SSLContext.load_cert_chain') - @mock.patch('ssl.SSLContext.load_verify_locations') - @mock.patch('ssl.SSLContext.set_ciphers') - @mock.patch('ssl.SSLContext.wrap_socket') - @unittest.skipIf(sys.version_info < (2,7,0), 'Unavailable ssl features') - def test_ssl_wrap_socket_with_default_ssl_options_obj(self, - wrap_socket_mock, - set_ciphers_mock, - load_verify_mock, - load_certs_mock): - ssl_options = pika.SSLOptions() - params = pika.ConnectionParameters(ssl_options=ssl_options) - #self.assertEqual(params.ssl_options, ssl_options) - - - with mock.patch('pika.connection.Connection.connect'): - conn = base_connection.BaseConnection(parameters=params) - - sock_mock = mock.Mock() - conn._wrap_socket(sock_mock) - - load_certs_mock.assert_not_called() - load_verify_mock.assert_not_called() - # the __init__ of SSLContext calls set_ciphers, - # hence the 'called once' - set_ciphers_mock.assert_called_once() - wrap_socket_mock.assert_called_once_with( - sock_mock, - server_side=False, - do_handshake_on_connect=conn.DO_HANDSHAKE, - suppress_ragged_eofs=True, - server_hostname=None - ) - - @mock.patch('ssl.SSLContext.load_cert_chain') - @mock.patch('ssl.SSLContext.load_verify_locations') - @mock.patch('ssl.SSLContext.set_ciphers') - @mock.patch('ssl.SSLContext.wrap_socket') - @unittest.skipIf(sys.version_info < (2,7,0), 'Unavailable ssl features') - def test_ssl_wrap_socket_with_ssl_options_obj(self, - wrap_socket_mock, - set_ciphers_mock, - load_verify_mock, - load_certs_mock): - ssl_options = pika.SSLOptions(certfile='/some/cert/file.crt', - keyfile='/some/key/file.crt', - key_password='pa55w0rd', - cafile='/some/ca/file.crt', - capath='/some/ca/path', - cadata='/some/data/or/something', - ciphers='ciphers', - server_hostname='some.virtual.host', - do_handshake_on_connect=False, - suppress_ragged_eofs=False, - server_side=True) - params = pika.ConnectionParameters(ssl_options=ssl_options) - #self.assertEqual(params.ssl_options, ssl_options) - - - with mock.patch('pika.connection.Connection.connect'): - conn = base_connection.BaseConnection(parameters=params) - - sock_mock = mock.Mock() - conn._wrap_socket(sock_mock) - - load_certs_mock.assert_called_once_with(certfile='/some/cert/file.crt', - keyfile='/some/key/file.crt', - password='pa55w0rd') - load_verify_mock.assert_called_once_with(cafile='/some/ca/file.crt', - capath='/some/ca/path', - cadata='/some/data/or/something') - # the constructor of SSLContext calls set_ciphers as well - set_ciphers_mock.assert_called_with('ciphers') - wrap_socket_mock.assert_called_once_with( - sock_mock, - server_side=True, - do_handshake_on_connect=False, - suppress_ragged_eofs=False, - server_hostname='some.virtual.host' - ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/tests/unit/connection_parameters_tests.py new/pika-0.13.0/tests/unit/connection_parameters_tests.py --- old/pika-0.12.0/tests/unit/connection_parameters_tests.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/tests/unit/connection_parameters_tests.py 2019-01-17 18:05:25.000000000 +0100 @@ -605,9 +605,7 @@ 'locale': 'en_UK', 'retry_delay': 3, 'socket_timeout': 100.5, - 'ssl_options': { - 'ssl': 'options' - }, + 'ssl_options': None, 'tcp_options': { 'TCP_USER_TIMEOUT': 1000, 'TCP_KEEPIDLE': 60 @@ -619,7 +617,7 @@ test_params['backpressure_detection'] = backpressure virtual_host = '/' query_string = urlencode(test_params) - test_url = ('https://myuser:[email protected]:5678/%s?%s' % ( + test_url = ('amqp://myuser:[email protected]:5678/%s?%s' % ( url_quote(virtual_host, safe=''), query_string, )) @@ -642,7 +640,6 @@ backpressure == 't') # check all values from base URL - self.assertEqual(params.ssl, True) self.assertEqual(params.credentials.username, 'myuser') self.assertEqual(params.credentials.password, 'mypass') self.assertEqual(params.host, 'www.test.com') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/tests/unit/connection_timeout_tests.py new/pika-0.13.0/tests/unit/connection_timeout_tests.py --- old/pika-0.12.0/tests/unit/connection_timeout_tests.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/tests/unit/connection_timeout_tests.py 2019-01-17 18:05:25.000000000 +0100 @@ -112,7 +112,7 @@ def test_tornado_connection_timeout(self): with self.assertRaises(exceptions.AMQPConnectionError) as err_ctx: with mock.patch( - 'pika.TornadoConnection' + 'pika.adapters.tornado_connection.TornadoConnection' '._create_tcp_connection_socket', return_value=mock.Mock( spec_set=socket.socket, @@ -131,7 +131,7 @@ def test_twisted_connection_timeout(self): with self.assertRaises(exceptions.AMQPConnectionError) as err_ctx: with mock.patch( - 'pika.TwistedConnection._create_tcp_connection_socket', + 'pika.adapters.twisted_connection.TwistedConnection._create_tcp_connection_socket', return_value=mock.Mock( spec_set=socket.socket, connect=mock.Mock( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pika-0.12.0/tests/unit/select_connection_ioloop_tests.py new/pika-0.13.0/tests/unit/select_connection_ioloop_tests.py --- old/pika-0.12.0/tests/unit/select_connection_ioloop_tests.py 2018-06-19 19:05:51.000000000 +0200 +++ new/pika-0.13.0/tests/unit/select_connection_ioloop_tests.py 2019-01-17 18:05:25.000000000 +0100 @@ -33,7 +33,7 @@ class IOLoopBaseTest(unittest.TestCase): SELECT_POLLER = None - TIMEOUT = 1.0 + TIMEOUT = 1.5 def setUp(self): select_type_patch = mock.patch.multiple( @@ -182,7 +182,7 @@ """ NUM_TIMERS = 5 - TIMER_INTERVAL = 0.02 + TIMER_INTERVAL = 0.25 SELECT_POLLER = 'select' def set_timers(self):
