summaryrefslogtreecommitdiff
path: root/dev-python/Babel
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-06-13 10:39:22 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-06-13 10:39:22 +0100
commit9452a6e87b6c2c70513bc47a2470bf9f1168920e (patch)
tree8ac67e26b45f34d71c5aab3621813b100a0d5f00 /dev-python/Babel
parentf516638b7fe9592837389826a6152a7e1b251c54 (diff)
gentoo resync : 13.06.2020
Diffstat (limited to 'dev-python/Babel')
-rw-r--r--dev-python/Babel/Babel-2.8.0-r1.ebuild13
-rw-r--r--dev-python/Babel/Manifest3
-rw-r--r--dev-python/Babel/files/Babel-2.8.0-py39.patch169
3 files changed, 182 insertions, 3 deletions
diff --git a/dev-python/Babel/Babel-2.8.0-r1.ebuild b/dev-python/Babel/Babel-2.8.0-r1.ebuild
index f970db31cb9f..c7d4b499463c 100644
--- a/dev-python/Babel/Babel-2.8.0-r1.ebuild
+++ b/dev-python/Babel/Babel-2.8.0-r1.ebuild
@@ -3,14 +3,14 @@
EAPI=7
-PYTHON_COMPAT=( pypy3 python{2_7,3_{6,7,8}} )
+PYTHON_COMPAT=( pypy3 python{2_7,3_{6..9}} )
PYTHON_REQ_USE="threads(+)"
DISTUTILS_USE_SETUPTOOLS=rdepend
inherit distutils-r1
DESCRIPTION="Collection of tools for internationalizing Python applications"
-HOMEPAGE="http://babel.pocoo.org/ https://pypi.org/project/Babel/"
+HOMEPAGE="https://babel.pocoo.org/ https://pypi.org/project/Babel/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
@@ -24,3 +24,12 @@ DEPEND="${DEPEND}
distutils_enable_sphinx docs
distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/${P}-py39.patch
+)
+
+src_test() {
+ local -x TZ=UTC
+ distutils-r1_src_test
+}
diff --git a/dev-python/Babel/Manifest b/dev-python/Babel/Manifest
index 9c3fb2c9274b..193c3def2410 100644
--- a/dev-python/Babel/Manifest
+++ b/dev-python/Babel/Manifest
@@ -1,3 +1,4 @@
+AUX Babel-2.8.0-py39.patch 7421 BLAKE2B 94a9b55504214b4c422cab61651dcc4c9192f438635e0ec6aa77ea1b53fefb782dd4a1d13ba89500fc2c2e13bebfc616529aaf74c18a55304fd23c2c53fb77cc SHA512 8d738bb0140c80bb2db8a2180c563f61500df42de1b69f0b2a36dea23aad889fe59451fca993161f6ca6a2f6006d98ce94ab139eb5be4a1a25f43e922e3fc9de
DIST Babel-2.8.0.tar.gz 8444381 BLAKE2B ea3757182464770f47d3253e77bece7b64c84558e7a19fc55759198bfa55c6d8156d27e9de7b796b62eefd93e458c7e00b2014dd23e4ed7383f5bc9785d1a332 SHA512 f9687b36176c146a8ace073197111463d24fca343bb1dbee8b0e37a7f37b68b4cd77ffbe3bf14a20f8f64c701aa860e0b5e6076658a95dbee2556f0688d68d91
-EBUILD Babel-2.8.0-r1.ebuild 830 BLAKE2B 6b2636c528f62265ee7b9ca79fb8e45df8e5668a3dbd84993be4573f9c095cd888656491cfae76233d047768c030d440c748967eab083778ccd4b02dc921faf8 SHA512 e93e0f647da7baecba64ba13ad3029399b58ecf97b1ff7b4ecf7654dd1439fd677c528a658af2c03fee29f8eac7724702f25513998470e40554c0e938c42acf0
+EBUILD Babel-2.8.0-r1.ebuild 930 BLAKE2B 18d7eb5333ce5487b22d6c43504c53130a62262918fcdef70fc509e0167d2f53df279a499071ae2d1d686a07a2242898b05b651017e1d8ec82ac8954c8986a8a SHA512 6ef9304ba4b345756c3f80b6f0ec141d5310912177335b8ece236357965ea93132d30da4f2934d3cc315400fe0978eedc8cc0d71d7d6a6c934c3ee2366b3cffd
MISC metadata.xml 839 BLAKE2B d9916ce88ce8436bb28d15300e78013e1c9e0f88f385a369c0ad6840f0fe81ad136052a3c257cef50a2fd86500bcde2b652ad0ed664f95d6affa4ccc8770445b SHA512 3688c1488c552b84c685d0aeb6251aea4f9d41be3db3aeb226291655107e1332df13445545b3742587e133de7468a40f22ca53fa67fd8d2e0db570069498654f
diff --git a/dev-python/Babel/files/Babel-2.8.0-py39.patch b/dev-python/Babel/files/Babel-2.8.0-py39.patch
new file mode 100644
index 000000000000..efada9c1d08c
--- /dev/null
+++ b/dev-python/Babel/files/Babel-2.8.0-py39.patch
@@ -0,0 +1,169 @@
+From 167b71421f113e2210e4deefef5020402492e5be Mon Sep 17 00:00:00 2001
+From: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
+Date: Tue, 5 May 2020 09:58:01 +0200
+Subject: [PATCH] stop using deprecated ElementTree methods "getchildren()" and
+ "getiterator()"
+
+Both methods were removed in Python 3.9 as mentioned in the release notes:
+
+> Methods getchildren() and getiterator() of classes ElementTree and Element in
+> the ElementTree module have been removed. They were deprecated in Python 3.2.
+> Use iter(x) or list(x) instead of x.getchildren() and x.iter() or
+> list(x.iter()) instead of x.getiterator().
+---
+ scripts/import_cldr.py | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py
+index 8993b68e..2ed3af91 100755
+--- a/scripts/import_cldr.py
++++ b/scripts/import_cldr.py
+@@ -598,7 +598,7 @@ def parse_calendar_months(data, calendar):
+ for width in ctxt.findall('monthWidth'):
+ width_type = width.attrib['type']
+ widths = ctxts.setdefault(width_type, {})
+- for elem in width.getiterator():
++ for elem in width.iter():
+ if elem.tag == 'month':
+ _import_type_text(widths, elem, int(elem.attrib['type']))
+ elif elem.tag == 'alias':
+@@ -616,7 +616,7 @@ def parse_calendar_days(data, calendar):
+ for width in ctxt.findall('dayWidth'):
+ width_type = width.attrib['type']
+ widths = ctxts.setdefault(width_type, {})
+- for elem in width.getiterator():
++ for elem in width.iter():
+ if elem.tag == 'day':
+ _import_type_text(widths, elem, weekdays[elem.attrib['type']])
+ elif elem.tag == 'alias':
+@@ -634,7 +634,7 @@ def parse_calendar_quarters(data, calendar):
+ for width in ctxt.findall('quarterWidth'):
+ width_type = width.attrib['type']
+ widths = ctxts.setdefault(width_type, {})
+- for elem in width.getiterator():
++ for elem in width.iter():
+ if elem.tag == 'quarter':
+ _import_type_text(widths, elem, int(elem.attrib['type']))
+ elif elem.tag == 'alias':
+@@ -649,7 +649,7 @@ def parse_calendar_eras(data, calendar):
+ for width in calendar.findall('eras/*'):
+ width_type = NAME_MAP[width.tag]
+ widths = eras.setdefault(width_type, {})
+- for elem in width.getiterator():
++ for elem in width.iter():
+ if elem.tag == 'era':
+ _import_type_text(widths, elem, type=int(elem.attrib.get('type')))
+ elif elem.tag == 'alias':
+@@ -676,7 +676,7 @@ def parse_calendar_periods(data, calendar):
+ def parse_calendar_date_formats(data, calendar):
+ date_formats = data.setdefault('date_formats', {})
+ for format in calendar.findall('dateFormats'):
+- for elem in format.getiterator():
++ for elem in format.iter():
+ if elem.tag == 'dateFormatLength':
+ type = elem.attrib.get('type')
+ if _should_skip_elem(elem, type, date_formats):
+@@ -696,7 +696,7 @@ def parse_calendar_date_formats(data, calendar):
+ def parse_calendar_time_formats(data, calendar):
+ time_formats = data.setdefault('time_formats', {})
+ for format in calendar.findall('timeFormats'):
+- for elem in format.getiterator():
++ for elem in format.iter():
+ if elem.tag == 'timeFormatLength':
+ type = elem.attrib.get('type')
+ if _should_skip_elem(elem, type, time_formats):
+@@ -717,7 +717,7 @@ def parse_calendar_datetime_skeletons(data, calendar):
+ datetime_formats = data.setdefault('datetime_formats', {})
+ datetime_skeletons = data.setdefault('datetime_skeletons', {})
+ for format in calendar.findall('dateTimeFormats'):
+- for elem in format.getiterator():
++ for elem in format.iter():
+ if elem.tag == 'dateTimeFormatLength':
+ type = elem.attrib.get('type')
+ if _should_skip_elem(elem, type, datetime_formats):
+@@ -880,7 +880,7 @@ def parse_interval_formats(data, tree):
+ interval_formats[None] = elem.text
+ elif elem.tag == "intervalFormatItem":
+ skel_data = interval_formats.setdefault(elem.attrib["id"], {})
+- for item_sub in elem.getchildren():
++ for item_sub in elem:
+ if item_sub.tag == "greatestDifference":
+ skel_data[item_sub.attrib["id"]] = split_interval_pattern(item_sub.text)
+ else:
+@@ -903,7 +903,7 @@ def parse_currency_formats(data, tree):
+ type = '%s:%s' % (type, curr_length_type)
+ if _should_skip_elem(elem, type, currency_formats):
+ continue
+- for child in elem.getiterator():
++ for child in elem.iter():
+ if child.tag == 'alias':
+ currency_formats[type] = Alias(
+ _translate_alias(['currency_formats', elem.attrib['type']],
+From 7bdaa28a55e8d8228d5434effa4b1473ab7b3669 Mon Sep 17 00:00:00 2001
+From: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
+Date: Tue, 5 May 2020 08:05:56 +0000
+Subject: [PATCH] fix tests when using Python 3.9a6
+
+In Python 3.9a6 integer values for future flags were changed to prevent
+collision with compiler flags. We need to retrieve these at runtime so
+the test suite works with Python <= 3.8 as well as Python 3.9.
+---
+ tests/test_util.py | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_util.py b/tests/test_util.py
+index a6a4450c..b9343aaa 100644
+--- a/tests/test_util.py
++++ b/tests/test_util.py
+@@ -11,6 +11,7 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://babel.edgewall.org/log/.
+
++import __future__
+ import unittest
+
+ import pytest
+@@ -20,6 +21,12 @@
+ from babel.util import parse_future_flags
+
+
++class _FF:
++ division = __future__.division.compiler_flag
++ print_function = __future__.print_function.compiler_flag
++ with_statement = __future__.with_statement.compiler_flag
++ unicode_literals = __future__.unicode_literals.compiler_flag
++
+ def test_distinct():
+ assert list(util.distinct([1, 2, 1, 3, 4, 4])) == [1, 2, 3, 4]
+ assert list(util.distinct('foobar')) == ['f', 'o', 'b', 'a', 'r']
+@@ -70,25 +77,25 @@ def test_parse_encoding_non_ascii():
+ from __future__ import print_function,
+ division, with_statement,
+ unicode_literals
+-''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
++''', _FF.print_function | _FF.division | _FF.with_statement | _FF.unicode_literals),
+ ('''
+ from __future__ import print_function, division
+ print('hello')
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ('''
+ from __future__ import print_function, division, unknown,,,,,
+ print 'hello'
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ('''
+ from __future__ import (
+ print_function,
+ division)
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ('''
+ from __future__ import \\
+ print_function, \\
+ division
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ])
+ def test_parse_future(source, result):
+ fp = BytesIO(source.encode('latin-1'))