Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/django/, dev-python/django/files/
Date: Sun, 07 Aug 2022 08:54:32
Message-Id: 1659862174.d18ad5e444b7c62f4960eb9abfe84ce13f26349d.mgorny@gentoo
1 commit: d18ad5e444b7c62f4960eb9abfe84ce13f26349d
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 7 08:33:15 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 7 08:49:34 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d18ad5e4
7
8 dev-python/django: Bump to 4.1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/django/Manifest | 2 +
13 dev-python/django/django-4.1.ebuild | 106 ++++++++++++++++++++++++++
14 dev-python/django/files/django-4.1-test.patch | 33 ++++++++
15 3 files changed, 141 insertions(+)
16
17 diff --git a/dev-python/django/Manifest b/dev-python/django/Manifest
18 index adf350526e1b..e7168a82e114 100644
19 --- a/dev-python/django/Manifest
20 +++ b/dev-python/django/Manifest
21 @@ -2,3 +2,5 @@ DIST Django-3.2.15.checksum.txt 2560 BLAKE2B 35a4f28005a07cee0b667ec55838d846cb7
22 DIST Django-3.2.15.tar.gz 9833828 BLAKE2B 4b914b1e3c192340d9a1bbd68b7d3bf3d1c1b3f41da6e4a67149e811a2312f646e2ced83af23ae035cf590e526dad00537aa5b4aee14a657f6952675eca94b30 SHA512 fccdad52d39c8757972d5e987b94b13d8ce5ce08ad480ef79407b0d9b88cff69336770409cbe18ce9529bf10966ad63105a0b0f1ffe39b681a41be3718ec886b
23 DIST Django-4.0.7.checksum.txt 2551 BLAKE2B 6fa44707d33af485d3c55096dcc650b4e2384421c57c30cedee9f9577488783836a3ad8261dceaf5c718c1a5fcbe5852b081596525b22639c310c9aa6e86c639 SHA512 4b2453be8090c2a9d48bbe34f6e5dd55859b9debc3a116519c69da39d04ecca202e6da62ae9114790a9da8c55cfcfe176a972bb25576305a8e23736e2e063e3e
24 DIST Django-4.0.7.tar.gz 10407810 BLAKE2B 77c994d042ace329699aa33e14098cbcd4f24fa4db880dd78ed87828b02c25298a1c1664511547de53eb80ebade7bdfb16412a615027e512ded437ae7de79b54 SHA512 51574ab7423a3948318a5985f74bd781269bf1c95dc77838c11e8f9d5e9233f0a3be5dfa4798d523473b9f1fd3196d4c10284e3a28d9543084b2a63179167731
25 +DIST Django-4.1.checksum.txt 2533 BLAKE2B 263c3719c572347cb5d2087b960a47f0e6ac409a94499cd5ee8ec619c3388d29354c10813d4b3d2a0d6bd73ca52f562a6ae89a3d9340d5ea478a80cc30284467 SHA512 96d0a66c40261530d65bdde34ba1fc2e650690821b0f52900d60ab85162debc64e33e089f90e2b106235fc47581a54dc6432968534837c1a71a887b40fdd4f36
26 +DIST Django-4.1.tar.gz 10484595 BLAKE2B 29a833330862abcf69bf082af6df08986443d34abfe821bd307fba6ddd73dd00be7ae8d3e809fe97db0b22f9062daa760cbe01da8d773e1528f583938959f775 SHA512 f0f7e627b3c474c886cb2476f900222d2623e1ed1da1ac6b23ac618ff49e330edc2efd47b275cb02b8bcb254126bf3c926462c616bb0abee1cd433715f5184da
27
28 diff --git a/dev-python/django/django-4.1.ebuild b/dev-python/django/django-4.1.ebuild
29 new file mode 100644
30 index 000000000000..5c62178ef58f
31 --- /dev/null
32 +++ b/dev-python/django/django-4.1.ebuild
33 @@ -0,0 +1,106 @@
34 +# Copyright 1999-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +DISTUTILS_USE_PEP517=setuptools
40 +PYTHON_COMPAT=( python3_{8..11} )
41 +PYTHON_REQ_USE='sqlite?,threads(+)'
42 +
43 +inherit bash-completion-r1 distutils-r1 optfeature verify-sig
44 +
45 +MY_P=${P^}
46 +DESCRIPTION="High-level Python web framework"
47 +HOMEPAGE="
48 + https://www.djangoproject.com/
49 + https://github.com/django/django/
50 + https://pypi.org/project/Django/
51 +"
52 +SRC_URI="
53 + https://media.djangoproject.com/releases/$(ver_cut 1-2)/${MY_P}.tar.gz
54 + verify-sig? ( https://media.djangoproject.com/pgp/${MY_P}.checksum.txt )
55 +"
56 +S="${WORKDIR}/${MY_P}"
57 +
58 +LICENSE="BSD"
59 +# admin fonts: Roboto (media-fonts/roboto)
60 +LICENSE+=" Apache-2.0"
61 +# admin icons, jquery, xregexp.js
62 +LICENSE+=" MIT"
63 +SLOT="0"
64 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
65 +IUSE="doc sqlite test"
66 +RESTRICT="!test? ( test )"
67 +
68 +RDEPEND="
69 + <dev-python/asgiref-4[${PYTHON_USEDEP}]
70 + >=dev-python/asgiref-3.5.2[${PYTHON_USEDEP}]
71 + >=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}]
72 + $(python_gen_cond_dep '
73 + dev-python/backports-zoneinfo[${PYTHON_USEDEP}]
74 + ' 3.8)
75 +"
76 +BDEPEND="
77 + test? (
78 + $(python_gen_impl_dep sqlite)
79 + ${RDEPEND}
80 + dev-python/docutils[${PYTHON_USEDEP}]
81 + dev-python/jinja[${PYTHON_USEDEP}]
82 + dev-python/numpy[${PYTHON_USEDEP}]
83 + dev-python/pillow[webp,${PYTHON_USEDEP}]
84 + dev-python/pyyaml[${PYTHON_USEDEP}]
85 + dev-python/selenium[${PYTHON_USEDEP}]
86 + dev-python/tblib[${PYTHON_USEDEP}]
87 + sys-devel/gettext
88 + !!<dev-python/ipython-7.21.0-r1
89 + !!=dev-python/ipython-7.22.0-r0
90 + )
91 + verify-sig? ( >=sec-keys/openpgp-keys-django-20201201 )
92 +"
93 +
94 +PATCHES=(
95 + "${FILESDIR}"/${PN}-4.0-bashcomp.patch
96 + # https://github.com/django/django/commit/9e9bdf8dbd6e2354a2e23aa7e37d5b491338085e
97 + "${FILESDIR}"/${P}-test.patch
98 +)
99 +
100 +distutils_enable_sphinx docs --no-autodoc
101 +
102 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/django.asc
103 +
104 +src_unpack() {
105 + if use verify-sig; then
106 + cd "${DISTDIR}" || die
107 + verify-sig_verify_signed_checksums \
108 + "${MY_P}.checksum.txt" sha256 "${MY_P}.tar.gz"
109 + cd "${WORKDIR}" || die
110 + fi
111 +
112 + default
113 +}
114 +
115 +python_test() {
116 + # Tests have non-standard assumptions about PYTHONPATH,
117 + # and don't work with ${BUILD_DIR}/lib.
118 + PYTHONPATH=. "${EPYTHON}" tests/runtests.py --settings=test_sqlite -v2 ||
119 + die "Tests fail with ${EPYTHON}"
120 +}
121 +
122 +python_install_all() {
123 + newbashcomp extras/django_bash_completion ${PN}-admin
124 + bashcomp_alias ${PN}-admin django-admin.py
125 +
126 + distutils-r1_python_install_all
127 +}
128 +
129 +pkg_postinst() {
130 + optfeature_header "Additional Backend support can be enabled via:"
131 + optfeature "MySQL backend support" dev-python/mysqlclient
132 + optfeature "PostgreSQL backend support" dev-python/psycopg:2
133 + optfeature_header
134 + optfeature "GEO Django" "sci-libs/gdal[geos]"
135 + optfeature "Memcached support" dev-python/pylibmc dev-python/python-memcached
136 + optfeature "ImageField Support" dev-python/pillow
137 + optfeature "Password encryption" dev-python/bcrypt
138 + optfeature "High-level abstractions for Django forms" dev-python/django-formtools
139 +}
140
141 diff --git a/dev-python/django/files/django-4.1-test.patch b/dev-python/django/files/django-4.1-test.patch
142 new file mode 100644
143 index 000000000000..d50c3df89bec
144 --- /dev/null
145 +++ b/dev-python/django/files/django-4.1-test.patch
146 @@ -0,0 +1,33 @@
147 +From 9e9bdf8dbd6e2354a2e23aa7e37d5b491338085e Mon Sep 17 00:00:00 2001
148 +From: Alberto Planas <aplanas@×××××.com>
149 +Date: Wed, 3 Aug 2022 16:36:04 +0200
150 +Subject: [PATCH] [4.1.x] Fixed #33887 -- Fixed
151 + test_fails_squash_migration_manual_porting() on final tags.
152 +
153 +Regression in 7c318a8bdd66f8c5241864c9970dddb525d0ca4c.
154 +Backport of 4e13b40a764cfdae50416338c5d077e9d9a6d0f1 from main
155 +---
156 + tests/migrations/test_commands.py | 9 +++++----
157 + 1 file changed, 5 insertions(+), 4 deletions(-)
158 +
159 +diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
160 +index a3e1efc924bd..0d4fb52bbb82 100644
161 +--- a/tests/migrations/test_commands.py
162 ++++ b/tests/migrations/test_commands.py
163 +@@ -3005,11 +3005,12 @@ def test_fails_squash_migration_manual_porting(self):
164 + with self.temporary_migration_module(
165 + module="migrations.test_migrations_manual_porting"
166 + ) as migration_dir:
167 ++ version = get_docs_version()
168 + msg = (
169 +- "Migration will require manual porting but is already a squashed "
170 +- "migration.\nTransition to a normal migration first: "
171 +- "https://docs.djangoproject.com/en/dev/topics/migrations/"
172 +- "#squashing-migrations"
173 ++ f"Migration will require manual porting but is already a squashed "
174 ++ f"migration.\nTransition to a normal migration first: "
175 ++ f"https://docs.djangoproject.com/en/{version}/topics/migrations/"
176 ++ f"#squashing-migrations"
177 + )
178 + with self.assertRaisesMessage(CommandError, msg):
179 + call_command("optimizemigration", "migrations", "0004", stdout=out)