diff options
Diffstat (limited to 'dev-python/django')
-rw-r--r-- | dev-python/django/Manifest | 14 | ||||
-rw-r--r-- | dev-python/django/django-3.2.25.ebuild (renamed from dev-python/django/django-3.2.15.ebuild) | 23 | ||||
-rw-r--r-- | dev-python/django/django-4.2.13.ebuild (renamed from dev-python/django/django-4.1.ebuild) | 43 | ||||
-rw-r--r-- | dev-python/django/django-5.0.6.ebuild (renamed from dev-python/django/django-4.0.7.ebuild) | 59 | ||||
-rw-r--r-- | dev-python/django/files/django-3.2.19-py311.patch | 183 | ||||
-rw-r--r-- | dev-python/django/files/django-3.2.20-urlsplit.patch | 111 | ||||
-rw-r--r-- | dev-python/django/files/django-4.0.5-py311.patch | 218 | ||||
-rw-r--r-- | dev-python/django/files/django-4.1-test.patch | 33 |
8 files changed, 358 insertions, 326 deletions
diff --git a/dev-python/django/Manifest b/dev-python/django/Manifest index e7168a82e114..b0b32ecef2aa 100644 --- a/dev-python/django/Manifest +++ b/dev-python/django/Manifest @@ -1,6 +1,8 @@ -DIST Django-3.2.15.checksum.txt 2560 BLAKE2B 35a4f28005a07cee0b667ec55838d846cb7f1970be41ce08f2191992b1247263f7632bb9dcaa3d20f9df4e050b370416a2a9af6f0e5cc3523484016161a7a47e SHA512 b3d00d18e14be7dec77901ddd8818b41e2b592dbafb2c66b314478f0b2ac0f8486ce41a73a71da9bed4d9ad92a6d6bf21765ede79055c1fb2a9972e3f16cfac7 -DIST Django-3.2.15.tar.gz 9833828 BLAKE2B 4b914b1e3c192340d9a1bbd68b7d3bf3d1c1b3f41da6e4a67149e811a2312f646e2ced83af23ae035cf590e526dad00537aa5b4aee14a657f6952675eca94b30 SHA512 fccdad52d39c8757972d5e987b94b13d8ce5ce08ad480ef79407b0d9b88cff69336770409cbe18ce9529bf10966ad63105a0b0f1ffe39b681a41be3718ec886b -DIST Django-4.0.7.checksum.txt 2551 BLAKE2B 6fa44707d33af485d3c55096dcc650b4e2384421c57c30cedee9f9577488783836a3ad8261dceaf5c718c1a5fcbe5852b081596525b22639c310c9aa6e86c639 SHA512 4b2453be8090c2a9d48bbe34f6e5dd55859b9debc3a116519c69da39d04ecca202e6da62ae9114790a9da8c55cfcfe176a972bb25576305a8e23736e2e063e3e -DIST Django-4.0.7.tar.gz 10407810 BLAKE2B 77c994d042ace329699aa33e14098cbcd4f24fa4db880dd78ed87828b02c25298a1c1664511547de53eb80ebade7bdfb16412a615027e512ded437ae7de79b54 SHA512 51574ab7423a3948318a5985f74bd781269bf1c95dc77838c11e8f9d5e9233f0a3be5dfa4798d523473b9f1fd3196d4c10284e3a28d9543084b2a63179167731 -DIST Django-4.1.checksum.txt 2533 BLAKE2B 263c3719c572347cb5d2087b960a47f0e6ac409a94499cd5ee8ec619c3388d29354c10813d4b3d2a0d6bd73ca52f562a6ae89a3d9340d5ea478a80cc30284467 SHA512 96d0a66c40261530d65bdde34ba1fc2e650690821b0f52900d60ab85162debc64e33e089f90e2b106235fc47581a54dc6432968534837c1a71a887b40fdd4f36 -DIST Django-4.1.tar.gz 10484595 BLAKE2B 29a833330862abcf69bf082af6df08986443d34abfe821bd307fba6ddd73dd00be7ae8d3e809fe97db0b22f9062daa760cbe01da8d773e1528f583938959f775 SHA512 f0f7e627b3c474c886cb2476f900222d2623e1ed1da1ac6b23ac618ff49e330edc2efd47b275cb02b8bcb254126bf3c926462c616bb0abee1cd433715f5184da +DIST Django-3.2.25.checksum.txt 2560 BLAKE2B e082c588f4e124c9d71c1914e475fd70ed9b68583d65ea59ba0822b96de36c2edc98b4d9192f3d7c75467306fe03404303f6c2a98a026bdb5308bbd1dee89f99 SHA512 49a1610dcd61cbd322f0a5d7fe3cf249c0c4288b194fc8c2bdf7ec6fb8f92b69ca68dcdb71b79998cd80b978b70f48069669d996b6503261ba726c77c8b87672 +DIST Django-3.2.25.tar.gz 9836336 BLAKE2B 586520e0689b2594dd8ce4abb173418aedfde80cc84012d2a4207cbfc67120cbf405a8dfc8d069bb946f027f0eef22b233bd3b3ce569b01ea8fdc7836a6e530f SHA512 ccba83abd1777123186d685e21b96f41abf216a692d18ffe764d2e519eb9d1f6011d08c86b3affdd891591ca4ed7fee27ffa4750d19b486ca775ee680fdb0cb1 +DIST Django-4.2.13.checksum.txt 2578 BLAKE2B c4dee2c255a77da0655f685852bfac937e6afbfa32c6f5048916675d806c1d9218ff40117c99d7e63ee06b05dd88af4db9460672c3628c948cb17e5ca2f56817 SHA512 0994eef854b991c2db290712aff892e900ef3bab84607e385b4f78e3213b816739e42d5010afaaf30f6c68d5bc52b509b7c6e797e8e87db499a49f75b4cfd232 +DIST Django-4.2.13.tar.gz 10430886 BLAKE2B 09e8743de500f11c32c540d23d9aae1377c83177089732c78c03501dc560fd7b4316d6032534c923c354539421e519ed8439fc09d61500cea479c9eaf115f160 SHA512 2d141e2d710dbd55999db9c7005ca4a8d291dad57f0ef246eb41d4ffed76e62035b36969c5f338c3158ccd2d1677eb23de0b8f783606b4c62a3ee45e8988b712 +DIST Django-5.0.6.checksum.txt 2568 BLAKE2B c4c94e1a245248ed59707fb8aeb97a8379e679c50829d0470eefd2f870de32d5b57cb4841ac44809483993bc515514c3e2b0cdf0f1768681a4ba1930e2d278a3 SHA512 231954ae528beff69fbfa385aba192f19d56e862f1a2e5e40ccbba60ce31b59a075af31d75ab9e5767c9405a37f14fd3c5c41e74f60f6b7d6821391a43992301 +DIST Django-5.0.6.tar.gz 10639679 BLAKE2B 2198f273f28f89eb12db481e3531a963e2f5215677f0227d2ce8940cf1c2076acafe9bf1064595b481c6d65fadd7c6d6c7cda5fbbded81a87895e697338c78fd SHA512 6dab32357c423762a4fdd7372aec0ae4855861431fb9a90d4a818144e675cf891c0673a11351ddf8344f31624ce0ea8c9d9c6bc3c4514f38380aecb48a684894 +DIST django-4.2.8-pypy3.patch.xz 5900 BLAKE2B b7dc5c5fc162817a218ee6d025ed8a65559b80e4506e49ac393428c26e2621f9e7c5010b36f2412dea8194a9f1086ab21f97286eabd696c6a786285eb07393cf SHA512 f953b5adbd1364f1d84dde55087ccb493256b1327701275fd2fe99f3cd41751d18e002b6e21afc96892e1671428a6b8f3c2e4b88252c3c278f1a79e286bb73e3 +DIST django-5.0-pypy3.patch.xz 6124 BLAKE2B 7eba7cc70b30743cf4e186a2c5b0f27c13f49114a7a80bcaa2b25fdd7a959583c115a302c9bc6da97c32f6401cf8f3616818ba759190d317c5b033a0f0088766 SHA512 c550e2b2c1243d13cd1f4908f4b6df606355d1491e3bf72042e4b4777a4474306ff0f67b1c2eb4ab4d137cc85bde52dcdbd54bec245d2ba2e092545be8a2993b diff --git a/dev-python/django/django-3.2.15.ebuild b/dev-python/django/django-3.2.25.ebuild index b83663879072..a026c5a478e4 100644 --- a/dev-python/django/django-3.2.15.ebuild +++ b/dev-python/django/django-3.2.25.ebuild @@ -1,25 +1,25 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..10} ) +PYTHON_COMPAT=( python3_{10..11} ) PYTHON_REQ_USE='sqlite?,threads(+)' inherit bash-completion-r1 distutils-r1 optfeature verify-sig -MY_P=${P^} 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)/${MY_P}.tar.gz - verify-sig? ( https://media.djangoproject.com/pgp/${MY_P}.checksum.txt ) + https://media.djangoproject.com/releases/$(ver_cut 1-2)/${P^}.tar.gz + verify-sig? ( https://media.djangoproject.com/pgp/${P^}.checksum.txt ) " -S="${WORKDIR}/${MY_P}" +S="${WORKDIR}/${P^}" LICENSE="BSD" # admin fonts: Roboto (media-fonts/roboto) @@ -35,6 +35,7 @@ RDEPEND=" >=dev-python/asgiref-3.3.4[${PYTHON_USEDEP}] dev-python/pytz[${PYTHON_USEDEP}] >=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}] + sys-libs/timezone-data " BDEPEND=" test? ( @@ -48,25 +49,26 @@ BDEPEND=" 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}-3.1-bashcomp.patch + "${FILESDIR}"/django-3.2.19-py311.patch + # needed for Python 3.11 + "${FILESDIR}"/django-3.2.20-urlsplit.patch ) distutils_enable_sphinx docs --no-autodoc -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/django.asc +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 \ - "${MY_P}.checksum.txt" sha256 "${MY_P}.tar.gz" + "${P^}.checksum.txt" sha256 "${P^}.tar.gz" cd "${WORKDIR}" || die fi @@ -105,5 +107,4 @@ pkg_postinst() { 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 } diff --git a/dev-python/django/django-4.1.ebuild b/dev-python/django/django-4.2.13.ebuild index 5c62178ef58f..7379e6655f94 100644 --- a/dev-python/django/django-4.1.ebuild +++ b/dev-python/django/django-4.2.13.ebuild @@ -1,15 +1,14 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..11} ) +PYTHON_COMPAT=( pypy3 python3_{10..12} ) PYTHON_REQ_USE='sqlite?,threads(+)' -inherit bash-completion-r1 distutils-r1 optfeature verify-sig +inherit bash-completion-r1 distutils-r1 multiprocessing optfeature verify-sig -MY_P=${P^} DESCRIPTION="High-level Python web framework" HOMEPAGE=" https://www.djangoproject.com/ @@ -17,10 +16,11 @@ HOMEPAGE=" https://pypi.org/project/Django/ " SRC_URI=" - https://media.djangoproject.com/releases/$(ver_cut 1-2)/${MY_P}.tar.gz - verify-sig? ( https://media.djangoproject.com/pgp/${MY_P}.checksum.txt ) + https://media.djangoproject.com/releases/$(ver_cut 1-2)/${P^}.tar.gz + https://dev.gentoo.org/~mgorny/dist/python/django-4.2.8-pypy3.patch.xz + verify-sig? ( https://media.djangoproject.com/pgp/${P^}.checksum.txt ) " -S="${WORKDIR}/${MY_P}" +S="${WORKDIR}/${P^}" LICENSE="BSD" # admin fonts: Roboto (media-fonts/roboto) @@ -28,17 +28,15 @@ LICENSE+=" Apache-2.0" # admin icons, jquery, xregexp.js LICENSE+=" MIT" SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos" +KEYWORDS="amd64 arm arm64 ~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.5.2[${PYTHON_USEDEP}] - >=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}] - $(python_gen_cond_dep ' - dev-python/backports-zoneinfo[${PYTHON_USEDEP}] - ' 3.8) + >=dev-python/asgiref-3.6.0[${PYTHON_USEDEP}] + >=dev-python/sqlparse-0.3.1[${PYTHON_USEDEP}] + sys-libs/timezone-data " BDEPEND=" test? ( @@ -52,27 +50,24 @@ BDEPEND=" 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 ) + verify-sig? ( >=sec-keys/openpgp-keys-django-20230606 ) " PATCHES=( - "${FILESDIR}"/${PN}-4.0-bashcomp.patch - # https://github.com/django/django/commit/9e9bdf8dbd6e2354a2e23aa7e37d5b491338085e - "${FILESDIR}"/${P}-test.patch + "${FILESDIR}"/django-4.0-bashcomp.patch + "${WORKDIR}"/django-4.2.8-pypy3.patch ) distutils_enable_sphinx docs --no-autodoc -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/django.asc +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 \ - "${MY_P}.checksum.txt" sha256 "${MY_P}.tar.gz" + "${P^}.checksum.txt" sha256 "${P^}.tar.gz" cd "${WORKDIR}" || die fi @@ -82,7 +77,8 @@ src_unpack() { 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 || + PYTHONPATH=. "${EPYTHON}" tests/runtests.py --settings=test_sqlite \ + -v2 --parallel="${EPYTEST_JOBS:-$(makeopts_jobs)}" || die "Tests fail with ${EPYTHON}" } @@ -96,11 +92,10 @@ 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 "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 - optfeature "High-level abstractions for Django forms" dev-python/django-formtools } diff --git a/dev-python/django/django-4.0.7.ebuild b/dev-python/django/django-5.0.6.ebuild index ed8ebbdf0176..465a7dcda6cd 100644 --- a/dev-python/django/django-4.0.7.ebuild +++ b/dev-python/django/django-5.0.6.ebuild @@ -1,25 +1,26 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..11} ) +PYTHON_COMPAT=( pypy3 python3_{10..12} ) PYTHON_REQ_USE='sqlite?,threads(+)' -inherit bash-completion-r1 distutils-r1 optfeature verify-sig +inherit bash-completion-r1 distutils-r1 multiprocessing optfeature verify-sig -MY_P=${P^} 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)/${MY_P}.tar.gz - verify-sig? ( https://media.djangoproject.com/pgp/${MY_P}.checksum.txt ) + https://media.djangoproject.com/releases/$(ver_cut 1-2)/${P^}.tar.gz + https://dev.gentoo.org/~mgorny/dist/python/django-5.0-pypy3.patch.xz + verify-sig? ( https://media.djangoproject.com/pgp/${P^}.checksum.txt ) " -S="${WORKDIR}/${MY_P}" +S="${WORKDIR}/${P^}" LICENSE="BSD" # admin fonts: Roboto (media-fonts/roboto) @@ -27,66 +28,57 @@ LICENSE+=" Apache-2.0" # admin icons, jquery, xregexp.js LICENSE+=" MIT" SLOT="0" -KEYWORDS="amd64 arm arm64 ~ppc ~ppc64 ~riscv ~sparc x86 ~x64-macos" +KEYWORDS="~alpha amd64 arm arm64 ~loong ~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) + <dev-python/asgiref-4[${PYTHON_USEDEP}] + >=dev-python/asgiref-3.7.0[${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[${PYTHON_USEDEP}] - dev-python/jinja[${PYTHON_USEDEP}] + >=dev-python/docutils-0.19[${PYTHON_USEDEP}] + >=dev-python/jinja-2.11.0[${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}] + >=dev-python/selenium-4.8.0[${PYTHON_USEDEP}] + >=dev-python/tblib-1.5.0[${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 ) + verify-sig? ( >=sec-keys/openpgp-keys-django-20230606 ) " PATCHES=( - "${FILESDIR}"/${PN}-4.0-bashcomp.patch - "${FILESDIR}"/django-4.0.5-py311.patch + "${FILESDIR}"/django-4.0-bashcomp.patch + "${WORKDIR}"/django-5.0-pypy3.patch ) distutils_enable_sphinx docs --no-autodoc -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/django.asc +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 \ - "${MY_P}.checksum.txt" sha256 "${MY_P}.tar.gz" + "${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 || + PYTHONPATH=. "${EPYTHON}" tests/runtests.py --settings=test_sqlite \ + -v2 --parallel="${EPYTEST_JOBS:-$(makeopts_jobs)}" || die "Tests fail with ${EPYTHON}" } @@ -100,11 +92,10 @@ 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 "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 - optfeature "High-level abstractions for Django forms" dev-python/django-formtools } diff --git a/dev-python/django/files/django-3.2.19-py311.patch b/dev-python/django/files/django-3.2.19-py311.patch new file mode 100644 index 000000000000..976537289ff3 --- /dev/null +++ b/dev-python/django/files/django-3.2.19-py311.patch @@ -0,0 +1,183 @@ +From 2882cf6f184c7578219e2b5266623e82c0e9b8a2 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] Refs #33173 -- Fixed test_runner/test_utils tests on Python + 3.11+. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Python 3.11 uses fully qualified test name in unittest output. See +https://github.com/python/cpython/commit/755be9b1505af591b9f2ee424a6525b6c2b65ce9 + +(rebased by Michał Górny) +--- + django/utils/version.py | 1 + + tests/test_runner/test_debug_sql.py | 30 ++++++++++++++++++----------- + tests/test_runner/test_parallel.py | 11 ++++++++--- + tests/test_utils/tests.py | 9 +++++++-- + 4 files changed, 35 insertions(+), 16 deletions(-) + +diff --git a/django/utils/version.py b/django/utils/version.py +index 74c327525e..0c2bfc626e 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/test_runner/test_debug_sql.py b/tests/test_runner/test_debug_sql.py +index 0e8e4207d6..2b5fed7a76 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 + +@@ -100,20 +101,27 @@ class TestDebugSQL(unittest.TestCase): + '''"test_runner_person"."first_name" = 'subtest-fail';'''), + ] + ++ # 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) ...', +- ('''SELECT COUNT(*) AS "__count" ''' +- '''FROM "test_runner_person" WHERE ''' +- '''"test_runner_person"."first_name" = 'pass';'''), +- ('''SELECT COUNT(*) AS "__count" ''' +- '''FROM "test_runner_person" WHERE ''' +- '''"test_runner_person"."first_name" = 'subtest-pass';'''), ++ 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 """ ++ """"test_runner_person"."first_name" = 'pass';""" ++ ), ++ ( ++ """SELECT COUNT(*) AS "__count" """ ++ """FROM "test_runner_person" WHERE """ ++ """"test_runner_person"."first_name" = 'subtest-pass';""" ++ ), + ] + + def test_setupclass_exception(self): +diff --git a/tests/test_runner/test_parallel.py b/tests/test_runner/test_parallel.py +index c1a89bd0f0..0f1adcf208 100644 +--- a/tests/test_runner/test_parallel.py ++++ b/tests/test_runner/test_parallel.py +@@ -2,7 +2,7 @@ import unittest + + from django.test import SimpleTestCase + from django.test.runner import RemoteTestResult +-from django.utils.version import PY37 ++from django.utils.version import PY37, PY311 + + try: + import tblib +@@ -78,8 +78,13 @@ class RemoteTestResultTest(SimpleTestCase): + self.assertEqual(len(events), 4) + + event = events[1] +- self.assertEqual(event[0], 'addSubTest') +- self.assertEqual(str(event[2]), 'dummy_test (test_runner.test_parallel.SampleFailingSubtest) (index=0)') ++ self.assertEqual(event[0], "addSubTest") ++ self.assertEqual( ++ str(event[2]), ++ "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 ""), ++ ) + trailing_comma = '' if PY37 else ',' + self.assertEqual(repr(event[3][1]), "AssertionError('0 != 1'%s)" % trailing_comma) + +diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py +index 9255315e98..8f72057afe 100644 +--- a/tests/test_utils/tests.py ++++ b/tests/test_utils/tests.py +@@ -26,6 +26,7 @@ from django.test.utils import ( + ) + from django.urls import NoReverseMatch, path, reverse, reverse_lazy + from django.utils.deprecation import RemovedInDjango41Warning ++from django.utils.version import PY311 + + from .models import Car, Person, PossessedCar + from .views import empty_response +@@ -78,9 +79,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." ++ # Python 3.11 uses fully qualified test name in the output. ++ % (".test_foo" if PY311 else ""), + ) + + def test_skip_if_db_feature(self): +@@ -122,9 +125,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." ++ # Python 3.11 uses fully qualified test name in the output. ++ % (".test_foo" if PY311 else ""), + ) + + +-- +2.40.0 + +From 0981a4bc273e2a87ad10c602d9547e006e06d8dd Mon Sep 17 00:00:00 2001 +From: Mariusz Felisiak <felisiak.mariusz@gmail.com> +Date: Fri, 7 Apr 2023 11:07:54 +0200 +Subject: [PATCH] Refs #34118 -- Fixed CustomChoicesTests.test_uuid_unsupported + on Python 3.11.4+. + +https://github.com/python/cpython/commit/5342f5e713e0cc45b6f226d2d053a8cde1b4d68e + +Follow up to 38e63c9e61152682f3ff982c85a73793ab6d3267. +--- + tests/model_enums/tests.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/model_enums/tests.py b/tests/model_enums/tests.py +index ffc199ce42..c4ca6c91d7 100644 +--- a/tests/model_enums/tests.py ++++ b/tests/model_enums/tests.py +@@ -259,7 +259,7 @@ class CustomChoicesTests(SimpleTestCase): + pass + + def test_uuid_unsupported(self): +- msg = 'UUID objects are immutable' +- with self.assertRaisesMessage(TypeError, msg): ++ with self.assertRaises(TypeError): ++ + class Identifier(uuid.UUID, models.Choices): + A = '972ce4eb-a95f-4a56-9339-68c208a76f18' +-- +2.40.1 + diff --git a/dev-python/django/files/django-3.2.20-urlsplit.patch b/dev-python/django/files/django-3.2.20-urlsplit.patch new file mode 100644 index 000000000000..4883da38c0f5 --- /dev/null +++ b/dev-python/django/files/django-3.2.20-urlsplit.patch @@ -0,0 +1,111 @@ +From 74fee3f5cab1481dcb299b6eeaf82f862470bafa Mon Sep 17 00:00:00 2001 +From: mendespedro <windowsxpedro@gmail.com> +Date: Wed, 15 Dec 2021 11:55:19 -0300 +Subject: [PATCH] Fixed #33367 -- Fixed URLValidator crash in some edge cases. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[backported to 3.2.x by Michał Górny] +--- + django/core/validators.py | 13 +++--- + .../forms_tests/field_tests/test_urlfield.py | 40 +++++++++++++++---- + 2 files changed, 40 insertions(+), 13 deletions(-) + +diff --git a/django/core/validators.py b/django/core/validators.py +index b9b58dfa61..aad21f95ea 100644 +--- a/django/core/validators.py ++++ b/django/core/validators.py +@@ -111,15 +111,16 @@ class URLValidator(RegexValidator): + raise ValidationError(self.message, code=self.code, params={'value': value}) + + # Then check full URL ++ try: ++ splitted_url = urlsplit(value) ++ except ValueError: ++ raise ValidationError(self.message, code=self.code, params={'value': value}) + try: + super().__call__(value) + except ValidationError as e: + # Trivial case failed. Try for possible IDN domain + if value: +- try: +- scheme, netloc, path, query, fragment = urlsplit(value) +- except ValueError: # for example, "Invalid IPv6 URL" +- raise ValidationError(self.message, code=self.code, params={'value': value}) ++ scheme, netloc, path, query, fragment = splitted_url + try: + netloc = punycode(netloc) # IDN -> ACE + except UnicodeError: # invalid domain part +@@ -130,7 +131,7 @@ class URLValidator(RegexValidator): + raise + else: + # Now verify IPv6 in the netloc part +- host_match = re.search(r'^\[(.+)\](?::\d{2,5})?$', urlsplit(value).netloc) ++ host_match = re.search(r'^\[(.+)\](?::\d{1,5})?$', splitted_url.netloc) + if host_match: + potential_ip = host_match[1] + try: +@@ -142,7 +143,7 @@ class URLValidator(RegexValidator): + # section 3.1. It's defined to be 255 bytes or less, but this includes + # one byte for the length of the name and one byte for the trailing dot + # that's used to indicate absolute names in DNS. +- if len(urlsplit(value).hostname) > 253: ++ if splitted_url.hostname is None or len(splitted_url.hostname) > 253: + raise ValidationError(self.message, code=self.code, params={'value': value}) + + +diff --git a/tests/forms_tests/field_tests/test_urlfield.py b/tests/forms_tests/field_tests/test_urlfield.py +index 19e4351c6a..68b148e7b7 100644 +--- a/tests/forms_tests/field_tests/test_urlfield.py ++++ b/tests/forms_tests/field_tests/test_urlfield.py +@@ -135,13 +135,39 @@ class URLFieldTest(FormFieldAssertionsMixin, SimpleTestCase): + def test_urlfield_10(self): + """URLField correctly validates IPv6 (#18779).""" + f = URLField() +- urls = ( +- 'http://[12:34::3a53]/', +- 'http://[a34:9238::]:8080/', +- ) +- for url in urls: +- with self.subTest(url=url): +- self.assertEqual(url, f.clean(url)) ++ tests = [ ++ 'foo', ++ 'com.', ++ '.', ++ 'http://', ++ 'http://example', ++ 'http://example.', ++ 'http://.com', ++ 'http://invalid-.com', ++ 'http://-invalid.com', ++ 'http://inv-.alid-.com', ++ 'http://inv-.-alid.com', ++ '[a', ++ 'http://[a', ++ # Non-string. ++ 23, ++ # Hangs "forever" before fixing a catastrophic backtracking, ++ # see #11198. ++ 'http://%s' % ('X' * 60,), ++ # A second example, to make sure the problem is really addressed, ++ # even on domains that don't fail the domain label length check in ++ # the regex. ++ 'http://%s' % ("X" * 200,), ++ # urlsplit() raises ValueError. ++ '////]@N.AN', ++ # Empty hostname. ++ '#@A.bO', ++ ] ++ msg = "'Enter a valid URL.'" ++ for value in tests: ++ with self.subTest(value=value): ++ with self.assertRaisesMessage(ValidationError, msg): ++ f.clean(value) + + def test_urlfield_not_string(self): + f = URLField(required=False) +-- +2.41.0 + diff --git a/dev-python/django/files/django-4.0.5-py311.patch b/dev-python/django/files/django-4.0.5-py311.patch deleted file mode 100644 index d566db006574..000000000000 --- a/dev-python/django/files/django-4.0.5-py311.patch +++ /dev/null @@ -1,218 +0,0 @@ -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 - diff --git a/dev-python/django/files/django-4.1-test.patch b/dev-python/django/files/django-4.1-test.patch deleted file mode 100644 index d50c3df89bec..000000000000 --- a/dev-python/django/files/django-4.1-test.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 9e9bdf8dbd6e2354a2e23aa7e37d5b491338085e Mon Sep 17 00:00:00 2001 -From: Alberto Planas <aplanas@gmail.com> -Date: Wed, 3 Aug 2022 16:36:04 +0200 -Subject: [PATCH] [4.1.x] Fixed #33887 -- Fixed - test_fails_squash_migration_manual_porting() on final tags. - -Regression in 7c318a8bdd66f8c5241864c9970dddb525d0ca4c. -Backport of 4e13b40a764cfdae50416338c5d077e9d9a6d0f1 from main ---- - tests/migrations/test_commands.py | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py -index a3e1efc924bd..0d4fb52bbb82 100644 ---- a/tests/migrations/test_commands.py -+++ b/tests/migrations/test_commands.py -@@ -3005,11 +3005,12 @@ def test_fails_squash_migration_manual_porting(self): - with self.temporary_migration_module( - module="migrations.test_migrations_manual_porting" - ) as migration_dir: -+ version = get_docs_version() - msg = ( -- "Migration will require manual porting but is already a squashed " -- "migration.\nTransition to a normal migration first: " -- "https://docs.djangoproject.com/en/dev/topics/migrations/" -- "#squashing-migrations" -+ f"Migration will require manual porting but is already a squashed " -+ f"migration.\nTransition to a normal migration first: " -+ f"https://docs.djangoproject.com/en/{version}/topics/migrations/" -+ f"#squashing-migrations" - ) - with self.assertRaisesMessage(CommandError, msg): - call_command("optimizemigration", "migrations", "0004", stdout=out) |