Hello community,
here is the log from the commit of package python-capturer for openSUSE:Factory
checked in at 2020-03-31 17:13:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-capturer (Old)
and /work/SRC/openSUSE:Factory/.python-capturer.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-capturer"
Tue Mar 31 17:13:45 2020 rev:4 rq:789768 version:3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-capturer/python-capturer.changes
2018-12-13 19:41:07.681262605 +0100
+++
/work/SRC/openSUSE:Factory/.python-capturer.new.3160/python-capturer.changes
2020-03-31 17:14:06.271584133 +0200
@@ -1,0 +2,14 @@
+Mon Mar 30 09:31:30 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- Update to 3.0
+ * Added support for Python 3.7 and 3.8.
+ * Dropped support for Python 2.6 and 3.4.
+ * Actively deprecate ``interpret_carriage_returns()``.
+ * Moved test helpers to :mod:`humanfriendly.testing`.
+ * Include documentation in source distributions.
+ * Use Python 3 for local development (``Makefile``).
+ * Restructured the online documentation.
+ * Updated PyPI domain in documentation.
+ * Added this changelog.
+
+-------------------------------------------------------------------
Old:
----
capturer-2.4.tar.gz
New:
----
capturer-3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-capturer.spec ++++++
--- /var/tmp/diff_new_pack.BQwEBN/_old 2020-03-31 17:14:06.879584518 +0200
+++ /var/tmp/diff_new_pack.BQwEBN/_new 2020-03-31 17:14:06.879584518 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-capturer
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,25 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%bcond_with test
+%bcond_without test
Name: python-capturer
-Version: 2.4
+Version: 3.0
Release: 0
Summary: Python module for capturing stdout/stderr of the current
process group
License: MIT
Group: Development/Languages/Python
-Url: https://capturer.readthedocs.io
+URL: https://capturer.readthedocs.io
Source:
https://files.pythonhosted.org/packages/source/c/capturer/capturer-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
-BuildRequires: %{python_module humanfriendly >= 2.1}
+BuildRequires: %{python_module coverage >= 4.2}
+BuildRequires: %{python_module humanfriendly >= 8.0}
+BuildRequires: %{python_module pytest >= 3.0.4}
+BuildRequires: %{python_module pytest-cov >= 2.4.0}
%endif
-Requires: python-humanfriendly >= 2.1
+Requires: python-humanfriendly >= 8.0
BuildArch: noarch
%python_subpackages
@@ -59,7 +62,7 @@
%if %{with test}
%check
export LANG=en_US.UTF-8
-%python_exec setup.py test
+%pytest capturer/tests.py
%endif
%files %{python_files}
++++++ capturer-2.4.tar.gz -> capturer-3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/CHANGELOG.rst
new/capturer-3.0/CHANGELOG.rst
--- old/capturer-2.4/CHANGELOG.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/capturer-3.0/CHANGELOG.rst 2020-03-07 01:34:03.000000000 +0100
@@ -0,0 +1,97 @@
+Changelog
+=========
+
+The purpose of this document is to list all of the notable changes to this
+project. The format was inspired by `Keep a Changelog`_. This project adheres
+to `semantic versioning`_.
+
+.. contents::
+ :local:
+
+.. _Keep a Changelog: http://keepachangelog.com/
+.. _semantic versioning: http://semver.org/
+
+`Release 3.0`_ (2020-03-07)
+---------------------------
+
+This is a maintenance release that updates the supported Python
+versions, adds a changelog and makes some minor internal changes:
+
+- Added support for Python 3.7 and 3.8.
+- Dropped support for Python 2.6 and 3.4.
+- Actively deprecate ``interpret_carriage_returns()``.
+- Moved test helpers to :mod:`humanfriendly.testing`.
+- Include documentation in source distributions.
+- Use Python 3 for local development (``Makefile``).
+- Restructured the online documentation.
+- Updated PyPI domain in documentation.
+- Added this changelog.
+
+.. _Release 3.0: https://github.com/xolox/python-capturer/compare/2.4...3.0
+
+`Release 2.4`_ (2017-05-17)
+---------------------------
+
+- Allow capturing output without relaying it.
+- Make ``OutputBuffer.flush()`` more robust.
+- Add Python 3.6 to supported versions.
+
+.. _Release 2.4: https://github.com/xolox/python-capturer/compare/2.3...2.4
+
+`Release 2.3`_ (2016-11-12)
+---------------------------
+
+- Clearly document supported operating systems (`#4`_).
+- Start testing Python 3.5 and Mac OS X on Travis CI.
+- Start publishing wheel distributions.
+- PEP-8 and PEP-257 checks.
+
+.. _Release 2.3: https://github.com/xolox/python-capturer/compare/2.2...2.3
+.. _#4: https://github.com/xolox/python-capturer/issues/4
+
+`Release 2.2`_ (2016-10-09)
+---------------------------
+
+Switch to :func:`humanfriendly.terminal.clean_terminal_output()`.
+
+.. _Release 2.2: https://github.com/xolox/python-capturer/compare/2.1.1...2.2
+
+`Release 2.1.1`_ (2015-10-24)
+-----------------------------
+
+Make it easier to run test suite from PyPI release (fixes `#3`_).
+
+.. _Release 2.1.1: https://github.com/xolox/python-capturer/compare/2.1...2.1.1
+.. _#3: https://github.com/xolox/python-capturer/issues/3
+
+`Release 2.1`_ (2015-06-21)
+---------------------------
+
+Make "nested" output capturing work as expected (issue `#2`_).
+
+.. _Release 2.1: https://github.com/xolox/python-capturer/compare/2.0...2.1
+.. _#2: https://github.com/xolox/python-capturer/issues/2
+
+`Release 2.0`_ (2015-06-18)
+---------------------------
+
+Experimental support for capturing stdout/stderr separately (issue `#2`_).
+
+.. _Release 2.0: https://github.com/xolox/python-capturer/compare/1.1...2.0
+.. _#2: https://github.com/xolox/python-capturer/issues/2
+
+`Release 1.1`_ (2015-06-16)
+---------------------------
+
+- Expose captured output as file handle (wiht shortcuts for saving to files).
+- Improve documentation of ``interpret_carriage_returns()``.
+- Clearly document drawbacks of emulating a terminal.
+
+.. _Release 1.1: https://github.com/xolox/python-capturer/compare/1.0...1.1
+
+`Release 1.0`_ (2015-06-14)
+---------------------------
+
+This was the initial release.
+
+.. _Release 1.0: https://github.com/xolox/python-capturer/tree/1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/LICENSE.txt new/capturer-3.0/LICENSE.txt
--- old/capturer-2.4/LICENSE.txt 2017-05-17 02:21:36.000000000 +0200
+++ new/capturer-3.0/LICENSE.txt 2020-03-07 01:34:03.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright (c) 2017 Peter Odding
+Copyright (c) 2020 Peter Odding
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/MANIFEST.in new/capturer-3.0/MANIFEST.in
--- old/capturer-2.4/MANIFEST.in 2017-02-17 02:46:43.000000000 +0100
+++ new/capturer-3.0/MANIFEST.in 2020-03-07 01:34:03.000000000 +0100
@@ -1,2 +1,3 @@
+graft docs
include *.rst
include *.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/PKG-INFO new/capturer-3.0/PKG-INFO
--- old/capturer-2.4/PKG-INFO 2017-05-17 02:25:36.000000000 +0200
+++ new/capturer-3.0/PKG-INFO 2020-03-07 01:34:47.000000000 +0100
@@ -1,11 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: capturer
-Version: 2.4
+Version: 3.0
Summary: Easily capture stdout/stderr of the current process and subprocesses
Home-page: https://capturer.readthedocs.io
Author: Peter Odding
Author-email: [email protected]
-License: UNKNOWN
+License: MIT
Description: capturer: Easily capture stdout/stderr of the current process and
subprocesses
==============================================================================
@@ -15,13 +15,13 @@
.. image::
https://coveralls.io/repos/xolox/python-capturer/badge.svg?branch=master
:target: https://coveralls.io/r/xolox/python-capturer?branch=master
- The `capturer` package makes it easy to capture the stdout_ and
stderr_ streams
+ The capturer package makes it easy to capture the stdout_ and stderr_
streams
of the current process *and subprocesses*. Output can be relayed to the
terminal in real time but is also available to the Python program for
- additional processing. It's currently tested on cPython 2.6, 2.7, 3.4,
3.5, 3.6
- and PyPy (2.7). It's tested on Linux and Mac OS X and may work on
other unixes
- but definitely won't work on Windows (due to the use of the platform
dependent
- pty_ module). For usage instructions please refer to the
documentation_.
+ additional processing. It's currently tested on cPython 2.7, 3.5+ and
PyPy
+ (2.7). It's tested on Linux and Mac OS X and may work on other unixes
but
+ definitely won't work on Windows (due to the use of the platform
dependent pty_
+ module). For usage instructions please refer to the documentation_.
.. contents::
:local:
@@ -42,7 +42,7 @@
The `capturer` package is available on PyPI_ which means installation
should be
as simple as:
- .. code-block:: sh
+ .. code-block:: console
$ pip install capturer
@@ -163,16 +163,16 @@
-------
The latest version of `capturer` is available on PyPI_ and GitHub_. The
- documentation is hosted on `Read the Docs`_. For bug reports please
create an
- issue on GitHub_. If you have questions, suggestions, etc. feel free
to send me
- an e-mail at `[email protected]`_.
+ documentation is hosted on `Read the Docs`_ and includes a changelog_.
For bug
+ reports please create an issue on GitHub_. If you have questions,
suggestions,
+ etc. feel free to send me an e-mail at `[email protected]`_.
License
-------
This software is licensed under the `MIT license`_.
- © 2017 Peter Odding.
+ © 2020 Peter Odding.
A big thanks goes out to the pytest_ developers because pytest's
mechanism for
capturing the output of subprocesses provided inspiration for the
`capturer`
@@ -180,22 +180,23 @@
not like it's very relevant :-).
.. External references:
- .. _capture: https://pypi.python.org/pypi/capture
+ .. _capture: https://pypi.org/project/capture
+ .. _changelog: https://capturer.readthedocs.io/en/latest/changelog.html
.. _documentation: https://capturer.readthedocs.io
- .. _get_bytes():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_bytes
- .. _get_lines():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_lines
- .. _get_text():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_text
+ .. _get_bytes():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_bytes
+ .. _get_lines():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_lines
+ .. _get_text():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_text
.. _GitHub: https://github.com/xolox/python-capturer
.. _gpg: https://en.wikipedia.org/wiki/GNU_Privacy_Guard
.. _how pytest does it: https://pytest.org/latest/capture.html
- .. _iocapture: https://pypi.python.org/pypi/iocapture
+ .. _iocapture: https://pypi.org/project/iocapture
.. _MIT license: http://en.wikipedia.org/wiki/MIT_License
.. _per user site-packages directory:
https://www.python.org/dev/peps/pep-0370/
.. [email protected]: [email protected]
.. _pty.openpty():
https://docs.python.org/2/library/pty.html#pty.openpty
.. _pty: https://docs.python.org/2/library/pty.html
- .. _PyPI: https://pypi.python.org/pypi/capturer
- .. _pytest: https://pypi.python.org/pypi/pytest
+ .. _PyPI: https://pypi.org/project/capturer
+ .. _pytest: https://pypi.org/project/pytest
.. _Read the Docs: https://capturer.readthedocs.io
.. _ssh: https://en.wikipedia.org/wiki/Secure_Shell
.. _stderr:
https://en.wikipedia.org/wiki/Standard_streams#Standard_error_.28stderr.29
@@ -219,17 +220,18 @@
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Communications
Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
Classifier: Topic :: Software Development
+Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: System :: Shells
@@ -237,3 +239,4 @@
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Terminals
Classifier: Topic :: Text Processing :: General
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/README.rst new/capturer-3.0/README.rst
--- old/capturer-2.4/README.rst 2017-05-17 02:21:36.000000000 +0200
+++ new/capturer-3.0/README.rst 2020-03-07 01:34:03.000000000 +0100
@@ -7,13 +7,13 @@
.. image::
https://coveralls.io/repos/xolox/python-capturer/badge.svg?branch=master
:target: https://coveralls.io/r/xolox/python-capturer?branch=master
-The `capturer` package makes it easy to capture the stdout_ and stderr_ streams
+The capturer package makes it easy to capture the stdout_ and stderr_ streams
of the current process *and subprocesses*. Output can be relayed to the
terminal in real time but is also available to the Python program for
-additional processing. It's currently tested on cPython 2.6, 2.7, 3.4, 3.5, 3.6
-and PyPy (2.7). It's tested on Linux and Mac OS X and may work on other unixes
-but definitely won't work on Windows (due to the use of the platform dependent
-pty_ module). For usage instructions please refer to the documentation_.
+additional processing. It's currently tested on cPython 2.7, 3.5+ and PyPy
+(2.7). It's tested on Linux and Mac OS X and may work on other unixes but
+definitely won't work on Windows (due to the use of the platform dependent pty_
+module). For usage instructions please refer to the documentation_.
.. contents::
:local:
@@ -34,7 +34,7 @@
The `capturer` package is available on PyPI_ which means installation should be
as simple as:
-.. code-block:: sh
+.. code-block:: console
$ pip install capturer
@@ -155,16 +155,16 @@
-------
The latest version of `capturer` is available on PyPI_ and GitHub_. The
-documentation is hosted on `Read the Docs`_. For bug reports please create an
-issue on GitHub_. If you have questions, suggestions, etc. feel free to send me
-an e-mail at `[email protected]`_.
+documentation is hosted on `Read the Docs`_ and includes a changelog_. For bug
+reports please create an issue on GitHub_. If you have questions, suggestions,
+etc. feel free to send me an e-mail at `[email protected]`_.
License
-------
This software is licensed under the `MIT license`_.
-© 2017 Peter Odding.
+© 2020 Peter Odding.
A big thanks goes out to the pytest_ developers because pytest's mechanism for
capturing the output of subprocesses provided inspiration for the `capturer`
@@ -172,22 +172,23 @@
not like it's very relevant :-).
.. External references:
-.. _capture: https://pypi.python.org/pypi/capture
+.. _capture: https://pypi.org/project/capture
+.. _changelog: https://capturer.readthedocs.io/en/latest/changelog.html
.. _documentation: https://capturer.readthedocs.io
-.. _get_bytes():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_bytes
-.. _get_lines():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_lines
-.. _get_text():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_text
+.. _get_bytes():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_bytes
+.. _get_lines():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_lines
+.. _get_text():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_text
.. _GitHub: https://github.com/xolox/python-capturer
.. _gpg: https://en.wikipedia.org/wiki/GNU_Privacy_Guard
.. _how pytest does it: https://pytest.org/latest/capture.html
-.. _iocapture: https://pypi.python.org/pypi/iocapture
+.. _iocapture: https://pypi.org/project/iocapture
.. _MIT license: http://en.wikipedia.org/wiki/MIT_License
.. _per user site-packages directory: https://www.python.org/dev/peps/pep-0370/
.. [email protected]: [email protected]
.. _pty.openpty(): https://docs.python.org/2/library/pty.html#pty.openpty
.. _pty: https://docs.python.org/2/library/pty.html
-.. _PyPI: https://pypi.python.org/pypi/capturer
-.. _pytest: https://pypi.python.org/pypi/pytest
+.. _PyPI: https://pypi.org/project/capturer
+.. _pytest: https://pypi.org/project/pytest
.. _Read the Docs: https://capturer.readthedocs.io
.. _ssh: https://en.wikipedia.org/wiki/Secure_Shell
.. _stderr:
https://en.wikipedia.org/wiki/Standard_streams#Standard_error_.28stderr.29
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/capturer/__init__.py
new/capturer-3.0/capturer/__init__.py
--- old/capturer-2.4/capturer/__init__.py 2017-05-17 02:21:36.000000000
+0200
+++ new/capturer-3.0/capturer/__init__.py 2020-03-07 01:34:03.000000000
+0100
@@ -1,7 +1,7 @@
# Easily capture stdout/stderr of the current process and subprocesses.
#
# Author: Peter Odding <[email protected]>
-# Last Change: May 17, 2017
+# Last Change: March 7, 2020
# URL: https://capturer.readthedocs.io
"""Easily capture stdout/stderr of the current process and subprocesses."""
@@ -17,20 +17,15 @@
import time
# External dependencies.
+from humanfriendly.deprecation import define_aliases
from humanfriendly.text import compact, dedent
from humanfriendly.terminal import clean_terminal_output
# Semi-standard module versioning.
-__version__ = '2.4'
+__version__ = '3.0'
-interpret_carriage_returns = clean_terminal_output
-"""
-Alias to :func:`humanfriendly.terminal.clean_terminal_output()`.
-
-In `capturer` version 2.1.2 the ``interpret_carriage_returns()`` function was
-obsoleted by :func:`humanfriendly.terminal.clean_terminal_output()`. This alias
-remains for backwards compatibility.
-"""
+# Define aliases for backwards compatibility.
+define_aliases(module_name=__name__,
interpret_carriage_returns='humanfriendly.terminal.clean_terminal_output')
DEFAULT_TEXT_ENCODING = 'UTF-8'
"""
@@ -568,7 +563,7 @@
Get the captured output split into lines.
:param interpreted: If :data:`True` (the default) captured output is
- processed using
:func:`interpret_carriage_returns()`.
+ processed using :func:`.clean_terminal_output()`.
:param partial: Refer to :func:`get_handle()` for details.
:returns: The captured output as a list of Unicode strings.
@@ -579,7 +574,7 @@
output = self.get_bytes(partial)
output = output.decode(self.encoding)
if interpreted:
- return interpret_carriage_returns(output)
+ return clean_terminal_output(output)
else:
return output.splitlines()
@@ -588,7 +583,7 @@
Get the captured output as a single string.
:param interpreted: If :data:`True` (the default) captured output is
- processed using
:func:`interpret_carriage_returns()`.
+ processed using :func:`clean_terminal_output()`.
:param partial: Refer to :func:`get_handle()` for details.
:returns: The captured output as a Unicode string.
@@ -599,7 +594,7 @@
output = self.get_bytes(partial)
output = output.decode(self.encoding)
if interpreted:
- output = u'\n'.join(interpret_carriage_returns(output))
+ output = u'\n'.join(clean_terminal_output(output))
return output
def save_to_handle(self, handle, partial=PARTIAL_DEFAULT):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/capturer/tests.py
new/capturer-3.0/capturer/tests.py
--- old/capturer-2.4/capturer/tests.py 2017-02-17 02:46:43.000000000 +0100
+++ new/capturer-3.0/capturer/tests.py 2020-03-07 01:34:03.000000000 +0100
@@ -1,39 +1,40 @@
# Easily capture stdout/stderr of the current process and subprocesses.
#
# Author: Peter Odding <[email protected]>
-# Last Change: November 12, 2016
+# Last Change: March 7, 2020
# URL: https://capturer.readthedocs.io
"""Test suite for the `capturer` package."""
# Standard library modules.
import os
-import random
-import string
import subprocess
import sys
import tempfile
-import time
import unittest
+# External dependencies.
+from humanfriendly.terminal import clean_terminal_output
+from humanfriendly.testing import TestCase, random_string, retry
+
# The module we're testing.
-from capturer import interpret_carriage_returns, CaptureOutput, Stream
+from capturer import CaptureOutput, Stream
-class CapturerTestCase(unittest.TestCase):
+class CapturerTestCase(TestCase):
"""Container for the `capturer` test suite."""
def test_carriage_return_interpretation(self):
- """Sanity check the results of interpret_carriage_returns()."""
+ """Sanity check the results of clean_terminal_output()."""
# Simple output should pass through unharmed.
- assert interpret_carriage_returns('foo') == ['foo']
+ assert clean_terminal_output('foo') == ['foo']
# Simple output should pass through unharmed.
- assert interpret_carriage_returns('foo\nbar') == ['foo', 'bar']
+ assert clean_terminal_output('foo\nbar') == ['foo', 'bar']
# Carriage returns and preceding substrings should be stripped.
- assert interpret_carriage_returns('foo\rbar\nbaz') == ['bar', 'baz']
+ assert clean_terminal_output('foo\rbar\nbaz') == ['bar', 'baz']
# Trailing empty lines should be stripped.
- assert interpret_carriage_returns('foo\nbar\nbaz\n\n\n') == ['foo',
'bar', 'baz']
+ assert clean_terminal_output('foo\nbar\nbaz\n\n\n') == ['foo', 'bar',
'baz']
def test_error_handling(self):
"""Test error handling code paths."""
@@ -193,21 +194,5 @@
assert expected_stderr in capturer.stderr.get_lines()
-def random_string():
- """Generate a random string."""
- length = random.randint(25, 100)
- characters = string.ascii_letters + string.digits
- return ''.join(random.choice(characters) for i in range(length))
-
-
-def retry(func, timeout=10):
- """Retry a function until it returns True or the timeout passes."""
- time_started = time.time()
- while (time.time() - time_started) < timeout:
- if func():
- return
- assert False, "Timeout expired but function never passed all assertions!"
-
-
if __name__ == '__main__':
unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/capturer.egg-info/PKG-INFO
new/capturer-3.0/capturer.egg-info/PKG-INFO
--- old/capturer-2.4/capturer.egg-info/PKG-INFO 2017-05-17 02:25:36.000000000
+0200
+++ new/capturer-3.0/capturer.egg-info/PKG-INFO 2020-03-07 01:34:47.000000000
+0100
@@ -1,11 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: capturer
-Version: 2.4
+Version: 3.0
Summary: Easily capture stdout/stderr of the current process and subprocesses
Home-page: https://capturer.readthedocs.io
Author: Peter Odding
Author-email: [email protected]
-License: UNKNOWN
+License: MIT
Description: capturer: Easily capture stdout/stderr of the current process and
subprocesses
==============================================================================
@@ -15,13 +15,13 @@
.. image::
https://coveralls.io/repos/xolox/python-capturer/badge.svg?branch=master
:target: https://coveralls.io/r/xolox/python-capturer?branch=master
- The `capturer` package makes it easy to capture the stdout_ and
stderr_ streams
+ The capturer package makes it easy to capture the stdout_ and stderr_
streams
of the current process *and subprocesses*. Output can be relayed to the
terminal in real time but is also available to the Python program for
- additional processing. It's currently tested on cPython 2.6, 2.7, 3.4,
3.5, 3.6
- and PyPy (2.7). It's tested on Linux and Mac OS X and may work on
other unixes
- but definitely won't work on Windows (due to the use of the platform
dependent
- pty_ module). For usage instructions please refer to the
documentation_.
+ additional processing. It's currently tested on cPython 2.7, 3.5+ and
PyPy
+ (2.7). It's tested on Linux and Mac OS X and may work on other unixes
but
+ definitely won't work on Windows (due to the use of the platform
dependent pty_
+ module). For usage instructions please refer to the documentation_.
.. contents::
:local:
@@ -42,7 +42,7 @@
The `capturer` package is available on PyPI_ which means installation
should be
as simple as:
- .. code-block:: sh
+ .. code-block:: console
$ pip install capturer
@@ -163,16 +163,16 @@
-------
The latest version of `capturer` is available on PyPI_ and GitHub_. The
- documentation is hosted on `Read the Docs`_. For bug reports please
create an
- issue on GitHub_. If you have questions, suggestions, etc. feel free
to send me
- an e-mail at `[email protected]`_.
+ documentation is hosted on `Read the Docs`_ and includes a changelog_.
For bug
+ reports please create an issue on GitHub_. If you have questions,
suggestions,
+ etc. feel free to send me an e-mail at `[email protected]`_.
License
-------
This software is licensed under the `MIT license`_.
- © 2017 Peter Odding.
+ © 2020 Peter Odding.
A big thanks goes out to the pytest_ developers because pytest's
mechanism for
capturing the output of subprocesses provided inspiration for the
`capturer`
@@ -180,22 +180,23 @@
not like it's very relevant :-).
.. External references:
- .. _capture: https://pypi.python.org/pypi/capture
+ .. _capture: https://pypi.org/project/capture
+ .. _changelog: https://capturer.readthedocs.io/en/latest/changelog.html
.. _documentation: https://capturer.readthedocs.io
- .. _get_bytes():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_bytes
- .. _get_lines():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_lines
- .. _get_text():
https://capturer.readthedocs.io/en/latest/#capturer.CaptureOutput.get_text
+ .. _get_bytes():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_bytes
+ .. _get_lines():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_lines
+ .. _get_text():
https://capturer.readthedocs.io/en/latest/api.html#capturer.CaptureOutput.get_text
.. _GitHub: https://github.com/xolox/python-capturer
.. _gpg: https://en.wikipedia.org/wiki/GNU_Privacy_Guard
.. _how pytest does it: https://pytest.org/latest/capture.html
- .. _iocapture: https://pypi.python.org/pypi/iocapture
+ .. _iocapture: https://pypi.org/project/iocapture
.. _MIT license: http://en.wikipedia.org/wiki/MIT_License
.. _per user site-packages directory:
https://www.python.org/dev/peps/pep-0370/
.. [email protected]: [email protected]
.. _pty.openpty():
https://docs.python.org/2/library/pty.html#pty.openpty
.. _pty: https://docs.python.org/2/library/pty.html
- .. _PyPI: https://pypi.python.org/pypi/capturer
- .. _pytest: https://pypi.python.org/pypi/pytest
+ .. _PyPI: https://pypi.org/project/capturer
+ .. _pytest: https://pypi.org/project/pytest
.. _Read the Docs: https://capturer.readthedocs.io
.. _ssh: https://en.wikipedia.org/wiki/Secure_Shell
.. _stderr:
https://en.wikipedia.org/wiki/Standard_streams#Standard_error_.28stderr.29
@@ -219,17 +220,18 @@
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Communications
Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
Classifier: Topic :: Software Development
+Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: System :: Shells
@@ -237,3 +239,4 @@
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Terminals
Classifier: Topic :: Text Processing :: General
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/capturer.egg-info/SOURCES.txt
new/capturer-3.0/capturer.egg-info/SOURCES.txt
--- old/capturer-2.4/capturer.egg-info/SOURCES.txt 2017-05-17
02:25:36.000000000 +0200
+++ new/capturer-3.0/capturer.egg-info/SOURCES.txt 2020-03-07
01:34:47.000000000 +0100
@@ -1,8 +1,10 @@
+CHANGELOG.rst
LICENSE.txt
MANIFEST.in
README.rst
requirements-checks.txt
requirements-tests.txt
+requirements-travis.txt
requirements.txt
setup.cfg
setup.py
@@ -12,4 +14,9 @@
capturer.egg-info/SOURCES.txt
capturer.egg-info/dependency_links.txt
capturer.egg-info/requires.txt
-capturer.egg-info/top_level.txt
\ No newline at end of file
+capturer.egg-info/top_level.txt
+docs/api.rst
+docs/changelog.rst
+docs/conf.py
+docs/index.rst
+docs/readme.rst
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/capturer.egg-info/requires.txt
new/capturer-3.0/capturer.egg-info/requires.txt
--- old/capturer-2.4/capturer.egg-info/requires.txt 2017-05-17
02:25:36.000000000 +0200
+++ new/capturer-3.0/capturer.egg-info/requires.txt 2020-03-07
01:34:47.000000000 +0100
@@ -1 +1 @@
-humanfriendly>=2.1
+humanfriendly>=8.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/docs/api.rst
new/capturer-3.0/docs/api.rst
--- old/capturer-2.4/docs/api.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/capturer-3.0/docs/api.rst 2020-03-07 01:34:03.000000000 +0100
@@ -0,0 +1,14 @@
+API documentation
+=================
+
+The following API documentation was automatically generated from the source
+code of `capturer` |release|:
+
+.. contents::
+ :local:
+
+:mod:`capturer`
+---------------
+
+.. automodule:: capturer
+ :members:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/docs/changelog.rst
new/capturer-3.0/docs/changelog.rst
--- old/capturer-2.4/docs/changelog.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/capturer-3.0/docs/changelog.rst 2020-03-07 01:34:03.000000000 +0100
@@ -0,0 +1 @@
+.. include:: ../CHANGELOG.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/docs/conf.py
new/capturer-3.0/docs/conf.py
--- old/capturer-2.4/docs/conf.py 1970-01-01 01:00:00.000000000 +0100
+++ new/capturer-3.0/docs/conf.py 2020-03-07 01:34:03.000000000 +0100
@@ -0,0 +1,79 @@
+# Easily capture stdout/stderr of the current process and subprocesses.
+#
+# Author: Peter Odding <[email protected]>
+# Last Change: March 7, 2020
+# URL: https://capturer.readthedocs.io
+
+"""Sphinx documentation configuration for the `capturer` project."""
+
+import os
+import sys
+
+# Add the capturer source distribution's root directory to the module path.
+sys.path.insert(0, os.path.abspath('..'))
+
+# -- General configuration
-----------------------------------------------------
+
+# Sphinx extension module names.
+extensions = [
+ 'sphinx.ext.autodoc',
+ 'sphinx.ext.intersphinx',
+ 'sphinx.ext.viewcode',
+ 'humanfriendly.sphinx',
+]
+
+# Paths that contain templates, relative to this directory.
+templates_path = ['templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = 'capturer'
+copyright = '2020, Peter Odding'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+
+# Find the package version and make it the release.
+from capturer import __version__ as capturer_version # NOQA
+
+# The short X.Y version.
+version = '.'.join(capturer_version.split('.')[:2])
+
+# The full version, including alpha/beta/rc tags.
+release = capturer_version
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+language = 'en'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['build']
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+add_function_parentheses = True
+
+# http://sphinx-doc.org/ext/autodoc.html#confval-autodoc_member_order
+autodoc_member_order = 'bysource'
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# Refer to the Python standard library.
+# From: http://twistedmatrix.com/trac/ticket/4582.
+intersphinx_mapping = dict(
+ humanfriendly=('https://humanfriendly.readthedocs.io/en/latest/', None),
+ python=('https://docs.python.org/2/', None),
+)
+
+# -- Options for HTML output
---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'nature'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/docs/index.rst
new/capturer-3.0/docs/index.rst
--- old/capturer-2.4/docs/index.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/capturer-3.0/docs/index.rst 2020-03-07 01:34:03.000000000 +0100
@@ -0,0 +1,32 @@
+capturer: Easily capture stdout/stderr of the current process and subprocesses
+==============================================================================
+
+Welcome to the documentation of `capturer` version |release|!
+The following sections are available:
+
+.. contents::
+ :local:
+
+User documentation
+------------------
+
+The readme is the best place to start reading:
+
+.. toctree::
+ readme.rst
+
+API documentation
+-----------------
+
+The following API documentation is automatically generated from the source
code:
+
+.. toctree::
+ api.rst
+
+Change log
+----------
+
+The change log lists notable changes to the project:
+
+.. toctree::
+ changelog.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/docs/readme.rst
new/capturer-3.0/docs/readme.rst
--- old/capturer-2.4/docs/readme.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/capturer-3.0/docs/readme.rst 2020-03-07 01:34:03.000000000 +0100
@@ -0,0 +1 @@
+.. include:: ../README.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/requirements-travis.txt
new/capturer-3.0/requirements-travis.txt
--- old/capturer-2.4/requirements-travis.txt 1970-01-01 01:00:00.000000000
+0100
+++ new/capturer-3.0/requirements-travis.txt 2020-03-07 01:34:03.000000000
+0100
@@ -0,0 +1,4 @@
+--requirement=requirements-checks.txt
+--requirement=requirements-tests.txt
+--requirement=requirements.txt
+coveralls
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/requirements.txt
new/capturer-3.0/requirements.txt
--- old/capturer-2.4/requirements.txt 2017-02-17 02:46:43.000000000 +0100
+++ new/capturer-3.0/requirements.txt 2020-03-07 01:34:03.000000000 +0100
@@ -1 +1 @@
-humanfriendly >= 2.1
+humanfriendly >= 8.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/capturer-2.4/setup.py new/capturer-3.0/setup.py
--- old/capturer-2.4/setup.py 2017-05-17 02:21:36.000000000 +0200
+++ new/capturer-3.0/setup.py 2020-03-07 01:34:03.000000000 +0100
@@ -1,9 +1,9 @@
#!/usr/bin/env python
-# Setup script for the `capturer' package.
+# Setup script for the 'capturer' package.
#
# Author: Peter Odding <[email protected]>
-# Last Change: May 17, 2017
+# Last Change: March 7, 2020
# URL: https://capturer.readthedocs.io
"""
@@ -30,15 +30,15 @@
def get_contents(*args):
"""Get the contents of a file relative to the source distribution
directory."""
- with codecs.open(get_absolute_path(*args), 'r', 'UTF-8') as handle:
+ with codecs.open(get_absolute_path(*args), "r", "UTF-8") as handle:
return handle.read()
def get_version(*args):
"""Extract the version number from a Python module."""
contents = get_contents(*args)
- metadata = dict(re.findall('__([a-z]+)__ = [\'"]([^\'"]+)', contents))
- return metadata['version']
+ metadata = dict(re.findall("__([a-z]+)__ = ['\"]([^'\"]+)", contents))
+ return metadata["version"]
def get_requirements(*args):
@@ -47,10 +47,10 @@
with open(get_absolute_path(*args)) as handle:
for line in handle:
# Strip comments.
- line = re.sub(r'^#.*|\s#.*', '', line)
+ line = re.sub(r"^#.*|\s#.*", "", line)
# Ignore empty lines
if line and not line.isspace():
- requirements.add(re.sub(r'\s+', '', line))
+ requirements.add(re.sub(r"\s+", "", line))
return sorted(requirements)
@@ -60,44 +60,48 @@
setup(
- name='capturer',
- version=get_version('capturer', '__init__.py'),
+ name="capturer",
+ version=get_version("capturer", "__init__.py"),
description="Easily capture stdout/stderr of the current process and
subprocesses",
- long_description=get_contents('README.rst'),
- url='https://capturer.readthedocs.io',
+ long_description=get_contents("README.rst"),
+ url="https://capturer.readthedocs.io",
author="Peter Odding",
- author_email='[email protected]',
+ author_email="[email protected]",
+ license="MIT",
packages=find_packages(),
- test_suite='capturer.tests',
- install_requires=get_requirements('requirements.txt'),
+ test_suite="capturer.tests",
+ install_requires=get_requirements("requirements.txt"),
+ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
classifiers=[
- 'Development Status :: 4 - Beta',
- 'Environment :: Console',
- 'Intended Audience :: Developers',
- 'Intended Audience :: Information Technology',
- 'Intended Audience :: System Administrators',
- 'License :: OSI Approved :: MIT License',
- 'Operating System :: POSIX',
- 'Operating System :: Unix',
- 'Natural Language :: English',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.6',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: Implementation :: CPython',
- 'Programming Language :: Python :: Implementation :: PyPy',
- 'Topic :: Communications',
- 'Topic :: Scientific/Engineering :: Human Machine Interfaces',
- 'Topic :: Software Development',
- 'Topic :: Software Development :: Libraries :: Python Modules',
- 'Topic :: Software Development :: User Interfaces',
- 'Topic :: System :: Shells',
- 'Topic :: System :: System Shells',
- 'Topic :: System :: Systems Administration',
- 'Topic :: Terminals',
- 'Topic :: Text Processing :: General',
- ])
+ "Development Status :: 4 - Beta",
+ "Environment :: Console",
+ "Intended Audience :: Developers",
+ "Intended Audience :: Information Technology",
+ "Intended Audience :: System Administrators",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: POSIX",
+ "Operating System :: Unix",
+ "Natural Language :: English",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: Implementation :: CPython",
+ "Programming Language :: Python :: Implementation :: PyPy",
+ "Topic :: Communications",
+ "Topic :: Scientific/Engineering :: Human Machine Interfaces",
+ "Topic :: Software Development",
+ "Topic :: Software Development :: Libraries",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Topic :: Software Development :: User Interfaces",
+ "Topic :: System :: Shells",
+ "Topic :: System :: System Shells",
+ "Topic :: System :: Systems Administration",
+ "Topic :: Terminals",
+ "Topic :: Text Processing :: General",
+ ],
+)