Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-tinyrpc for openSUSE:Factory 
checked in at 2023-04-28 16:25:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tinyrpc (Old)
 and      /work/SRC/openSUSE:Factory/.python-tinyrpc.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-tinyrpc"

Fri Apr 28 16:25:00 2023 rev:11 rq:1083353 version:1.1.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tinyrpc/python-tinyrpc.changes    
2022-10-01 17:44:36.873829230 +0200
+++ /work/SRC/openSUSE:Factory/.python-tinyrpc.new.1533/python-tinyrpc.changes  
2023-04-28 16:26:18.595040656 +0200
@@ -1,0 +2,9 @@
+Tue Apr 25 09:14:21 UTC 2023 - pgaj...@suse.com
+
+- version update to 1.1.6
+  * no upstream changelog found
+- added patches
+  fix https://github.com/mbr/tinyrpc/issues/103
+  + python-tinyrpc-no-six.patch
+
+-------------------------------------------------------------------

Old:
----
  1.1.4.tar.gz

New:
----
  1.1.6.tar.gz
  python-tinyrpc-no-six.patch

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

Other differences:
------------------
++++++ python-tinyrpc.spec ++++++
--- /var/tmp/diff_new_pack.9aNFv0/_old  2023-04-28 16:26:19.211044270 +0200
+++ /var/tmp/diff_new_pack.9aNFv0/_new  2023-04-28 16:26:19.215044293 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-tinyrpc
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,15 +16,16 @@
 #
 
 
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-tinyrpc
-Version:        1.1.4
+Version:        1.1.6
 Release:        0
 Summary:        A modular transport and protocol neutral RPC library
 License:        MIT
 URL:            https://github.com/mbr/tinyrpc
 Source:         https://github.com/mbr/tinyrpc/archive/%{version}.tar.gz
+# https://github.com/mbr/tinyrpc/issues/103
+Patch0:         python-tinyrpc-no-six.patch
 BuildRequires:  %{python_module Werkzeug}
 BuildRequires:  %{python_module gevent}
 BuildRequires:  %{python_module msgpack}
@@ -33,10 +34,8 @@
 BuildRequires:  %{python_module pyzmq}
 BuildRequires:  %{python_module requests}
 BuildRequires:  %{python_module setuptools}
-BuildRequires:  %{python_module six}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-Requires:       python-six
 BuildArch:      noarch
 %python_subpackages
 
@@ -51,7 +50,7 @@
 WebSockets or ZeroMQ).
 
 %prep
-%setup -q -n tinyrpc-%{version}
+%autosetup -p1 -n tinyrpc-%{version}
 
 %build
 %python_build
@@ -59,6 +58,8 @@
 %install
 %python_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
+%python_expand rm -r %{buildroot}%{$python_sitelib}/tests
+%python_expand find %{buildroot}%{$python_sitelib}/tinyrpc -name "*.py" | 
xargs sed -i '1 {/^#!/ d}'
 
 %check
 # test_batch_dispatch - needs old pytest syntax, skip
@@ -67,6 +68,6 @@
 %files %{python_files}
 %license LICENSE
 %doc README.rst
-%{python_sitelib}/*
+%{python_sitelib}/tinyrpc*
 
 %changelog

++++++ 1.1.4.tar.gz -> 1.1.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyrpc-1.1.4/docs/conf.py 
new/tinyrpc-1.1.6/docs/conf.py
--- old/tinyrpc-1.1.4/docs/conf.py      2022-01-30 14:56:51.000000000 +0100
+++ new/tinyrpc-1.1.6/docs/conf.py      2023-02-09 17:45:39.000000000 +0100
@@ -42,7 +42,7 @@
 
 # General information about the project.
 project = u'tinyrpc'
-copyright = u'2013 - 2021, Marc Brinkmann, Leo Noordergraaf'
+copyright = u'2013 - 2023, Marc Brinkmann, Leo Noordergraaf'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -51,7 +51,7 @@
 # The short X.Y version.
 version = '1.1'
 # The full version, including alpha/beta/rc tags.
-release = '1.1.4'
+release = '1.1.6'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyrpc-1.1.4/setup.py new/tinyrpc-1.1.6/setup.py
--- old/tinyrpc-1.1.4/setup.py  2022-01-30 14:56:51.000000000 +0100
+++ new/tinyrpc-1.1.6/setup.py  2023-02-09 17:45:39.000000000 +0100
@@ -9,12 +9,12 @@
 
 setup(
     name='tinyrpc',
-    version='1.1.4',
+    version='1.1.6',
     description='A small, modular, transport and protocol neutral RPC '
                 'library that, among other things, supports JSON-RPC and zmq.',
     long_description=read('README.rst'),
     long_description_content_type="text/x-rst",
-    packages=find_packages(exclude=['tests', 'examples']),
+    packages=find_packages(exclude=['examples']),
     keywords='json rpc json-rpc jsonrpc 0mq zmq zeromq',
     author='Marc Brinkmann',
     author_email='g...@marcbrinkmann.de',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyrpc-1.1.4/tinyrpc/protocols/__init__.py 
new/tinyrpc-1.1.6/tinyrpc/protocols/__init__.py
--- old/tinyrpc-1.1.4/tinyrpc/protocols/__init__.py     2022-01-30 
14:56:51.000000000 +0100
+++ new/tinyrpc-1.1.6/tinyrpc/protocols/__init__.py     2023-02-09 
17:45:39.000000000 +0100
@@ -16,9 +16,9 @@
     def __init__(self) -> None:
         self.unique_id = None
         """Correlation ID used to match request and response.
-        
+
         :type: int or str or None
-        
+
         Protocol specific, may or may not be set.
         This value should only be set by 
:py:func:`~tinyrpc.protocols.RPCProtocol.create_request`.
 
@@ -27,15 +27,15 @@
 
         Only supported if the protocol has its
         :py:attr:`~tinyrpc.protocols.RPCProtocol.supports_out_of_order` set to 
``True``.
-        
+
         Generated by the client, the server copies it from request to 
corresponding response.
         """
 
         self.method = None
         """The name of the RPC function to be called.
-        
+
         :type: str
-        
+
         The :py:attr:`method` attribute uses the name of the function as it is 
known by the public.
         The :py:class:`~tinyrpc.dispatch.RPCDispatcher` allows the use of 
public aliases in the
         ``@public`` decorators.
@@ -44,18 +44,18 @@
 
         self.args = []
         """The positional arguments of the method call.
-        
+
         :type: list
-        
+
         The contents of this list are the positional parameters for the 
:py:attr:`method` called.
         It is eventually called as ``method(*args)``.
         """
 
         self.kwargs = {}
         """The keyword arguments of the method call.
-        
+
         :type: dict
-        
+
         The contents of this dict are the keyword parameters for the 
:py:attr:`method` called.
         It is eventually called as ``method(**kwargs)``.
         """
@@ -232,7 +232,7 @@
     generation of these may or may not be thread safe, depending on the
     protocol. Ideally, only one instance of RPCProtocol should be used per
     client.
-    
+
     :type: bool
     """
 
@@ -242,7 +242,7 @@
     On receipt of an RPCErrorResponse instance an RPCError exception is raised.
     When this flag is False the RPCErrorResponse object is returned to the 
caller
     which is then responsible for handling the error.
-    
+
     :type: bool
     """
     def create_request(
@@ -279,7 +279,7 @@
         """
         raise NotImplementedError()
 
-    def parse_reply(self, data: bytes) -> 'RPCResponse':
+    def parse_reply(self, data: bytes) -> Union['RPCResponse', 
'RPCBatchResponse']:
         """De-serializes and validates a response.
 
         Called by the client to reconstruct the serialized 
:py:class:`RPCResponse`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyrpc-1.1.4/tinyrpc/protocols/jsonrpc.py 
new/tinyrpc-1.1.6/tinyrpc/protocols/jsonrpc.py
--- old/tinyrpc-1.1.4/tinyrpc/protocols/jsonrpc.py      2022-01-30 
14:56:51.000000000 +0100
+++ new/tinyrpc-1.1.6/tinyrpc/protocols/jsonrpc.py      2023-02-09 
17:45:39.000000000 +0100
@@ -587,7 +587,7 @@
 
     def parse_reply(
             self, data: bytes
-    ) -> Union['JSONRPCSuccessResponse', 'JSONRPCErrorResponse']:
+    ) -> Union['JSONRPCSuccessResponse', 'JSONRPCErrorResponse', 
'JSONRPCBatchResponse']:
         """De-serializes and validates a response.
 
         Called by the client to reconstruct the serialized 
:py:class:`JSONRPCResponse`.
@@ -607,6 +607,24 @@
         except Exception as e:
             raise InvalidReplyError(e)
 
+        if isinstance(rep, list):
+            # batch request
+            replies = JSONRPCBatchResponse()
+            for subrep in rep:
+                try:
+                    replies.append(self._parse_subreply(subrep))
+                except RPCError as e:
+                    replies.append(e)
+                except Exception as e:
+                    replies.append(InvalidReplyError(e))
+
+            if not replies:
+                raise InvalidReplyError("Empty batch response received.")
+            return replies
+        else:
+            return self._parse_subreply(rep)
+
+    def _parse_subreply(self, rep):
         for k in rep.keys():
             if k not in self._ALLOWED_REPLY_KEYS:
                 raise InvalidReplyError('Key not allowed: %s' % k)

++++++ python-tinyrpc-no-six.patch ++++++
Index: tinyrpc-1.1.6/requirements.txt
===================================================================
--- tinyrpc-1.1.6.orig/requirements.txt
+++ tinyrpc-1.1.6/requirements.txt
@@ -6,6 +6,5 @@ pytest==6.2.4
 pytest-cov==2.11.1
 pyzmq==22.0.3
 requests==2.25.1
-six==1.16.0
 Werkzeug==2.0.0
 
Index: tinyrpc-1.1.6/setup.py
===================================================================
--- tinyrpc-1.1.6.orig/setup.py
+++ tinyrpc-1.1.6/setup.py
@@ -22,7 +22,7 @@ setup(
     maintainer_email='l...@noordergraaf.net',
     url='http://github.com/mbr/tinyrpc',
     license='MIT',
-    install_requires=['six'],
+    install_requires=[],
     extras_require={
         'gevent': ['gevent'],
         'httpclient': ['requests', 'websocket-client', 'gevent-websocket'],
Index: tinyrpc-1.1.6/tests/_compat.py
===================================================================
--- tinyrpc-1.1.6.orig/tests/_compat.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# from 
http://stackoverflow.com/questions/28215214/how-to-add-custom-renames-in-six
-
-import six
-mod = six.MovedModule('mock', 'mock', 'unittest.mock')
-six.add_move(mod)
-six._importer._add_module(mod, "moves." + mod.name)
-
-# issue open at 
https://bitbucket.org/gutworth/six/issue/116/enable-importing-from-within-custom
Index: tinyrpc-1.1.6/tests/test_jsonrpc.py
===================================================================
--- tinyrpc-1.1.6.orig/tests/test_jsonrpc.py
+++ tinyrpc-1.1.6/tests/test_jsonrpc.py
@@ -3,7 +3,6 @@
 
 import json
 
-import six
 import pytest
 
 from tinyrpc import MethodNotFoundError, InvalidRequestError, ServerError, \
@@ -65,7 +64,7 @@ def prot():
 def test_parsing_good_request_samples(prot, data, attrs):
     req = prot.parse_request(data)
 
-    for k, v in six.iteritems(attrs):
+    for k, v in attrs.items():
         assert getattr(req, k) == v
 
 
Index: tinyrpc-1.1.6/tests/test_msgpackrpc.py
===================================================================
--- tinyrpc-1.1.6.orig/tests/test_msgpackrpc.py
+++ tinyrpc-1.1.6/tests/test_msgpackrpc.py
@@ -2,7 +2,6 @@
 # -*- coding: utf-8 -*-
 
 import msgpack
-import six
 import pytest
 
 from tinyrpc import InvalidReplyError, MethodNotFoundError
@@ -48,7 +47,7 @@ def prot():
 def test_parsing_good_request_samples(prot, data, attrs):
     req = prot.parse_request(data)
 
-    for k, v in six.iteritems(attrs):
+    for k, v in attrs.items():
         assert getattr(req, k) == v
 
 
Index: tinyrpc-1.1.6/tests/test_transport.py
===================================================================
--- tinyrpc-1.1.6.orig/tests/test_transport.py
+++ tinyrpc-1.1.6/tests/test_transport.py
@@ -2,7 +2,6 @@
 # -*- coding: utf-8 -*-
 
 import pytest
-import six
 
 import zmq
 import zmq.green
@@ -60,11 +59,9 @@ def zmq_green_context(request):
     return ctx
 
 
-if six.PY3:
-    # zmq and zmq.green fail on python3
-    SERVERS=['dummy']
-else:
-    SERVERS=['dummy', 'zmq', 'zmq.green']
+# zmq and zmq.green fail on python3
+SERVERS=['dummy']
+
 @pytest.fixture(params=SERVERS)
 def transport(request, zmq_context, zmq_green_context):
     if request.param == 'dummy':
@@ -87,10 +84,7 @@ def transport(request, zmq_context, zmq_
 
 SAMPLE_MESSAGES = ['asdf', 'loremipsum' * 1500, '', '\x00', 'b\x00a', '\r\n',
                    '\n', u'\u1234'.encode('utf8')]
-if six.PY3:
-    BAD_MESSAGES = [b'asdf', b'', 1234, 1.2, None, True, False, ('foo',)]
-else:
-    BAD_MESSAGES = [u'asdf', u'', 1234, 1.2, None, True, False, ('foo',)]
+BAD_MESSAGES = [b'asdf', b'', 1234, 1.2, None, True, False, ('foo',)]
 
 
 @pytest.fixture(scope='session',
Index: tinyrpc-1.1.6/tests/test_wsgi_transport.py
===================================================================
--- tinyrpc-1.1.6.orig/tests/test_wsgi_transport.py
+++ tinyrpc-1.1.6/tests/test_wsgi_transport.py
@@ -3,8 +3,7 @@
 
 import pytest
 
-
-import six
+import importlib
 import gevent
 import gevent.queue
 import gevent.monkey
@@ -33,7 +32,7 @@ def monkey_patches(request):
         aggressive=False)
 
     def fin():
-        six.moves.reload_module(socket)
+        importlib.reload(socket)
 
     request.addfinalizer(fin)
 
@@ -70,21 +69,21 @@ def test_server_supports_post_only(wsgi_
 
 
 @pytest.mark.parametrize(('msg',),
-    [(six.b('foo'),), (six.b(''),), (six.b('bar'),), (six.b('1234'),), 
(six.b('{}'),), (six.b('{'),), (six.b('\x00\r\n'),)])
+    [(b'foo',), (b'',), (b'bar',), (b'1234',), (b'{}',), (b'{',), 
(b'\x00\r\n',)])
 def test_server_receives_messages(wsgi_server, msg):
     transport, addr = wsgi_server
 
     def consumer():
         context, received_msg = transport.receive_message()
         assert received_msg == msg
-        reply = six.b('reply:') + msg
+        reply = b'reply:' + msg
         transport.send_reply(context, reply)
 
     gevent.spawn(consumer)
 
     r = requests.post(addr, data=msg)
 
-    assert r.content == six.b('reply:') + msg
+    assert r.content == b'reply:' + msg
 
 
 @pytest.fixture
@@ -106,20 +105,20 @@ def non_sessioned_client():
 
 
 @pytest.mark.parametrize(('msg',),
-    [(six.b('foo'),), (six.b(''),), (six.b('bar'),), (six.b('1234'),), 
(six.b('{}'),), (six.b('{'),), (six.b('\x00\r\n'),)])
+    [(b'foo',), (b'',), (b'bar',), (b'1234',), (b'{}',), (b'{',), 
(b'\x00\r\n',)])
 def test_sessioned_http_sessioned_client(wsgi_server, sessioned_client, msg):
     transport, addr = wsgi_server
 
     def consumer():
         context, received_msg = transport.receive_message()
         assert received_msg == msg
-        reply = six.b('reply:') + msg
+        reply = b'reply:' + msg
         transport.send_reply(context, reply)
 
     gevent.spawn(consumer)
 
     result = sessioned_client.send_message(msg)
-    assert result == six.b('reply:') + msg
+    assert result == b'reply:' + msg
 
 
 @pytest.mark.skip('somehow fails on travis')
@@ -137,22 +136,22 @@ def test_exhaust_ports(wsgi_server, non_
 
     def consumer():
         context, received_msg = transport.receive_message()
-        reply = six.b('reply:') + received_msg
+        reply = b'reply:' + received_msg
         transport.send_reply(context, reply)
 
     def send_and_receive(i):
         try:
             gevent.spawn(consumer)
-            msg = six.b('msg_%s' % i)
+            msg = b'msg_%s' % i
             result = non_sessioned_client.send_message(msg)
-            return result == six.b('reply:') + msg
+            return result == b'reply:' + msg
         except Exception as e:
             return e
 
     pool = gevent.pool.Pool(500)
 
     with pytest.raises(requests.ConnectionError):
-        for result in pool.imap_unordered(send_and_receive, 
six.moves.xrange(55000)):
+        for result in pool.imap_unordered(send_and_receive, range(55000)):
             assert result
             if isinstance(result, Exception):
                 raise result
Index: tinyrpc-1.1.6/tinyrpc/protocols/msgpackrpc.py
===================================================================
--- tinyrpc-1.1.6.orig/tinyrpc/protocols/msgpackrpc.py
+++ tinyrpc-1.1.6/tinyrpc/protocols/msgpackrpc.py
@@ -14,7 +14,6 @@ from .. import (
 )
 
 import msgpack
-import six
 
 from typing import Any, Dict, List, Optional, Tuple, Union, Generator
 
@@ -104,7 +103,7 @@ class MSGPACKRPCErrorResponse(RPCErrorRe
 
 
 def _get_code_and_message(error):
-    assert isinstance(error, (Exception, six.string_types))
+    assert isinstance(error, (Exception, str))
     if isinstance(error, Exception):
         if hasattr(error, "msgpackrpc_error_code"):
             code = error.msgpackrpc_error_code
@@ -390,7 +389,7 @@ class MSGPACKRPCProtocol(RPCProtocol):
             raise MSGPACKRPCInvalidRequestError()
 
     def _parse_notification(self, req):
-        if not isinstance(req[1], six.string_types):
+        if not isinstance(req[1], str):
             raise MSGPACKRPCInvalidRequestError()
 
         request = MSGPACKRPCRequest()
@@ -408,7 +407,7 @@ class MSGPACKRPCProtocol(RPCProtocol):
         return request
 
     def _parse_request(self, req):
-        if not isinstance(req[2], six.string_types):
+        if not isinstance(req[2], str):
             raise MSGPACKRPCInvalidRequestError(request_id=req[1])
 
         request = MSGPACKRPCRequest()

Reply via email to