Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-ZConfig for openSUSE:Factory checked in at 2021-07-16 22:12:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ZConfig (Old) and /work/SRC/openSUSE:Factory/.python-ZConfig.new.2632 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ZConfig" Fri Jul 16 22:12:34 2021 rev:8 rq:905798 version:3.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ZConfig/python-ZConfig.changes 2019-11-29 15:55:46.929010747 +0100 +++ /work/SRC/openSUSE:Factory/.python-ZConfig.new.2632/python-ZConfig.changes 2021-07-16 22:13:03.826693848 +0200 @@ -1,0 +2,14 @@ +Sun Jul 11 19:18:44 UTC 2021 - Jason Craig <[email protected]> + +- Update to 3.6.0 + * Added support for Python 3.8, 3.9 and 3.10. This primarily + involves avoiding the new-in-3.8 validation of the format + string when using the ???safe-template??? format style, since + that???s not supported in the Python standard library. + * Added ZConfig.pygments module containing a lexer compatible + with the pygments library. Made discoverable via an entry + point; use zconfig as the highlight language for code-block + directives in Sphinx documents. +- Drop patch python-38-support.patch that was integrated upstream. + +------------------------------------------------------------------- Old: ---- ZConfig-3.5.0.tar.gz python-38-support.patch New: ---- ZConfig-3.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ZConfig.spec ++++++ --- /var/tmp/diff_new_pack.yvjswp/_old 2021-07-16 22:13:04.298690512 +0200 +++ /var/tmp/diff_new_pack.yvjswp/_new 2021-07-16 22:13:04.302690484 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-ZConfig # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,15 +18,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-ZConfig -Version: 3.5.0 +Version: 3.6.0 Release: 0 Summary: Structured Configuration Library License: ZPL-2.1 Group: Development/Libraries/Python URL: https://github.com/zopefoundation/ZConfig Source: https://files.pythonhosted.org/packages/source/Z/ZConfig/ZConfig-%{version}.tar.gz -# UPSTREAM PATCH (partial): gh#zopefoundation/ZConfig#70 -Patch0: python-38-support.patch # Testing requirements: BuildRequires: %{python_module docutils} BuildRequires: %{python_module manuel} @@ -36,7 +34,7 @@ BuildRequires: python-rpm-macros Requires: python-setuptools Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives BuildArch: noarch %python_subpackages @@ -66,7 +64,6 @@ %prep %setup -q -n ZConfig-%{version} -%autopatch -p1 rm -rf ZConfig.egg-info rm doc/make.bat # test works only in git repo ++++++ ZConfig-3.5.0.tar.gz -> ZConfig-3.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/.travis.yml new/ZConfig-3.6.0/.travis.yml --- old/ZConfig-3.5.0/.travis.yml 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/.travis.yml 2021-05-18 00:35:31.000000000 +0200 @@ -7,6 +7,8 @@ - 3.5 - 3.6 - 3.7 + - 3.8 + - 3.9 - pypy - pypy3 @@ -14,6 +16,7 @@ - pip install -U pip setuptools - pip install -U coverage coveralls - pip install -U flake8 + - pip install -U pygments - pip install -U -e .[test] script: - coverage run -m zope.testrunner --test-path=. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/CHANGES.rst new/ZConfig-3.6.0/CHANGES.rst --- old/ZConfig-3.5.0/CHANGES.rst 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/CHANGES.rst 2021-05-18 00:54:45.000000000 +0200 @@ -2,6 +2,20 @@ Change History for ZConfig ============================ +3.6.0 (2021-05-19) +================== + +- Added support for Python 3.8, 3.9 and 3.10. This primarily involves + avoiding the new-in-3.8 validation of the format string when using the + 'safe-template' format style, since that's not supported in the Python + standard library. + +- Added ``ZConfig.pygments`` module containing a lexer compatible with + the ``pygments`` library. Made discoverable via an entry point; use + **zconfig** as the highlight language for ``code-block`` directives in + Sphinx documents. + + 3.5.0 (2019-06-24) ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/PKG-INFO new/ZConfig-3.6.0/PKG-INFO --- old/ZConfig-3.5.0/PKG-INFO 2019-06-24 12:55:23.000000000 +0200 +++ new/ZConfig-3.6.0/PKG-INFO 2021-05-18 00:57:16.845010300 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ZConfig -Version: 3.5.0 +Version: 3.6.0 Summary: Structured Configuration Library Home-page: https://github.com/zopefoundation/ZConfig/ Author: Fred L. Drake, Jr. @@ -18,8 +18,8 @@ :target: https://pypi.org/project/ZConfig/ :alt: Supported Python versions - .. image:: https://travis-ci.org/zopefoundation/ZConfig.svg?branch=master - :target: https://travis-ci.org/zopefoundation/ZConfig + .. image:: https://travis-ci.com/zopefoundation/ZConfig.svg?branch=master + :target: https://travis-ci.com/zopefoundation/ZConfig .. image:: https://coveralls.io/repos/github/zopefoundation/ZConfig/badge.svg?branch=master :target: https://coveralls.io/github/zopefoundation/ZConfig?branch=master @@ -53,7 +53,7 @@ Information on the latest released version of the ZConfig package is available at - https://pypi.python.org/pypi/ZConfig/ + https://pypi.org/project/ZConfig/ You may either create an RPM and install this, or install directly from the source distribution. @@ -128,6 +128,20 @@ Change History for ZConfig ============================ + 3.6.0 (2021-05-19) + ================== + + - Added support for Python 3.8, 3.9 and 3.10. This primarily involves + avoiding the new-in-3.8 validation of the format string when using the + 'safe-template' format style, since that's not supported in the Python + standard library. + + - Added ``ZConfig.pygments`` module containing a lexer compatible with + the ``pygments`` library. Made discoverable via an entry point; use + **zconfig** as the highlight language for ``code-block`` directives in + Sphinx documents. + + 3.5.0 (2019-06-24) ================== @@ -517,9 +531,12 @@ 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 :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development -Provides-Extra: docs Provides-Extra: test +Provides-Extra: docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/README.rst new/ZConfig-3.6.0/README.rst --- old/ZConfig-3.5.0/README.rst 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/README.rst 2021-05-18 00:35:31.000000000 +0200 @@ -9,8 +9,8 @@ :target: https://pypi.org/project/ZConfig/ :alt: Supported Python versions -.. image:: https://travis-ci.org/zopefoundation/ZConfig.svg?branch=master - :target: https://travis-ci.org/zopefoundation/ZConfig +.. image:: https://travis-ci.com/zopefoundation/ZConfig.svg?branch=master + :target: https://travis-ci.com/zopefoundation/ZConfig .. image:: https://coveralls.io/repos/github/zopefoundation/ZConfig/badge.svg?branch=master :target: https://coveralls.io/github/zopefoundation/ZConfig?branch=master @@ -44,7 +44,7 @@ Information on the latest released version of the ZConfig package is available at - https://pypi.python.org/pypi/ZConfig/ + https://pypi.org/project/ZConfig/ You may either create an RPM and install this, or install directly from the source distribution. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig/components/logger/formatter.py new/ZConfig-3.6.0/ZConfig/components/logger/formatter.py --- old/ZConfig-3.5.0/ZConfig/components/logger/formatter.py 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/ZConfig/components/logger/formatter.py 2019-10-07 22:48:54.000000000 +0200 @@ -248,8 +248,17 @@ else: # A formatter class that supports style, but our style is # non-standard, so we reach under the covers a bit. + # + # Python 3.8 adds a validate option, defaulting to True, + # which causes the format string to be checked. Since + # safe-template is not a standard style, we want to + # suppress this. + # + kwargs = dict() + if sys.version_info >= (3, 8): + kwargs['validate'] = False formatter = self.factory(self.format, self.dateformat, - style='$') + style='$', **kwargs) assert formatter._style._fmt == self.format formatter._style = stylist else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig/components/logger/handlers.xml new/ZConfig-3.6.0/ZConfig/components/logger/handlers.xml --- old/ZConfig-3.5.0/ZConfig/components/logger/handlers.xml 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/ZConfig/components/logger/handlers.xml 2019-09-23 22:46:41.000000000 +0200 @@ -148,10 +148,10 @@ \b \f \n \r \t - %-replacements are checked to refer to the fields available in + Field placeholders are checked to refer to the fields available in the :class:`logging.LogRecord` instances created without extra fields. Referring to other fields will generate an error in - loading the configuration. + loading the configuration, unless ``arbitrary-fields`` is true. </description> </key> <key name="encoding" required="no" datatype="string"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig/components/logger/tests/test_formatter.py new/ZConfig-3.6.0/ZConfig/components/logger/tests/test_formatter.py --- old/ZConfig-3.5.0/ZConfig/components/logger/tests/test_formatter.py 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/ZConfig/components/logger/tests/test_formatter.py 2019-09-18 19:05:12.000000000 +0200 @@ -25,6 +25,17 @@ import ZConfig.components.logger.tests.support +# In Python 3.8, a KeyError raised by string interpolation is re-written +# into a ValueError reporting a reference to an undefined field. We're +# not masking the exception, but we want to check for the right one in +# the tests below (without catching anything else). +# +if sys.version_info >= (3, 8): + MissingFieldError = ValueError +else: + MissingFieldError = KeyError + + class LogFormatStyleTestCase(unittest.TestCase): def setUp(self): @@ -314,7 +325,10 @@ class StylelessFormatter(logging.Formatter): def __init__(self, fmt=None, datefmt=None): - logging.Formatter.__init__(self, fmt=fmt, datefmt=datefmt) + kwargs = dict() + if sys.version_info >= (3, 8): + kwargs['validate'] = False + logging.Formatter.__init__(self, fmt=fmt, datefmt=datefmt, **kwargs) def styleless_formatter(fmt=None, datefmt=None): @@ -552,9 +566,9 @@ arbitrary_fields=True) # The formatter still breaks when it references an undefined field: - with self.assertRaises(KeyError) as cm: + with self.assertRaises(MissingFieldError) as cm: formatter.format(self.record) - self.assertEqual(str(cm.exception), "'undefined_field'") + self.assertIn("'undefined_field'", str(cm.exception)) def test_classic_arbitrary_field_present(self): formatter = self.get_formatter( @@ -574,9 +588,9 @@ arbitrary_fields=True) # The formatter still breaks when it references an undefined field: - with self.assertRaises(KeyError) as cm: + with self.assertRaises(MissingFieldError) as cm: formatter.format(self.record) - self.assertEqual(str(cm.exception), "'undefined_field'") + self.assertIn("'undefined_field'", str(cm.exception)) def test_format_arbitrary_field_present(self): formatter = self.get_formatter( @@ -596,9 +610,9 @@ arbitrary_fields=True) # The formatter still breaks when it references an undefined field: - with self.assertRaises(KeyError) as cm: + with self.assertRaises(MissingFieldError) as cm: formatter.format(self.record) - self.assertEqual(str(cm.exception), "'undefined_field'") + self.assertIn("'undefined_field'", str(cm.exception)) def test_template_arbitrary_field_present(self): formatter = self.get_formatter( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig/pygments.py new/ZConfig-3.6.0/ZConfig/pygments.py --- old/ZConfig-3.5.0/ZConfig/pygments.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ZConfig-3.6.0/ZConfig/pygments.py 2019-10-11 16:36:35.000000000 +0200 @@ -0,0 +1,78 @@ +############################################################################## +# +# Copyright (c) 2019 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""\ +pygments-compatible lexer. + +""" + +from __future__ import print_function, absolute_import + +import pygments.lexer +import pygments.token + +import ZConfig.substitution + + +class ZConfigLexer(pygments.lexer.RegexLexer): + """pygments lexer for ZConfig configuration syntax.""" + + name = 'ZConfig' + aliases = ['zconfig'] + + tokens = { + 'root': [ + (r'\s+', pygments.token.Text), + (r'(%%define)(\s+)(%s)(\s+)?' + % ZConfig.substitution._name_re, + pygments.lexer.bygroups( + pygments.token.Keyword, pygments.token.Whitespace, + pygments.token.Name, pygments.token.Whitespace), + 'value'), + (r'(%import)(\s+)', + pygments.lexer.bygroups( + pygments.token.Keyword, pygments.token.Whitespace), + 'value'), + (r'(%include)(\s+)', + pygments.lexer.bygroups( + pygments.token.Keyword, pygments.token.Whitespace), + 'value'), + (r'(#.*?)$', pygments.token.Comment), + (r'(<[^\s>]+)(\s*)(/?>)', + pygments.lexer.bygroups( + pygments.token.Name.Tag, pygments.token.Whitespace, + pygments.token.Name.Tag)), + (r'(<[^\s>]+)(?:(\s+)([^/>]*))?(\s*)(/?>)', + pygments.lexer.bygroups( + pygments.token.Name.Tag, pygments.token.Whitespace, + pygments.token.Name, pygments.token.Whitespace, + pygments.token.Name.Tag)), + (r'([a-z]\w*)(\s+)', + pygments.lexer.bygroups( + pygments.token.Name, pygments.token.Whitespace), + 'value'), + (r'[^\n]+', pygments.token.Text), + ], + 'value': [ + (r'\$\$', pygments.token.String.Escape), + (r'(\${)(%s)(})' % ZConfig.substitution._name_re, + pygments.lexer.bygroups( + pygments.token.String.Interpol, pygments.token.Name, + pygments.token.String.Interpol)), + (r'(\$)(%s)' % ZConfig.substitution._name_re, + pygments.lexer.bygroups( + pygments.token.String.Interpol, pygments.token.Name)), + (r'\n', pygments.token.Text, '#pop'), + (r'.[^\n$]*', pygments.token.String), + ], + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig/substitution.py new/ZConfig-3.6.0/ZConfig/substitution.py --- old/ZConfig-3.5.0/ZConfig/substitution.py 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/ZConfig/substitution.py 2019-10-11 16:36:35.000000000 +0200 @@ -1,6 +1,6 @@ ############################################################################## # -# Copyright (c) 2002, 2003 Zope Foundation and Contributors. +# Copyright (c) 2002, 2003, 2019 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, @@ -19,7 +19,8 @@ import ZConfig -_name_match = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*").match +_name_re = r'[a-zA-Z_][a-zA-Z0-9_]*' +_name_match = re.compile(_name_re).match def substitute(s, mapping): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig/tests/test_pygments.py new/ZConfig-3.6.0/ZConfig/tests/test_pygments.py --- old/ZConfig-3.5.0/ZConfig/tests/test_pygments.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ZConfig-3.6.0/ZConfig/tests/test_pygments.py 2019-10-11 16:36:35.000000000 +0200 @@ -0,0 +1,221 @@ +############################################################################## +# +# Copyright (c) 2019 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""\ +Tests for ZConfig.pygments.ZConfigLexer. + +""" + +from __future__ import print_function, absolute_import + +import unittest + +try: + import pygments.lexer + import pygments.token +except ImportError: + pygments = None +else: + import ZConfig.pygments + + +class ZConfigLexerTestCase(unittest.TestCase): + + def setUp(self): + if pygments is None: + self.skipTest('pygments is not available') + + def test_comment(self): + expected = [ + (pygments.token.Text, ' '), + (pygments.token.Comment, '# some crazy text'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + ' # some crazy text\n')) + self.assertEqual(t, expected) + + def test_option_without_substitutions(self): + expected = [ + (pygments.token.Name, 'logdir'), + (pygments.token.Whitespace, ' \t'), + (pygments.token.String, '/var/log/myapp'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + 'logdir \t/var/log/myapp\n')) + self.assertEqual(t, expected) + + def test_option_with_substitutions(self): + expected = [ + (pygments.token.Name, 'logdir'), + (pygments.token.Whitespace, ' \t'), + (pygments.token.String, '/var/log/'), + (pygments.token.String.Escape, '$$'), + (pygments.token.String, '-'), + (pygments.token.String.Interpol, '$'), + (pygments.token.Name, 'conf'), + (pygments.token.String, '-'), + (pygments.token.String.Interpol, '${'), + (pygments.token.Name, 'fnoc'), + (pygments.token.String.Interpol, '}'), + (pygments.token.String, '-monthly'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + 'logdir \t/var/log/$$-$conf-${fnoc}-monthly\n')) + self.assertEqual(t, expected) + + def test_named_section(self): + expected = [ + (pygments.token.Name.Tag, '<sect'), + (pygments.token.Whitespace, ' '), + (pygments.token.Name, 'name'), + (pygments.token.Name.Tag, '>'), + (pygments.token.Text, '\n '), + (pygments.token.Name, 'option'), + (pygments.token.Whitespace, ' '), + (pygments.token.String, 'value'), + (pygments.token.Text, '\n'), + (pygments.token.Name.Tag, '</sect'), + (pygments.token.Name.Tag, '>'), + (pygments.token.Text, '\n'), + ] + text = ('<sect name>\n' + ' option value\n' + '</sect>\n') + t = list(ZConfig.pygments.ZConfigLexer().get_tokens(text)) + self.assertEqual(t, expected) + + def test_unnamed_section(self): + expected = [ + (pygments.token.Name.Tag, '<sect'), + (pygments.token.Name.Tag, '>'), + (pygments.token.Text, '\n '), + (pygments.token.Name, 'option'), + (pygments.token.Whitespace, ' '), + (pygments.token.String, 'value'), + (pygments.token.Text, '\n'), + (pygments.token.Name.Tag, '</sect'), + (pygments.token.Name.Tag, '>'), + (pygments.token.Text, '\n'), + ] + text = ('<sect>\n' + ' option value\n' + '</sect>\n') + t = list(ZConfig.pygments.ZConfigLexer().get_tokens(text)) + self.assertEqual(t, expected) + + def test_empty_named_section(self): + expected = [ + (pygments.token.Name.Tag, '<sect'), + (pygments.token.Whitespace, ' '), + (pygments.token.Name, 'name'), + (pygments.token.Name.Tag, '/>'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens('<sect name/>')) + self.assertEqual(t, expected) + + def test_empty_unnamed_section(self): + expected = [ + (pygments.token.Name.Tag, '<sect/'), + (pygments.token.Name.Tag, '>'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens('<sect/>')) + self.assertEqual(t, expected) + + def test_define_without_substitutions(self): + expected = [ + (pygments.token.Keyword, '%define'), + (pygments.token.Whitespace, ' '), + (pygments.token.Name, 'logdir'), + (pygments.token.Whitespace, ' \t'), + (pygments.token.String, '/var/log/myapp'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + '%define logdir \t/var/log/myapp\n')) + self.assertEqual(t, expected) + + def test_define_with_substitutions(self): + expected = [ + (pygments.token.Keyword, '%define'), + (pygments.token.Whitespace, ' '), + (pygments.token.Name, 'logdir'), + (pygments.token.Whitespace, ' \t'), + (pygments.token.String, '/var/log/'), + (pygments.token.String.Escape, '$$'), + (pygments.token.String, '-'), + (pygments.token.String.Interpol, '$'), + (pygments.token.Name, 'conf'), + (pygments.token.String, '-'), + (pygments.token.String.Interpol, '${'), + (pygments.token.Name, 'fnoc'), + (pygments.token.String.Interpol, '}'), + (pygments.token.String, '-monthly'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + '%define logdir \t/var/log/$$-$conf-${fnoc}-monthly\n')) + self.assertEqual(t, expected) + + def test_import_without_substitutions(self): + expected = [ + (pygments.token.Keyword, '%import'), + (pygments.token.Whitespace, ' '), + (pygments.token.String, 'ZConfig.components.logger'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + '%import ZConfig.components.logger\n')) + self.assertEqual(t, expected) + + def test_import_with_substitutions(self): + expected = [ + (pygments.token.Keyword, '%import'), + (pygments.token.Whitespace, ' '), + (pygments.token.String, 'ZConfig.components.'), + (pygments.token.String.Interpol, '${'), + (pygments.token.Name, 'module'), + (pygments.token.String.Interpol, '}'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + '%import ZConfig.components.${module}\n')) + self.assertEqual(t, expected) + + def test_include_without_substitutions(self): + expected = [ + (pygments.token.Keyword, '%include'), + (pygments.token.Whitespace, ' '), + (pygments.token.String, 'somefile.conf'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + '%include somefile.conf\n')) + self.assertEqual(t, expected) + + def test_include_with_substitutions(self): + expected = [ + (pygments.token.Keyword, '%include'), + (pygments.token.Whitespace, ' '), + (pygments.token.String.Interpol, '$'), + (pygments.token.Name, 'basename'), + (pygments.token.String, '.conf'), + (pygments.token.Text, '\n'), + ] + t = list(ZConfig.pygments.ZConfigLexer().get_tokens( + '%include $basename.conf\n')) + self.assertEqual(t, expected) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig.egg-info/PKG-INFO new/ZConfig-3.6.0/ZConfig.egg-info/PKG-INFO --- old/ZConfig-3.5.0/ZConfig.egg-info/PKG-INFO 2019-06-24 12:55:23.000000000 +0200 +++ new/ZConfig-3.6.0/ZConfig.egg-info/PKG-INFO 2021-05-18 00:57:16.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ZConfig -Version: 3.5.0 +Version: 3.6.0 Summary: Structured Configuration Library Home-page: https://github.com/zopefoundation/ZConfig/ Author: Fred L. Drake, Jr. @@ -18,8 +18,8 @@ :target: https://pypi.org/project/ZConfig/ :alt: Supported Python versions - .. image:: https://travis-ci.org/zopefoundation/ZConfig.svg?branch=master - :target: https://travis-ci.org/zopefoundation/ZConfig + .. image:: https://travis-ci.com/zopefoundation/ZConfig.svg?branch=master + :target: https://travis-ci.com/zopefoundation/ZConfig .. image:: https://coveralls.io/repos/github/zopefoundation/ZConfig/badge.svg?branch=master :target: https://coveralls.io/github/zopefoundation/ZConfig?branch=master @@ -53,7 +53,7 @@ Information on the latest released version of the ZConfig package is available at - https://pypi.python.org/pypi/ZConfig/ + https://pypi.org/project/ZConfig/ You may either create an RPM and install this, or install directly from the source distribution. @@ -128,6 +128,20 @@ Change History for ZConfig ============================ + 3.6.0 (2021-05-19) + ================== + + - Added support for Python 3.8, 3.9 and 3.10. This primarily involves + avoiding the new-in-3.8 validation of the format string when using the + 'safe-template' format style, since that's not supported in the Python + standard library. + + - Added ``ZConfig.pygments`` module containing a lexer compatible with + the ``pygments`` library. Made discoverable via an entry point; use + **zconfig** as the highlight language for ``code-block`` directives in + Sphinx documents. + + 3.5.0 (2019-06-24) ================== @@ -517,9 +531,12 @@ 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 :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development -Provides-Extra: docs Provides-Extra: test +Provides-Extra: docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig.egg-info/SOURCES.txt new/ZConfig-3.6.0/ZConfig.egg-info/SOURCES.txt --- old/ZConfig-3.5.0/ZConfig.egg-info/SOURCES.txt 2019-06-24 12:55:23.000000000 +0200 +++ new/ZConfig-3.6.0/ZConfig.egg-info/SOURCES.txt 2021-05-18 00:57:16.000000000 +0200 @@ -20,6 +20,7 @@ ZConfig/info.py ZConfig/loader.py ZConfig/matcher.py +ZConfig/pygments.py ZConfig/schema.py ZConfig/schema2html.py ZConfig/schemaless.py @@ -73,6 +74,7 @@ ZConfig/tests/test_info.py ZConfig/tests/test_loader.py ZConfig/tests/test_matcher.py +ZConfig/tests/test_pygments.py ZConfig/tests/test_readme.py ZConfig/tests/test_schema.py ZConfig/tests/test_schema2html.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/ZConfig.egg-info/entry_points.txt new/ZConfig-3.6.0/ZConfig.egg-info/entry_points.txt --- old/ZConfig-3.5.0/ZConfig.egg-info/entry_points.txt 2019-06-24 12:55:23.000000000 +0200 +++ new/ZConfig-3.6.0/ZConfig.egg-info/entry_points.txt 2021-05-18 00:57:16.000000000 +0200 @@ -2,3 +2,6 @@ zconfig = ZConfig.validator:main zconfig_schema2html = ZConfig.schema2html:main +[pygments.lexers] +zconfig = ZConfig.pygments:ZConfigLexer + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/doc/conf.py new/ZConfig-3.6.0/doc/conf.py --- old/ZConfig-3.5.0/doc/conf.py 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/doc/conf.py 2021-05-18 00:54:03.000000000 +0200 @@ -59,9 +59,9 @@ # built documents. # # The short X.Y version. -version = u'3.2' +version = u'3.6' # The full version, including alpha/beta/rc tags. -release = u'3.2.0' +release = u'3.6.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/doc/py-mod-subst.rst new/ZConfig-3.6.0/doc/py-mod-subst.rst --- old/ZConfig-3.5.0/doc/py-mod-subst.rst 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/doc/py-mod-subst.rst 2021-05-18 00:35:31.000000000 +0200 @@ -9,13 +9,14 @@ The replacements supported by this module include: -=========== ================================ ===== -Source Replacement Notes -=========== ================================ ===== -``$$`` ``$`` (1) -``$name`` The result of looking up *name* (2) +=========== =================================================== ===== +Source Replacement Notes +=========== =================================================== ===== +``$$`` ``$`` (1) +``$name`` The result of looking up *name* (2) ``${name}`` The result of looking up *name* -=========== ================================ ===== +``$(name)`` The result of looking up *name* in the environment (3) +=========== =================================================== ===== Notes: @@ -27,6 +28,7 @@ 2. Any character which immediately follows *name* may not be a valid character in a name. +3. This is not Bourne shell style. In each case, *name* is a non-empty sequence of alphanumeric and underscore characters not starting with a digit. If there is not a @@ -59,3 +61,8 @@ 'value' >>> substitute('$top', d) '$middle' + >>> import os + >>> os.environ['from_environment'] = 'From environment.' + >>> substitute('$(from_einvironment)', d) + 'From environment.' + \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/doc/using-zconfig.rst new/ZConfig-3.6.0/doc/using-zconfig.rst --- old/ZConfig-3.5.0/doc/using-zconfig.rst 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/doc/using-zconfig.rst 2021-05-18 00:35:31.000000000 +0200 @@ -163,7 +163,7 @@ implementations of abstract types to be used in place of or in addition to implementations provided with the application. -Consider an example application application which supports logging in +Consider an example application which supports logging in the same way Zope 2 does. There are some parameters which configure the general behavior of the logging mechanism, and an arbitrary number of **log handlers** may be specified to control how the log @@ -252,3 +252,17 @@ %define name value key $name + + +Substitution in Values from Environment Variables +------------------------------------------------- + +Values in :mod:`ZConfig` can be substituted from environment variables. +It utilizes Pythons ``os.getenv`` to fetch the values. Syntax is a ``$`` +followed by round brackets (parentheses). In this example the variable +key gets a value assigned from the enviroment named ENVKEY:: + + key $(ENVKEY) + +Further details and examples are described in the :mod:`ZConfig.substitution` +module. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/setup.py new/ZConfig-3.6.0/setup.py --- old/ZConfig-3.5.0/setup.py 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/setup.py 2021-05-18 00:52:49.000000000 +0200 @@ -19,7 +19,7 @@ options = dict( name="ZConfig", - version='3.5.0', + version='3.6.0', author="Fred L. Drake, Jr.", author_email="[email protected]", maintainer="Zope Foundation and Contributors", @@ -47,6 +47,9 @@ 'zconfig = ZConfig.validator:main', 'zconfig_schema2html = ZConfig.schema2html:main', ], + 'pygments.lexers': [ + 'zconfig = ZConfig.pygments:ZConfigLexer', + ], }, include_package_data=True, zip_safe=False, @@ -64,6 +67,9 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Operating System :: OS Independent', @@ -74,7 +80,7 @@ 'test': tests_require, 'docs': [ 'sphinxcontrib-programoutput', - ] + ], }, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ZConfig-3.5.0/tox.ini new/ZConfig-3.6.0/tox.ini --- old/ZConfig-3.5.0/tox.ini 2019-06-24 12:55:22.000000000 +0200 +++ new/ZConfig-3.6.0/tox.ini 2021-05-18 00:45:12.000000000 +0200 @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,py37,pypy,coverage-report +envlist = py27,py34,py35,py36,py37,py38,py39,py310,pypy,coverage-report skip_missing_interpreters = true [testenv] @@ -10,6 +10,7 @@ .[test] coverage flake8 + pygments [testenv:coverage] basepython =
