dev-python/django: add 4.0.10

Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
Alarig Le Lay 2024-08-21 14:51:26 +02:00
parent 5c2ecbdd57
commit 2492c99776
Signed by: alarig
GPG key ID: 7AFE62C6DF8BCDEC
4 changed files with 346 additions and 0 deletions

View file

@ -2,3 +2,5 @@ DIST Django-3.2.25.checksum.txt 2560 BLAKE2B e082c588f4e124c9d71c1914e475fd70ed9
DIST Django-3.2.25.tar.gz 9836336 BLAKE2B 586520e0689b2594dd8ce4abb173418aedfde80cc84012d2a4207cbfc67120cbf405a8dfc8d069bb946f027f0eef22b233bd3b3ce569b01ea8fdc7836a6e530f SHA512 ccba83abd1777123186d685e21b96f41abf216a692d18ffe764d2e519eb9d1f6011d08c86b3affdd891591ca4ed7fee27ffa4750d19b486ca775ee680fdb0cb1 DIST Django-3.2.25.tar.gz 9836336 BLAKE2B 586520e0689b2594dd8ce4abb173418aedfde80cc84012d2a4207cbfc67120cbf405a8dfc8d069bb946f027f0eef22b233bd3b3ce569b01ea8fdc7836a6e530f SHA512 ccba83abd1777123186d685e21b96f41abf216a692d18ffe764d2e519eb9d1f6011d08c86b3affdd891591ca4ed7fee27ffa4750d19b486ca775ee680fdb0cb1
DIST Django-3.2.9.checksum.txt 2547 BLAKE2B 7a1c38abe3215ee4533984c7d78c37b369545695fb11d84d6600d64eec290addb9257c4d2850af4e311df2245799572e0866917e09713643376da7859754a2ce SHA512 9aae8da65079e20dcf9071fd72fa5f5c61640264b52c842d96cc2f697ba1d5003cf7b7c6d1f95549eb8ec4449679a00ddd267c022b3d0483ab030cc96c9405b7 DIST Django-3.2.9.checksum.txt 2547 BLAKE2B 7a1c38abe3215ee4533984c7d78c37b369545695fb11d84d6600d64eec290addb9257c4d2850af4e311df2245799572e0866917e09713643376da7859754a2ce SHA512 9aae8da65079e20dcf9071fd72fa5f5c61640264b52c842d96cc2f697ba1d5003cf7b7c6d1f95549eb8ec4449679a00ddd267c022b3d0483ab030cc96c9405b7
DIST Django-3.2.9.tar.gz 9809157 BLAKE2B 27fc04e874055f69466f06b009c015b46c2d2fa9ddd0005f7b2b7b32a45bd1b8a9f34e693027e040b8d05fa581dfeb9a00aaa1d876477cff5292167f20768b60 SHA512 62fb297694a7f5e48465e102dc97e3d1d04b94499bc6d98d37a00d96b438b8c919b6d08055868a1836d62b89ff65ce4fa7dbc9390789dab2eeca0187269b125f DIST Django-3.2.9.tar.gz 9809157 BLAKE2B 27fc04e874055f69466f06b009c015b46c2d2fa9ddd0005f7b2b7b32a45bd1b8a9f34e693027e040b8d05fa581dfeb9a00aaa1d876477cff5292167f20768b60 SHA512 62fb297694a7f5e48465e102dc97e3d1d04b94499bc6d98d37a00d96b438b8c919b6d08055868a1836d62b89ff65ce4fa7dbc9390789dab2eeca0187269b125f
DIST Django-4.0.10.checksum.txt 2563 BLAKE2B 1ec93751204e80d75f5f4f15086cfd9aabe65e392359f82edb234f2b86802bd1078e00575379c1956dfca8e6c60ddc6209079ae7e99450aa000b22c3312a89f4 SHA512 67b335f184ce02395efba3a4bec7d8087735ef8816eda70867faf9c02242c11c95f30fc36db6abd30996098dd567ef53f6dd467567c5405f34cb2bff7cd2a23c
DIST Django-4.0.10.tar.gz 10430363 BLAKE2B d36aefd5d00023e5c4e34dda2b283e9a82d9e3b82576ce00cef7d9b75837ffdbf56327ad21ccefb02b79e8db93f12cf850541f4cb1d01b3dd28bdea0c73cb9d6 SHA512 04d1b207af21067c22c120486ff57ea602b3436adf1871f691735825afb30c3ed62f1cbc98d92fa70e9a818bcf50db70d949ab0c460f48f6027b75df9eba56c7

View file

@ -0,0 +1,110 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..11} )
PYTHON_REQ_USE='sqlite?,threads(+)'
inherit bash-completion-r1 distutils-r1 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 )
"
S="${WORKDIR}/${P^}"
LICENSE="BSD"
# admin fonts: Roboto (media-fonts/roboto)
LICENSE+=" Apache-2.0"
# admin icons, jquery, xregexp.js
LICENSE+=" MIT"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~ppc ~ppc64 ~riscv ~sparc x86 ~x64-macos"
IUSE="doc sqlite test"
RESTRICT="!test? ( test )"
RDEPEND="
>=dev-python/asgiref-3.4.1[${PYTHON_USEDEP}]
>=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}]
$(python_gen_cond_dep '
dev-python/backports-zoneinfo[${PYTHON_USEDEP}]
' 3.8)
"
BDEPEND="
test? (
$(python_gen_impl_dep sqlite)
${RDEPEND}
dev-python/docutils[${PYTHON_USEDEP}]
dev-python/jinja[${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/pillow[webp,${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/selenium[${PYTHON_USEDEP}]
dev-python/tblib[${PYTHON_USEDEP}]
sys-devel/gettext
!!<dev-python/ipython-7.21.0-r1
!!=dev-python/ipython-7.22.0-r0
)
verify-sig? ( >=sec-keys/openpgp-keys-django-20201201 )
"
PATCHES=(
"${FILESDIR}"/${PN}-4.0-bashcomp.patch
"${FILESDIR}"/django-4.0.5-py311.patch
)
distutils_enable_sphinx docs --no-autodoc
VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/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
}
src_prepare() {
# TODO: this suddenly started failing
sed -i -e 's:test_custom_fields:_&:' tests/inspectdb/tests.py || die
distutils-r1_src_prepare
}
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 ||
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:2
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
optfeature "High-level abstractions for Django forms" dev-python/django-formtools
}

View file

@ -0,0 +1,218 @@
From 3d022e13bcc1de5162ba7198c856bf27c03d4f37 Mon Sep 17 00:00:00 2001
From: David Smith <39445562+smithdc1@users.noreply.github.com>
Date: Sat, 19 Feb 2022 19:36:01 +0000
Subject: [PATCH 1/3] Refs #33173 -- Fixed MailTests.test_backend_arg() on
Windows and Python 3.11+.
---
django/utils/version.py | 1 +
tests/mail/tests.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/django/utils/version.py b/django/utils/version.py
index 77f13833cb..8f4ab2bcfa 100644
--- a/django/utils/version.py
+++ b/django/utils/version.py
@@ -15,6 +15,7 @@ PY37 = sys.version_info >= (3, 7)
PY38 = sys.version_info >= (3, 8)
PY39 = sys.version_info >= (3, 9)
PY310 = sys.version_info >= (3, 10)
+PY311 = sys.version_info >= (3, 11)
def get_version(version=None):
diff --git a/tests/mail/tests.py b/tests/mail/tests.py
index 51e26cc6be..183a0c0ab1 100644
--- a/tests/mail/tests.py
+++ b/tests/mail/tests.py
@@ -29,6 +29,7 @@ from django.core.mail.message import BadHeaderError, sanitize_address
from django.test import SimpleTestCase, override_settings
from django.test.utils import requires_tz_support
from django.utils.translation import gettext_lazy
+from django.utils.version import PY311
try:
from aiosmtpd.controller import Controller
@@ -790,7 +791,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
filebased.EmailBackend,
)
- if sys.platform == "win32":
+ if sys.platform == "win32" and not PY311:
msg = (
"_getfullpathname: path should be string, bytes or os.PathLike, not "
"object"
--
2.35.1
From 4d548dce8fb280ed7be63e9818c316fe5f0ee154 Mon Sep 17 00:00:00 2001
From: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Date: Thu, 7 Apr 2022 07:02:21 +0200
Subject: [PATCH 2/3] Refs #33173 -- Fixed test_runner/test_utils tests on
Python 3.11+.
Python 3.11 uses fully qualified test name in unittest output. See
https://github.com/python/cpython/commit/755be9b1505af591b9f2ee424a6525b6c2b65ce9
---
tests/test_runner/test_debug_sql.py | 14 +++++++++-----
tests/test_runner/test_parallel.py | 5 ++++-
tests/test_utils/tests.py | 13 +++++++++----
3 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/tests/test_runner/test_debug_sql.py b/tests/test_runner/test_debug_sql.py
index 9957295f01..d45d8cb4ba 100644
--- a/tests/test_runner/test_debug_sql.py
+++ b/tests/test_runner/test_debug_sql.py
@@ -4,6 +4,7 @@ from io import StringIO
from django.db import connection
from django.test import TestCase
from django.test.runner import DiscoverRunner
+from django.utils.version import PY311
from .models import Person
@@ -109,14 +110,17 @@ class TestDebugSQL(unittest.TestCase):
),
]
+ # Python 3.11 uses fully qualified test name in the output.
+ method_name = ".runTest" if PY311 else ""
+ test_class_path = "test_runner.test_debug_sql.TestDebugSQL"
verbose_expected_outputs = [
- "runTest (test_runner.test_debug_sql.TestDebugSQL.FailingTest) ... FAIL",
- "runTest (test_runner.test_debug_sql.TestDebugSQL.ErrorTest) ... ERROR",
- "runTest (test_runner.test_debug_sql.TestDebugSQL.PassingTest) ... ok",
+ f"runTest ({test_class_path}.FailingTest{method_name}) ... FAIL",
+ f"runTest ({test_class_path}.ErrorTest{method_name}) ... ERROR",
+ f"runTest ({test_class_path}.PassingTest{method_name}) ... ok",
# If there are errors/failures in subtests but not in test itself,
# the status is not written. That behavior comes from Python.
- "runTest (test_runner.test_debug_sql.TestDebugSQL.FailingSubTest) ...",
- "runTest (test_runner.test_debug_sql.TestDebugSQL.ErrorSubTest) ...",
+ f"runTest ({test_class_path}.FailingSubTest{method_name}) ...",
+ f"runTest ({test_class_path}.ErrorSubTest{method_name}) ...",
(
"""SELECT COUNT(*) AS "__count" """
"""FROM "test_runner_person" WHERE """
diff --git a/tests/test_runner/test_parallel.py b/tests/test_runner/test_parallel.py
index ca208f6a48..a2f68d3512 100644
--- a/tests/test_runner/test_parallel.py
+++ b/tests/test_runner/test_parallel.py
@@ -4,6 +4,7 @@ import unittest
from django.test import SimpleTestCase
from django.test.runner import RemoteTestResult
+from django.utils.version import PY311
try:
import tblib.pickling_support
@@ -125,7 +126,9 @@ class RemoteTestResultTest(SimpleTestCase):
self.assertEqual(event[0], "addSubTest")
self.assertEqual(
str(event[2]),
- "dummy_test (test_runner.test_parallel.SampleFailingSubtest) (index=0)",
+ "dummy_test (test_runner.test_parallel.SampleFailingSubtest%s) (index=0)"
+ # Python 3.11 uses fully qualified test name in the output.
+ % (".dummy_test" if PY311 else ""),
)
self.assertEqual(repr(event[3][1]), "AssertionError('0 != 1')")
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index b21c83585b..3b17da1c13 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -47,6 +47,7 @@ from django.test.utils import (
from django.urls import NoReverseMatch, path, reverse, reverse_lazy
from django.utils.deprecation import RemovedInDjango41Warning
from django.utils.log import DEFAULT_LOGGING
+from django.utils.version import PY311
from .models import Car, Person, PossessedCar
from .views import empty_response
@@ -99,9 +100,11 @@ class SkippingTestCase(SimpleTestCase):
SkipTestCase("test_foo").test_foo,
ValueError,
"skipUnlessDBFeature cannot be used on test_foo (test_utils.tests."
- "SkippingTestCase.test_skip_unless_db_feature.<locals>.SkipTestCase) "
+ "SkippingTestCase.test_skip_unless_db_feature.<locals>.SkipTestCase%s) "
"as SkippingTestCase.test_skip_unless_db_feature.<locals>.SkipTestCase "
- "doesn't allow queries against the 'default' database.",
+ "doesn't allow queries against the 'default' database."
+ # Python 3.11 uses fully qualified test name in the output.
+ % (".test_foo" if PY311 else ""),
)
def test_skip_if_db_feature(self):
@@ -144,9 +147,11 @@ class SkippingTestCase(SimpleTestCase):
SkipTestCase("test_foo").test_foo,
ValueError,
"skipIfDBFeature cannot be used on test_foo (test_utils.tests."
- "SkippingTestCase.test_skip_if_db_feature.<locals>.SkipTestCase) "
+ "SkippingTestCase.test_skip_if_db_feature.<locals>.SkipTestCase%s) "
"as SkippingTestCase.test_skip_if_db_feature.<locals>.SkipTestCase "
- "doesn't allow queries against the 'default' database.",
+ "doesn't allow queries against the 'default' database."
+ # Python 3.11 uses fully qualified test name in the output.
+ % (".test_foo" if PY311 else ""),
)
--
2.35.1
From 2037b6b40a4250daaf3fa85f489fab34536c4f3a Mon Sep 17 00:00:00 2001
From: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Date: Mon, 9 May 2022 10:38:11 +0200
Subject: [PATCH 3/3] Refs #33173 -- Fixed test_dateparse tests on Python
3.11+.
date/datetime/time.fromisoformat() support any valid ISO 8601 format
in Python 3.11+, see https://github.com/python/cpython/issues/80010.
---
tests/utils_tests/test_dateparse.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/utils_tests/test_dateparse.py b/tests/utils_tests/test_dateparse.py
index 8683811636..3f04a8a49c 100644
--- a/tests/utils_tests/test_dateparse.py
+++ b/tests/utils_tests/test_dateparse.py
@@ -8,6 +8,7 @@ from django.utils.dateparse import (
parse_time,
)
from django.utils.timezone import get_fixed_timezone
+from django.utils.version import PY311
class DateParseTests(unittest.TestCase):
@@ -15,14 +16,18 @@ class DateParseTests(unittest.TestCase):
# Valid inputs
self.assertEqual(parse_date("2012-04-23"), date(2012, 4, 23))
self.assertEqual(parse_date("2012-4-9"), date(2012, 4, 9))
+ if PY311:
+ self.assertEqual(parse_date("20120423"), date(2012, 4, 23))
# Invalid inputs
- self.assertIsNone(parse_date("20120423"))
+ self.assertIsNone(parse_date("2012423"))
with self.assertRaises(ValueError):
parse_date("2012-04-56")
def test_parse_time(self):
# Valid inputs
self.assertEqual(parse_time("09:15:00"), time(9, 15))
+ if PY311:
+ self.assertEqual(parse_time("091500"), time(9, 15))
self.assertEqual(parse_time("10:10"), time(10, 10))
self.assertEqual(parse_time("10:20:30.400"), time(10, 20, 30, 400000))
self.assertEqual(parse_time("10:20:30,400"), time(10, 20, 30, 400000))
@@ -35,7 +40,7 @@ class DateParseTests(unittest.TestCase):
self.assertIsNone(parse_time("00:05:23+"))
self.assertIsNone(parse_time("00:05:23+25:00"))
self.assertIsNone(parse_time("4:18:101"))
- self.assertIsNone(parse_time("091500"))
+ self.assertIsNone(parse_time("91500"))
with self.assertRaises(ValueError):
parse_time("09:15:90")
--
2.35.1

View file

@ -0,0 +1,16 @@
BDEPEND=test? ( python_targets_python3_10? ( dev-lang/python:3.10[sqlite] ) python_targets_python3_11? ( dev-lang/python:3.11[sqlite] ) >=dev-python/asgiref-3.4.1[python_targets_python3_10(-)?,python_targets_python3_11(-)?] >=dev-python/sqlparse-0.2.2[python_targets_python3_10(-)?,python_targets_python3_11(-)?] dev-python/docutils[python_targets_python3_10(-)?,python_targets_python3_11(-)?] dev-python/jinja[python_targets_python3_10(-)?,python_targets_python3_11(-)?] dev-python/numpy[python_targets_python3_10(-)?,python_targets_python3_11(-)?] dev-python/pillow[webp,python_targets_python3_10(-)?,python_targets_python3_11(-)?] dev-python/pyyaml[python_targets_python3_10(-)?,python_targets_python3_11(-)?] dev-python/selenium[python_targets_python3_10(-)?,python_targets_python3_11(-)?] dev-python/tblib[python_targets_python3_10(-)?,python_targets_python3_11(-)?] sys-devel/gettext !!<dev-python/ipython-7.21.0-r1 !!=dev-python/ipython-7.22.0-r0 ) verify-sig? ( >=sec-keys/openpgp-keys-django-20201201 ) doc? ( >=dev-python/sphinx-7.2.6 ) python_targets_python3_10? ( dev-lang/python:3.10[sqlite?,threads(+)] ) python_targets_python3_11? ( dev-lang/python:3.11[sqlite?,threads(+)] ) >=dev-python/gpep517-15[python_targets_python3_10(-)?,python_targets_python3_11(-)?] >=dev-python/setuptools-69.0.3[python_targets_python3_10(-)?,python_targets_python3_11(-)?] verify-sig? ( app-crypt/gnupg >=app-portage/gemato-20 )
DEFINED_PHASES=compile configure install postinst prepare test unpack
DESCRIPTION=High-level Python web framework
EAPI=8
HOMEPAGE=https://www.djangoproject.com/ https://github.com/django/django/ https://pypi.org/project/Django/
INHERIT=bash-completion-r1 distutils-r1 optfeature verify-sig
IUSE=doc sqlite test doc python_targets_python3_10 python_targets_python3_11 verify-sig
KEYWORDS=amd64 arm arm64 ~ppc ~ppc64 ~riscv ~sparc x86 ~x64-macos
LICENSE=BSD Apache-2.0 MIT
RDEPEND=>=dev-python/asgiref-3.4.1[python_targets_python3_10(-)?,python_targets_python3_11(-)?] >=dev-python/sqlparse-0.2.2[python_targets_python3_10(-)?,python_targets_python3_11(-)?] python_targets_python3_10? ( dev-lang/python:3.10[sqlite?,threads(+)] ) python_targets_python3_11? ( dev-lang/python:3.11[sqlite?,threads(+)] )
REQUIRED_USE=|| ( python_targets_python3_10 python_targets_python3_11 )
RESTRICT=!test? ( test )
SLOT=0
SRC_URI=https://media.djangoproject.com/releases/4.0/Django-4.0.10.tar.gz verify-sig? ( https://media.djangoproject.com/pgp/Django-4.0.10.checksum.txt )
_eclasses_=toolchain-funcs e56c7649b804f051623c8bc1a1c44084 multilib c19072c3cd7ac5cb21de013f7e9832e0 bash-completion-r1 f5e7a020fd9c741740756aac61bf75ff flag-o-matic e503ea5acc20410237ba33ec3f7c857d out-of-source-utils 1a9007554652a6e627edbccb3c25a439 multibuild d67e78a235f541871c7dfe4cf7931489 multiprocessing 30ead54fa2e2b5f9cd4e612ffc34d0fe ninja-utils 2df4e452cea39a9ec8fb543ce059f8d6 python-utils-r1 8b220bbce5c119fb1d4d5c2f5588f3ea python-r1 428f5c53276c2adc06a89108fc2f9f46 distutils-r1 ac3ce68c875c9b392338dcd64f7feb73 optfeature 222cb475c5a4f7ae7cfb0bf510a6fe54 verify-sig a79ba011daaf532d71a219182474d150
_md5_=afc618f61aac5aef32f42efce9c7a377