From d99093fb4bb5652015c06274d64083daa2439e4f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 3 Mar 2021 10:28:17 +0000 Subject: gentoo resync : 03.03.2021 --- dev-python/zconfig/Manifest | 5 +- dev-python/zconfig/files/zconfig-3.5.0-py38.patch | 105 ++++++++++++++++++++++ dev-python/zconfig/metadata.xml | 1 + dev-python/zconfig/zconfig-3.5.0.ebuild | 19 ++-- 4 files changed, 117 insertions(+), 13 deletions(-) create mode 100644 dev-python/zconfig/files/zconfig-3.5.0-py38.patch (limited to 'dev-python/zconfig') diff --git a/dev-python/zconfig/Manifest b/dev-python/zconfig/Manifest index b9201c4d3c5d..800e6888d494 100644 --- a/dev-python/zconfig/Manifest +++ b/dev-python/zconfig/Manifest @@ -1,3 +1,4 @@ +AUX zconfig-3.5.0-py38.patch 4463 BLAKE2B 05d79cd68ba04ca55fb03f49ce5f2342e4806d921ea8e8a516a4d5ea841187be90a1a5a1a5ac4c14ed940f8c58773260a27d6617cb3e2c60b61f7764d1357ac7 SHA512 5ba6f4d6742d926bea2c19afa3ac130f6f6fd2527f3689b793a498e1a98e1f735216102ee49a5e4246af7f86b671b031a7b3b026001f4965f321f774a9590363 DIST ZConfig-3.5.0.tar.gz 127317 BLAKE2B 735d554072d4be4ee0552151a6bd0401e66bc0a7a091d97656a2c95efb13580d264a39e28c11e096ee77f57bc96d684720c22c981f5dbd82ce012d40c94d33ea SHA512 14af4de2adcb7e5404a4fd8e1a1903758c584898fda7c4d2a660616c37023f0e0b5d4acac789a930c2900eb501528899d51c4ea4c4050535cfbaa629e9159558 -EBUILD zconfig-3.5.0.ebuild 917 BLAKE2B 8a1931b8674d9efdf39004fe2d82da2f18d9ce0315b9abbd6a0cf96cb4cbd63979334722e383c3016eaabf6209f17b52359eaec9c459300587d114e209c88151 SHA512 a5f16587fb4adfe7c6d8e18675ad585cbd3e3e0278405cb412f8df2b54cef7bd8276a60e9b42bac93b2eccbb19eb8c76521bd1c18d0c9b0fc34db644f1b6b6cc -MISC metadata.xml 1493 BLAKE2B 2aa4b507ca0e016ab9b706913128984896622aa85904dd73bdb8e337339dcca8dab9df6153f275721081b9954d102bc6ef6645621f153243df9714c6d96984ef SHA512 81db84d822dca56d5e582bf22aa1b08b4b32b80143851ef890460ba39bc05179dd97ac5afc7bf0fdb839c1807783a4d9b1347d66f133effe6ffef90d801944e2 +EBUILD zconfig-3.5.0.ebuild 923 BLAKE2B cbd0d03bf0fac44fc514f12aa80447fa9cd583e203fae09785f4cf4330e8a7b92214e93fb8fea1f448dfd321279bc58dadb72bce6c726e8f7faee884d03fc89b SHA512 6954cfbf485c7acf8e076f8cbde95e1d8302dd9d19ae3dd4aa1ffb415b3ea102edd8b9169778c6de84d8dcc269e7e090abb9f122cdad903a194cf2c5b3ce77c9 +MISC metadata.xml 1517 BLAKE2B 171f2c7c76e86375f6d0bb0a50f17abe2e1dc7544a8989b3233c0fc54fa330af0b6f50a23a844988a4732d5879145c9fea78740ecee4bc1c8d87deeb7c45e740 SHA512 afcc2a2fbf0592562f726c4d2c5dac31cb401c12e06121b49d3f5c5c177fb90cb88ef9eba9a995e09c66341b948a8b5703bdf98da3e30addd1b288f5dfc2b4f0 diff --git a/dev-python/zconfig/files/zconfig-3.5.0-py38.patch b/dev-python/zconfig/files/zconfig-3.5.0-py38.patch new file mode 100644 index 000000000000..ea5e8db7642b --- /dev/null +++ b/dev-python/zconfig/files/zconfig-3.5.0-py38.patch @@ -0,0 +1,105 @@ +Required for python 3.8+ compatibility +https://github.com/zopefoundation/ZConfig/pull/70 +--- a/ZConfig/components/logger/formatter.py ++++ b/ZConfig/components/logger/formatter.py +@@ -248,8 +248,17 @@ def __call__(self): + 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 cases 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: +--- a/ZConfig/components/logger/tests/test_formatter.py ++++ b/ZConfig/components/logger/tests/test_formatter.py +@@ -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 CustomFormatterFactoryWithoutStyleParamTestCase( + 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 @@ def test_classic_arbitrary_field_missing(self): + 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 @@ def test_format_arbitrary_field_missing(self): + 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 @@ def test_template_arbitrary_field_missing(self): + 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( + +--- a/ZConfig/components/logger/formatter.py ++++ b/ZConfig/components/logger/formatter.py +@@ -250,7 +250,7 @@ def __call__(self): + # non-standard, so we reach under the covers a bit. + # + # Python 3.8 adds a validate option, defaulting to True, +- # which cases the format string to be checked. Since ++ # which causes the format string to be checked. Since + # safe-template is not a standard style, we want to + # suppress this. + # + + diff --git a/dev-python/zconfig/metadata.xml b/dev-python/zconfig/metadata.xml index ed502c98fcf9..82055c0c5fe6 100644 --- a/dev-python/zconfig/metadata.xml +++ b/dev-python/zconfig/metadata.xml @@ -9,6 +9,7 @@ proxy-maint@gentoo.org Proxy Maintainers + zopefoundation/ZConfig ZConfig diff --git a/dev-python/zconfig/zconfig-3.5.0.ebuild b/dev-python/zconfig/zconfig-3.5.0.ebuild index a84e81f5ef88..174067f20aaa 100644 --- a/dev-python/zconfig/zconfig-3.5.0.ebuild +++ b/dev-python/zconfig/zconfig-3.5.0.ebuild @@ -1,11 +1,10 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI="7" +EAPI=7 DISTUTILS_USE_SETUPTOOLS=rdepend -PYTHON_COMPAT=( python3_7 ) - +PYTHON_COMPAT=( python3_{7..9} ) inherit distutils-r1 MY_PN="ZConfig" @@ -13,27 +12,25 @@ MY_P="${MY_PN}-${PV}" DESCRIPTION="A configuration library supporting a hierarchical schema-driven configuration model" HOMEPAGE="https://pypi.org/project/ZConfig/" +S="${WORKDIR}/${MY_P}" SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz" LICENSE="ZPL" SLOT="0" KEYWORDS="~amd64" -RESTRICT="!test? ( test )" -DEPEND=" +BDEPEND=" test? ( dev-python/docutils[${PYTHON_USEDEP}] dev-python/manuel[${PYTHON_USEDEP}] dev-python/zope-exceptions[${PYTHON_USEDEP}] dev-python/zope-interface[${PYTHON_USEDEP}] dev-python/zope-testrunner[${PYTHON_USEDEP}] - ) -" -RDEPEND="" - -S="${WORKDIR}/${MY_P}" + )" DOCS=( CHANGES.rst README.rst ) +PATCHES=( "${FILESDIR}"/${P}-py38.patch ) + distutils_enable_tests nose distutils_enable_sphinx doc dev-python/sphinxcontrib-programoutput -- cgit v1.2.3