Hello community,

here is the log from the commit of package python-pamqp for openSUSE:Factory 
checked in at 2019-03-29 20:43:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pamqp (Old)
 and      /work/SRC/openSUSE:Factory/.python-pamqp.new.25356 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pamqp"

Fri Mar 29 20:43:07 2019 rev:4 rq:689759 version:2.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pamqp/python-pamqp.changes        
2018-09-24 13:12:47.441756260 +0200
+++ /work/SRC/openSUSE:Factory/.python-pamqp.new.25356/python-pamqp.changes     
2019-03-29 20:43:13.082677220 +0100
@@ -1,0 +2,7 @@
+Fri Mar 29 07:27:03 UTC 2019 - [email protected]
+
+- version update to 2.1.0
+  * Change raising a DeprecationWarning exception to using
+    warnings.warn for deprecated AMQP methods
+
+-------------------------------------------------------------------

Old:
----
  2.0.0.tar.gz

New:
----
  2.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pamqp.spec ++++++
--- /var/tmp/diff_new_pack.XH0iv5/_old  2019-03-29 20:43:13.938677194 +0100
+++ /var/tmp/diff_new_pack.XH0iv5/_new  2019-03-29 20:43:13.942677194 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pamqp
 #
-# 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
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-pamqp
-Version:        2.0.0
+Version:        2.1.0
 Release:        0
 Summary:        A pure-python AMQP 0-9-1 frame encoder and decoder
 License:        BSD-3-Clause
@@ -55,6 +55,8 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}/pamqp*
 
 %check
+# for python 2.7 has to 'always' be there, for python 3.7 'default' is enough
+export PYTHONWARNINGS=always
 # test_decode_embedded_value_long_uint_data_type 
https://github.com/gmr/pamqp/issues/11
 %python_expand nosetests-%{$python_bin_suffix} tests/ -e 
'test_decode_embedded_value_long_uint_data_type'
 

++++++ 2.0.0.tar.gz -> 2.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pamqp-2.0.0/.travis.yml new/pamqp-2.1.0/.travis.yml
--- old/pamqp-2.0.0/.travis.yml 2018-09-12 00:34:23.000000000 +0200
+++ new/pamqp-2.1.0/.travis.yml 2018-12-28 17:19:03.000000000 +0100
@@ -1,14 +1,11 @@
-sudo: false
 language: python
-
+dist: xenial
 python:
   - 2.7
   - 3.4
   - 3.5
   - 3.6
-  - 3.7-dev
-  - pypy
-  - pypy3
+  - 3.7
 
 env:
   global:
@@ -27,7 +24,7 @@
 install:
   - pip install -r requirements.txt
   - pip install awscli coverage
-script: nosetests
+script: PYTHONWARNINGS=always nosetests
 after_success: bin/upload-coverage.sh
 
 jobs:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pamqp-2.0.0/docs/history.rst 
new/pamqp-2.1.0/docs/history.rst
--- old/pamqp-2.0.0/docs/history.rst    2018-09-12 00:34:23.000000000 +0200
+++ new/pamqp-2.1.0/docs/history.rst    2018-12-28 17:19:03.000000000 +0100
@@ -1,6 +1,10 @@
 Version History
 ===============
 
+2.1.0 (2018-12-28)
+------------------
+- Change raising a DeprecationWarning exception to using warnings.warn for 
deprecated AMQP methods (#13 - `dzen <https://github.com/dzen>`_)
+
 2.0.0 (2018-09-11)
 ------------------
 - **Change Python versions supported to 2.7 and 3.4+**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pamqp-2.0.0/pamqp/__init__.py 
new/pamqp-2.1.0/pamqp/__init__.py
--- old/pamqp-2.0.0/pamqp/__init__.py   2018-09-12 00:34:23.000000000 +0200
+++ new/pamqp-2.1.0/pamqp/__init__.py   2018-12-28 17:19:03.000000000 +0100
@@ -3,7 +3,7 @@
 __author__ = 'Gavin M. Roy'
 __email__ = '[email protected]'
 __since__ = '2011-09-23'
-__version__ = '2.0.0'
+__version__ = '2.1.0'
 
 import sys
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pamqp-2.0.0/pamqp/specification.py 
new/pamqp-2.1.0/pamqp/specification.py
--- old/pamqp-2.0.0/pamqp/specification.py      2018-09-12 00:34:23.000000000 
+0200
+++ new/pamqp-2.1.0/pamqp/specification.py      2018-12-28 17:19:03.000000000 
+0100
@@ -5,9 +5,10 @@
 WARNING: DO NOT EDIT. To Generate run tools/codegen.py
 
 """
-__since__ = '2018-09-11'
+__since__ = '2018-12-27'
 
 import struct
+import warnings
 
 from pamqp import decode
 from pamqp import encode
@@ -2610,14 +2611,15 @@
 
             :param bool requeue: Requeue the message
 
-            :raises: DeprecationWarning
+            .. deprecated:: 0-9-1
+            This command is deprecated in AMQP 0-9-1
 
             """
             # Requeue the message
             self.requeue = requeue
 
             # This command is deprecated in AMQP 0-9-1
-            raise DeprecationWarning(DEPRECATION_WARNING)
+            warnings.warn(DEPRECATION_WARNING, category=DeprecationWarning)
 
     class Recover(Frame):
         """Redeliver unacknowledged messages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pamqp-2.0.0/tests/test_frame_unmarshaling.py 
new/pamqp-2.1.0/tests/test_frame_unmarshaling.py
--- old/pamqp-2.0.0/tests/test_frame_unmarshaling.py    2018-09-12 
00:34:23.000000000 +0200
+++ new/pamqp-2.1.0/tests/test_frame_unmarshaling.py    2018-12-28 
17:19:03.000000000 +0100
@@ -463,7 +463,24 @@
 
     def test_basic_recoverasync(self):
         frame_data = b'\x01\x00\x01\x00\x00\x00\x05\x00<\x00d\x00\xce'
-        self.assertRaises(DeprecationWarning, frame.unmarshal, frame_data)
+        expectation = {'requeue': False}
+
+        # Decode the frame and validate lengths
+        consumed, channel, frame_obj = frame.unmarshal(frame_data)
+        self.assertEqual(consumed, 13,
+                         'Bytes consumed did not match expectation: %i, %i' %
+                         (consumed, 13))
+
+        self.assertEqual(channel, 1,
+                         'Channel number did not match expectation: %i, %i' %
+                         (channel, 1))
+
+        # Validate the frame name
+        self.assertEqual(frame_obj.name, 'Basic.RecoverAsync',
+                         ('Frame was of wrong type, expected 
Basic.RecoverAsync, '
+                          'received %s' % frame_obj.name))
+
+        self.assertDictEqual(dict(frame_obj), expectation)
 
     def test_basic_recoverok(self):
         frame_data = b'\x01\x00\x01\x00\x00\x00\x04\x00<\x00o\xce'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pamqp-2.0.0/tests/test_specification.py 
new/pamqp-2.1.0/tests/test_specification.py
--- old/pamqp-2.0.0/tests/test_specification.py 2018-09-12 00:34:23.000000000 
+0200
+++ new/pamqp-2.1.0/tests/test_specification.py 2018-12-28 17:19:03.000000000 
+0100
@@ -1,4 +1,5 @@
 import unittest
+import warnings
 
 from pamqp import specification
 
@@ -908,7 +909,13 @@
 
 class DeprecationWarningTests(unittest.TestCase):
     def test_basic_recoverasync_raises_deprecation_error(self):
-        self.assertRaises(DeprecationWarning, specification.Basic.RecoverAsync)
+        with warnings.catch_warnings(record=True) as warning:
+            specification.Basic.RecoverAsync()
+            self.assertEqual(warning[0].category, DeprecationWarning)
+            self.assertEqual(
+                'This command is deprecated in AMQP 0-9-1',
+                str(warning[0].message)
+            )
 
 
 class BasicPropertiesTests(unittest.TestCase):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pamqp-2.0.0/tools/codegen.py 
new/pamqp-2.1.0/tools/codegen.py
--- old/pamqp-2.0.0/tools/codegen.py    2018-09-12 00:34:23.000000000 +0200
+++ new/pamqp-2.1.0/tools/codegen.py    2018-12-28 17:19:03.000000000 +0100
@@ -321,6 +321,7 @@
 __since__ = '%s'
 
 import struct
+import warnings
 
 from pamqp import decode
 from pamqp import encode
@@ -390,10 +391,12 @@
 
 comment("Other constants")
 # Deprecation Warning
-DEPRECATION_WARNING = 'This command is deprecated in AMQP %s' % \
-                        ('-'.join([str(amqp['major-version']),
-                                   str(amqp['minor-version']),
-                                   str(amqp['revision'])]))
+
+AMQP_VERSION = ('-'.join([str(amqp['major-version']),
+           str(amqp['minor-version']),
+           str(amqp['revision'])]))
+DEPRECATION_WARNING = 'This command is deprecated in AMQP %s' % AMQP_VERSION
+
 new_line('DEPRECATION_WARNING = \'%s\'' % DEPRECATION_WARNING)
 new_line()
 
@@ -620,7 +623,8 @@
                method_xml[0].attrib['deprecated']:
                 deprecated = True
                 new_line()
-                new_line(':raises: DeprecationWarning', indent)
+                new_line('.. deprecated:: %s' % AMQP_VERSION, indent)
+                new_line(DEPRECATION_WARNING, indent)
             else:
                 deprecated = False
 
@@ -651,7 +655,8 @@
             # Check if we're deprecated and warn if so
             if deprecated:
                 comment(DEPRECATION_WARNING, indent)
-                new_line('raise DeprecationWarning(DEPRECATION_WARNING)', 
indent)
+                new_line('warnings.warn(DEPRECATION_WARNING,'
+                         ' category=DeprecationWarning)', indent)
                 new_line()
 
             # End of function


Reply via email to