Hello community,

here is the log from the commit of package python-humanfriendly for 
openSUSE:Factory checked in at 2019-02-25 17:48:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-humanfriendly (Old)
 and      /work/SRC/openSUSE:Factory/.python-humanfriendly.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-humanfriendly"

Mon Feb 25 17:48:50 2019 rev:8 rq:670326 version:4.17

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-humanfriendly/python-humanfriendly.changes    
    2018-08-31 10:45:05.563249223 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-humanfriendly.new.28833/python-humanfriendly.changes
     2019-02-25 17:48:55.602819548 +0100
@@ -1,0 +2,6 @@
+Thu Jan 31 11:32:14 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 4.17:
+  * compatibility with python 3.7
+
+-------------------------------------------------------------------

Old:
----
  humanfriendly-4.16.1.tar.gz

New:
----
  humanfriendly-4.17.tar.gz

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

Other differences:
------------------
++++++ python-humanfriendly.spec ++++++
--- /var/tmp/diff_new_pack.iDq5H6/_old  2019-02-25 17:48:56.202819301 +0100
+++ /var/tmp/diff_new_pack.iDq5H6/_new  2019-02-25 17:48:56.206819300 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-humanfriendly
 #
-# 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
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -28,7 +28,7 @@
 %else
 Name:           python-humanfriendly
 %endif
-Version:        4.16.1
+Version:        4.17
 Release:        0
 Summary:        Human friendly input/output for text interfaces using Python
 License:        MIT

++++++ humanfriendly-4.16.1.tar.gz -> humanfriendly-4.17.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/CHANGELOG.rst 
new/humanfriendly-4.17/CHANGELOG.rst
--- old/humanfriendly-4.16.1/CHANGELOG.rst      2018-07-21 22:28:58.000000000 
+0200
+++ new/humanfriendly-4.17/CHANGELOG.rst        2018-10-20 07:21:01.000000000 
+0200
@@ -11,6 +11,24 @@
 .. _Keep a Changelog: http://keepachangelog.com/
 .. _semantic versioning: http://semver.org/
 
+`Release 4.17`_ (2018-10-20)
+----------------------------
+
+- Add Python 3.7 to versions tested on Travis CI and using ``tox`` and document
+  compatibility with Python 3.7.
+
+- Add rudimentary caching decorator for functions:
+
+  Over the years I've used several variations on this function in multiple
+  projects and I'd like to consolidate all of those implementations into a
+  single one that's properly tested and documented.
+
+  Due to the simplicity and lack of external dependencies it seemed kind of
+  fitting to include this in the ``humanfriendly`` package, which has become
+  a form of extended standard library for my Python projects 😇.
+
+.. _Release 4.17: 
https://github.com/xolox/python-humanfriendly/compare/4.16.1...4.17
+
 `Release 4.16.1`_ (2018-07-21)
 ------------------------------
 
@@ -61,9 +79,9 @@
 ``<b>`` for bold, ``<i>`` for italic, ``<u>`` for underline, ``<span>`` for
 colors, etc. to text with ANSI escape sequences.
 
-I'm still working on that awesome new project, this functionality was born
-there but seemed like a useful addition to the ``humanfriendly`` package, given
-the flexibility that this provides 😇.
+I'm still working on that awesome new project (update: see chat-archive_), this
+functionality was born there but seemed like a useful addition to the
+``humanfriendly`` package, given the flexibility that this provides 😇.
 
 .. _Release 4.15: 
https://github.com/xolox/python-humanfriendly/compare/4.14...4.15
 
@@ -80,12 +98,13 @@
 
 Support for *italic* text rendering on the terminal.
 
-I'm working on an awesome new project that's almost ready to publish, but then
-I noticed that I couldn't render italic text on the terminal using the
-humanfriendly package. I checked and sure enough my terminal supported it just
-fine, so I didn't see any reason not to fix this now 😇.
+I'm working on an awesome new project (update: see chat-archive_) that's almost
+ready to publish, but then I noticed that I couldn't render italic text on the
+terminal using the humanfriendly package. I checked and sure enough my terminal
+supported it just fine, so I didn't see any reason not to fix this now 😇.
 
 .. _Release 4.13: 
https://github.com/xolox/python-humanfriendly/compare/4.12.1...4.13
+.. _chat-archive: https://chat-archive.readthedocs.io/
 
 `Release 4.12.1`_ (2018-05-10)
 ------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/PKG-INFO 
new/humanfriendly-4.17/PKG-INFO
--- old/humanfriendly-4.16.1/PKG-INFO   2018-07-21 22:29:08.000000000 +0200
+++ new/humanfriendly-4.17/PKG-INFO     2018-10-20 07:21:14.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: humanfriendly
-Version: 4.16.1
+Version: 4.17
 Summary: Human friendly output for text interfaces using Python
 Home-page: https://humanfriendly.readthedocs.io
 Author: Peter Odding
@@ -32,8 +32,8 @@
           size.
         
         The `humanfriendly` package is currently tested on Python 2.6, 2.7, 
3.4, 3.5,
-        3.6 and PyPy (2.7) on Linux and Mac OS X. While the intention is to 
support
-        Windows as well, you may encounter some rough edges.
+        3.6, 3.7 and PyPy (2.7) on Linux and Mac OS X. While the intention is 
to
+        support Windows as well, you may encounter some rough edges.
         
         .. contents::
            :local:
@@ -175,6 +175,7 @@
 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 :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Communications
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/README.rst 
new/humanfriendly-4.17/README.rst
--- old/humanfriendly-4.16.1/README.rst 2018-05-10 11:56:00.000000000 +0200
+++ new/humanfriendly-4.17/README.rst   2018-10-20 07:21:01.000000000 +0200
@@ -24,8 +24,8 @@
   size.
 
 The `humanfriendly` package is currently tested on Python 2.6, 2.7, 3.4, 3.5,
-3.6 and PyPy (2.7) on Linux and Mac OS X. While the intention is to support
-Windows as well, you may encounter some rough edges.
+3.6, 3.7 and PyPy (2.7) on Linux and Mac OS X. While the intention is to
+support Windows as well, you may encounter some rough edges.
 
 .. contents::
    :local:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/constraints.txt 
new/humanfriendly-4.17/constraints.txt
--- old/humanfriendly-4.16.1/constraints.txt    1970-01-01 01:00:00.000000000 
+0100
+++ new/humanfriendly-4.17/constraints.txt      2018-10-20 07:21:01.000000000 
+0200
@@ -0,0 +1,29 @@
+# This is a pip constraints file that is used to preserve Python 2.6
+# compatibility (on Travis CI). Why I'm still doing that in 2018 is
+# a good question, maybe simply to prove that I can :-P.
+
+# flake8 3.0.0 drops explicit support for Python 2.6:
+# http://flake8.pycqa.org/en/latest/release-notes/3.0.0.html
+flake8 < 3.0.0 ; python_version < '2.7'
+
+# flake8-docstrings 1.0.0 switches from pep257 to pydocstyle and I haven't been
+# able to find a combination of versions of flake8-docstrings and pydocstyle
+# that actually works on Python 2.6. Here's the changelog:
+# https://gitlab.com/pycqa/flake8-docstrings/blob/master/HISTORY.rst
+flake8-docstrings < 1.0.0 ; python_version < '2.7'
+
+# pyflakes 2.0.0 drops Python 2.6 compatibility:
+# https://github.com/PyCQA/pyflakes/blob/master/NEWS.txt
+pyflakes < 2.0.0 ; python_version < '2.7'
+
+# pytest 3.3 drops Python 2.6 compatibility:
+# https://docs.pytest.org/en/latest/changelog.html#pytest-3-3-0-2017-11-23
+pytest < 3.3 ; python_version < '2.7'
+
+# attrs 16.0.0 (used by pytest) drops Python 2.6 compatibility:
+# http://www.attrs.org/en/stable/changelog.html
+attrs < 16.0.0 ; python_version < '2.7'
+
+# pycparser < 2.19 drops Python 2.6 compatibility:
+# https://github.com/eliben/pycparser/blob/master/CHANGES
+pycparser < 2.19 ; python_version < '2.7'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/docs/api.rst 
new/humanfriendly-4.17/docs/api.rst
--- old/humanfriendly-4.16.1/docs/api.rst       2018-05-10 11:56:00.000000000 
+0200
+++ new/humanfriendly-4.17/docs/api.rst 2018-10-20 07:21:01.000000000 +0200
@@ -46,6 +46,12 @@
 .. automodule:: humanfriendly.compat
    :members:
 
+The :mod:`humanfriendly.decorators` module
+------------------------------------------
+
+.. automodule:: humanfriendly.decorators
+   :members:
+
 The :mod:`humanfriendly.prompts` module
 ---------------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/humanfriendly/__init__.py 
new/humanfriendly-4.17/humanfriendly/__init__.py
--- old/humanfriendly-4.16.1/humanfriendly/__init__.py  2018-07-21 
22:28:58.000000000 +0200
+++ new/humanfriendly-4.17/humanfriendly/__init__.py    2018-10-20 
07:21:01.000000000 +0200
@@ -1,7 +1,7 @@
 # Human friendly input/output in Python.
 #
 # Author: Peter Odding <[email protected]>
-# Last Change: July 21, 2018
+# Last Change: October 20, 2018
 # URL: https://humanfriendly.readthedocs.io
 
 """The main module of the `humanfriendly` package."""
@@ -40,7 +40,7 @@
 from humanfriendly.compat import is_string, monotonic
 
 # Semi-standard module versioning.
-__version__ = '4.16.1'
+__version__ = '4.17'
 
 # Spinners are redrawn at most this many seconds.
 minimum_spinner_interval = 0.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/humanfriendly/decorators.py 
new/humanfriendly-4.17/humanfriendly/decorators.py
--- old/humanfriendly-4.16.1/humanfriendly/decorators.py        1970-01-01 
01:00:00.000000000 +0100
+++ new/humanfriendly-4.17/humanfriendly/decorators.py  2018-10-20 
07:21:01.000000000 +0200
@@ -0,0 +1,40 @@
+# Human friendly input/output in Python.
+#
+# Author: Peter Odding <[email protected]>
+# Last Change: October 20, 2018
+# URL: https://humanfriendly.readthedocs.io
+
+"""Simple function decorators to make Python programming easier."""
+
+# Public identifiers that require documentation.
+__all__ = ('RESULTS_ATTRIBUTE', 'cached')
+
+RESULTS_ATTRIBUTE = 'cached_results'
+"""The name of the property used to cache the return values of functions (a 
string)."""
+
+
+def cached(function):
+    """
+    Rudimentary caching decorator for functions.
+
+    :param function: The function whose return value should be cached.
+    :returns: The decorated function.
+
+    The given function will only be called once, the first time the wrapper
+    function is called. The return value is cached by the wrapper function as
+    an attribute of the given function and returned on each subsequent call.
+
+    .. note:: Currently no function arguments are supported because only a
+              single return value can be cached. Accepting any function
+              arguments at all would imply that the cache is parametrized on
+              function arguments, which is not currently the case.
+    """
+    def wrapper():
+        try:
+            return getattr(wrapper, RESULTS_ATTRIBUTE)
+        except AttributeError:
+            result = function()
+            setattr(wrapper, RESULTS_ATTRIBUTE, result)
+            return result
+    wrapper.__doc__ = function.__doc__
+    return wrapper
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/humanfriendly/terminal.py 
new/humanfriendly-4.17/humanfriendly/terminal.py
--- old/humanfriendly-4.16.1/humanfriendly/terminal.py  2018-07-21 
22:28:58.000000000 +0200
+++ new/humanfriendly-4.17/humanfriendly/terminal.py    2018-08-02 
19:35:18.000000000 +0200
@@ -1,7 +1,7 @@
 # Human friendly input/output in Python.
 #
 # Author: Peter Odding <[email protected]>
-# Last Change: July 21, 2018
+# Last Change: August 2, 2018
 # URL: https://humanfriendly.readthedocs.io
 
 """
@@ -719,6 +719,14 @@
       a performance standpoint to re-use an existing :class:`HTMLConverter`
       object for unrelated HTML fragments, in this case take a look at the
       :func:`__call__()` method (it makes this use case very easy).
+
+    .. versionadded:: 4.15
+       :class:`humanfriendly.terminal.HTMLConverter` was added to the
+       `humanfriendly` package during the initial development of my new
+       `chat-archive <https://chat-archive.readthedocs.io/>`_ project, whose
+       command line interface makes for a great demonstration of the
+       flexibility that this feature provides (hint: check out how the search
+       keyword highlighting combines with the regular highlighting).
     """
 
     BLOCK_TAGS = ('div', 'p', 'pre')
@@ -730,10 +738,9 @@
 
         :param callback: Optional keyword argument to specify a function that
                          will be called to process text fragments before they
-                         are emitted on the output stream.
-
-                         Note that link text and preformatted text fragments
-                         are not processed by this callback.
+                         are emitted on the output stream. Note that link text
+                         and preformatted text fragments are not processed by
+                         this callback.
         :param output: Optional keyword argument to redirect the output to the
                        given file-like object. If this is not given a new
                        :class:`python3:~io.StringIO` object is created.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/humanfriendly/tests.py 
new/humanfriendly-4.17/humanfriendly/tests.py
--- old/humanfriendly-4.16.1/humanfriendly/tests.py     2018-07-21 
22:28:58.000000000 +0200
+++ new/humanfriendly-4.17/humanfriendly/tests.py       2018-10-20 
07:21:01.000000000 +0200
@@ -4,7 +4,7 @@
 # Tests for the `humanfriendly' package.
 #
 # Author: Peter Odding <[email protected]>
-# Last Change: July 21, 2018
+# Last Change: October 20, 2018
 # URL: https://humanfriendly.readthedocs.io
 
 """Test suite for the `humanfriendly` package."""
@@ -25,6 +25,7 @@
 from humanfriendly import coerce_pattern, compact, dedent, trim_empty_lines
 from humanfriendly.cli import main
 from humanfriendly.compat import StringIO
+from humanfriendly.decorators import cached
 from humanfriendly.prompts import (
     TooManyInvalidReplies,
     prompt_for_confirmation,
@@ -205,6 +206,16 @@
         self.assertEqual(returncode, 0)
         self.assertEqual(output, expected_output)
 
+    def test_caching_decorator(self):
+        """Test the caching decorator."""
+        # Confirm that the caching decorator works.
+        a = cached(lambda: random.random())
+        b = cached(lambda: random.random())
+        assert a() == a()
+        assert b() == b()
+        # Confirm that functions have their own cache.
+        assert a() != b()
+
     def test_compact(self):
         """Test :func:`humanfriendly.text.compact()`."""
         assert compact(' a \n\n b ') == 'a b'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/humanfriendly.egg-info/PKG-INFO 
new/humanfriendly-4.17/humanfriendly.egg-info/PKG-INFO
--- old/humanfriendly-4.16.1/humanfriendly.egg-info/PKG-INFO    2018-07-21 
22:29:08.000000000 +0200
+++ new/humanfriendly-4.17/humanfriendly.egg-info/PKG-INFO      2018-10-20 
07:21:14.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: humanfriendly
-Version: 4.16.1
+Version: 4.17
 Summary: Human friendly output for text interfaces using Python
 Home-page: https://humanfriendly.readthedocs.io
 Author: Peter Odding
@@ -32,8 +32,8 @@
           size.
         
         The `humanfriendly` package is currently tested on Python 2.6, 2.7, 
3.4, 3.5,
-        3.6 and PyPy (2.7) on Linux and Mac OS X. While the intention is to 
support
-        Windows as well, you may encounter some rough edges.
+        3.6, 3.7 and PyPy (2.7) on Linux and Mac OS X. While the intention is 
to
+        support Windows as well, you may encounter some rough edges.
         
         .. contents::
            :local:
@@ -175,6 +175,7 @@
 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 :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Communications
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/humanfriendly-4.16.1/humanfriendly.egg-info/SOURCES.txt 
new/humanfriendly-4.17/humanfriendly.egg-info/SOURCES.txt
--- old/humanfriendly-4.16.1/humanfriendly.egg-info/SOURCES.txt 2018-07-21 
22:29:08.000000000 +0200
+++ new/humanfriendly-4.17/humanfriendly.egg-info/SOURCES.txt   2018-10-20 
07:21:14.000000000 +0200
@@ -2,8 +2,10 @@
 LICENSE.txt
 MANIFEST.in
 README.rst
+constraints.txt
 requirements-checks.txt
 requirements-tests.txt
+requirements-travis.txt
 setup.cfg
 setup.py
 docs/api.rst
@@ -20,6 +22,7 @@
 humanfriendly/__init__.py
 humanfriendly/cli.py
 humanfriendly/compat.py
+humanfriendly/decorators.py
 humanfriendly/prompts.py
 humanfriendly/sphinx.py
 humanfriendly/tables.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/requirements-tests.txt 
new/humanfriendly-4.17/requirements-tests.txt
--- old/humanfriendly-4.16.1/requirements-tests.txt     2018-01-04 
13:06:45.000000000 +0100
+++ new/humanfriendly-4.17/requirements-tests.txt       2018-10-20 
07:21:01.000000000 +0200
@@ -1,9 +1,5 @@
 # Test suite requirements.
 capturer >= 2.1
 coloredlogs >= 2.0
-pytest >= 3.0.7 ; python_version > '2.6'
+pytest >= 3.0.7
 pytest-cov >= 2.4.0
-
-# pytest release 3.3 drops Python 2.6 compatibility:
-# https://docs.pytest.org/en/latest/changelog.html#pytest-3-3-0-2017-11-23
-pytest < 3.3 ; python_version < '2.7'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/requirements-travis.txt 
new/humanfriendly-4.17/requirements-travis.txt
--- old/humanfriendly-4.16.1/requirements-travis.txt    1970-01-01 
01:00:00.000000000 +0100
+++ new/humanfriendly-4.17/requirements-travis.txt      2018-10-20 
07:21:01.000000000 +0200
@@ -0,0 +1,3 @@
+--requirement=requirements-checks.txt
+--requirement=requirements-tests.txt
+coveralls
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/humanfriendly-4.16.1/setup.py 
new/humanfriendly-4.17/setup.py
--- old/humanfriendly-4.16.1/setup.py   2018-04-26 01:11:27.000000000 +0200
+++ new/humanfriendly-4.17/setup.py     2018-10-20 07:21:01.000000000 +0200
@@ -3,7 +3,7 @@
 # Setup script for the `humanfriendly' package.
 #
 # Author: Peter Odding <[email protected]>
-# Last Change: April 26, 2018
+# Last Change: October 20, 2018
 # URL: https://humanfriendly.readthedocs.io
 
 """
@@ -136,6 +136,7 @@
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
         'Programming Language :: Python :: Implementation :: CPython',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Topic :: Communications',


Reply via email to