commit python3-amqp for openSUSE:Factory
Hello community, here is the log from the commit of package python3-amqp for openSUSE:Factory checked in at 2015-11-02 12:55:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-amqp (Old) and /work/SRC/openSUSE:Factory/.python3-amqp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-amqp" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-amqp/python3-amqp.changes 2015-01-20 12:38:09.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-amqp.new/python3-amqp.changes 2015-11-02 12:55:53.000000000 +0100 @@ -1,0 +2,16 @@ +Sun Nov 1 18:19:39 UTC 2015 - arun@gmx.de + +- specfile + * added mock package for tests + +- update to version 1.4.7: + * Fixed libSystem error on OS X 10.11 (El Capitan) + Fix contributed by Eric Wang. + * "channel.basic_publish" now raises + :exc:`amqp.exceptions.NotConfirmed` on "basic.nack". + * AMQP timestamps received are now converted from GMT instead of + local time (Issue #67). + * Wheel package installation now supported by both Python 2 and + Python3. Fix contributed by Rémy Greinhofer. + +------------------------------------------------------------------- Old: ---- amqp-1.4.6.tar.gz New: ---- amqp-1.4.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-amqp.spec ++++++ --- /var/tmp/diff_new_pack.noUkZP/_old 2015-11-02 12:55:53.000000000 +0100 +++ /var/tmp/diff_new_pack.noUkZP/_new 2015-11-02 12:55:53.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package python3-amqp # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 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 @@ -17,7 +17,7 @@ Name: python3-amqp -Version: 1.4.6 +Version: 1.4.7 Release: 0 Summary: Low-level AMQP client for Python (fork of amqplib) License: LGPL-2.1 @@ -30,6 +30,7 @@ BuildRequires: python3-Sphinx BuildRequires: python3-sphinxcontrib-issuetracker # Test requirements: +BuildRequires: python3-mock BuildRequires: python3-nose BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch ++++++ amqp-1.4.6.tar.gz -> amqp-1.4.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/Changelog new/amqp-1.4.7/Changelog --- old/amqp-1.4.6/Changelog 2014-08-11 19:00:17.000000000 +0200 +++ new/amqp-1.4.7/Changelog 2015-10-03 02:31:01.000000000 +0200 @@ -5,6 +5,27 @@ The previous amqplib changelog is here: http://code.google.com/p/py-amqplib/source/browse/CHANGES +.. _version-1.4.7: + +1.4.7 +===== +:release-date: 2015-10-02 05:30 P.M PDT +:release-by: Ask Solem + +- Fixed libSystem error on OS X 10.11 (El Capitan) + + Fix contributed by Eric Wang. + +- ``channel.basic_publish`` now raises :exc:`amqp.exceptions.NotConfirmed` on + ``basic.nack``. + +- AMQP timestamps received are now converted from GMT instead of local time + (Issue #67). + +- Wheel package installation now supported by both Python 2 and Python3. + + Fix contributed by Rémy Greinhofer. + .. _version-1.4.6: 1.4.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/PKG-INFO new/amqp-1.4.7/PKG-INFO --- old/amqp-1.4.6/PKG-INFO 2014-08-11 19:02:54.000000000 +0200 +++ new/amqp-1.4.7/PKG-INFO 2015-10-03 02:33:44.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: amqp -Version: 1.4.6 +Version: 1.4.7 Summary: Low-level AMQP client for Python (fork of amqplib) Home-page: http://github.com/celery/py-amqp Author: Ask Solem @@ -10,7 +10,7 @@ Python AMQP 0.9.1 client library ===================================================================== - :Version: 1.4.6 + :Version: 1.4.7 :Web: http://amqp.readthedocs.org/ :Download: http://pypi.python.org/pypi/amqp/ :Source: http://github.com/celery/py-amqp/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/README.rst new/amqp-1.4.7/README.rst --- old/amqp-1.4.6/README.rst 2014-08-11 19:00:36.000000000 +0200 +++ new/amqp-1.4.7/README.rst 2015-10-03 00:02:20.000000000 +0200 @@ -2,7 +2,7 @@ Python AMQP 0.9.1 client library ===================================================================== -:Version: 1.4.6 +:Version: 1.4.7 :Web: http://amqp.readthedocs.org/ :Download: http://pypi.python.org/pypi/amqp/ :Source: http://github.com/celery/py-amqp/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp/__init__.py new/amqp-1.4.7/amqp/__init__.py --- old/amqp-1.4.6/amqp/__init__.py 2014-08-11 19:00:30.000000000 +0200 +++ new/amqp-1.4.7/amqp/__init__.py 2015-10-03 00:02:20.000000000 +0200 @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 from __future__ import absolute_import -VERSION = (1, 4, 6) +VERSION = (1, 4, 7) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'Barry Pederson' __maintainer__ = 'Ask Solem' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp/channel.py new/amqp-1.4.7/amqp/channel.py --- old/amqp-1.4.6/amqp/channel.py 2014-08-11 18:56:50.000000000 +0200 +++ new/amqp-1.4.7/amqp/channel.py 2015-10-03 00:06:13.000000000 +0200 @@ -22,7 +22,9 @@ from warnings import warn from .abstract_channel import AbstractChannel -from .exceptions import ChannelError, ConsumerCancelled, error_for_code +from .exceptions import ( + ChannelError, ConsumerCancelled, NotConfirmed, error_for_code, +) from .five import Queue from .protocol import basic_return_t, queue_declare_ok_t from .serialization import AMQPWriter @@ -1069,7 +1071,6 @@ args.write_shortstr(queue) args.write_shortstr(exchange) args.write_shortstr(routing_key) - #args.write_bit(nowait) args.write_table(arguments) self._send_method((50, 50), args) @@ -2127,7 +2128,8 @@ self._confirm_selected = True self.confirm_select() ret = self._basic_publish(*args, **kwargs) - self.wait([(60, 80)]) + # Basic.Ack / Basic.Nack + self.wait([(60, 80), (60, 120)]) return ret def basic_qos(self, prefetch_size, prefetch_count, a_global): @@ -2498,8 +2500,18 @@ def _basic_ack_recv(self, args): delivery_tag = args.read_longlong() multiple = args.read_bit() - for callback in self.events['basic_ack']: - callback(delivery_tag, multiple) + self._apply_callbacks('basic_ack', delivery_tag, multiple) + + def _apply_callbacks(self, event, *args): + return [callback(*args) for callback in self.events[event]] + + def _basic_nack(self, args): + delivery_tag = args.read_longlong() + multiple = args.read_bit() + requeue = args.read_bit() + if not self._apply_callbacks( + 'basic_nack', delivery_tag, multiple, requeue): + raise NotConfirmed(delivery_tag, (60, 120), 'basic.nack') _METHOD_MAP = { (20, 11): _open_ok, @@ -2525,6 +2537,7 @@ (60, 71): _basic_get_ok, (60, 72): _basic_get_empty, (60, 80): _basic_ack_recv, + (60, 120): _basic_nack, (60, 111): _basic_recover_ok, (85, 11): _confirm_select_ok, (90, 11): _tx_select_ok, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp/connection.py new/amqp-1.4.7/amqp/connection.py --- old/amqp-1.4.6/amqp/connection.py 2014-08-11 18:56:50.000000000 +0200 +++ new/amqp-1.4.7/amqp/connection.py 2015-10-03 00:05:01.000000000 +0200 @@ -127,8 +127,8 @@ and (password is not None): login_response = AMQPWriter() login_response.write_table({'LOGIN': userid, 'PASSWORD': password}) - login_response = login_response.getvalue()[4:] # Skip the length - # at the beginning + # Skip the length at the beginning + login_response = login_response.getvalue()[4:] d = dict(LIBRARY_PROPERTIES, **client_properties or {}) self._method_override = {(60, 50): self._dispatch_basic_return} @@ -338,7 +338,7 @@ # http://bugs.python.org/issue10272 if 'timed out' in str(exc): raise socket.timeout() - # Non-blocking SSL sockets can throw SSLError + # Non-blocking SSL sockets can throw SSLError if 'The operation did not complete' in str(exc): raise socket.timeout() raise diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp/exceptions.py new/amqp-1.4.7/amqp/exceptions.py --- old/amqp-1.4.6/amqp/exceptions.py 2014-07-24 17:52:53.000000000 +0200 +++ new/amqp-1.4.7/amqp/exceptions.py 2015-10-03 00:05:01.000000000 +0200 @@ -27,7 +27,7 @@ 'ConnectionForced', 'InvalidPath', 'AccessRefused', 'NotFound', 'ResourceLocked', 'PreconditionFailed', 'FrameError', 'FrameSyntaxError', 'InvalidCommand', 'ChannelNotOpen', 'UnexpectedFrame', 'ResourceError', - 'NotAllowed', 'AMQPNotImplementedError', 'InternalError', + 'NotConfirmed', 'NotAllowed', 'AMQPNotImplementedError', 'InternalError', ] @@ -112,6 +112,10 @@ code = 404 +class NotConfirmed(RecoverableConnectionError): + pass + + class ResourceLocked(RecoverableChannelError): code = 405 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp/five.py new/amqp-1.4.7/amqp/five.py --- old/amqp-1.4.6/amqp/five.py 2014-08-11 18:56:50.000000000 +0200 +++ new/amqp-1.4.7/amqp/five.py 2015-10-03 00:02:20.000000000 +0200 @@ -10,7 +10,7 @@ """ from __future__ import absolute_import -############## py3k ######################################################### +# ############# py3k ######################################################### import sys PY3 = sys.version_info[0] == 3 @@ -132,7 +132,7 @@ return _clone_with_metaclass -############## time.monotonic ################################################ +# ############# time.monotonic ################################################ if sys.version_info < (3, 3): @@ -142,7 +142,7 @@ if SYSTEM == 'Darwin': import ctypes from ctypes.util import find_library - libSystem = ctypes.CDLL('libSystem.dylib') + libSystem = ctypes.CDLL(find_library('libSystem.dylib')) CoreServices = ctypes.CDLL(find_library('CoreServices'), use_errno=True) mach_absolute_time = libSystem.mach_absolute_time diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp/serialization.py new/amqp-1.4.7/amqp/serialization.py --- old/amqp-1.4.6/amqp/serialization.py 2014-08-11 18:56:50.000000000 +0200 +++ new/amqp-1.4.7/amqp/serialization.py 2015-10-03 00:02:20.000000000 +0200 @@ -21,13 +21,13 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 from __future__ import absolute_import +import calendar import sys from datetime import datetime from decimal import Decimal from io import BytesIO from struct import pack, unpack -from time import mktime from .exceptions import FrameSyntaxError from .five import int_types, long_t, string, string_t, items @@ -224,7 +224,7 @@ expressed as localtime. """ - return datetime.fromtimestamp(self.read_longlong()) + return datetime.utcfromtimestamp(self.read_longlong()) class AMQPWriter(object): @@ -377,7 +377,6 @@ elif isinstance(v, datetime): self.write(b'T') self.write_timestamp(v) - ## FIXME: timezone ? elif isinstance(v, dict): self.write(b'F') self.write_table(v) @@ -402,7 +401,7 @@ def write_timestamp(self, v): """Write out a Python datetime.datetime object as a 64-bit integer representing seconds since the Unix epoch.""" - self.out.write(pack('>q', long_t(mktime(v.timetuple())))) + self.out.write(pack('>Q', long_t(calendar.timegm(v.utctimetuple())))) class GenericContent(object): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp/tests/case.py new/amqp-1.4.7/amqp/tests/case.py --- old/amqp-1.4.6/amqp/tests/case.py 1970-01-01 01:00:00.000000000 +0100 +++ new/amqp-1.4.7/amqp/tests/case.py 2015-10-03 00:02:20.000000000 +0200 @@ -0,0 +1,85 @@ +from __future__ import absolute_import + +import sys + +from functools import wraps +from io import StringIO + +import mock + +from nose import SkipTest # noqa + +try: + import unittest + unittest.skip +except AttributeError: + import unittest2 as unittest # noqa + +PY3 = sys.version_info[0] == 3 + +patch = mock.patch +call = mock.call + + +class Case(unittest.TestCase): + + def assertItemsEqual(self, a, b, *args, **kwargs): + return self.assertEqual(sorted(a), sorted(b), *args, **kwargs) + assertSameElements = assertItemsEqual + + +class Mock(mock.Mock): + + def __init__(self, *args, **kwargs): + attrs = kwargs.pop('attrs', None) or {} + super(Mock, self).__init__(*args, **kwargs) + for attr_name, attr_value in attrs.items(): + setattr(self, attr_name, attr_value) + + +class _ContextMock(Mock): + """Dummy class implementing __enter__ and __exit__ + as the with statement requires these to be implemented + in the class, not just the instance.""" + + def __enter__(self): + pass + + def __exit__(self, *exc_info): + pass + + +def ContextMock(*args, **kwargs): + obj = _ContextMock(*args, **kwargs) + obj.attach_mock(Mock(), '__enter__') + obj.attach_mock(Mock(), '__exit__') + obj.__enter__.return_value = obj + # if __exit__ return a value the exception is ignored, + # so it must return None here. + obj.__exit__.return_value = None + return obj + + +class MockPool(object): + + def __init__(self, value=None): + self.value = value or ContextMock() + + def acquire(self, **kwargs): + return self.value + + +def redirect_stdouts(fun): + + @wraps(fun) + def _inner(*args, **kwargs): + sys.stdout = StringIO() + sys.stderr = StringIO() + try: + return fun(*args, **dict(kwargs, + stdout=sys.stdout, stderr=sys.stderr)) + finally: + sys.stdout = sys.__stdout__ + sys.stderr = sys.__stderr__ + + return _inner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp/tests/test_channel.py new/amqp-1.4.7/amqp/tests/test_channel.py --- old/amqp-1.4.6/amqp/tests/test_channel.py 1970-01-01 01:00:00.000000000 +0100 +++ new/amqp-1.4.7/amqp/tests/test_channel.py 2015-10-03 00:02:20.000000000 +0200 @@ -0,0 +1,35 @@ +from __future__ import absolute_import + +from collections import defaultdict + +from amqp.channel import Channel +from amqp.exceptions import NotConfirmed +from amqp.serialization import AMQPWriter, AMQPReader + +from amqp.tests.case import Case, Mock + + +class NoOpenChannel(Channel): + + def _x_open(self): + pass + + +class test_Channel(Case): + + def setUp(self): + self.args = AMQPWriter() + self.connection = Mock(name='connection') + self.connection.channels = defaultdict(lambda: None) + self.channel = NoOpenChannel(self.connection, channel_id=1) + + def test_basic_nack(self, delivery_tag=3172312312): + self.args.write_longlong(delivery_tag) + self.args.write_bit(0) + self.args.write_bit(0) + with self.assertRaises(NotConfirmed): + self.channel._basic_nack(AMQPReader(self.args.getvalue())) + callback = Mock(name='callback') + self.channel.events['basic_nack'].add(callback) + self.channel._basic_nack(AMQPReader(self.args.getvalue())) + callback.assert_called_with(delivery_tag, False, False) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp.egg-info/PKG-INFO new/amqp-1.4.7/amqp.egg-info/PKG-INFO --- old/amqp-1.4.6/amqp.egg-info/PKG-INFO 2014-08-11 19:02:37.000000000 +0200 +++ new/amqp-1.4.7/amqp.egg-info/PKG-INFO 2015-10-03 02:33:39.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: amqp -Version: 1.4.6 +Version: 1.4.7 Summary: Low-level AMQP client for Python (fork of amqplib) Home-page: http://github.com/celery/py-amqp Author: Ask Solem @@ -10,7 +10,7 @@ Python AMQP 0.9.1 client library ===================================================================== - :Version: 1.4.6 + :Version: 1.4.7 :Web: http://amqp.readthedocs.org/ :Download: http://pypi.python.org/pypi/amqp/ :Source: http://github.com/celery/py-amqp/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/amqp.egg-info/SOURCES.txt new/amqp-1.4.7/amqp.egg-info/SOURCES.txt --- old/amqp-1.4.6/amqp.egg-info/SOURCES.txt 2014-08-11 19:02:38.000000000 +0200 +++ new/amqp-1.4.7/amqp.egg-info/SOURCES.txt 2015-10-03 02:33:39.000000000 +0200 @@ -2,6 +2,7 @@ LICENSE MANIFEST.in README.rst +setup.cfg setup.py amqp/__init__.py amqp/abstract_channel.py @@ -20,6 +21,9 @@ amqp.egg-info/dependency_links.txt amqp.egg-info/not-zip-safe amqp.egg-info/top_level.txt +amqp/tests/__init__.py +amqp/tests/case.py +amqp/tests/test_channel.py demo/amqp_clock.py demo/demo_receive.py demo/demo_send.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/docs/changelog.rst new/amqp-1.4.7/docs/changelog.rst --- old/amqp-1.4.6/docs/changelog.rst 2014-08-11 19:00:17.000000000 +0200 +++ new/amqp-1.4.7/docs/changelog.rst 2015-10-03 02:31:01.000000000 +0200 @@ -5,6 +5,27 @@ The previous amqplib changelog is here: http://code.google.com/p/py-amqplib/source/browse/CHANGES +.. _version-1.4.7: + +1.4.7 +===== +:release-date: 2015-10-02 05:30 P.M PDT +:release-by: Ask Solem + +- Fixed libSystem error on OS X 10.11 (El Capitan) + + Fix contributed by Eric Wang. + +- ``channel.basic_publish`` now raises :exc:`amqp.exceptions.NotConfirmed` on + ``basic.nack``. + +- AMQP timestamps received are now converted from GMT instead of local time + (Issue #67). + +- Wheel package installation now supported by both Python 2 and Python3. + + Fix contributed by Rémy Greinhofer. + .. _version-1.4.6: 1.4.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/amqp-1.4.6/setup.cfg new/amqp-1.4.7/setup.cfg --- old/amqp-1.4.6/setup.cfg 2014-08-11 19:02:54.000000000 +0200 +++ new/amqp-1.4.7/setup.cfg 2015-10-03 02:33:44.000000000 +0200 @@ -1,3 +1,9 @@ +[nosetests] +where = amqp/tests + +[bdist_wheel] +universal = 1 + [egg_info] tag_build = tag_date = 0
participants (1)
-
root@hilbert.suse.de