Accepting request 1099201 from home:mcalabkova:branches:devel:languages:python:django

- Update to 4.4
  * Full list of changes from v4.3.1 <https://github.com/django-compressor/django-compressor/compare/4.3.1...4.4>
  * Officially support Django 4.2
- Add upstream patch lstrip.patch

OBS-URL: https://build.opensuse.org/request/show/1099201
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-compressor?expand=0&rev=26
This commit is contained in:
Dirk Mueller 2023-07-19 11:15:31 +00:00 committed by Git OBS Bridge
parent 00c148ab14
commit 631c0e854a
5 changed files with 43 additions and 8 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68858c0da6cc099cc29a022d86c3ba8aed114da9d709eeceb0d7b8181b5f8942
size 422161

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b0acc9cfba9f69bc38e7c41da9b0d70a20bc95587b643ffef9609cf46064f67
size 422254

28
lstrip.patch Normal file
View File

@ -0,0 +1,28 @@
From 1afd937f6a49b10013c1df71b53d054170efdce4 Mon Sep 17 00:00:00 2001
From: bcail <bcail@crossway.org>
Date: Mon, 3 Jul 2023 17:24:39 +0000
Subject: [PATCH] Add `LazyScriptNamePrefixedUrl.lstrip` to fix tests (#1196)
Needed because of cpython PR
https://github.com/python/cpython/pull/104575
---
compressor/tests/test_offline.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/compressor/tests/test_offline.py b/compressor/tests/test_offline.py
index c208048e..c49d1277 100644
--- a/compressor/tests/test_offline.py
+++ b/compressor/tests/test_offline.py
@@ -58,6 +58,12 @@ def __unicode__(self):
def __hash__(self):
return str.__hash__(str(self))
+ def lstrip(self, *args, **kwargs):
+ """
+ Override ``.lstrip()`` method to make it work with ``{% static %}``.
+ """
+ return str(self).lstrip(*args, **kwargs)
+
def split(self, *args, **kwargs):
"""
Override ``.split()`` method to make it work with ``{% static %}``.

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jul 18 08:25:44 UTC 2023 - Markéta Machová <mmachova@suse.com>
- Update to 4.4
* Full list of changes from v4.3.1 <https://github.com/django-compressor/django-compressor/compare/4.3.1...4.4>
* Officially support Django 4.2
- Add upstream patch lstrip.patch
-------------------------------------------------------------------
Sun Jun 18 16:31:47 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>

View File

@ -19,12 +19,14 @@
%{?sle15_python_module_pythons}
%define mod_name django_compressor
Name: python-django-compressor
Version: 4.3.1
Version: 4.4
Release: 0
Summary: Python module to compress linked/inline JavaScript/CSS to cached files
License: Apache-2.0 AND BSD-3-Clause AND MIT
URL: https://github.com/django-compressor/django-compressor
Source: https://files.pythonhosted.org/packages/source/d/%{mod_name}/%{mod_name}-%{version}.tar.gz
#PATCH-FIX-UPSTREAM https://github.com/django-compressor/django-compressor/pull/1196 Add LazyScriptNamePrefixedUrl.lstrip to fix tests
Patch: lstrip.patch
BuildRequires: %{python_module Brotli >= 1.0.6}
BuildRequires: %{python_module Django >= 2.2}
BuildRequires: %{python_module Jinja2}
@ -64,11 +66,8 @@ template tag.
%prep
%setup -q -n %{mod_name}-%{version}
%autopatch -p1
sed -i '1{/env python/d}' compressor/tests/precompiler.py
# Fix broken tests related to jijna2
# gh#django-compressor/django-compressor#1139
# gh#django-compressor/django-compressor@bcdd21956a84
sed -i '/jinja2.ext.with_/d' compressor/tests/test_offline.py
%build
%python_build