commit: 717e0097c43b38fe4460b9f4a37081ba599412ed
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 16:49:47 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 17:21:35 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=717e0097
dev-python/django: Enable py3.13
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/django/django-5.0.6.ebuild | 4 +-
dev-python/django/files/django-5.0.6-py313.patch | 58 ++++++++++++++++++++++++
2 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/dev-python/django/django-5.0.6.ebuild
b/dev-python/django/django-5.0.6.ebuild
index 465a7dcda6cd..be69e34a55a0 100644
--- a/dev-python/django/django-5.0.6.ebuild
+++ b/dev-python/django/django-5.0.6.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( pypy3 python3_{10..12} )
+PYTHON_COMPAT=( pypy3 python3_{10..13} )
PYTHON_REQ_USE='sqlite?,threads(+)'
inherit bash-completion-r1 distutils-r1 multiprocessing optfeature verify-sig
@@ -57,6 +57,8 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/django-4.0-bashcomp.patch
"${WORKDIR}"/django-5.0-pypy3.patch
+ #
https://github.com/django/django/commit/3426a5c33c36266af42128ee9eca4921e68ea876
+ "${FILESDIR}"/django-5.0.6-py313.patch
)
distutils_enable_sphinx docs --no-autodoc
diff --git a/dev-python/django/files/django-5.0.6-py313.patch
b/dev-python/django/files/django-5.0.6-py313.patch
new file mode 100644
index 000000000000..377d41261d2e
--- /dev/null
+++ b/dev-python/django/files/django-5.0.6-py313.patch
@@ -0,0 +1,58 @@
+From 3426a5c33c36266af42128ee9eca4921e68ea876 Mon Sep 17 00:00:00 2001
+From: Mariusz Felisiak <[email protected]>
+Date: Tue, 20 Feb 2024 20:59:26 +0100
+Subject: [PATCH] Refs #34900 -- Fixed
+ CommandTypes.test_help_default_options_with_custom_arguments test on Python
+ 3.13+.
+
+https://github.com/python/cpython/commit/c4a2e8a2c5188c3288d57b80852e92c83f46f6f3
+---
+ django/utils/version.py | 1 +
+ tests/admin_scripts/tests.py | 15 +++++++++++----
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/django/utils/version.py b/django/utils/version.py
+index ecd41dac897ab..6f8171ffe0cfe 100644
+--- a/django/utils/version.py
++++ b/django/utils/version.py
+@@ -20,6 +20,7 @@
+ PY310 = sys.version_info >= (3, 10)
+ PY311 = sys.version_info >= (3, 11)
+ PY312 = sys.version_info >= (3, 12)
++PY313 = sys.version_info >= (3, 13)
+
+
+ def get_version(version=None):
+diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
+index 50e8d4a3b1eda..688aaa0a2f8de 100644
+--- a/tests/admin_scripts/tests.py
++++ b/tests/admin_scripts/tests.py
+@@ -33,6 +33,7 @@
+ from django.test import LiveServerTestCase, SimpleTestCase, TestCase,
override_settings
+ from django.test.utils import captured_stderr, captured_stdout
+ from django.urls import path
++from django.utils.version import PY313
+ from django.views.static import serve
+
+ from . import urls
+@@ -1901,10 +1902,16 @@ def
test_help_default_options_with_custom_arguments(self):
+ ]
+ for option in expected_options:
+ self.assertOutput(out, f"[{option}]")
+- self.assertOutput(out, "--option_a OPTION_A, -a OPTION_A")
+- self.assertOutput(out, "--option_b OPTION_B, -b OPTION_B")
+- self.assertOutput(out, "--option_c OPTION_C, -c OPTION_C")
+- self.assertOutput(out, "-v {0,1,2,3}, --verbosity {0,1,2,3}")
++ if PY313:
++ self.assertOutput(out, "--option_a, -a OPTION_A")
++ self.assertOutput(out, "--option_b, -b OPTION_B")
++ self.assertOutput(out, "--option_c, -c OPTION_C")
++ self.assertOutput(out, "-v, --verbosity {0,1,2,3}")
++ else:
++ self.assertOutput(out, "--option_a OPTION_A, -a OPTION_A")
++ self.assertOutput(out, "--option_b OPTION_B, -b OPTION_B")
++ self.assertOutput(out, "--option_c OPTION_C, -c OPTION_C")
++ self.assertOutput(out, "-v {0,1,2,3}, --verbosity {0,1,2,3}")
+
+ def test_color_style(self):
+ style = color.no_style()