Merge ~lvoytek/ubuntu/+source/django-assets:fix-django4-compatibility into ubuntu/+source/django-assets:ubuntu/devel

Proposed by Lena Voytek
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: d228897d8e882bdd2c76ec7671b70176b7332680
Proposed branch: ~lvoytek/ubuntu/+source/django-assets:fix-django4-compatibility
Merge into: ubuntu/+source/django-assets:ubuntu/devel
Diff against target: 131 lines (+56/-30)
6 files modified
debian/changelog (+9/-0)
debian/control (+2/-1)
debian/patches/django4-compatibility.patch (+21/-0)
debian/patches/fix-node-iteration.patch (+22/-0)
debian/patches/series (+2/-1)
dev/null (+0/-28)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Graham Inggs (community) Approve
Canonical Server Pending
Canonical Server Reporter Pending
Review via email: mp+449658@code.launchpad.net

Description of the change

Make django-assets compatible with Django 4.2 and fix build failures

django4-compatibility.patch comes from a merge request upstream that updates requires_system_checks to an empty array rather than False as boolean compatibility was removed in Django 4

01-webassets_version.patch is removed since upstream added the >= in __init__.py, meaning having it would lead to the error:
error in django-assets setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after name and no valid version specifier)
    webassets>=>=2.0

fix-node-iteration.patch Fixes the error:
TypeError: 'TextNode' object is not iterable
I created this patch myself and sent the fix upstream - https://github.com/miracle2k/django-assets/pull/105

PPA: https://launchpad.net/~lvoytek/+archive/ubuntu/django-4-mantic

To post a comment you must log in.
Revision history for this message
Graham Inggs (ginggs) wrote :

Looks good to me!

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: ginggs, lvoytek
Uploaders: ginggs
MP auto-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index d5483f5..37c5beb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
1django-assets (2.0-2.1ubuntu1) mantic; urgency=medium
2
3 * d/p/django4-compatibility.patch: Fix Django 4 compatibility by updating the
4 deprecated field requires_system_checks (LP: #2022089)
5 * d/p/fix-node-iteration.patch: Fix TypeError when iterating over Nodes
6 * d/p/01-webassets_version.patch: Remove - fixed upstream through __init__.py
7
8 -- Lena Voytek <lena.voytek@canonical.com> Mon, 31 Jul 2023 12:07:24 -0700
9
1django-assets (2.0-2.1) unstable; urgency=low10django-assets (2.0-2.1) unstable; urgency=low
211
3 * Non-maintainer upload.12 * Non-maintainer upload.
diff --git a/debian/control b/debian/control
index ae19f0b..00cd2fe 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
1Source: django-assets1Source: django-assets
2Section: python2Section: python
3Priority: optional3Priority: optional
4Maintainer: Debian Python Team <team+python@tracker.debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
5Uploaders:6Uploaders:
6 Michael Fladischer <fladi@debian.org>,7 Michael Fladischer <fladi@debian.org>,
7 Chris Lamb <lamby@debian.org>,8 Chris Lamb <lamby@debian.org>,
diff --git a/debian/patches/01-webassets_version.patch b/debian/patches/01-webassets_version.patch
8deleted file mode 1006449deleted file mode 100644
index e6aa376..0000000
--- a/debian/patches/01-webassets_version.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From: Mcihael Fladischer <fladi@debian.org>
2Date: Thu, 8 Oct 2015 08:49:20 -0700
3Subject: loosen up dependency on webassets
4
5 Upstream uses a strict versioned dependency on webassets-library which is
6 unnecessary. This patch loosens up this dependency to also allow newer versions
7 of webassets.
8Last-Update: 2014-09-09
9Forwarded: no
10
11Patch-Name: 01-webassets_version.patch
12---
13 setup.py | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/setup.py b/setup.py
17index 206458a..07a9ca0 100755
18--- a/setup.py
19+++ b/setup.py
20@@ -42,7 +42,7 @@ setup(
21 platforms='any',
22 install_requires=[
23 'Django>=1.7',
24- 'webassets%s' % webassets_version
25+ 'webassets>=%s' % webassets_version
26 ],
27 classifiers=[
28 'Environment :: Web Environment',
diff --git a/debian/patches/django4-compatibility.patch b/debian/patches/django4-compatibility.patch
29new file mode 1006440new file mode 100644
index 0000000..ea8fb10
--- /dev/null
+++ b/debian/patches/django4-compatibility.patch
@@ -0,0 +1,21 @@
1Description: Fix depricated field to build django-assets against Django 4.2
2 In Django 4 the requires_system_checks variable must now be a list or tuple,
3 as support for boolean values was removed. This patch replaces the False value
4 with an equivalent empty array. See https://code.djangoproject.com/ticket/33896
5Author: Madison Swain-Bowden <bowdenm@spu.edu>
6Origin: other, https://github.com/miracle2k/django-assets/pull/103/commits/bc85445e31acbdbf86deff62255175da72a8ea13
7Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/django-assets/+bug/2022089
8Last-Update: 2023-07-31
9---
10This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
11--- a/django_assets/management/commands/assets.py
12+++ b/django_assets/management/commands/assets.py
13@@ -37,7 +37,7 @@
14
15 class Command(BaseCommand):
16 help = 'Manage assets.'
17- requires_system_checks = False
18+ requires_system_checks = []
19
20 def add_arguments(self, parser):
21 # parser.add_argument('poll_id', nargs='+', type=str)
diff --git a/debian/patches/fix-node-iteration.patch b/debian/patches/fix-node-iteration.patch
0new file mode 10064422new file mode 100644
index 0000000..01531b5
--- /dev/null
+++ b/debian/patches/fix-node-iteration.patch
@@ -0,0 +1,22 @@
1Description: Fix Node iteration error due to unsupported __iter__ function
2 When iterating over Template and Node objects directly, nodes may fail with an
3 exception such as: TypeError: 'TextNode' object is not iterable
4 This is due to iterating over nodes being unsupported in Django, as noted in
5 https://code.djangoproject.com/ticket/7430
6 To avoid this error, explicitly iterate over the nodelist attribute, rather
7 than relying on __iter__.
8Author: Lena Voytek <lena.voytek@canonical.com>
9Origin: backport, https://github.com/miracle2k/django-assets/pull/105/commits/af2440a107df0eac310cf3585b9f267ebe59f3dc
10Last-Update: 2023-08-22
11---
12This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
13--- a/django_assets/loaders.py
14+++ b/django_assets/loaders.py
15@@ -107,6 +107,6 @@
16 and node.nodelist\
17 or []:
18 _recurse_node(subnode)
19- for node in t: # don't move into _recurse_node, ``Template`` has a .nodelist attribute
20+ for node in t.nodelist: # don't move into _recurse_node, ``Template`` has a .nodelist attribute
21 _recurse_node(node)
22 return result
diff --git a/debian/patches/series b/debian/patches/series
index e2d6a99..73abe40 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
101-webassets_version.patch
202-intersphinx.patch102-intersphinx.patch
30003-Patch-pytest-plugin-to-check-whether-we-are-running-.patch20003-Patch-pytest-plugin-to-check-whether-we-are-running-.patch
40001-Global-regex-flags-must-be-at-the-start-of-regex-in-.patch30001-Global-regex-flags-must-be-at-the-start-of-regex-in-.patch
4django4-compatibility.patch
5fix-node-iteration.patch

Subscribers

People subscribed via source and target branches

to all changes: