1 |
commit: 483b351863737a94b3e5871678dd45b40ba815ae |
2 |
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 3 07:06:41 2021 +0000 |
4 |
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 3 08:22:04 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=483b3518 |
7 |
|
8 |
dev-python/django-js-asset: enable py3.10, cleanup tests |
9 |
|
10 |
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> |
11 |
|
12 |
dev-python/django-js-asset/Manifest | 2 +- |
13 |
.../django-js-asset/django-js-asset-1.2.2.ebuild | 23 ++++++--- |
14 |
.../files/django-js-asset-1.2.2-fix-django3.patch | 55 ++++++++++++++++++++++ |
15 |
3 files changed, 73 insertions(+), 7 deletions(-) |
16 |
|
17 |
diff --git a/dev-python/django-js-asset/Manifest b/dev-python/django-js-asset/Manifest |
18 |
index 75fad6dc707..6a029054963 100644 |
19 |
--- a/dev-python/django-js-asset/Manifest |
20 |
+++ b/dev-python/django-js-asset/Manifest |
21 |
@@ -1 +1 @@ |
22 |
-DIST django-js-asset-1.2.2.tar.gz 4436 BLAKE2B e6b2ff1b2b90da5ae95af08b28eb1970e6e0edffee7eeec0a4697855040c4afd0febcc569d0a78c46bca80835b404367c426019016e5089b3aed984916e13cc2 SHA512 ea050c5093abd8312733b1402e275fcb44f0702c27e28aeb64d0470a8514cd85906707915556a9878b669c96918813c4bf2b69d281d33f18fcc7c143f8ae9f48 |
23 |
+DIST django-js-asset-1.2.2.gh.tar.gz 6367 BLAKE2B 5b24d3a2cf1ca2b28b82e581541dcb58aa2bf25d99f865007730c00211452dc5a062dc014b47fd1d10020d2a0b8f74060910460dec4f95be2b83c5c6d7bfb4d2 SHA512 ad2c51399da9b5d75305c0fa257cc75496df3f6704a827a0d297a4d762712039c3ebd921afbe6e10672626f1badd8637728292dd700ba41c4192c95ec73095a9 |
24 |
|
25 |
diff --git a/dev-python/django-js-asset/django-js-asset-1.2.2.ebuild b/dev-python/django-js-asset/django-js-asset-1.2.2.ebuild |
26 |
index 16175edec80..5704b6a31f0 100644 |
27 |
--- a/dev-python/django-js-asset/django-js-asset-1.2.2.ebuild |
28 |
+++ b/dev-python/django-js-asset/django-js-asset-1.2.2.ebuild |
29 |
@@ -3,20 +3,31 @@ |
30 |
|
31 |
EAPI=7 |
32 |
|
33 |
-PYTHON_COMPAT=( python3_{7..9} ) |
34 |
+PYTHON_COMPAT=( python3_{8..10} ) |
35 |
inherit distutils-r1 |
36 |
|
37 |
DESCRIPTION="script tag with additional attributes for django.forms.Media" |
38 |
HOMEPAGE="https://github.com/matthiask/django-js-asset" |
39 |
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
40 |
+SRC_URI=" |
41 |
+ https://github.com/matthiask/django-js-asset/archive/${PV}.tar.gz |
42 |
+ -> ${P}.gh.tar.gz |
43 |
+" |
44 |
|
45 |
LICENSE="BSD" |
46 |
SLOT="0" |
47 |
KEYWORDS="~amd64" |
48 |
-RESTRICT="test" |
49 |
+IUSE="test" |
50 |
+RESTRICT="!test? ( test )" |
51 |
|
52 |
RDEPEND=">=dev-python/django-1.17[${PYTHON_USEDEP}]" |
53 |
-DEPEND="${RDEPEND}" |
54 |
-BDEPEND="test? ( dev-python/coverage[${PYTHON_USEDEP}] )" |
55 |
+BDEPEND="test? ( ${RDEPEND} )" |
56 |
|
57 |
-distutils_enable_tests setup.py |
58 |
+PATCHES=( |
59 |
+ "${FILESDIR}/${P}-fix-django3.patch" |
60 |
+) |
61 |
+ |
62 |
+python_test() { |
63 |
+ cd tests || die |
64 |
+ local -x DJANGO_SETTINGS_MODULE=testapp.settings |
65 |
+ django-admin test -v 2 || die |
66 |
+} |
67 |
|
68 |
diff --git a/dev-python/django-js-asset/files/django-js-asset-1.2.2-fix-django3.patch b/dev-python/django-js-asset/files/django-js-asset-1.2.2-fix-django3.patch |
69 |
new file mode 100644 |
70 |
index 00000000000..4ab0484b17e |
71 |
--- /dev/null |
72 |
+++ b/dev-python/django-js-asset/files/django-js-asset-1.2.2-fix-django3.patch |
73 |
@@ -0,0 +1,55 @@ |
74 |
+From 232536ba50a2e1a0cffc6046dbcdfdec22cb0d9e Mon Sep 17 00:00:00 2001 |
75 |
+From: Matthias Kestenholz <mk@××××××××.ch> |
76 |
+Date: Fri, 15 May 2020 08:51:33 +0200 |
77 |
+Subject: [PATCH] Adapt the test suite to changes in Django |
78 |
+ |
79 |
+--- a/tests/testapp/test_js_asset.py |
80 |
++++ b/tests/testapp/test_js_asset.py |
81 |
+@@ -1,11 +1,15 @@ |
82 |
+ from __future__ import unicode_literals |
83 |
+ |
84 |
++import django |
85 |
+ from django.forms import Media |
86 |
+ from django.test import TestCase |
87 |
+ |
88 |
+ from js_asset.js import JS |
89 |
+ |
90 |
+ |
91 |
++JS_TYPE = ' type="text/javascript"' if django.VERSION < (3, 1) else "" |
92 |
++ |
93 |
++ |
94 |
+ class AssetTest(TestCase): |
95 |
+ def test_asset(self): |
96 |
+ media = Media( |
97 |
+@@ -25,15 +29,17 @@ def test_asset(self): |
98 |
+ html, |
99 |
+ ) |
100 |
+ self.assertInHTML( |
101 |
+- '<script type="text/javascript" src="/static/app/test.js"></script>', # noqa |
102 |
++ '<script{} src="/static/app/test.js"></script>'.format(JS_TYPE), # noqa |
103 |
+ html, |
104 |
+ ) |
105 |
+ self.assertInHTML( |
106 |
+- '<script type="text/javascript" src="/static/app/asset.js" data-the-answer="42" id="asset-script"></script>', # noqa |
107 |
++ '<script{} src="/static/app/asset.js" data-the-answer="42" id="asset-script"></script>'.format( # noqa |
108 |
++ JS_TYPE |
109 |
++ ), |
110 |
+ html, |
111 |
+ ) |
112 |
+ self.assertInHTML( |
113 |
+- '<script type="text/javascript" src="/static/app/asset-without.js"></script>', # noqa |
114 |
++ '<script{} src="/static/app/asset-without.js"></script>'.format(JS_TYPE), |
115 |
+ html, |
116 |
+ ) |
117 |
+ |
118 |
+@@ -42,7 +48,9 @@ def test_absolute(self): |
119 |
+ html = "%s" % media |
120 |
+ |
121 |
+ self.assertInHTML( |
122 |
+- '<script type="text/javascript" src="https://cdn.example.org/script.js"></script>', # noqa |
123 |
++ '<script{} src="https://cdn.example.org/script.js"></script>'.format( |
124 |
++ JS_TYPE |
125 |
++ ), |
126 |
+ html, |
127 |
+ ) |
128 |
+ |