Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-jaraco.text for openSUSE:Factory checked in at 2022-07-05 12:26:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-jaraco.text (Old) and /work/SRC/openSUSE:Factory/.python-jaraco.text.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jaraco.text" Tue Jul 5 12:26:59 2022 rev:8 rq:986349 version:3.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-jaraco.text/python-jaraco.text.changes 2021-11-21 23:51:50.522318713 +0100 +++ /work/SRC/openSUSE:Factory/.python-jaraco.text.new.1548/python-jaraco.text.changes 2022-07-05 12:27:00.393829360 +0200 @@ -1,0 +2,8 @@ +Tue Jun 28 14:33:21 UTC 2022 - Adrian Schr??ter <adr...@suse.de> + +- Update to version 3.8.0: + * Added ``layouts`` module and ``to-qwerty`` and ``to-dvorak`` scripts. + * Introducing ``yield_lines``, ``drop_comment``, and ``join_continuation``. +- droping dependency to jaraco.base + +------------------------------------------------------------------- Old: ---- jaraco.text-3.6.0.tar.gz New: ---- jaraco.text-3.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-jaraco.text.spec ++++++ --- /var/tmp/diff_new_pack.XFH5xz/_old 2022-07-05 12:27:01.013830268 +0200 +++ /var/tmp/diff_new_pack.XFH5xz/_new 2022-07-05 12:27:01.021830280 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-jaraco.text # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,22 +19,25 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-jaraco.text -Version: 3.6.0 +Version: 3.8.0 Release: 0 Summary: Tools to work with text License: MIT URL: https://github.com/jaraco/jaraco.text Source0: https://files.pythonhosted.org/packages/source/j/jaraco.text/jaraco.text-%{version}.tar.gz BuildRequires: %{python_module importlib_resources} -BuildRequires: %{python_module jaraco.base >= 6.1} +BuildRequires: %{python_module jaraco.context} BuildRequires: %{python_module jaraco.functools} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest-black} +BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-importlib_resources -Requires: python-jaraco.base >= 6.1 +Requires: python-jaraco.context >= 4.1 Requires: python-jaraco.functools Requires: python-six BuildArch: noarch @@ -45,14 +48,12 @@ %prep %setup -q -n jaraco.text-%{version} -sed -i 's/--flake8 --black --cov//' pytest.ini -rm -rf jaraco.text.egg-info %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand install -Dm 0644 jaraco/text/*.txt %{buildroot}%{$python_sitelib}/jaraco/text/ %{python_expand rm -f %{buildroot}%{$python_sitelib}/jaraco/__init__.py* \ @@ -68,7 +69,6 @@ %files %{python_files} %license LICENSE %doc docs/*.rst README.rst CHANGES.rst -%{python_sitelib}/jaraco.text-%{version}-py*.egg-info %{python_sitelib}/jaraco* %changelog ++++++ jaraco.text-3.6.0.tar.gz -> jaraco.text-3.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/.github/workflows/main.yml new/jaraco.text-3.8.0/.github/workflows/main.yml --- old/jaraco.text-3.6.0/.github/workflows/main.yml 2021-10-31 17:06:24.000000000 +0100 +++ new/jaraco.text-3.8.0/.github/workflows/main.yml 2022-06-03 19:21:29.000000000 +0200 @@ -7,7 +7,7 @@ strategy: matrix: python: - - 3.6 + - 3.7 - 3.9 - "3.10" platform: @@ -27,8 +27,23 @@ - name: Run tests run: tox + check: # This job does nothing and is only used for the branch protection + if: always() + + needs: + - test + + runs-on: ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} + release: - needs: test + needs: + - check if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-latest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/.pre-commit-config.yaml new/jaraco.text-3.8.0/.pre-commit-config.yaml --- old/jaraco.text-3.6.0/.pre-commit-config.yaml 2021-10-31 17:06:24.000000000 +0100 +++ new/jaraco.text-3.8.0/.pre-commit-config.yaml 2022-06-03 19:21:29.000000000 +0200 @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.1.0 hooks: - id: black diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/CHANGES.rst new/jaraco.text-3.8.0/CHANGES.rst --- old/jaraco.text-3.6.0/CHANGES.rst 2021-10-31 17:06:24.000000000 +0100 +++ new/jaraco.text-3.8.0/CHANGES.rst 2022-06-03 19:21:29.000000000 +0200 @@ -1,3 +1,13 @@ +v3.8.0 +====== + +Added ``layouts`` module and ``to-qwerty`` and ``to-dvorak`` scripts. + +v3.7.0 +====== + +Introducing ``yield_lines``, ``drop_comment``, and ``join_continuation``. + v3.6.0 ====== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/PKG-INFO new/jaraco.text-3.8.0/PKG-INFO --- old/jaraco.text-3.6.0/PKG-INFO 2021-10-31 17:06:43.892615000 +0100 +++ new/jaraco.text-3.8.0/PKG-INFO 2022-06-03 19:21:59.957509800 +0200 @@ -1,18 +1,16 @@ Metadata-Version: 2.1 Name: jaraco.text -Version: 3.6.0 +Version: 3.8.0 Summary: Module for text manipulation Home-page: https://github.com/jaraco/jaraco.text Author: Jason R. Coombs Author-email: jar...@jaraco.com -License: UNKNOWN -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only -Requires-Python: >=3.6 +Requires-Python: >=3.7 Provides-Extra: testing Provides-Extra: docs License-File: LICENSE @@ -36,7 +34,18 @@ .. image:: https://readthedocs.org/projects/jaracotext/badge/?version=latest :target: https://jaracotext.readthedocs.io/en/latest/?badge=latest -.. image:: https://img.shields.io/badge/skeleton-2021-informational +.. image:: https://img.shields.io/badge/skeleton-2022-informational :target: https://blog.jaraco.com/skeleton +Layouts +======= + +One of the features of this package is the layouts module, which +provides a simple example of translating keystrokes from one keyboard +layout to another:: + + echo qwerty | python -m jaraco.text.to-dvorak + ',.pyf + echo "',.pyf" | python -m jaraco.text.to-qwerty + qwerty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/README.rst new/jaraco.text-3.8.0/README.rst --- old/jaraco.text-3.6.0/README.rst 2021-10-31 17:06:24.000000000 +0100 +++ new/jaraco.text-3.8.0/README.rst 2022-06-03 19:21:29.000000000 +0200 @@ -17,5 +17,18 @@ .. image:: https://readthedocs.org/projects/jaracotext/badge/?version=latest :target: https://jaracotext.readthedocs.io/en/latest/?badge=latest -.. image:: https://img.shields.io/badge/skeleton-2021-informational +.. image:: https://img.shields.io/badge/skeleton-2022-informational :target: https://blog.jaraco.com/skeleton + + +Layouts +======= + +One of the features of this package is the layouts module, which +provides a simple example of translating keystrokes from one keyboard +layout to another:: + + echo qwerty | python -m jaraco.text.to-dvorak + ',.pyf + echo "',.pyf" | python -m jaraco.text.to-qwerty + qwerty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/docs/index.rst new/jaraco.text-3.8.0/docs/index.rst --- old/jaraco.text-3.6.0/docs/index.rst 2021-10-31 17:06:24.000000000 +0100 +++ new/jaraco.text-3.8.0/docs/index.rst 2022-06-03 19:21:29.000000000 +0200 @@ -12,6 +12,11 @@ :undoc-members: :show-inheritance: +.. automodule:: jaraco.text.layouts + :members: + :undoc-members: + :show-inheritance: + Indices and tables ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/jaraco/text/__init__.py new/jaraco.text-3.8.0/jaraco/text/__init__.py --- old/jaraco.text-3.6.0/jaraco/text/__init__.py 2021-10-31 17:06:24.000000000 +0100 +++ new/jaraco.text-3.8.0/jaraco/text/__init__.py 2022-06-03 19:21:29.000000000 +0200 @@ -9,6 +9,7 @@ from importlib_resources import files # type: ignore from jaraco.functools import compose, method_cache +from jaraco.context import ExceptionTrap def substitution(old, new): @@ -128,6 +129,11 @@ return pattern.split(self, maxsplit) +# Python 3.8 compatibility +_unicode_trap = ExceptionTrap(UnicodeDecodeError) + + +@_unicode_trap.passes def is_decodable(value): r""" Return True if the supplied value is decodable (using the default @@ -138,14 +144,7 @@ >>> is_decodable(b'\x32') True """ - # TODO: This code could be expressed more consisely and directly - # with a jaraco.context.ExceptionTrap, but that adds an unfortunate - # long dependency tree, so for now, use boolean literals. - try: - value.decode() - except UnicodeDecodeError: - return False - return True + value.decode() def is_binary(value): @@ -370,10 +369,6 @@ result = WordSet(result) return result - # for compatibility with Python 2 - def __getslice__(self, i, j): # pragma: nocover - return self.__getitem__(slice(i, j)) - @classmethod def parse(cls, identifier): matches = cls._pattern.finditer(identifier) @@ -527,3 +522,79 @@ newlines = ['\r\n', '\r', '\n', '\u0085', '\u2028', '\u2029'] pattern = '|'.join(newlines) return re.sub(pattern, '\n', text) + + +def _nonblank(str): + return str and not str.startswith('#') + + +@functools.singledispatch +def yield_lines(iterable): + r""" + Yield valid lines of a string or iterable. + + >>> list(yield_lines('')) + [] + >>> list(yield_lines(['foo', 'bar'])) + ['foo', 'bar'] + >>> list(yield_lines('foo\nbar')) + ['foo', 'bar'] + >>> list(yield_lines('\nfoo\n#bar\nbaz #comment')) + ['foo', 'baz #comment'] + >>> list(yield_lines(['foo\nbar', 'baz', 'bing\n\n\n'])) + ['foo', 'bar', 'baz', 'bing'] + """ + return itertools.chain.from_iterable(map(yield_lines, iterable)) + + +@yield_lines.register(str) +def _(text): + return filter(_nonblank, map(str.strip, text.splitlines())) + + +def drop_comment(line): + """ + Drop comments. + + >>> drop_comment('foo # bar') + 'foo' + + A hash without a space may be in a URL. + + >>> drop_comment('http://example.com/foo#bar') + 'http://example.com/foo#bar' + """ + return line.partition(' #')[0] + + +def join_continuation(lines): + r""" + Join lines continued by a trailing backslash. + + >>> list(join_continuation(['foo \\', 'bar', 'baz'])) + ['foobar', 'baz'] + >>> list(join_continuation(['foo \\', 'bar', 'baz'])) + ['foobar', 'baz'] + >>> list(join_continuation(['foo \\', 'bar \\', 'baz'])) + ['foobarbaz'] + + Not sure why, but... + The character preceeding the backslash is also elided. + + >>> list(join_continuation(['goo\\', 'dly'])) + ['godly'] + + A terrible idea, but... + If no line is available to continue, suppress the lines. + + >>> list(join_continuation(['foo', 'bar\\', 'baz\\'])) + ['foo'] + """ + lines = iter(lines) + for item in lines: + while item.endswith('\\'): + try: + item = item[:-2].strip() + next(lines) + except StopIteration: + return + yield item diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/jaraco/text/layouts.py new/jaraco.text-3.8.0/jaraco/text/layouts.py --- old/jaraco.text-3.6.0/jaraco/text/layouts.py 1970-01-01 01:00:00.000000000 +0100 +++ new/jaraco.text-3.8.0/jaraco/text/layouts.py 2022-06-03 19:21:29.000000000 +0200 @@ -0,0 +1,25 @@ +qwerty = "-=qwertyuiop[]asdfghjkl;'zxcvbnm,./_+QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>?" +dvorak = "[]',.pyfgcrl/=aoeuidhtns-;qjkxbmwvz{}\"<>PYFGCRL?+AOEUIDHTNS_:QJKXBMWVZ" + + +to_dvorak = str.maketrans(qwerty, dvorak) +to_qwerty = str.maketrans(dvorak, qwerty) + + +def translate(input, translation): + """ + >>> translate('dvorak', to_dvorak) + 'ekrpat' + >>> translate('qwerty', to_qwerty) + 'x,dokt' + """ + return input.translate(translation) + + +def _translate_stream(stream, translation): + """ + >>> import io + >>> _translate_stream(io.StringIO('foo'), to_dvorak) + urr + """ + print(translate(stream.read(), translation)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/jaraco/text/to-dvorak.py new/jaraco.text-3.8.0/jaraco/text/to-dvorak.py --- old/jaraco.text-3.6.0/jaraco/text/to-dvorak.py 1970-01-01 01:00:00.000000000 +0100 +++ new/jaraco.text-3.8.0/jaraco/text/to-dvorak.py 2022-06-03 19:21:29.000000000 +0200 @@ -0,0 +1,6 @@ +import sys + +from . import layouts + + +__name__ == '__main__' and layouts._translate_stream(sys.stdin, layouts.to_dvorak) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/jaraco/text/to-qwerty.py new/jaraco.text-3.8.0/jaraco/text/to-qwerty.py --- old/jaraco.text-3.6.0/jaraco/text/to-qwerty.py 1970-01-01 01:00:00.000000000 +0100 +++ new/jaraco.text-3.8.0/jaraco/text/to-qwerty.py 2022-06-03 19:21:29.000000000 +0200 @@ -0,0 +1,6 @@ +import sys + +from . import layouts + + +__name__ == '__main__' and layouts._translate_stream(sys.stdin, layouts.to_qwerty) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/jaraco.text.egg-info/PKG-INFO new/jaraco.text-3.8.0/jaraco.text.egg-info/PKG-INFO --- old/jaraco.text-3.6.0/jaraco.text.egg-info/PKG-INFO 2021-10-31 17:06:43.000000000 +0100 +++ new/jaraco.text-3.8.0/jaraco.text.egg-info/PKG-INFO 2022-06-03 19:21:59.000000000 +0200 @@ -1,18 +1,16 @@ Metadata-Version: 2.1 Name: jaraco.text -Version: 3.6.0 +Version: 3.8.0 Summary: Module for text manipulation Home-page: https://github.com/jaraco/jaraco.text Author: Jason R. Coombs Author-email: jar...@jaraco.com -License: UNKNOWN -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only -Requires-Python: >=3.6 +Requires-Python: >=3.7 Provides-Extra: testing Provides-Extra: docs License-File: LICENSE @@ -36,7 +34,18 @@ .. image:: https://readthedocs.org/projects/jaracotext/badge/?version=latest :target: https://jaracotext.readthedocs.io/en/latest/?badge=latest -.. image:: https://img.shields.io/badge/skeleton-2021-informational +.. image:: https://img.shields.io/badge/skeleton-2022-informational :target: https://blog.jaraco.com/skeleton +Layouts +======= + +One of the features of this package is the layouts module, which +provides a simple example of translating keystrokes from one keyboard +layout to another:: + + echo qwerty | python -m jaraco.text.to-dvorak + ',.pyf + echo "',.pyf" | python -m jaraco.text.to-qwerty + qwerty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/jaraco.text.egg-info/SOURCES.txt new/jaraco.text-3.8.0/jaraco.text.egg-info/SOURCES.txt --- old/jaraco.text-3.6.0/jaraco.text.egg-info/SOURCES.txt 2021-10-31 17:06:43.000000000 +0100 +++ new/jaraco.text-3.8.0/jaraco.text.egg-info/SOURCES.txt 2022-06-03 19:21:59.000000000 +0200 @@ -10,7 +10,6 @@ pyproject.toml pytest.ini setup.cfg -setup.py tox.ini .github/dependabot.yml .github/workflows/main.yml @@ -23,4 +22,7 @@ jaraco.text.egg-info/requires.txt jaraco.text.egg-info/top_level.txt jaraco/text/Lorem ipsum.txt -jaraco/text/__init__.py \ No newline at end of file +jaraco/text/__init__.py +jaraco/text/layouts.py +jaraco/text/to-dvorak.py +jaraco/text/to-qwerty.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/jaraco.text.egg-info/requires.txt new/jaraco.text-3.8.0/jaraco.text.egg-info/requires.txt --- old/jaraco.text-3.6.0/jaraco.text.egg-info/requires.txt 2021-10-31 17:06:43.000000000 +0100 +++ new/jaraco.text-3.8.0/jaraco.text.egg-info/requires.txt 2022-06-03 19:21:59.000000000 +0200 @@ -1,11 +1,12 @@ jaraco.functools +jaraco.context>=4.1 [:python_version < "3.9"] importlib_resources [docs] sphinx -jaraco.packaging>=8.2 +jaraco.packaging>=9 rst.linker>=1.9 [testing] @@ -17,4 +18,4 @@ [testing:platform_python_implementation != "PyPy"] pytest-black>=0.3.7 -pytest-mypy +pytest-mypy>=0.9.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/pytest.ini new/jaraco.text-3.8.0/pytest.ini --- old/jaraco.text-3.6.0/pytest.ini 2021-10-31 17:06:24.000000000 +0100 +++ new/jaraco.text-3.8.0/pytest.ini 2022-06-03 19:21:29.000000000 +0200 @@ -5,5 +5,13 @@ filterwarnings= # Suppress deprecation warning in flake8 ignore:SelectableGroups dict interface is deprecated::flake8 - # Suppress deprecation warning in pypa/packaging#433 - ignore:The distutils package is deprecated::packaging.tags + + # shopkeep/pytest-black#55 + ignore:<class 'pytest_black.BlackItem'> is not using a cooperative constructor:pytest.PytestDeprecationWarning + ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestDeprecationWarning + ignore:BlackItem is an Item subclass and should not be a collector:pytest.PytestWarning + + # tholo/pytest-flake8#83 + ignore:<class 'pytest_flake8.Flake8Item'> is not using a cooperative constructor:pytest.PytestDeprecationWarning + ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestDeprecationWarning + ignore:Flake8Item is an Item subclass and should not be a collector:pytest.PytestWarning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/setup.cfg new/jaraco.text-3.8.0/setup.cfg --- old/jaraco.text-3.6.0/setup.cfg 2021-10-31 17:06:43.896615000 +0100 +++ new/jaraco.text-3.8.0/setup.cfg 2022-06-03 19:21:59.957509800 +0200 @@ -15,9 +15,10 @@ [options] packages = find_namespace: include_package_data = true -python_requires = >=3.6 +python_requires = >=3.7 install_requires = jaraco.functools + jaraco.context >= 4.1 importlib_resources; python_version < "3.9" [options.packages.find] @@ -35,12 +36,12 @@ pytest-black >= 0.3.7; \ python_implementation != "PyPy" pytest-cov - pytest-mypy; \ + pytest-mypy >= 0.9.1; \ python_implementation != "PyPy" pytest-enabler >= 1.0.1 docs = sphinx - jaraco.packaging >= 8.2 + jaraco.packaging >= 9 rst.linker >= 1.9 [options.entry_points] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.text-3.6.0/setup.py new/jaraco.text-3.8.0/setup.py --- old/jaraco.text-3.6.0/setup.py 2021-10-31 17:06:24.000000000 +0100 +++ new/jaraco.text-3.8.0/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -import setuptools - -if __name__ == "__main__": - setuptools.setup()