- Update to 4.5.1

* Officially support Python 3.12 (requires lxml 4.9.3 or higher)
  * Drop support for Django versions before 4.2.
  * Added support for Django 5.1
  * Added new ``COMPRESS_STORAGE_ALIAS`` and ``COMPRESS_OFFLINE_MANIFEST_STORAGE_ALIAS``
    settings. These point to keys in Django's ``storages`` handler. If set by the
    user, Compressor will use these storages, or otherwise will set a default
    storage, given by ``COMPRESS_STORAGE`` and
    ``COMPRESS_OFFLINE_MANIFEST_STORAGE`` respectively on first access.
- Drop already merged patches:
  * python-django-compressor-rcssmin-and-rjsmin-versions.patch
  * lstrip.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-compressor?expand=0&rev=30
This commit is contained in:
Markéta Machová 2024-09-05 08:38:38 +00:00 committed by Git OBS Bridge
commit 0ab37271e6
8 changed files with 632 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

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

View File

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

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

@ -0,0 +1,13 @@
diff -ruN a/setup.py b/setup.py
--- a/setup.py 2023-06-28 00:11:30.000000000 +0200
+++ b/setup.py 2023-12-11 13:19:34.154446612 +0100
@@ -164,7 +164,7 @@
zip_safe=False,
install_requires=[
"django-appconf >= 1.0.3",
- "rcssmin == 1.1.1",
- "rjsmin == 1.2.1",
+ "rcssmin >= 1.1.1",
+ "rjsmin >= 1.2.1",
],
)

View File

@ -0,0 +1,474 @@
-------------------------------------------------------------------
Tue Sep 3 13:44:11 UTC 2024 - Markéta Machová <mmachova@suse.com>
- Update to 4.5.1
* Officially support Python 3.12 (requires lxml 4.9.3 or higher)
* Drop support for Django versions before 4.2.
* Added support for Django 5.1
* Added new ``COMPRESS_STORAGE_ALIAS`` and ``COMPRESS_OFFLINE_MANIFEST_STORAGE_ALIAS``
settings. These point to keys in Django's ``storages`` handler. If set by the
user, Compressor will use these storages, or otherwise will set a default
storage, given by ``COMPRESS_STORAGE`` and
``COMPRESS_OFFLINE_MANIFEST_STORAGE`` respectively on first access.
- Drop already merged patches:
* python-django-compressor-rcssmin-and-rjsmin-versions.patch
* lstrip.patch
-------------------------------------------------------------------
Mon Dec 11 12:30:39 UTC 2023 - Jacob Michalskie <hel@lcp.world>
- Adds patch python-django-compressor-rcssmin-and-rjsmin-versions.patch
* Make sure newer versions of rcssmin and rjsmin can be used
-------------------------------------------------------------------
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>
- Use sle15_python_module_pythons
-------------------------------------------------------------------
Mon Jan 23 17:25:42 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 4.3.1:
* `Full list of changes from v4.3 <https://github.com/django-
compressor/django-compressor/compare/4.3...4.3.1>`_
* Documentation fixes only
-------------------------------------------------------------------
Sat Jan 7 08:45:56 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 4.3:
* `Full Changelog <https://github.com/django-compressor/django-
compressor/compare/4.1...4.3>`_
* Officially support Python 3.11
* Drop Python 3.6 and 3.7 support
* Drop Django 2.2 and 3.1 support
* Drop SlimItFilter
* Update the `CachedS3Boto3Storage` example storage subclass in "Remote
Storages" to work properly after the v4.0 change to how duplicate file
names are handled by `CompressorFileStorage`
* Update rsmin and jsmin versions
-------------------------------------------------------------------
Thu Nov 24 18:26:17 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Fix tests problem related to jinja2 version
# gh#django-compressor/django-compressor#1139
# gh#django-compressor/django-compressor@bcdd21956a84
-------------------------------------------------------------------
Thu Aug 4 17:45:11 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Update to 4.1
* Add Django 4.1 compatibility
* New setting ``COMPRESS_OFFLINE_MANIFEST_STORAGE`` to customize
the offline manifest's file storage (#1112) With this change
the function
``compressor.cache.get_offline_manifest_filename()`` has been
removed. You can now use the new file storage
``compressor.storage.default_offline_manifest_storage`` to
access the location of the manifest.
- Release 4.0
* Fix intermittent No such file or directory errors by changing
strategy to deal with duplicate filenames in
CompressorFileStorage
* Deprecate SlimItFilter, stop testing it with Python 3.7 or
higher
-------------------------------------------------------------------
Wed Apr 27 01:58:15 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Remove unneeded BuildRequires on mock.
-------------------------------------------------------------------
Sun Dec 26 09:03:25 UTC 2021 - John Vandenberg <jayvdb@gmail.com>
- Re-activate test suite
- Update to v3.1
* Fix error with verbose offline compression when
COMPRESS_OFFLINE_CONTEXT is a generator
- from v3.0
* Officially support for Python 3.9 and 3.10 as well as
Django 3.1, 3.2 and 4.0
* Drop support for Django 1.11, 2.1 and 3.0
* Drop support for Python 2.x and 3.4
* Fix compatibility with Jinja 3.x
* Require django-sekizai 2.0 for django-sekizai extension
* Make template compression in compress command threaded to
improve performance
* Correctly handle relative paths in ``extends`` tags
* Enable ``rCSSMinFilter`` by default
* Fix various deprecation warnings
* Add ability to pass a logger to various classes & methods
* Removed deprecated ``COMPRESS_JS_FILTERS`` and
``COMPRESS_CSS_FILTERS`` settings
* Fix offline compression race condition, which could result in incomplete manifest
-------------------------------------------------------------------
Tue May 25 11:07:13 UTC 2021 - Markéta Machová <mmachova@suse.com>
- Update to 2.4.1
* Raise proper DeprecationWarning for COMPRESS_JS_FILTERS and COMPRESS_CSS_FILTERS
-------------------------------------------------------------------
Mon Jun 1 07:34:01 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Disable tests until upstream makes them work with new python
Beautifulsoup
-------------------------------------------------------------------
Fri Apr 3 06:58:10 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Bump the version requirement on django to be >= 2.2
- Enable verbose testing
-------------------------------------------------------------------
Mon Jan 6 14:27:50 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 2.4 release:
* support for newer django releases
- Drop merged patch:
* pr_956.patch
-------------------------------------------------------------------
Mon Jan 6 14:26:05 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Rename to django-compressor to match up pypi name
-------------------------------------------------------------------
Sat Sep 14 10:51:15 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Add pr_956.patch to fix tests to use sys.executable
-------------------------------------------------------------------
Mon Jun 3 09:55:50 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 2.3 release:
- Drop support for Django 1.8, 1.9 and 1.10
- Add support for Django 2.1 and 2.2, as well as Python 3.7
- Update all dependencies. This required minor code changes, you might need to update some optional dependencies if you use any
- Allow the mixed use of JS/CSS in Sekizai's templatetags `{% addtoblock "js" %}` and `{% addtoblock "css" %}` (#891)
- Allow the implementation of new types other than css and js. (#900)
- Update jinja2 extension to behave similar to the django tag (#899)
- Fix crash in offline compression when child nodelist is None, again (#605)
- Support STATIC_URL and COMPRESS_URL being string-like objects
- Improve compress command memory usage (#870)
- Ensure generated file always contains a base name (#775)
- Add BrotliCompressorFileStorage (#867)
- Drop merged patch compressor-django2.patch
-------------------------------------------------------------------
Fri Jan 4 14:44:11 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
- Use noun phrase for summary.
-------------------------------------------------------------------
Thu Jan 3 11:41:08 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to build with django 2.0:
* compressor-django2.patch
-------------------------------------------------------------------
Thu Jan 3 07:53:15 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Add missing dependencies
-------------------------------------------------------------------
Tue Dec 11 09:47:19 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>
- Enable testsuite (currently failing)
-------------------------------------------------------------------
Wed Nov 15 17:08:49 UTC 2017 - buschmann23@opensuse.org
- update to 2.2
+ Switch from MD5 to SHA256 for hashes generation.
+ Add Django 1.11 compatibility
+ Various compatibility fixes for Python 3.6 and Django 1.8
+ Made OfflineGenerationError easier to debug
+ Drop support for Python 3.2
+ Add new CssRelativeFilter which works like CssAbsoluteFilter
but outputs relative URLs.
+ Fix URL CssAbsoluteFilter URL detection
- spec file
+ convert to single spec file
-------------------------------------------------------------------
Wed Aug 16 06:45:28 UTC 2017 - dmueller@suse.com
- update to 2.1.1
-------------------------------------------------------------------
Wed Feb 22 18:18:31 CET 2017 - sbrabec@suse.com
- Update to version 2.1:
* Add Django 1.10 compatibility
* Add support for inheritance using a variable in offline
compression
* Fix recursion error with offline compression when extending
templates with the same name
* Fix UnicodeDecodeError when using CompilerFilter and caching
* Fix CssAbsoluteFilter changing double quotes to single quotes,
breaking SVG
-------------------------------------------------------------------
Wed Jul 6 16:24:17 UTC 2016 - dmueller@suse.com
- update to 2.0:
- Add Django 1.9 compatibility
- Remove official support for Django 1.4 and 1.7
- Add official support for Python 3.5
- Remove official support for Python 2.6
- Remove support for coffin and jingo
- Fix Jinja2 compatibility for Django 1.8+
- Stop bundling vendored versions of rcssmin and rjsmin, make them proper dependencies
- Remove support for CSSTidy
- Remove support for beautifulsoup 3.
- Replace cssmin by csscompressor (cssmin is still available for backwards-compatibility but points to rcssmin)
-------------------------------------------------------------------
Fri May 20 12:07:14 UTC 2016 - aplanas@suse.com
- update to 1.6
- Upgrade rcssmin and rjsmin
- Apply CssAbsoluteFilter to precompiled css even when compression is disabled
- Add optional caching to CompilerFilter to avoid re-compiling unchanged files
- Fix various deprecation warnings on Django 1.7 / 1.8
- Fix TemplateFilter
- Fix double-rendering bug with sekizai extension
- Fix debug mode using destination directory instead of staticfiles finders first
- Removed some silent exception catching in compress command
-------------------------------------------------------------------
Sat Jul 25 19:59:44 UTC 2015 - seife+obs@b1-systems.com
- fix non-suse build by conditionalizing "Suggests" tags
-------------------------------------------------------------------
Thu Jul 23 16:45:28 UTC 2015 - dmueller@suse.com
- update to 1.5:
- Fix compress command and run automated tests for Django 1.8
- Fix Django 1.8 warnings
- Handle TypeError from import_module
- Fix reading UTF-8 files which have BOM
- Fix incompatibility with Windows (shell_quote is not supported)
- Run automated tests on Django 1.7
- Ignore non-existent {{ block.super }} in offline compression instead of raising AttributeError
- Support for clean-css
- Fix link markup
- Add support for COMPRESS_CSS_HASHING_METHOD = None
- Remove compatibility with old 'staticfiles' app
- In compress command, use get_template() instead of opening template files manually, fixing compatibility issues
- Fix FilterBase so that does not override self.type for subclasses if filter_type is not specified at init
- Remove unnecessary filename and existence checks in CssAbsoluteFilter
-------------------------------------------------------------------
Thu Jun 26 09:42:00 UTC 2014 - dmueller@suse.com
- update to 1.4:
- Added Python 3 compatibility.
- Added compatibility with Django 1.6.x.
- Fixed compatibility with html5lib 1.0.
- Added offline compression for Jinja2 with Jingo and Coffin integration.
- Improved support for template inheritance in offline compression.
- Made offline compression avoid compressing the same block multiple times.
- Added a ``testenv`` target in the Makefile to make it easier to set up the
test environment.
- Allowed data-uri filter to handle external/protocol-relative references.
- Made ``CssCompressor`` class easier to extend.
- Added support for explictly stating the block being ended.
- Added rcssmin and updated rjsmin.
- Removed implicit requirement on BeautifulSoup.
- Made GzipCompressorFileStorage set access and modified times to the same time
as the corresponding base file.
- Defaulted to using django's simplejson, if present.
- Fixed CompilerFilter to always output Unicode strings.
- Fixed windows line endings in offline compression.
-------------------------------------------------------------------
Thu Oct 24 11:01:47 UTC 2013 - speilicke@suse.com
- Require python-setuptools instead of distribute (upstreams merged)
-------------------------------------------------------------------
Mon May 13 08:39:13 UTC 2013 - dmueller@suse.com
- update to 1.3:
- *Backward incompatible changes*
- Dropped support for Python 2.5. Removed ``any`` and ``walk`` compatibility
functions in ``compressor.utils``.
- Removed compatibility with Django 1.2 for default values of some settings:
- :attr:`~COMPRESS_ROOT` no longer uses ``MEDIA_ROOT`` if ``STATIC_ROOT`` is
not defined. It expects ``STATIC_ROOT`` to be defined instead.
- :attr:`~COMPRESS_URL` no longer uses ``MEDIA_URL`` if ``STATIC_URL`` is
not defined. It expects ``STATIC_URL`` to be defined instead.
- :attr:`~COMPRESS_CACHE_BACKEND` no longer uses ``CACHE_BACKEND`` and simply
defaults to ``default``.
- Added precompiler class support. This enables you to write custom precompilers
with Python logic in them instead of just relying on executables.
- Made CssAbsoluteFilter smarter: it now handles URLs with hash fragments or
querystring correctly. In addition, it now leaves alone fragment-only URLs.
- Removed a ``fsync()`` call in ``CompilerFilter`` to improve performance.
We already called ``self.infile.flush()`` so that call was not necessary.
- Added an extension to provide django-sekizai support.
See :ref:`django-sekizai Support <django-sekizai_support>` for more
information.
- Fixed a ``DeprecationWarning`` regarding the use of ``django.utils.hashcompat``
- Updated bundled ``rjsmin.py`` to fix some JavaScript compression errors.
-------------------------------------------------------------------
Wed Nov 28 15:32:11 UTC 2012 - saschpe@suse.de
- Add suggestions for useful additions:
+ python-beautifulsoup
+ python-html5lib
+ python-lxml
+ python-slimit
-------------------------------------------------------------------
Mon Nov 26 14:47:14 UTC 2012 - cfarrell@suse.com
- license update: MIT and BSD-3-Clause and Apache-2.0
-------------------------------------------------------------------
Tue Nov 13 22:47:11 UTC 2012 - jfunk@funktronics.ca
- Update to 1.2:
* Added compatibility with Django 1.4 and dropped support for Django 1.2.X.
* Added contributing docs. Be sure to check them out and start contributing!
* Moved CI to Travis: http://travis-ci.org/jezdez/django_compressor
* Introduced a new compressed context dictionary that is passed to the
templates that are responsible for rendering the compressed snippets.
This is a backwards-incompatible change if you've overridden any of the included templates:
compressor/css_file.html
compressor/css_inline.html
compressor/js_file.html
compressor/js_inline.html
The variables passed to those templates have been namespaced in a
dictionary, so it's easy to fix your own templates.
For example, the old compressor/js_file.html:
<script type="text/javascript" src="{{ url }}"></script>
The new compressor/js_file.html:
<script type="text/javascript" src="{{ compressed.url }}"></script>
* Removed old templates named compressor/css.html and compressor/js.html
that were originally left for backwards compatibility. If you've
overridden them, just rename them to compressor/css_file.html or
compressor/js_file.html and make sure you've accounted for the backwards
incompatible change of the template context mentioned above.
* Reverted an unfortunate change to the YUI filter that prepended
'java -jar' to the binary name, which doesn't alway work, e.g. if the YUI
compressor is shipped as a script like /usr/bin/yui-compressor.
* Changed the sender parameter of the post_compress() signal to be either
compressor.css.CssCompressor or compressor.js.JsCompressor for easier
customization.
* Correctly handle offline compressing files that are found in {% if %}
template blocks.
* Renamed the second option for the COMPRESS_CSS_HASHING_METHOD setting from
'hash' to 'content' to better describe what it does. The old name is also
supported, as well as the default being 'mtime'.
* Fixed CssAbsoluteFilter, src attributes in includes now get transformed.
* Added a new hook to allow developers to completely bypass offline
compression in CompressorNode subclasses: is_offline_compression_enabled.
* Dropped versiontools from required dependencies again.
-------------------------------------------------------------------
Wed Feb 1 13:26:25 UTC 2012 - saschpe@suse.de
- Spec file cleanup:
* Simplified macro usage
* Removed outdated %clean section
* Buildrequire python-distribute instead of setuptools
-------------------------------------------------------------------
Fri Jan 20 02:04:02 UTC 2012 - jfunk@funktronics.ca
- Add missing requirement for django-appconf
-------------------------------------------------------------------
Thu Jan 12 19:03:33 UTC 2012 - jfunk@funktronics.ca
- Update to 1.1.2:
* Fixed an installation issue related to versiontools
-------------------------------------------------------------------
Sat Nov 26 06:01:29 UTC 2011 - jfunk@funktronics.ca
- Update to 1.1.1:
- Fixed a stupid ImportError bug introduced in 1.1
- Fixed Jinja2 docs of since JINJA2_EXTENSIONS expects a class, not a module
- Fixed a Windows bug with regard to file resolving with staticfiles finders
- Stopped a potential memory leak when memoizing the rendered output
- Fixed the integration between staticfiles (e.g. in Django <= 1.3.1) and
compressor which prevents the collectstatic management command to work
- Warning - Make sure to remove the path method of your custom remote
storage class!
- 1.1:
- Made offline compression completely independent from cache (by writing a
manifest.json file)
- You can now easily run the compress management command locally and
transfer the COMPRESS_ROOT dir to your server
- Updated installation instructions to properly mention all dependencies,
even those internally used
- Fixed a bug introduced in 1.0 which would prevent the proper deactivation
of the compression in production
- Added a Jinja2 contrib extension
- Made sure the rel attribute of link tags can be mixed case
- Avoid overwriting context variables needed for compressor to work
- Stopped the compress management command to require model validation
- Added missing imports and fixed a few PEP 8 issues
- 1.0.1:
- Fixed regression in compressor.utils.staticfiles compatibility module
- 1.0:
- BACKWARDS-INCOMPATIBLE Stopped swallowing exceptions raised by rendering
the template tag in production (DEBUG = False). This has the potential to
breaking lots of apps but on the other hand will help find bugs
- BACKWARDS-INCOMPATIBLE The default function to create the cache key
stopped containing the server hostname. Instead the cache key now only has
the form 'django_compressor.<KEY>'
- To revert to the previous way simply set the COMPRESS_CACHE_KEY_FUNCTION
to 'compressor.cache.socket_cachekey'
- BACKWARDS-INCOMPATIBLE Renamed ambigously named COMPRESS_DATA_URI_MAX_SIZE
setting to COMPRESS_DATA_URI_MAX_SIZE. Its the maximum size the
compressor.filters.datauri.DataUriFilter filter will embed files as data:
URIs
- Added COMPRESS_CSS_HASHING_METHOD setting with the options 'mtime'
(default) and 'hash' for the CssAbsoluteFilter filter. The latter uses the
content of the file to calculate the cache-busting hash
- Added support for {{ block.super }} to compress management command
- Dropped Django 1.1.X support
- Fixed compiler filters on Windows
- Handle new-style cached template loaders in the compress management
command
- Documented included filters
- Added Slim It filter
- Added new CallbackOutputFilter to ease the implementation of Python-based
callback filters that only need to pass the content to a callable
- Make use of django-appconf for settings handling and versiontools for
versions
- Uses the current context when rendering the render templates
- Added post_compress signal
-------------------------------------------------------------------
Wed Jul 27 21:27:56 UTC 2011 - jfunk@funktronics.ca
- Initial release

View File

@ -0,0 +1,87 @@
#
# spec file for package python-django-compressor
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
%define mod_name django_compressor
Name: python-django-compressor
Version: 4.5.1
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
BuildRequires: %{python_module Brotli >= 1.0.6}
BuildRequires: %{python_module Django >= 4.2}
BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module beautifulsoup4}
BuildRequires: %{python_module calmjs}
BuildRequires: %{python_module csscompressor}
BuildRequires: %{python_module django-appconf >= 1.0.3}
BuildRequires: %{python_module django-sekizai >= 2.0.0}
BuildRequires: %{python_module html5lib}
BuildRequires: %{python_module lxml >= 4.9.3}
BuildRequires: %{python_module rcssmin >= 1.1.1}
BuildRequires: %{python_module rjsmin >= 1.2.1}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Django >= 4.2
Requires: python-beautifulsoup4
Requires: python-csscompressor
Requires: python-django-appconf >= 1.0.3
Requires: python-rcssmin >= 1.1.1
Requires: python-rjsmin >= 1.2.1
Recommends: python-Brotli >= 1.0.6
Recommends: python-Jinja2
Recommends: python-calmjs
Suggests: python-django-sekizai >= 2.0.0
Provides: python-django_compressor = %{version}
Obsoletes: python-django_compressor < %{version}
BuildArch: noarch
%python_subpackages
%description
Django Compressor combines and compresses linked and inline Javascript or CSS
in a Django templates into cacheable static files by using the "compress"
template tag.
%prep
%setup -q -n %{mod_name}-%{version}
%autopatch -p1
sed -i '1{/env python/d}' compressor/tests/precompiler.py
%build
%python_build
%install
%python_install
%{python_expand #
echo '/* empty file */' >> %{buildroot}%{$python_sitelib}/compressor/tests/static/CACHE/css/output.e3b0c44298fc.css
%fdupes %{buildroot}%{$python_sitelib}
}
%check
%python_expand $python -m django test --settings=compressor.test_settings compressor --pythonpath=`pwd` -v2
%files %{python_files}
%license LICENSE
%doc AUTHORS README.rst
%{python_sitelib}/compressor
%{python_sitelib}/django_compressor-%{version}*-info
%changelog