Hello community, here is the log from the commit of package python-humanfriendly for openSUSE:Factory checked in at 2019-03-13 09:14:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-humanfriendly (Old) and /work/SRC/openSUSE:Factory/.python-humanfriendly.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-humanfriendly" Wed Mar 13 09:14:40 2019 rev:9 rq:684406 version:4.18 Changes: -------- --- /work/SRC/openSUSE:Factory/python-humanfriendly/python-humanfriendly.changes 2019-02-25 17:48:55.602819548 +0100 +++ /work/SRC/openSUSE:Factory/.python-humanfriendly.new.28833/python-humanfriendly.changes 2019-03-13 09:14:44.575389751 +0100 @@ -1,0 +2,7 @@ +Tue Mar 12 16:03:38 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 4.18: + * Added humanfriendly.text.generate_slug() function. + * Fixed "invalid escape sequence" DeprecationWarning (pointed out by Python >= 3.6). + +------------------------------------------------------------------- Old: ---- humanfriendly-4.17.tar.gz New: ---- humanfriendly-4.18.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-humanfriendly.spec ++++++ --- /var/tmp/diff_new_pack.JrLaQ5/_old 2019-03-13 09:14:46.967389504 +0100 +++ /var/tmp/diff_new_pack.JrLaQ5/_new 2019-03-13 09:14:47.003389501 +0100 @@ -28,7 +28,7 @@ %else Name: python-humanfriendly %endif -Version: 4.17 +Version: 4.18 Release: 0 Summary: Human friendly input/output for text interfaces using Python License: MIT ++++++ humanfriendly-4.17.tar.gz -> humanfriendly-4.18.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/humanfriendly-4.17/CHANGELOG.rst new/humanfriendly-4.18/CHANGELOG.rst --- old/humanfriendly-4.17/CHANGELOG.rst 2018-10-20 07:21:01.000000000 +0200 +++ new/humanfriendly-4.18/CHANGELOG.rst 2019-02-21 21:22:00.000000000 +0100 @@ -11,6 +11,19 @@ .. _Keep a Changelog: http://keepachangelog.com/ .. _semantic versioning: http://semver.org/ +`Release 4.18`_ (2019-02-21) +---------------------------- + +- Added ``humanfriendly.text.generate_slug()`` function. + +- Fixed "invalid escape sequence" DeprecationWarning (pointed out by Python >= 3.6). + +- Fought Travis CI (for way too long) in order to restore Python 2.6, 2.7, 3.4, + 3.5, 3.6 and 3.7 compatibility in the Travis CI configuration (unrelated to + the ``humanfriendly`` package itself). + +.. _Release 4.18: https://github.com/xolox/python-humanfriendly/compare/4.17...4.18 + `Release 4.17`_ (2018-10-20) ---------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/humanfriendly-4.17/PKG-INFO new/humanfriendly-4.18/PKG-INFO --- old/humanfriendly-4.17/PKG-INFO 2018-10-20 07:21:14.000000000 +0200 +++ new/humanfriendly-4.18/PKG-INFO 2019-02-21 21:22:20.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: humanfriendly -Version: 4.17 +Version: 4.18 Summary: Human friendly output for text interfaces using Python Home-page: https://humanfriendly.readthedocs.io Author: Peter Odding diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/humanfriendly-4.17/constraints.txt new/humanfriendly-4.18/constraints.txt --- old/humanfriendly-4.17/constraints.txt 2018-10-20 07:21:01.000000000 +0200 +++ new/humanfriendly-4.18/constraints.txt 2019-02-21 21:22:00.000000000 +0100 @@ -20,6 +20,10 @@ # https://docs.pytest.org/en/latest/changelog.html#pytest-3-3-0-2017-11-23 pytest < 3.3 ; python_version < '2.7' +# pytest-cov 2.6.0 drops Python 3.4 compatibility: +# https://pytest-cov.readthedocs.io/en/latest/changelog.html +pytest-cov < 2.6.0 ; python_version < '3.5' + # 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' @@ -27,3 +31,6 @@ # pycparser < 2.19 drops Python 2.6 compatibility: # https://github.com/eliben/pycparser/blob/master/CHANGES pycparser < 2.19 ; python_version < '2.7' + +# idna 2.8 drops Python 2.6 compatibility (not documented). +idna < 2.8 ; python_version < '2.7' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/humanfriendly-4.17/humanfriendly/__init__.py new/humanfriendly-4.18/humanfriendly/__init__.py --- old/humanfriendly-4.17/humanfriendly/__init__.py 2018-10-20 07:21:01.000000000 +0200 +++ new/humanfriendly-4.18/humanfriendly/__init__.py 2019-02-21 21:22:00.000000000 +0100 @@ -1,7 +1,7 @@ # Human friendly input/output in Python. # # Author: Peter Odding <pe...@peterodding.com> -# Last Change: October 20, 2018 +# Last Change: February 21, 2019 # 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.17' +__version__ = '4.18' # Spinners are redrawn at most this many seconds. minimum_spinner_interval = 0.2 @@ -391,7 +391,7 @@ text = '%.2f' % float(count) if not keep_width: text = re.sub('0+$', '', text) - text = re.sub('\.$', '', text) + text = re.sub(r'\.$', '', text) return text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/humanfriendly-4.17/humanfriendly/tests.py new/humanfriendly-4.18/humanfriendly/tests.py --- old/humanfriendly-4.17/humanfriendly/tests.py 2018-10-20 07:21:01.000000000 +0200 +++ new/humanfriendly-4.18/humanfriendly/tests.py 2019-02-21 21:22:00.000000000 +0100 @@ -4,7 +4,7 @@ # Tests for the `humanfriendly' package. # # Author: Peter Odding <peter.odd...@paylogic.eu> -# Last Change: October 20, 2018 +# Last Change: February 21, 2019 # URL: https://humanfriendly.readthedocs.io """Test suite for the `humanfriendly` package.""" @@ -73,7 +73,7 @@ run_cli, touch, ) -from humanfriendly.text import compact_empty_lines, random_string +from humanfriendly.text import compact_empty_lines, generate_slug, random_string from humanfriendly.usage import ( find_meta_variables, format_usage, @@ -258,6 +258,16 @@ self.assertEqual('1 box', humanfriendly.pluralize(1, 'box', 'boxes')) self.assertEqual('2 boxes', humanfriendly.pluralize(2, 'box', 'boxes')) + def test_generate_slug(self): + """Test :func:`humanfriendly.text.generate_slug()`.""" + # Test the basic functionality. + self.assertEqual('some-random-text', generate_slug('Some Random Text!')) + # Test that previous output doesn't change. + self.assertEqual('some-random-text', generate_slug('some-random-text')) + # Test that inputs which can't be converted to a slug raise an exception. + self.assertRaises(ValueError, generate_slug, ' ') + self.assertRaises(ValueError, generate_slug, '-') + def test_boolean_coercion(self): """Test :func:`humanfriendly.coerce_boolean()`.""" for value in [True, 'TRUE', 'True', 'true', 'on', 'yes', '1']: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/humanfriendly-4.17/humanfriendly/text.py new/humanfriendly-4.18/humanfriendly/text.py --- old/humanfriendly-4.17/humanfriendly/text.py 2018-07-21 12:53:15.000000000 +0200 +++ new/humanfriendly-4.18/humanfriendly/text.py 2019-02-21 21:22:00.000000000 +0100 @@ -1,7 +1,7 @@ # Human friendly input/output in Python. # # Author: Peter Odding <pe...@peterodding.com> -# Last Change: July 21, 2018 +# Last Change: February 21, 2019 # URL: https://humanfriendly.readthedocs.io """ @@ -223,6 +223,27 @@ return text +def generate_slug(text, delimiter="-"): + """ + Convert text to a normalized "slug" without whitespace. + + :param text: The original text, for example ``Some Random Text!``. + :param delimiter: The delimiter used to separate words + (defaults to the ``-`` character). + :returns: The slug text, for example ``some-random-text``. + :raises: :exc:`~exceptions.ValueError` when the provided + text is nonempty but results in an empty slug. + """ + slug = text.lower() + escaped = delimiter.replace("\\", "\\\\") + slug = re.sub("[^a-z0-9]+", escaped, slug) + slug = slug.strip(delimiter) + if text and not slug: + msg = "The provided text %r results in an empty slug!" + raise ValueError(format(msg, text)) + return slug + + def is_empty_line(text): """ Check if a text is empty or contains only whitespace. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/humanfriendly-4.17/humanfriendly.egg-info/PKG-INFO new/humanfriendly-4.18/humanfriendly.egg-info/PKG-INFO --- old/humanfriendly-4.17/humanfriendly.egg-info/PKG-INFO 2018-10-20 07:21:14.000000000 +0200 +++ new/humanfriendly-4.18/humanfriendly.egg-info/PKG-INFO 2019-02-21 21:22:20.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: humanfriendly -Version: 4.17 +Version: 4.18 Summary: Human friendly output for text interfaces using Python Home-page: https://humanfriendly.readthedocs.io Author: Peter Odding