Hello community,

here is the log from the commit of package python-thriftpy for openSUSE:Factory 
checked in at 2018-07-18 22:56:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-thriftpy (Old)
 and      /work/SRC/openSUSE:Factory/.python-thriftpy.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-thriftpy"

Wed Jul 18 22:56:01 2018 rev:2 rq:623485 version:0.3.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-thriftpy/python-thriftpy.changes  
2017-08-29 11:44:21.457980762 +0200
+++ /work/SRC/openSUSE:Factory/.python-thriftpy.new/python-thriftpy.changes     
2018-07-18 22:56:39.042421509 +0200
@@ -1,0 +2,5 @@
+Tue Jul 17 14:12:57 UTC 2018 - mimi...@gmail.com
+
+- add tornado_5.patch to build with tornado-5.x
+
+-------------------------------------------------------------------

New:
----
  LICENSE
  tornado_5.patch

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

Other differences:
------------------
++++++ python-thriftpy.spec ++++++
--- /var/tmp/diff_new_pack.wR3WDN/_old  2018-07-18 22:56:39.478420063 +0200
+++ /var/tmp/diff_new_pack.wR3WDN/_new  2018-07-18 22:56:39.478420063 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-thriftpy
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -24,24 +24,22 @@
 Summary:        Pure python implementation of Apache Thrift
 License:        MIT
 Group:          Development/Languages/Python
-Url:            https://thriftpy.readthedocs.org/
+URL:            https://thriftpy.readthedocs.org/
 Source:         
https://files.pythonhosted.org/packages/source/t/thriftpy/thriftpy-%{version}.tar.gz
+Source1:        LICENSE
+Patch0:         tornado_5.patch
 BuildRequires:  %{python_module Cython}
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module ply >= 3.4}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+Requires:       python-ply >= 3.4
+Recommends:     python-tornado >= 4.0
 %if %{with test}
 BuildRequires:  %{python_module pytest >= 2.8}
 BuildRequires:  %{python_module tornado >= 4.0}
-BuildRequires:  %{python_module toro >= 0.6}
 %endif
-Requires:       python-ply >= 3.4
-Recommends:     python-tornado >= 4.0
-Recommends:     python-toro >= 0.6
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-
 %python_subpackages
 
 %description
@@ -50,6 +48,8 @@
 
 %prep
 %setup -q -n thriftpy-%{version}
+cp %{SOURCE1} .
+%patch0 -p1
 
 %build
 export CFLAGS="%{optflags}"
@@ -60,7 +60,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitearch}
 
 %files %{python_files}
-%defattr(-,root,root,-)
+%license LICENSE
 %doc CHANGES.rst README.rst
 %{python_sitearch}/*
 

++++++ LICENSE ++++++
The MIT License (MIT)

Copyright (c) <2014> <Eleme Inc.>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
++++++ tornado_5.patch ++++++
Index: thriftpy-0.3.9/setup.py
===================================================================
--- thriftpy-0.3.9.orig/setup.py
+++ thriftpy-0.3.9/setup.py
@@ -18,7 +18,7 @@ install_requires = [
 ]
 
 tornado_requires = [
-    "tornado>=4.0,<5.0",
+    "tornado>=4.0,<6.0",
     "toro==0.6"
 ]
 
Index: thriftpy-0.3.9/thriftpy/tornado.py
===================================================================
--- thriftpy-0.3.9.orig/thriftpy/tornado.py
+++ thriftpy-0.3.9/thriftpy/tornado.py
@@ -18,7 +18,8 @@
 from __future__ import absolute_import
 
 from contextlib import contextmanager
-from tornado import tcpserver, ioloop, iostream, gen
+from tornado import tcpserver, iostream, gen
+from tornado import version as tornado_version
 from io import BytesIO
 from datetime import timedelta
 
@@ -32,7 +33,11 @@ from .protocol.binary import TBinaryProt
 import logging
 import socket
 import struct
-import toro
+
+try:
+    from tornado.locks import Lock
+except ImportError:
+    from toro import Lock
 
 
 logger = logging.getLogger(__name__)
@@ -47,12 +52,12 @@ class TTornadoStreamTransport(TTransport
                  read_timeout=DEFAULT_READ_TIMEOUT):
         self.host = host
         self.port = port
-        self.io_loop = io_loop or ioloop.IOLoop.current()
+        self.io_loop = io_loop
         self.read_timeout = read_timeout
         self.is_queuing_reads = False
         self.read_queue = []
         self.__wbuf = BytesIO()
-        self._read_lock = toro.Lock()
+        self._read_lock = Lock()
         self.ssl_options = ssl_options
 
         # servers provide a ready-to-go stream
@@ -60,8 +65,12 @@ class TTornadoStreamTransport(TTransport
         if self.stream is not None:
             self._set_close_callback()
 
-    def with_timeout(self, timeout, future):
-        return gen.with_timeout(timeout, future, self.io_loop)
+    if tornado_version >= '5.0':
+        def with_timeout(self, timeout, future):
+            return gen.with_timeout(timeout, future)
+    else:
+        def with_timeout(self, timeout, future):
+            return gen.with_timeout(timeout, future, self.io_loop)
 
     @gen.coroutine
     def open(self, timeout=DEFAULT_CONNECT_TIMEOUT):
@@ -157,12 +166,15 @@ class TTornadoServer(tcpserver.TCPServer
                                else iprot_factory)
         self.transport_read_timeout = transport_read_timeout
 
+        # `io_loop` has been deprecated since tornado 4.1 and removed in 5.0
+        self.__io_loop = getattr(self, 'io_loop', None)
+
     @gen.coroutine
     def handle_stream(self, stream, address):
         host, port = address
         trans = TTornadoStreamTransport(
             host=host, port=port, stream=stream,
-            io_loop=self.io_loop, read_timeout=self.transport_read_timeout)
+            io_loop=self.__io_loop, read_timeout=self.transport_read_timeout)
         try:
             oprot = self._oprot_factory.get_protocol(trans)
             iprot = self._iprot_factory.get_protocol(TMemoryBuffer())
@@ -213,9 +225,14 @@ def make_server(
         io_loop=None, ssl_options=None,
         transport_read_timeout=TTornadoStreamTransport.DEFAULT_READ_TIMEOUT):
     processor = TProcessor(service, handler)
-    server = TTornadoServer(processor, iprot_factory=proto_factory,
-                            transport_read_timeout=transport_read_timeout,
-                            io_loop=io_loop, ssl_options=ssl_options)
+    if tornado_version >= '5.0':
+        server = TTornadoServer(processor, iprot_factory=proto_factory,
+                                transport_read_timeout=transport_read_timeout,
+                                ssl_options=ssl_options)
+    else:
+        server = TTornadoServer(processor, iprot_factory=proto_factory,
+                                transport_read_timeout=transport_read_timeout,
+                                io_loop=io_loop, ssl_options=ssl_options)
     return server
 
 

Reply via email to