* [gentoo-commits] repo/gentoo:master commit in: dev-python/Babel/files/, dev-python/Babel/
@ 2017-05-14 21:36 Mike Gilbert
0 siblings, 0 replies; 4+ messages in thread
From: Mike Gilbert @ 2017-05-14 21:36 UTC (permalink / raw
To: gentoo-commits
commit: 7b83bf742015ae680d8f26a28420cfcd49d2903c
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun May 14 21:35:40 2017 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun May 14 21:35:40 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b83bf74
dev-python/Babel: backport fix for buggy test
Bug: https://bugs.gentoo.org/618448
Package-Manager: Portage-2.3.5_p32, Repoman-2.3.2_p62
dev-python/Babel/Babel-2.3.4.ebuild | 6 +++--
...he-way-local-time-is-constructed-in-tests.patch | 30 ++++++++++++++++++++++
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/dev-python/Babel/Babel-2.3.4.ebuild b/dev-python/Babel/Babel-2.3.4.ebuild
index a7cc27cafdf..8a594828ac2 100644
--- a/dev-python/Babel/Babel-2.3.4.ebuild
+++ b/dev-python/Babel/Babel-2.3.4.ebuild
@@ -23,6 +23,10 @@ DEPEND="${DEPEND}
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
test? ( >=dev-python/pytest-2.3.5[${PYTHON_USEDEP}] )"
+PATCHES=(
+ "${FILESDIR}"/2.3-Fix-the-way-local-time-is-constructed-in-tests.patch
+)
+
python_prepare_all() {
# Make the tests use implementation-specific datadir,
# because they try to write in it.
@@ -35,8 +39,6 @@ python_prepare_all() {
python_test() {
# Create implementation-specific datadir for tests.
cp -R -l tests/messages/data "${BUILD_DIR}"/ || die
- # https://bugs.gentoo.org/show_bug.cgi?id=618448
- export TZ=UTC
py.test || die
}
diff --git a/dev-python/Babel/files/2.3-Fix-the-way-local-time-is-constructed-in-tests.patch b/dev-python/Babel/files/2.3-Fix-the-way-local-time-is-constructed-in-tests.patch
new file mode 100644
index 00000000000..fdfb31d7c62
--- /dev/null
+++ b/dev-python/Babel/files/2.3-Fix-the-way-local-time-is-constructed-in-tests.patch
@@ -0,0 +1,30 @@
+From 476515c2418039e471656f47efbfc43e5230c1fd Mon Sep 17 00:00:00 2001
+From: Isaac Jurado <diptongo@gmail.com>
+Date: Sun, 29 May 2016 10:50:42 +0200
+Subject: [PATCH] Fix the way local time is constructed in tests
+
+In summer time zones, the test for "get_timezone_name" failed because the
+construct used to obtain a local time did not deal properly with DST offsets.
+As recommended by pytz, it is better to convert to local time from UTC.
+---
+ tests/test_dates.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_dates.py b/tests/test_dates.py
+index 3bb9e8b..b0d093e 100644
+--- a/tests/test_dates.py
++++ b/tests/test_dates.py
+@@ -624,8 +624,9 @@ def test_get_timezone_name():
+ assert dates.get_timezone_name(tz, locale='en', width='long',
+ zone_variant='daylight') == u'Pacific Daylight Time'
+
++ localnow = datetime.utcnow().replace(tzinfo=timezone('UTC')).astimezone(dates.LOCALTZ)
+ assert (dates.get_timezone_name(None, locale='en_US') ==
+- dates.get_timezone_name(datetime.now().replace(tzinfo=dates.LOCALTZ), locale='en_US'))
++ dates.get_timezone_name(localnow, locale='en_US'))
+
+ assert (dates.get_timezone_name('Europe/Berlin', locale='en_US') == "Central European Time")
+
+--
+2.13.0
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/Babel/files/, dev-python/Babel/
@ 2020-12-03 10:50 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2020-12-03 10:50 UTC (permalink / raw
To: gentoo-commits
commit: b031aa31015287af7828fbb85a66a566138c8afa
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 3 10:28:12 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec 3 10:50:25 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b031aa31
dev-python/Babel: Bump to 2.9.0
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/Babel/Babel-2.9.0.ebuild | 37 ++++++++++++++++++++++++++
dev-python/Babel/Manifest | 1 +
dev-python/Babel/files/Babel-2.9.0-pypy3.patch | 33 +++++++++++++++++++++++
3 files changed, 71 insertions(+)
diff --git a/dev-python/Babel/Babel-2.9.0.ebuild b/dev-python/Babel/Babel-2.9.0.ebuild
new file mode 100644
index 00000000000..b10743d637c
--- /dev/null
+++ b/dev-python/Babel/Babel-2.9.0.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( pypy3 python3_{6..9} )
+PYTHON_REQ_USE="threads(+)"
+DISTUTILS_USE_SETUPTOOLS=rdepend
+
+inherit distutils-r1
+
+DESCRIPTION="Collection of tools for internationalizing Python applications"
+HOMEPAGE="https://babel.pocoo.org/ https://pypi.org/project/Babel/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="dev-python/pytz[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/backports-zoneinfo[${PYTHON_USEDEP}]
+ ' python3_{6..8} pypy3)"
+DEPEND="${DEPEND}
+ test? ( dev-python/freezegun[${PYTHON_USEDEP}] )"
+
+distutils_enable_sphinx docs
+distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/Babel-2.9.0-pypy3.patch
+)
+
+src_test() {
+ local -x TZ=UTC
+ distutils-r1_src_test
+}
diff --git a/dev-python/Babel/Manifest b/dev-python/Babel/Manifest
index 3239a74c302..53cefd9bb2b 100644
--- a/dev-python/Babel/Manifest
+++ b/dev-python/Babel/Manifest
@@ -1,2 +1,3 @@
DIST Babel-2.8.0.tar.gz 8444381 BLAKE2B ea3757182464770f47d3253e77bece7b64c84558e7a19fc55759198bfa55c6d8156d27e9de7b796b62eefd93e458c7e00b2014dd23e4ed7383f5bc9785d1a332 SHA512 f9687b36176c146a8ace073197111463d24fca343bb1dbee8b0e37a7f37b68b4cd77ffbe3bf14a20f8f64c701aa860e0b5e6076658a95dbee2556f0688d68d91
DIST Babel-2.8.1.tar.gz 8471453 BLAKE2B bc2e66a3c1c77e5b190cdb3f53d149268b6f49adde3040cbe6a3dd8eb98f6caffb3988232e76083e606186a87b9ee6b2b5352de89b7bc43d4f72905f1f594127 SHA512 ed39ad01b873d40d0bc611739761d412ff442b2df3d4c2363ec24501547da678cb752f640a02470c8513073a76c468c27fc16248820c779ef7adbe14d0f07199
+DIST Babel-2.9.0.tar.gz 8682986 BLAKE2B 0e1e8fe647fdd27230ee9c97f0994772bd5877f262f9cd00eb450445c5780b278249f87d50f98c5ca3fa5eca287c6b4fc74c5e082c522c250d640912f0ebc581 SHA512 250d1a19741eb0d1bda9d6b862f2d4779b6c67f10b8e045f450a271a16587e30f26f35ccccfea8ca13bb519582d2ef83569fa4381d0590fb9b61bf3ebf67e5f6
diff --git a/dev-python/Babel/files/Babel-2.9.0-pypy3.patch b/dev-python/Babel/files/Babel-2.9.0-pypy3.patch
new file mode 100644
index 00000000000..45d50f5ff0b
--- /dev/null
+++ b/dev-python/Babel/files/Babel-2.9.0-pypy3.patch
@@ -0,0 +1,33 @@
+From a291ee5da29fb9767ce8dc5f94e3fa19908f2596 Mon Sep 17 00:00:00 2001
+From: Keri Volans <keri.volans@gmail.com>
+Date: Sun, 10 May 2020 18:43:58 +0100
+Subject: [PATCH] tests/test_dates.py: Fix broken test
+
+datetime was being incorrectly patched, so the unittest was failing
+
+Closes https://github.com/python-babel/babel/issues/675
+---
+ tests/test_dates.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/tests/test_dates.py b/tests/test_dates.py
+index 5be0d16a..3cd70d3e 100644
+--- a/tests/test_dates.py
++++ b/tests/test_dates.py
+@@ -761,7 +761,6 @@ def test_zh_TW_format():
+
+
+ def test_format_current_moment(monkeypatch):
+- import datetime as datetime_module
+ frozen_instant = datetime.utcnow()
+
+ class frozen_datetime(datetime):
+@@ -771,7 +770,7 @@ def utcnow(cls):
+ return frozen_instant
+
+ # Freeze time! Well, some of it anyway.
+- monkeypatch.setattr(datetime_module, "datetime", frozen_datetime)
++ monkeypatch.setattr(dates, "datetime_", frozen_datetime)
+ assert dates.format_datetime(locale="en_US") == dates.format_datetime(frozen_instant, locale="en_US")
+
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/Babel/files/, dev-python/Babel/
@ 2021-04-30 15:50 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2021-04-30 15:50 UTC (permalink / raw
To: gentoo-commits
commit: 626e1a9d049ff498d64160a487715e4324871f4b
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 30 15:49:38 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Apr 30 15:50:07 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=626e1a9d
dev-python/Babel: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/Babel/Babel-2.8.1.ebuild | 36 ------
dev-python/Babel/Babel-2.9.0.ebuild | 37 ------
dev-python/Babel/Manifest | 2 -
dev-python/Babel/files/Babel-2.8.0-py39.patch | 169 -------------------------
dev-python/Babel/files/Babel-2.9.0-pypy3.patch | 33 -----
5 files changed, 277 deletions(-)
diff --git a/dev-python/Babel/Babel-2.8.1.ebuild b/dev-python/Babel/Babel-2.8.1.ebuild
deleted file mode 100644
index 59a1c0b8d63..00000000000
--- a/dev-python/Babel/Babel-2.8.1.ebuild
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( pypy3 python3_{7..9} )
-PYTHON_REQ_USE="threads(+)"
-DISTUTILS_USE_SETUPTOOLS=rdepend
-
-inherit distutils-r1
-
-DESCRIPTION="Collection of tools for internationalizing Python applications"
-HOMEPAGE="https://babel.pocoo.org/ https://pypi.org/project/Babel/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
-
-RDEPEND="dev-python/pytz[${PYTHON_USEDEP}]
- dev-python/setuptools[${PYTHON_USEDEP}]"
-DEPEND="${DEPEND}
- test? ( dev-python/freezegun[${PYTHON_USEDEP}] )"
-
-distutils_enable_sphinx docs
-distutils_enable_tests pytest
-
-PATCHES=(
- "${FILESDIR}"/Babel-2.8.0-py39.patch
- "${FILESDIR}"/Babel-2.9.0-pypy3.patch
-)
-
-src_test() {
- local -x TZ=UTC
- distutils-r1_src_test
-}
diff --git a/dev-python/Babel/Babel-2.9.0.ebuild b/dev-python/Babel/Babel-2.9.0.ebuild
deleted file mode 100644
index 55fd72ae890..00000000000
--- a/dev-python/Babel/Babel-2.9.0.ebuild
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( pypy3 python3_{7..9} )
-PYTHON_REQ_USE="threads(+)"
-DISTUTILS_USE_SETUPTOOLS=rdepend
-
-inherit distutils-r1
-
-DESCRIPTION="Collection of tools for internationalizing Python applications"
-HOMEPAGE="https://babel.pocoo.org/ https://pypi.org/project/Babel/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos"
-
-RDEPEND="dev-python/pytz[${PYTHON_USEDEP}]
- $(python_gen_cond_dep '
- dev-python/backports-zoneinfo[${PYTHON_USEDEP}]
- ' python3_{6..8} pypy3)"
-DEPEND="${DEPEND}
- test? ( dev-python/freezegun[${PYTHON_USEDEP}] )"
-
-distutils_enable_sphinx docs
-distutils_enable_tests pytest
-
-PATCHES=(
- "${FILESDIR}"/Babel-2.9.0-pypy3.patch
-)
-
-src_test() {
- local -x TZ=UTC
- distutils-r1_src_test
-}
diff --git a/dev-python/Babel/Manifest b/dev-python/Babel/Manifest
index 7fe56472581..e22fec96358 100644
--- a/dev-python/Babel/Manifest
+++ b/dev-python/Babel/Manifest
@@ -1,3 +1 @@
-DIST Babel-2.8.1.tar.gz 8471453 BLAKE2B bc2e66a3c1c77e5b190cdb3f53d149268b6f49adde3040cbe6a3dd8eb98f6caffb3988232e76083e606186a87b9ee6b2b5352de89b7bc43d4f72905f1f594127 SHA512 ed39ad01b873d40d0bc611739761d412ff442b2df3d4c2363ec24501547da678cb752f640a02470c8513073a76c468c27fc16248820c779ef7adbe14d0f07199
-DIST Babel-2.9.0.tar.gz 8682986 BLAKE2B 0e1e8fe647fdd27230ee9c97f0994772bd5877f262f9cd00eb450445c5780b278249f87d50f98c5ca3fa5eca287c6b4fc74c5e082c522c250d640912f0ebc581 SHA512 250d1a19741eb0d1bda9d6b862f2d4779b6c67f10b8e045f450a271a16587e30f26f35ccccfea8ca13bb519582d2ef83569fa4381d0590fb9b61bf3ebf67e5f6
DIST Babel-2.9.1.tar.gz 8683505 BLAKE2B e4c6fe7284f03cd9e3e712156d87a520a437316955679f765aa68ca941bf668c544c96598486f3dad1bbb1f1d9a0719ccd527f23a2b1fb0274e453bdba557bd7 SHA512 89a2ce18301b522907bb66ec5453cbcd4c6b2d494d6928c9c62dc07bd8b6983982db571a85e251a1ea413b6f76fbd515f65c67c9bccf5441c62d351a57f2f4d0
diff --git a/dev-python/Babel/files/Babel-2.8.0-py39.patch b/dev-python/Babel/files/Babel-2.8.0-py39.patch
deleted file mode 100644
index efada9c1d08..00000000000
--- a/dev-python/Babel/files/Babel-2.8.0-py39.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-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'))
diff --git a/dev-python/Babel/files/Babel-2.9.0-pypy3.patch b/dev-python/Babel/files/Babel-2.9.0-pypy3.patch
deleted file mode 100644
index 45d50f5ff0b..00000000000
--- a/dev-python/Babel/files/Babel-2.9.0-pypy3.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From a291ee5da29fb9767ce8dc5f94e3fa19908f2596 Mon Sep 17 00:00:00 2001
-From: Keri Volans <keri.volans@gmail.com>
-Date: Sun, 10 May 2020 18:43:58 +0100
-Subject: [PATCH] tests/test_dates.py: Fix broken test
-
-datetime was being incorrectly patched, so the unittest was failing
-
-Closes https://github.com/python-babel/babel/issues/675
----
- tests/test_dates.py | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/tests/test_dates.py b/tests/test_dates.py
-index 5be0d16a..3cd70d3e 100644
---- a/tests/test_dates.py
-+++ b/tests/test_dates.py
-@@ -761,7 +761,6 @@ def test_zh_TW_format():
-
-
- def test_format_current_moment(monkeypatch):
-- import datetime as datetime_module
- frozen_instant = datetime.utcnow()
-
- class frozen_datetime(datetime):
-@@ -771,7 +770,7 @@ def utcnow(cls):
- return frozen_instant
-
- # Freeze time! Well, some of it anyway.
-- monkeypatch.setattr(datetime_module, "datetime", frozen_datetime)
-+ monkeypatch.setattr(dates, "datetime_", frozen_datetime)
- assert dates.format_datetime(locale="en_US") == dates.format_datetime(frozen_instant, locale="en_US")
-
-
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/Babel/files/, dev-python/Babel/
@ 2023-04-07 15:06 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2023-04-07 15:06 UTC (permalink / raw
To: gentoo-commits
commit: 35e9f3f0918bc4b0982c084521b042fb0f3c3ec8
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 7 14:59:48 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Apr 7 15:06:26 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35e9f3f0
dev-python/Babel: Fix date-related test failures
Closes: https://bugs.gentoo.org/903971
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/Babel/Babel-2.12.1.ebuild | 4 ++
dev-python/Babel/files/Babel-2.12.1-dst-test.patch | 46 ++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/dev-python/Babel/Babel-2.12.1.ebuild b/dev-python/Babel/Babel-2.12.1.ebuild
index 818272ef77fa..943a3ce6af7f 100644
--- a/dev-python/Babel/Babel-2.12.1.ebuild
+++ b/dev-python/Babel/Babel-2.12.1.ebuild
@@ -44,6 +44,10 @@ distutils_enable_sphinx docs
distutils_enable_tests pytest
src_prepare() {
+ local PATCHES=(
+ "${FILESDIR}/${P}-dst-test.patch"
+ )
+
rm babel/locale-data/*.dat || die
rm babel/global.dat || die
distutils-r1_src_prepare
diff --git a/dev-python/Babel/files/Babel-2.12.1-dst-test.patch b/dev-python/Babel/files/Babel-2.12.1-dst-test.patch
new file mode 100644
index 000000000000..2a732854e7b1
--- /dev/null
+++ b/dev-python/Babel/files/Babel-2.12.1-dst-test.patch
@@ -0,0 +1,46 @@
+From 641f58c9951d9f5746cd63743dd337f1340d7bff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 7 Apr 2023 14:51:10 +0000
+Subject: [PATCH] Freeze format_time() tests to a specific date to fix test
+ failures
+
+Freeze the date when performing the tests for format_time() with
+a timezone specified. Since the time object does not specify a date,
+the formatter uses the format string specific to the current date.
+As a result, if the current DST state is different than when the test
+was last updated, it failed.
+
+This fix covers only regular tests. I have no idea how to do the same
+for doctests.
+
+Issue #988
+---
+ tests/test_dates.py | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_dates.py b/tests/test_dates.py
+index b94c710..3f1fc3f 100644
+--- a/tests/test_dates.py
++++ b/tests/test_dates.py
+@@ -601,12 +601,13 @@ def test_format_time(timezone_getter):
+ custom = dates.format_time(t, "hh 'o''clock' a, zzzz", tzinfo=eastern, locale='en')
+ assert custom == "09 o'clock AM, Eastern Daylight Time"
+
+- t = time(15, 30)
+- paris = dates.format_time(t, format='full', tzinfo=paris, locale='fr_FR')
+- assert paris == '15:30:00 heure normale d’Europe centrale'
++ with freezegun.freeze_time("2023-01-01"):
++ t = time(15, 30)
++ paris = dates.format_time(t, format='full', tzinfo=paris, locale='fr_FR')
++ assert paris == '15:30:00 heure normale d’Europe centrale'
+
+- us_east = dates.format_time(t, format='full', tzinfo=eastern, locale='en_US')
+- assert us_east == '3:30:00\u202fPM Eastern Standard Time'
++ us_east = dates.format_time(t, format='full', tzinfo=eastern, locale='en_US')
++ assert us_east == '3:30:00\u202fPM Eastern Standard Time'
+
+
+ def test_format_skeleton(timezone_getter):
+--
+2.40.0
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-07 15:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07 15:06 [gentoo-commits] repo/gentoo:master commit in: dev-python/Babel/files/, dev-python/Babel/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2021-04-30 15:50 Michał Górny
2020-12-03 10:50 Michał Górny
2017-05-14 21:36 Mike Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox