commit: f400b9b53ce0dddb41adaad0c27c96a57c90bf49
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 29 18:41:04 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Oct 29 20:25:13 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f400b9b5
dev-python/django: Backport gettext-0.21 compat fix
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/django/django-2.2.16.ebuild | 4 +--
dev-python/django/django-3.0.10-r1.ebuild | 4 +--
dev-python/django/django-3.1.1-r1.ebuild | 4 +--
dev-python/django/django-3.1.2-r1.ebuild | 4 +--
dev-python/django/files/django-gettext-0.21.patch | 39 +++++++++++++++++++++++
5 files changed, 47 insertions(+), 8 deletions(-)
diff --git a/dev-python/django/django-2.2.16.ebuild
b/dev-python/django/django-2.2.16.ebuild
index a104153638a..a6fd5e608d0 100644
--- a/dev-python/django/django-2.2.16.ebuild
+++ b/dev-python/django/django-2.2.16.ebuild
@@ -30,7 +30,6 @@ RESTRICT="!test? ( test )"
RDEPEND="
dev-python/pytz[${PYTHON_USEDEP}]
>=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}]"
-# gettext: https://code.djangoproject.com/ticket/31850
BDEPEND="
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
test? (
@@ -43,11 +42,12 @@ BDEPEND="
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/selenium[${PYTHON_USEDEP}]
dev-python/tblib[${PYTHON_USEDEP}]
- <sys-devel/gettext-0.21
+ sys-devel/gettext
)"
PATCHES=(
"${FILESDIR}"/${PN}-2.0.7-bashcomp.patch
+ "${FILESDIR}"/django-gettext-0.21.patch
)
distutils_enable_sphinx docs --no-autodoc
diff --git a/dev-python/django/django-3.0.10-r1.ebuild
b/dev-python/django/django-3.0.10-r1.ebuild
index 58de4970519..75ded0b622f 100644
--- a/dev-python/django/django-3.0.10-r1.ebuild
+++ b/dev-python/django/django-3.0.10-r1.ebuild
@@ -31,7 +31,6 @@ RDEPEND="
dev-python/asgiref[${PYTHON_USEDEP}]
dev-python/pytz[${PYTHON_USEDEP}]
>=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}]"
-# gettext: https://code.djangoproject.com/ticket/31850
BDEPEND="
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
test? (
@@ -44,11 +43,12 @@ BDEPEND="
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/selenium[${PYTHON_USEDEP}]
dev-python/tblib[${PYTHON_USEDEP}]
- <sys-devel/gettext-0.21
+ sys-devel/gettext
)"
PATCHES=(
"${FILESDIR}"/${PN}-3.0.6-bashcomp.patch
+ "${FILESDIR}"/django-gettext-0.21.patch
)
distutils_enable_sphinx docs --no-autodoc
diff --git a/dev-python/django/django-3.1.1-r1.ebuild
b/dev-python/django/django-3.1.1-r1.ebuild
index 858be578907..2c544a79688 100644
--- a/dev-python/django/django-3.1.1-r1.ebuild
+++ b/dev-python/django/django-3.1.1-r1.ebuild
@@ -31,7 +31,6 @@ RDEPEND="
dev-python/asgiref[${PYTHON_USEDEP}]
dev-python/pytz[${PYTHON_USEDEP}]
>=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}]"
-# gettext: https://code.djangoproject.com/ticket/31850
BDEPEND="
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
test? (
@@ -44,11 +43,12 @@ BDEPEND="
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/selenium[${PYTHON_USEDEP}]
dev-python/tblib[${PYTHON_USEDEP}]
- <sys-devel/gettext-0.21
+ sys-devel/gettext
)"
PATCHES=(
"${FILESDIR}"/${PN}-3.1-bashcomp.patch
+ "${FILESDIR}"/django-gettext-0.21.patch
)
distutils_enable_sphinx docs --no-autodoc
diff --git a/dev-python/django/django-3.1.2-r1.ebuild
b/dev-python/django/django-3.1.2-r1.ebuild
index 858be578907..2c544a79688 100644
--- a/dev-python/django/django-3.1.2-r1.ebuild
+++ b/dev-python/django/django-3.1.2-r1.ebuild
@@ -31,7 +31,6 @@ RDEPEND="
dev-python/asgiref[${PYTHON_USEDEP}]
dev-python/pytz[${PYTHON_USEDEP}]
>=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}]"
-# gettext: https://code.djangoproject.com/ticket/31850
BDEPEND="
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
test? (
@@ -44,11 +43,12 @@ BDEPEND="
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/selenium[${PYTHON_USEDEP}]
dev-python/tblib[${PYTHON_USEDEP}]
- <sys-devel/gettext-0.21
+ sys-devel/gettext
)"
PATCHES=(
"${FILESDIR}"/${PN}-3.1-bashcomp.patch
+ "${FILESDIR}"/django-gettext-0.21.patch
)
distutils_enable_sphinx docs --no-autodoc
diff --git a/dev-python/django/files/django-gettext-0.21.patch
b/dev-python/django/files/django-gettext-0.21.patch
new file mode 100644
index 00000000000..5d3edfea4a1
--- /dev/null
+++ b/dev-python/django/files/django-gettext-0.21.patch
@@ -0,0 +1,39 @@
+From 07a30f561661efae1691ff45d10ec6014b395b58 Mon Sep 17 00:00:00 2001
+From: Max Smolens <[email protected]>
+Date: Tue, 6 Oct 2020 17:58:52 -0400
+Subject: [PATCH] Fixed #31850 -- Fixed
+ BasicExtractorTests.test_extraction_warning with xgettext 0.21+.
+
+"format string with unnamed arguments cannot be properly localized"
+warning is not raised in xgettext 0.21+.
+
+This patch uses a message that causes an xgettext warning regardless of
+the version.
+---
+ AUTHORS | 1 +
+ tests/i18n/commands/code.sample | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/AUTHORS b/AUTHORS
+index b10852f407a4..9253740857de 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -622,6 +622,7 @@ answer newbie questions, and generally made Django that
much better:
+ [email protected]
+ Max Burstein <http://maxburstein.com>
+ Max Derkachev <[email protected]>
++ Max Smolens <[email protected]>
+ Maxime Lorant <[email protected]>
+ Maxime Turcotte <[email protected]>
+ Maximilian Merz <[email protected]>
+diff --git a/tests/i18n/commands/code.sample b/tests/i18n/commands/code.sample
+index a5f1520ecba5..2c305a3a1dcf 100644
+--- a/tests/i18n/commands/code.sample
++++ b/tests/i18n/commands/code.sample
+@@ -1,4 +1,4 @@
+ from django.utils.translation import gettext
+
+-# This will generate an xgettext warning
+-my_string = gettext("This string contain two placeholders: %s and %s" % ('a',
'b'))
++# This will generate an xgettext "Empty msgid" warning.
++my_string = gettext('')