Hello community,

here is the log from the commit of package python-wurlitzer for 
openSUSE:Factory checked in at 2019-07-22 17:19:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-wurlitzer (Old)
 and      /work/SRC/openSUSE:Factory/.python-wurlitzer.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-wurlitzer"

Mon Jul 22 17:19:18 2019 rev:2 rq:717551 version:1.0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-wurlitzer/python-wurlitzer.changes        
2018-12-28 12:34:22.788002928 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-wurlitzer.new.4126/python-wurlitzer.changes  
    2019-07-22 17:19:19.745913624 +0200
@@ -1,0 +2,6 @@
+Mon Jul 22 11:35:41 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 1.0.3:
+  * no upstream changelog
+
+-------------------------------------------------------------------

Old:
----
  wurlitzer-1.0.2.tar.gz

New:
----
  wurlitzer-1.0.3.tar.gz

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

Other differences:
------------------
++++++ python-wurlitzer.spec ++++++
--- /var/tmp/diff_new_pack.79wI8k/_old  2019-07-22 17:19:21.145912509 +0200
+++ /var/tmp/diff_new_pack.79wI8k/_new  2019-07-22 17:19:21.177912484 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-wurlitzer
 #
-# 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,23 +18,21 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-wurlitzer
-Version:        1.0.2
+Version:        1.0.3
 Release:        0
 Summary:        Python package to capture C-level output in context managers
 License:        MIT
 Group:          Development/Languages/Python
-Url:            https://github.com/minrk/wurlitzer
+URL:            https://github.com/minrk/wurlitzer
 Source:         
https://files.pythonhosted.org/packages/source/w/wurlitzer/wurlitzer-%{version}.tar.gz
-BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+BuildArch:      noarch
 # SECTION test requirements
 BuildRequires:  %{python_module mock}
 BuildRequires:  %{python_module pytest}
 # /SECTION
-BuildArch:      noarch
-
 %python_subpackages
 
 %description
@@ -52,7 +50,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-%python_expand py.test-%{$python_bin_suffix} test.py
+%pytest test.py
 
 %files %{python_files}
 %doc README.md

++++++ wurlitzer-1.0.2.tar.gz -> wurlitzer-1.0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/MANIFEST.in 
new/wurlitzer-1.0.3/MANIFEST.in
--- old/wurlitzer-1.0.2/MANIFEST.in     1970-01-01 01:00:00.000000000 +0100
+++ new/wurlitzer-1.0.3/MANIFEST.in     2016-03-08 15:51:30.000000000 +0100
@@ -0,0 +1,8 @@
+include README.md
+include test.py
+include LICENSE
+include Demo.ipynb
+include dev-requirements.txt
+
+prune htmlcov
+prune build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/PKG-INFO new/wurlitzer-1.0.3/PKG-INFO
--- old/wurlitzer-1.0.2/PKG-INFO        2018-05-20 19:45:37.000000000 +0200
+++ new/wurlitzer-1.0.3/PKG-INFO        2019-06-13 10:49:38.000000000 +0200
@@ -1,24 +1,78 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: wurlitzer
-Version: 1.0.2
+Version: 1.0.3
 Summary: Capture C-level output in context managers
 Home-page: https://github.com/minrk/wurlitzer
 Author: Min RK
 Author-email: [email protected]
 License: MIT
-Description: 
-        Context managers for capturing C-level output::
+Description: # Wurlitzer
         
-            from wurlitzer import pipes
+        Capture C-level stdout/stderr pipes in Python via `os.dup2`.
         
-            with pipes() as (stdout, stderr):
-                call_c_function()
-            out = stdout.read()
-            err = stderr.read()
+        For more details on why this is needed, please read [this blog post]( 
https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/ ).
+        
+        ## Install
+        
+            pip install wurlitzer
+        
+        ## Usage
+        
+        Capture stdout/stderr in pipes:
+        
+        ```python
+        from wurlitzer import pipes
+        
+        with pipes() as (out, err):
+            call_some_c_function()
+        
+        stdout = out.read()
+        ```
+        
+        Capture stdout/stderr in StringIO:
+        
+        ```python
+        from io import StringIO
+        from wurlitzer import pipes, STDOUT
+        
+        out = StringIO()
+        with pipes(stdout=out, stderr=STDOUT):
+            call_some_c_function()
+        
+        stdout = out.getvalue()
+        ```
+        
+        Forward C-level stdout/stderr to Python sys.stdout/stderr,
+        which may already be forwarded somewhere by the environment, e.g. 
IPython:
+        
+        ```python
+        from wurlitzer import sys_pipes
+        
+        with sys_pipes():
+            call_some_c_function()
+        ```
+        
+        Or even simpler, enable it as an IPython extension:
+        
+        ```
+        %load_ext wurlitzer
+        ```
+        
+        To forward all C-level output to IPython during execution.
+        
+        ## Acknowledgments
+        
+        This package is based on stuff we learned with @takluyver and @karies 
while working on capturing output from the [Cling 
Kernel](https://github.com/root-mirror/cling/tree/master/tools/Jupyter/kernel) 
for Jupyter.
+        
+        ## Wurlitzer?!
+        
+        [Wurlitzer](https://en.wikipedia.org/wiki/Wurlitzer) makes pipe 
organs. Get it? Pipes? Naming is hard.
         
 Platform: UNKNOWN
-Classifier: Development Status :: 3 - Alpha
+Classifier: Development Status :: 4 - Beta
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: MIT License
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
+Requires-Python: >=2.7
+Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/README.md 
new/wurlitzer-1.0.3/README.md
--- old/wurlitzer-1.0.2/README.md       2016-03-14 16:07:04.000000000 +0100
+++ new/wurlitzer-1.0.3/README.md       2018-12-10 12:49:44.000000000 +0100
@@ -2,6 +2,8 @@
 
 Capture C-level stdout/stderr pipes in Python via `os.dup2`.
 
+For more details on why this is needed, please read [this blog post]( 
https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/ ).
+
 ## Install
 
     pip install wurlitzer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/setup.cfg 
new/wurlitzer-1.0.3/setup.cfg
--- old/wurlitzer-1.0.2/setup.cfg       2016-03-14 16:07:04.000000000 +0100
+++ new/wurlitzer-1.0.3/setup.cfg       2019-06-13 10:49:38.000000000 +0200
@@ -1,2 +1,7 @@
 [bdist_wheel]
-universal=1
+universal = 1
+
+[egg_info]
+tag_build = 
+tag_date = 0
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/setup.py new/wurlitzer-1.0.3/setup.py
--- old/wurlitzer-1.0.2/setup.py        2018-05-14 09:17:13.000000000 +0200
+++ new/wurlitzer-1.0.3/setup.py        2018-12-10 12:49:42.000000000 +0100
@@ -1,38 +1,49 @@
 #!/usr/bin/env python
 import sys
 
-from distutils.core import setup
+from setuptools import setup
+from setuptools.command.bdist_egg import bdist_egg
 
-long_description = """
-Context managers for capturing C-level output::
-
-    from wurlitzer import pipes
-
-    with pipes() as (stdout, stderr):
-        call_c_function()
-    out = stdout.read()
-    err = stderr.read()
-"""
+with open("README.md") as f:
+    long_description = f.read()
 
 version_ns = {}
-with open('wurlitzer.py') as f:
+with open("wurlitzer.py") as f:
     for line in f:
-        if line.startswith('__version__'):
+        if line.startswith("__version__"):
             exec(line, version_ns)
 
+
+class bdist_egg_disabled(bdist_egg):
+    """Disabled version of bdist_egg
+
+    Prevents setup.py install from performing setuptools' default easy_install,
+    which it should never ever do.
+    """
+
+    def run(self):
+        sys.exit(
+            "Aborting implicit building of eggs. Use `pip install .` to 
install from source."
+        )
+
+
 setup_args = dict(
-    name='wurlitzer',
-    version=version_ns['__version__'],
+    name="wurlitzer",
+    version=version_ns["__version__"],
     author="Min RK",
     author_email="[email protected]",
     description="Capture C-level output in context managers",
     long_description=long_description,
+    long_description_content_type="text/markdown",
     url="https://github.com/minrk/wurlitzer";,
-    py_modules=['wurlitzer'],
+    py_modules=["wurlitzer"],
+    python_requires=">=2.7",
     license="MIT",
-    cmdclass={},
+    cmdclass={
+        "bdist_egg": bdist_egg if "bdist_egg" in sys.argv else 
bdist_egg_disabled
+    },
     classifiers=[
-        "Development Status :: 3 - Alpha",
+        "Development Status :: 4 - Beta",
         "Intended Audience :: Developers",
         "License :: OSI Approved :: MIT License",
         "Programming Language :: Python :: 2.7",
@@ -40,9 +51,5 @@
     ],
 )
 
-if 'bdist_wheel' in sys.argv:
-    from wheel.bdist_wheel import bdist_wheel
-    setup_args['cmdclass']['bdist_wheel'] = bdist_wheel
-
-if __name__ == '__main__':
+if __name__ == "__main__":
     setup(**setup_args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/test.py new/wurlitzer-1.0.3/test.py
--- old/wurlitzer-1.0.2/test.py 2018-05-20 19:43:32.000000000 +0200
+++ new/wurlitzer-1.0.3/test.py 2018-12-12 14:13:06.000000000 +0100
@@ -56,6 +56,7 @@
     with pipes(stdout=stdout, stderr=STDOUT) as (_stdout, _stderr):
         printf(u"Hellø")
         libc.fflush(c_stdout_p)
+        time.sleep(0.1)
         printf_err(u"Hi, stdérr")
         assert _stdout is stdout
         assert _stderr is None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/wurlitzer.egg-info/PKG-INFO 
new/wurlitzer-1.0.3/wurlitzer.egg-info/PKG-INFO
--- old/wurlitzer-1.0.2/wurlitzer.egg-info/PKG-INFO     1970-01-01 
01:00:00.000000000 +0100
+++ new/wurlitzer-1.0.3/wurlitzer.egg-info/PKG-INFO     2019-06-13 
10:49:38.000000000 +0200
@@ -0,0 +1,78 @@
+Metadata-Version: 2.1
+Name: wurlitzer
+Version: 1.0.3
+Summary: Capture C-level output in context managers
+Home-page: https://github.com/minrk/wurlitzer
+Author: Min RK
+Author-email: [email protected]
+License: MIT
+Description: # Wurlitzer
+        
+        Capture C-level stdout/stderr pipes in Python via `os.dup2`.
+        
+        For more details on why this is needed, please read [this blog post]( 
https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/ ).
+        
+        ## Install
+        
+            pip install wurlitzer
+        
+        ## Usage
+        
+        Capture stdout/stderr in pipes:
+        
+        ```python
+        from wurlitzer import pipes
+        
+        with pipes() as (out, err):
+            call_some_c_function()
+        
+        stdout = out.read()
+        ```
+        
+        Capture stdout/stderr in StringIO:
+        
+        ```python
+        from io import StringIO
+        from wurlitzer import pipes, STDOUT
+        
+        out = StringIO()
+        with pipes(stdout=out, stderr=STDOUT):
+            call_some_c_function()
+        
+        stdout = out.getvalue()
+        ```
+        
+        Forward C-level stdout/stderr to Python sys.stdout/stderr,
+        which may already be forwarded somewhere by the environment, e.g. 
IPython:
+        
+        ```python
+        from wurlitzer import sys_pipes
+        
+        with sys_pipes():
+            call_some_c_function()
+        ```
+        
+        Or even simpler, enable it as an IPython extension:
+        
+        ```
+        %load_ext wurlitzer
+        ```
+        
+        To forward all C-level output to IPython during execution.
+        
+        ## Acknowledgments
+        
+        This package is based on stuff we learned with @takluyver and @karies 
while working on capturing output from the [Cling 
Kernel](https://github.com/root-mirror/cling/tree/master/tools/Jupyter/kernel) 
for Jupyter.
+        
+        ## Wurlitzer?!
+        
+        [Wurlitzer](https://en.wikipedia.org/wiki/Wurlitzer) makes pipe 
organs. Get it? Pipes? Naming is hard.
+        
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Requires-Python: >=2.7
+Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/wurlitzer.egg-info/SOURCES.txt 
new/wurlitzer-1.0.3/wurlitzer.egg-info/SOURCES.txt
--- old/wurlitzer-1.0.2/wurlitzer.egg-info/SOURCES.txt  1970-01-01 
01:00:00.000000000 +0100
+++ new/wurlitzer-1.0.3/wurlitzer.egg-info/SOURCES.txt  2019-06-13 
10:49:38.000000000 +0200
@@ -0,0 +1,13 @@
+Demo.ipynb
+LICENSE
+MANIFEST.in
+README.md
+dev-requirements.txt
+setup.cfg
+setup.py
+test.py
+wurlitzer.py
+wurlitzer.egg-info/PKG-INFO
+wurlitzer.egg-info/SOURCES.txt
+wurlitzer.egg-info/dependency_links.txt
+wurlitzer.egg-info/top_level.txt
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wurlitzer-1.0.2/wurlitzer.egg-info/dependency_links.txt 
new/wurlitzer-1.0.3/wurlitzer.egg-info/dependency_links.txt
--- old/wurlitzer-1.0.2/wurlitzer.egg-info/dependency_links.txt 1970-01-01 
01:00:00.000000000 +0100
+++ new/wurlitzer-1.0.3/wurlitzer.egg-info/dependency_links.txt 2019-06-13 
10:49:38.000000000 +0200
@@ -0,0 +1 @@
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/wurlitzer.egg-info/top_level.txt 
new/wurlitzer-1.0.3/wurlitzer.egg-info/top_level.txt
--- old/wurlitzer-1.0.2/wurlitzer.egg-info/top_level.txt        1970-01-01 
01:00:00.000000000 +0100
+++ new/wurlitzer-1.0.3/wurlitzer.egg-info/top_level.txt        2019-06-13 
10:49:38.000000000 +0200
@@ -0,0 +1 @@
+wurlitzer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wurlitzer-1.0.2/wurlitzer.py 
new/wurlitzer-1.0.3/wurlitzer.py
--- old/wurlitzer-1.0.2/wurlitzer.py    2018-05-20 19:44:28.000000000 +0200
+++ new/wurlitzer-1.0.3/wurlitzer.py    2019-06-13 10:49:36.000000000 +0200
@@ -4,7 +4,7 @@
 """
 from __future__ import print_function
 
-__version__ = '1.0.2'
+__version__ = '1.0.3'
 
 __all__ = [
     'pipes',
@@ -176,9 +176,14 @@
             """Forward bytes on a pipe to stream messages"""
             draining = False
             flush_interval = 0
+            poller = select.poll()
+            for pipe_ in pipes:
+                poller.register(pipe_, select.POLLIN | select.POLLPRI)
+
             while pipes:
-                r, w, x = select.select(pipes, [], [], flush_interval)
-                if r:
+                events = poller.poll(int(flush_interval * 1000))
+                #r = all([(r_[1] == (select.POLLIN | select.POLLPRI)) for r_ 
in events])
+                if events:
                     # found something to read, don't block select until
                     # we run out of things to read
                     flush_interval = 0
@@ -194,18 +199,21 @@
                         flush_queue.put('flush')
                         flush_interval = self.flush_interval
                         continue
-                for pipe in r:
-                    if pipe == self._control_r:
+
+                for fd, flags in events:
+                    if fd == self._control_r:
                         draining = True
-                        os.close(self._control_r)
                         pipes.remove(self._control_r)
+                        poller.unregister(self._control_r)
+                        os.close(self._control_r)
                         continue
-                    name = names[pipe]
-                    data = os.read(pipe, 1024)
+                    name = names[fd]
+                    data = os.read(fd, 1024)
                     if not data:
                         # pipe closed, stop polling it
-                        os.close(pipe)
-                        pipes.remove(pipe)
+                        pipes.remove(fd)
+                        poller.unregister(fd)
+                        os.close(fd)
                     else:
                         handler = getattr(self, '_handle_%s' % name)
                         handler(data)
@@ -308,24 +316,28 @@
 
 
 _mighty_wurlitzer = None
+_mighty_lock = threading.Lock()
+
 
 def sys_pipes_forever(encoding=_default_encoding):
     """Redirect all C output to sys.stdout/err
-    
+
     This is not a context manager; it turns on C-forwarding permanently.
     """
     global _mighty_wurlitzer
-    if _mighty_wurlitzer is None:
-        _mighty_wurlitzer = sys_pipes(encoding)
-    _mighty_wurlitzer.__enter__()
+    with _mighty_lock:
+        if _mighty_wurlitzer is None:
+            _mighty_wurlitzer = sys_pipes(encoding)
+            _mighty_wurlitzer.__enter__()
 
 
 def stop_sys_pipes():
     """Stop permanent redirection started by sys_pipes_forever"""
     global _mighty_wurlitzer
-    if _mighty_wurlitzer is not None:
-        _mighty_wurlitzer.__exit__(None, None, None)
-        _mighty_wurlitzer = None
+    with _mighty_lock:
+        if _mighty_wurlitzer is not None:
+            _mighty_wurlitzer.__exit__(None, None, None)
+            _mighty_wurlitzer = None
 
 
 def load_ipython_extension(ip):


Reply via email to