commit:     36b40adc9fd1ef9d775d12607a450fcc66f36eab
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  7 13:30:56 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug  7 14:15:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36b40adc

dev-python/django: Bump to 5.2.5

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/django/Manifest                         |   2 +
 dev-python/django/django-5.2.5.ebuild              | 100 +++++++++++++++++++++
 .../django/files/django-5.2.5-htmlparser.patch     |  58 ++++++++++++
 3 files changed, 160 insertions(+)

diff --git a/dev-python/django/Manifest b/dev-python/django/Manifest
index 7287cc44d880..753b477de68a 100644
--- a/dev-python/django/Manifest
+++ b/dev-python/django/Manifest
@@ -1,7 +1,9 @@
 DIST Django-4.2.23.checksum.txt 2384 BLAKE2B 
b14eedfea3253c3f3e3a96e124fe942bfdcfd5013876fd2ab7a693c5cf9190652869ef9093b1650c968bd2ecf097566cb404984645dbb3e28423a4a47f747c05
 SHA512 
8393fb7e21b5ea0db8fc909588e1ce40ce18f405f2d53470f75237889509e4606e3a1aa7168e9defe4c790446dee12084a779c275d6290dcd6f7db285ec3c045
 DIST Django-5.1.11.checksum.txt 2384 BLAKE2B 
8a8c2528bf0453d9da92cd5c6929b59f5e942840e17fd15dac00c1979d92f46b21c318f0d5d0426dd3cf0fd2c99799eb24eb2e50c4af906ad330d8fa1acd40df
 SHA512 
748b3f4987ef0854cb3cbb501a7ee0c71acb5fbd2a3b4b07eef581db8ba31ad481aef4465a75fc42dcd4e75148568700101d169329373d3208b76aa6b90602f3
 DIST Django-5.2.4.checksum.txt 2536 BLAKE2B 
112467d2065f70700ee7f52e672f9208a4b96d8015ef8f11ec15f06fd62f8dd90e08690099a4ab859a2056ce16b033bd04162dbcbd590fa33f64af617bf225d8
 SHA512 
e8f1b971c4097996e3513d088a93b6bfc89280fc400aa908324041691f1f794d2e329d5e8ccadbbddfa7cba31823376651ea157b031efe5e2b74b38177ed7a6b
+DIST Django-5.2.5.checksum.txt 2375 BLAKE2B 
f3a3efcfb301ff20c949f48d6eeae53fb509c4a1ed4296d9d61f087e1fc7c6584d140e25446cdf39630ef35f957493ea1acf415e69e7aecc6314a2a10811c27e
 SHA512 
7e5118e68c16bc18fed842040babea4428865fe24ae7d9571cfd195473b583be79fc0beed6b921735ccfa9711ad016df613c9882fe34305aa22070a6cc6af0cd
 DIST django-4.2.17-pypy3.patch.xz 5900 BLAKE2B 
2a564fc31d8e2f3def5a532d3bca1a4426a496c659192f602d659e0c1a5f5882978baedb384cc3b67fda8c836513ce43aece80db1528c8e8b6e9ca420f7572ce
 SHA512 
9c9d935aff6db7230a26931b5e7f5f94f3b5ff4fc8f7d4201178571de9d9c7929a0e1e558cc2d9b54b8ee91f85819a5680d24fad6251620515a4a020e3b2d66d
 DIST django-4.2.23.tar.gz 10448384 BLAKE2B 
7ac537b279c3ff3e530c8a3a8c2884e30b8771e7bc86fa9086c5149aa9c2c0bf98b90b572e607e7c38c6dbfa95a06783e93a157ee6cdcd24a5285d4e9d700901
 SHA512 
3461a83b5c6cad1db8b1a54fa44735c6ec6d1aadb476973f3a76f8c1c3ffc49549ad8aded28baf05be439bdf8f9890f79b4908f16655804eb805a74dbb0e6ab3
 DIST django-5.1.11.tar.gz 10734926 BLAKE2B 
2fd387f356e3bafd3569ae0dd24c540970f5bcd465ebbf8726950fd92f4a85563ec6f79e5bbe69ba430eceab46cca50f631c9027a0e5abb024c906d42e69354e
 SHA512 
dc9cb8e16242c6276cedccb639443d3f4b2d3805f52a74310fddb761ffc3ff9ad6be3863a4a14574ae9bf19342304afc0733497b4b584cb6cbe59e9b394d9a59
 DIST django-5.2.4.tar.gz 10831909 BLAKE2B 
3dac27659b23698142b4b9163fe3a916a2352ab9f079ade10cdf0304229ab1109818befdf29f42864fed2409b1af5b777836c2f63cbbf98f7af09920507fcdc6
 SHA512 
af2ec6cfa6e17c6b348c165947ac76287f51e5ab6edc90682b57f8412ec22aaa0cd326516f65b63438d2ef48a70d306a59bfb7a235adeae0e753b654a3b0059c
+DIST django-5.2.5.tar.gz 10859748 BLAKE2B 
a721e6199bd1c386098536a62a652bbad14268fd79f56a1235d0c0377e511a5c5ddc7646549389c72994bc1019a15ddb0b38a237a4ef4a5cc83caa8d248cec11
 SHA512 
b65e59596a2c3b4d219d0b37b54bbcead10b1f9760d499cb5cd603b0025995415f3883531f3274ca56a66f3c809933859a079d829403ca8160e6f6cadf7591a4

diff --git a/dev-python/django/django-5.2.5.ebuild 
b/dev-python/django/django-5.2.5.ebuild
new file mode 100644
index 000000000000..d9d956b7fd7d
--- /dev/null
+++ b/dev-python/django/django-5.2.5.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( pypy3_11 python3_{11..13} )
+PYTHON_REQ_USE='sqlite?,threads(+)'
+
+inherit bash-completion-r1 distutils-r1 multiprocessing optfeature verify-sig
+
+DESCRIPTION="High-level Python web framework"
+HOMEPAGE="
+       https://www.djangoproject.com/
+       https://github.com/django/django/
+       https://pypi.org/project/Django/
+"
+SRC_URI="
+       https://media.djangoproject.com/releases/$(ver_cut 1-2)/${P}.tar.gz
+       verify-sig? ( https://media.djangoproject.com/pgp/${P^}.checksum.txt )
+"
+
+LICENSE="BSD"
+# admin fonts: Roboto (media-fonts/roboto)
+LICENSE+=" Apache-2.0"
+# admin icons, jquery, xregexp.js
+LICENSE+=" MIT"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc 
~x86 ~x64-macos"
+IUSE="doc sqlite test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       <dev-python/asgiref-4[${PYTHON_USEDEP}]
+       >=dev-python/asgiref-3.8.1[${PYTHON_USEDEP}]
+       >=dev-python/sqlparse-0.3.1[${PYTHON_USEDEP}]
+       sys-libs/timezone-data
+"
+BDEPEND="
+       test? (
+               $(python_gen_impl_dep sqlite)
+               ${RDEPEND}
+               >=dev-python/docutils-0.19[${PYTHON_USEDEP}]
+               >=dev-python/jinja2-2.11.0[${PYTHON_USEDEP}]
+               dev-python/numpy[${PYTHON_USEDEP}]
+               dev-python/pillow[webp,${PYTHON_USEDEP}]
+               dev-python/pyyaml[${PYTHON_USEDEP}]
+               >=dev-python/selenium-4.8.0[${PYTHON_USEDEP}]
+               >=dev-python/tblib-1.5.0[${PYTHON_USEDEP}]
+               sys-devel/gettext
+       )
+       verify-sig? ( >=sec-keys/openpgp-keys-django-20240807 )
+"
+
+PATCHES=(
+       "${FILESDIR}"/django-4.0-bashcomp.patch
+       # https://github.com/django/django/pull/19639
+       "${FILESDIR}"/django-5.2.5-htmlparser.patch
+)
+
+distutils_enable_sphinx docs --no-autodoc
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/django.asc
+
+src_unpack() {
+       if use verify-sig; then
+               cd "${DISTDIR}" || die
+               verify-sig_verify_signed_checksums \
+                       "${P^}.checksum.txt" sha256 "${P}.tar.gz"
+               cd "${WORKDIR}" || die
+       fi
+
+       default
+}
+
+python_test() {
+       # Tests have non-standard assumptions about PYTHONPATH,
+       # and don't work with ${BUILD_DIR}/lib.
+       PYTHONPATH=. "${EPYTHON}" tests/runtests.py --settings=test_sqlite \
+               -v2 --parallel="${EPYTEST_JOBS:-$(makeopts_jobs)}" ||
+               die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+       newbashcomp extras/django_bash_completion ${PN}-admin
+       bashcomp_alias ${PN}-admin django-admin.py
+
+       distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+       optfeature_header "Additional Backend support can be enabled via:"
+       optfeature "MySQL backend support" dev-python/mysqlclient
+       optfeature "PostgreSQL backend support" dev-python/psycopg:0
+       optfeature_header
+       optfeature "GEO Django" "sci-libs/gdal[geos]"
+       optfeature "Memcached support" dev-python/pylibmc 
dev-python/python-memcached
+       optfeature "ImageField Support" dev-python/pillow
+       optfeature "Password encryption" dev-python/bcrypt
+}

diff --git a/dev-python/django/files/django-5.2.5-htmlparser.patch 
b/dev-python/django/files/django-5.2.5-htmlparser.patch
new file mode 100644
index 000000000000..6d986be38478
--- /dev/null
+++ b/dev-python/django/files/django-5.2.5-htmlparser.patch
@@ -0,0 +1,58 @@
+From e0a1e8d549e7be25960b8ad060c63def3dc35d1d Mon Sep 17 00:00:00 2001
+From: Natalia <[email protected]>
+Date: Mon, 21 Jul 2025 15:23:32 -0300
+Subject: [PATCH 1/2] Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors
+ following Python's HTMLParser fixed parsing.
+
+Further details about Python changes can be found in:
+https://github.com/python/cpython/commit/0243f97cbadec8d985e63b1daec5d1cbc850cae3.
+
+Thank you Clifford Gama for the thorough review!
+---
+ tests/test_utils/tests.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
+index 37e87aa1022c..9c22b61b4ff2 100644
+--- a/tests/test_utils/tests.py
++++ b/tests/test_utils/tests.py
+@@ -962,7 +962,7 @@ def test_parsing_errors(self):
+             "('Unexpected end tag `div` (Line 1, Column 6)', (1, 6))"
+         )
+         with self.assertRaisesMessage(AssertionError, error_msg):
+-            self.assertHTMLEqual("< div></ div>", "<div></div>")
++            self.assertHTMLEqual("< div></div>", "<div></div>")
+         with self.assertRaises(HTMLParseError):
+             parse_html("</p>")
+ 
+
+From e8afcf0e644553bcba3e5f931266963bffc46748 Mon Sep 17 00:00:00 2001
+From: Natalia <[email protected]>
+Date: Mon, 14 Jul 2025 14:45:03 -0300
+Subject: [PATCH 2/2] Fixed #36499 -- Adjusted
+ utils_tests.test_html.TestUtilsHtml.test_strip_tags following Python's
+ HTMLParser new behavior.
+
+Python fixed a quadratic complexity processing for HTMLParser in:
+https://github.com/python/cpython/commit/6eb6c5dbfb528bd07d77b60fd71fd05d81d45c41.
+---
+ tests/utils_tests/test_html.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py
+index 284f33aedcfb..51573b81eb9d 100644
+--- a/tests/utils_tests/test_html.py
++++ b/tests/utils_tests/test_html.py
+@@ -142,10 +142,10 @@ def test_strip_tags(self):
+             ("&gotcha&#;<>", "&gotcha&#;<>"),
+             ("<sc<!-- -->ript>test<<!-- -->/script>", "ript>test"),
+             ("<script>alert()</script>&h", "alert()h"),
+-            ("><!" + ("&" * 16000) + "D", "><!" + ("&" * 16000) + "D"),
++            ("><!" + ("&" * 16000) + "D", ">"),
+             ("X<<<<br>br>br>br>X", "XX"),
+             ("<" * 50 + "a>" * 50, ""),
+-            (">" + "<a" * 500 + "a", ">" + "<a" * 500 + "a"),
++            (">" + "<a" * 500 + "a", ">"),
+             ("<a" * 49 + "a" * 951, "<a" * 49 + "a" * 951),
+             ("<" + "a" * 1_002, "<" + "a" * 1_002),
+         )

Reply via email to