1 |
commit: 9d03e546c0c80c0d3b1234b51e992e9625f5e466 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 7 22:38:19 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 7 23:27:22 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d03e546 |
7 |
|
8 |
dev-python/django: Bump to 4.0 |
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.0.ebuild | 103 ++++++++++++++++++++++ |
14 |
dev-python/django/files/django-4.0-bashcomp.patch | 56 ++++++++++++ |
15 |
3 files changed, 161 insertions(+) |
16 |
|
17 |
diff --git a/dev-python/django/Manifest b/dev-python/django/Manifest |
18 |
index 07cd085595e0..53143ba51c04 100644 |
19 |
--- a/dev-python/django/Manifest |
20 |
+++ b/dev-python/django/Manifest |
21 |
@@ -4,3 +4,5 @@ DIST Django-3.1.14.checksum.txt 2556 BLAKE2B bb17e596d076489ac00b6b3eb98ab294969 |
22 |
DIST Django-3.1.14.tar.gz 9659386 BLAKE2B 5e9317e777e3879f2cea3eea98018884c073eed47c3da9aab09858bc0869f4f34f48d20860c32344446498879b6c9b5cb9d5ba12f0528b703436a2c37325d286 SHA512 5356f453e23a33092221137769a594608771c5832c0dc00453e571fee056438b5366eba720b1fefa33099356980ee56a9665fc6ed7c86f5412e45d6432940e64 |
23 |
DIST Django-3.2.10.checksum.txt 2556 BLAKE2B cdc1b28f213e43b27b0534587b8475bd68979f3c179357a7978109fa85ee0a4bbd5d0bba4625e6850aca603f688483dbdcb102a7411e74394079d2b0c0ef767e SHA512 852f867a5a11f11f98710cf27fdba2774de537dbe1e5edc402214acb65a6e00bf05a7b4fe5eb663cc21aa6ee9da890d7c74172a17c1b084db89ada1ff1db3745 |
24 |
DIST Django-3.2.10.tar.gz 9811341 BLAKE2B a2ed3dda0d88a884443cc07446921fcd9cc9f302b5f578910f2e4027f8d87b92717bb22a7bf73cdb44fb7ddf4c178349e31eee6b796a45727356cde24e41d318 SHA512 6b793a1e544ab988d909d9fc5152d9dbba864c4916bb1f703a07c72f1a945ba93ba53b2f8843b67a16d0e68a736c43faf2f3d8aaa0867de1668c3845c24da7da |
25 |
+DIST Django-4.0.checksum.txt 2529 BLAKE2B 0488acaf4fe37c99e3bd2370d47c47db81ffcad961212a88e7d53349299fdb3cbdc4a10fea3729d6d2353405216b8073abe8fcb2596b845760f16f2539ba4417 SHA512 26ac6ce6118d60d7bd0f0ef4c24c590eef7a102f546c3163000ad392d8f64b1c24648b8a4110df81170d60e3528466ceae974d408a700cf238dfdb8f9386d1ce |
26 |
+DIST Django-4.0.tar.gz 9980403 BLAKE2B fb3cdaa8beae6983930d1e2760d617f1a96e52d7f538269709b07cc31ef049511b0517c1538934cf9ede5e374cd466df05ebabe29f1f8fb8c4c3928e8a08a1fc SHA512 6fec0521ee7da209f3b0fb1487ef4e8ef16bf3bf4ea108efc7a2ee3a9d28c7c33e5e3b2bd92e231641b0be902b45d1fd8b712c48a33496ae2c865a3698b25e14 |
27 |
|
28 |
diff --git a/dev-python/django/django-4.0.ebuild b/dev-python/django/django-4.0.ebuild |
29 |
new file mode 100644 |
30 |
index 000000000000..d3c26859a6de |
31 |
--- /dev/null |
32 |
+++ b/dev-python/django/django-4.0.ebuild |
33 |
@@ -0,0 +1,103 @@ |
34 |
+# Copyright 1999-2021 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=8 |
38 |
+ |
39 |
+PYTHON_COMPAT=( python3_{8..10} ) |
40 |
+PYTHON_REQ_USE='sqlite?,threads(+)' |
41 |
+ |
42 |
+inherit bash-completion-r1 distutils-r1 optfeature verify-sig |
43 |
+ |
44 |
+MY_P=${P^} |
45 |
+DESCRIPTION="High-level Python web framework" |
46 |
+HOMEPAGE="https://www.djangoproject.com/ https://pypi.org/project/Django/" |
47 |
+SRC_URI=" |
48 |
+ https://media.djangoproject.com/releases/$(ver_cut 1-2)/${MY_P}.tar.gz |
49 |
+ verify-sig? ( https://media.djangoproject.com/pgp/${MY_P}.checksum.txt )" |
50 |
+S="${WORKDIR}/${MY_P}" |
51 |
+ |
52 |
+LICENSE="BSD" |
53 |
+# admin fonts: Roboto (media-fonts/roboto) |
54 |
+LICENSE+=" Apache-2.0" |
55 |
+# admin icons, jquery, xregexp.js |
56 |
+LICENSE+=" MIT" |
57 |
+SLOT="0" |
58 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos" |
59 |
+IUSE="doc sqlite test" |
60 |
+RESTRICT="!test? ( test )" |
61 |
+ |
62 |
+RDEPEND=" |
63 |
+ >=dev-python/asgiref-3.4.1[${PYTHON_USEDEP}] |
64 |
+ >=dev-python/sqlparse-0.2.2[${PYTHON_USEDEP}] |
65 |
+ $(python_gen_cond_dep ' |
66 |
+ dev-python/backports-zoneinfo[${PYTHON_USEDEP}] |
67 |
+ ' python3_8 pypy3)" |
68 |
+BDEPEND=" |
69 |
+ test? ( |
70 |
+ $(python_gen_impl_dep sqlite) |
71 |
+ ${RDEPEND} |
72 |
+ dev-python/docutils[${PYTHON_USEDEP}] |
73 |
+ dev-python/jinja[${PYTHON_USEDEP}] |
74 |
+ dev-python/numpy[${PYTHON_USEDEP}] |
75 |
+ dev-python/pillow[webp,${PYTHON_USEDEP}] |
76 |
+ dev-python/pyyaml[${PYTHON_USEDEP}] |
77 |
+ dev-python/selenium[${PYTHON_USEDEP}] |
78 |
+ dev-python/tblib[${PYTHON_USEDEP}] |
79 |
+ sys-devel/gettext |
80 |
+ !!<dev-python/ipython-7.21.0-r1 |
81 |
+ !!=dev-python/ipython-7.22.0-r0 |
82 |
+ ) |
83 |
+ verify-sig? ( >=app-crypt/openpgp-keys-django-20201201 ) |
84 |
+" |
85 |
+ |
86 |
+PATCHES=( |
87 |
+ "${FILESDIR}"/${PN}-4.0-bashcomp.patch |
88 |
+) |
89 |
+ |
90 |
+distutils_enable_sphinx docs --no-autodoc |
91 |
+ |
92 |
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/django.asc |
93 |
+ |
94 |
+src_unpack() { |
95 |
+ if use verify-sig; then |
96 |
+ cd "${DISTDIR}" || die |
97 |
+ verify-sig_verify_signed_checksums \ |
98 |
+ "${MY_P}.checksum.txt" sha256 "${MY_P}.tar.gz" |
99 |
+ cd "${WORKDIR}" || die |
100 |
+ fi |
101 |
+ |
102 |
+ default |
103 |
+} |
104 |
+ |
105 |
+python_prepare_all() { |
106 |
+ # Fails because of warnings |
107 |
+ sed -i 's/test_dumpdata_proxy_with_concrete/_&/' tests/fixtures/tests.py |
108 |
+ |
109 |
+ distutils-r1_python_prepare_all |
110 |
+} |
111 |
+ |
112 |
+python_test() { |
113 |
+ # Tests have non-standard assumptions about PYTHONPATH, |
114 |
+ # and don't work with ${BUILD_DIR}/lib. |
115 |
+ PYTHONPATH=. "${EPYTHON}" tests/runtests.py --settings=test_sqlite -v2 || |
116 |
+ die "Tests fail with ${EPYTHON}" |
117 |
+} |
118 |
+ |
119 |
+python_install_all() { |
120 |
+ newbashcomp extras/django_bash_completion ${PN}-admin |
121 |
+ bashcomp_alias ${PN}-admin django-admin.py |
122 |
+ |
123 |
+ distutils-r1_python_install_all |
124 |
+} |
125 |
+ |
126 |
+pkg_postinst() { |
127 |
+ optfeature_header "Additional Backend support can be enabled via:" |
128 |
+ optfeature "MySQL backend support" dev-python/mysqlclient |
129 |
+ optfeature "PostgreSQL backend support" dev-python/psycopg:2 |
130 |
+ optfeature_header |
131 |
+ optfeature "GEO Django" "sci-libs/gdal[geos]" |
132 |
+ optfeature "Memcached support" dev-python/pylibmc dev-python/python-memcached |
133 |
+ optfeature "ImageField Support" dev-python/pillow |
134 |
+ optfeature "Password encryption" dev-python/bcrypt |
135 |
+ optfeature "High-level abstractions for Django forms" dev-python/django-formtools |
136 |
+} |
137 |
|
138 |
diff --git a/dev-python/django/files/django-4.0-bashcomp.patch b/dev-python/django/files/django-4.0-bashcomp.patch |
139 |
new file mode 100644 |
140 |
index 000000000000..06d121cce102 |
141 |
--- /dev/null |
142 |
+++ b/dev-python/django/files/django-4.0-bashcomp.patch |
143 |
@@ -0,0 +1,56 @@ |
144 |
+From 103a0f5559795f6517c24ab65d2305a8320acf8a Mon Sep 17 00:00:00 2001 |
145 |
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
146 |
+Date: Wed, 6 May 2020 07:24:05 +0200 |
147 |
+Subject: [PATCH] Remove completions unsuitable for autoloading |
148 |
+ |
149 |
+The override of 'python*' completions, as well as the attempt |
150 |
+to './manage.py' completion are not going to work with autoloader. |
151 |
+Strip them. |
152 |
+--- |
153 |
+ extras/django_bash_completion | 33 +-------------------------------- |
154 |
+ 1 file changed, 1 insertion(+), 32 deletions(-) |
155 |
+ |
156 |
+diff --git a/extras/django_bash_completion b/extras/django_bash_completion |
157 |
+index 6fb941bef6..2f761ceb83 100755 |
158 |
+--- a/extras/django_bash_completion |
159 |
++++ b/extras/django_bash_completion |
160 |
+@@ -36,35 +36,4 @@ _django_completion() |
161 |
+ COMP_CWORD=$COMP_CWORD \ |
162 |
+ DJANGO_AUTO_COMPLETE=1 $1 ) ) |
163 |
+ } |
164 |
+-complete -F _django_completion -o default manage.py django-admin |
165 |
+- |
166 |
+-_python_django_completion() |
167 |
+-{ |
168 |
+- if [[ ${COMP_CWORD} -ge 2 ]]; then |
169 |
+- local PYTHON_EXE=${COMP_WORDS[0]##*/} |
170 |
+- if echo "$PYTHON_EXE" | grep -qE "python([3-9]\.[0-9])?"; then |
171 |
+- local PYTHON_SCRIPT=${COMP_WORDS[1]##*/} |
172 |
+- if echo "$PYTHON_SCRIPT" | grep -qE "manage\.py|django-admin"; then |
173 |
+- COMPREPLY=( $( COMP_WORDS=( "${COMP_WORDS[*]:1}" ) |
174 |
+- COMP_CWORD=$(( COMP_CWORD-1 )) |
175 |
+- DJANGO_AUTO_COMPLETE=1 ${COMP_WORDS[*]} ) ) |
176 |
+- fi |
177 |
+- fi |
178 |
+- fi |
179 |
+-} |
180 |
+- |
181 |
+-# Support for multiple interpreters. |
182 |
+-unset pythons |
183 |
+-if command -v whereis &>/dev/null; then |
184 |
+- python_interpreters=$(whereis python | cut -d " " -f 2-) |
185 |
+- for python in $python_interpreters; do |
186 |
+- [[ $python != *-config ]] && pythons="${pythons} ${python##*/}" |
187 |
+- done |
188 |
+- unset python_interpreters |
189 |
+- pythons=$(echo "$pythons" | tr " " "\n" | sort -u | tr "\n" " ") |
190 |
+-else |
191 |
+- pythons=python |
192 |
+-fi |
193 |
+- |
194 |
+-complete -F _python_django_completion -o default $pythons |
195 |
+-unset pythons |
196 |
++complete -F _django_completion -o default django-admin |
197 |
+-- |
198 |
+2.34.1 |
199 |
+ |