diff --git a/AUTHORS b/AUTHORS index 648921ac..0cbcb987 100644 --- a/AUTHORS +++ b/AUTHORS @@ -121,3 +121,4 @@ or just made Pipeline more awesome. * Wismill * Zachary Kazanski * Zenobius Jiricek + * Zeus Kronion \ No newline at end of file diff --git a/HISTORY.rst b/HISTORY.rst index f8cca0ca..a1f7eee9 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,15 @@ History ======= +2.0.2 +===== + +* Fix Middleware to properly decode HTML. Thank to @gatsinski +* Keep mimetypes as str. Thank to @benspaulding +* Based on #642 add 'NonPackagingPipelineManifestStorage' and update + the documentation: **storages.rst**. Thank to @kronion +* Remove futures from pipeline **setup.py** requirements. + 2.0.1 ===== diff --git a/docs/storages.rst b/docs/storages.rst index c17d41a3..d2bf884c 100644 --- a/docs/storages.rst +++ b/docs/storages.rst @@ -15,7 +15,7 @@ to use it configure ``STATICFILES_STORAGE`` like so :: And if you want versioning use :: - STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' + STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage' There is also non-packing storage available, that allows you to run ``collectstatic`` command without packaging your assets. Useful for production when you don't want to run compressor or compilers :: @@ -24,7 +24,7 @@ without packaging your assets. Useful for production when you don't want to run Also available if you want versioning :: - STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineCachedStorage' + STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineManifestStorage' If you use staticfiles with ``DEBUG = False`` (i.e. for integration tests with `Selenium `_) you should install the finder diff --git a/pipeline/conf.py b/pipeline/conf.py index f84da5d3..b089ac14 100644 --- a/pipeline/conf.py +++ b/pipeline/conf.py @@ -71,11 +71,11 @@ 'LESS_ARGUMENTS': '', 'MIMETYPES': ( - (str('text/coffeescript'), str('.coffee')), - (str('text/less'), str('.less')), - (str('text/javascript'), str('.js')), - (str('text/x-sass'), str('.sass')), - (str('text/x-scss'), str('.scss')) + (('text/coffeescript'), ('.coffee')), + (('text/less'), ('.less')), + (('text/javascript'), ('.js')), + (('text/x-sass'), ('.sass')), + (('text/x-scss'), ('.scss')) ), 'EMBED_MAX_IMAGE_SIZE': 32700, diff --git a/pipeline/middleware.py b/pipeline/middleware.py index 883a7aa2..271ef524 100644 --- a/pipeline/middleware.py +++ b/pipeline/middleware.py @@ -16,7 +16,7 @@ def __init__(self, *args, **kwargs): def process_response(self, request, response): if response.has_header('Content-Type') and 'text/html' in response['Content-Type']: try: - response.content = minify_html(response.content.decode().strip()) + response.content = minify_html(response.content.decode('utf-8').strip()) response['Content-Length'] = str(len(response.content)) except DjangoUnicodeDecodeError: pass diff --git a/pipeline/storage.py b/pipeline/storage.py index 3c3deaf0..b8dd3759 100644 --- a/pipeline/storage.py +++ b/pipeline/storage.py @@ -91,6 +91,12 @@ class NonPackagingPipelineStorage(NonPackagingMixin, PipelineStorage): class PipelineCachedStorage(PipelineMixin, CachedStaticFilesStorage): + # Deprecated since Django 2.2 + pass + + +class NonPackagingPipelineCachedStorage(NonPackagingMixin, PipelineCachedStorage): + # Deprecated since Django 2.2 pass @@ -98,5 +104,5 @@ class PipelineManifestStorage(PipelineMixin, ManifestStaticFilesStorage): pass -class NonPackagingPipelineCachedStorage(NonPackagingMixin, PipelineCachedStorage): +class NonPackagingPipelineManifestStorage(NonPackagingMixin, ManifestStaticFilesStorage): pass diff --git a/setup.py b/setup.py index 9eabd5d5..fe0ed56a 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='django-pipeline', - version='2.0.1', + version='2.0.2', description='Pipeline is an asset packaging library for Django.', long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' + io.open('HISTORY.rst', encoding='utf-8').read(), @@ -16,7 +16,7 @@ license='MIT', packages=find_packages(exclude=['tests', 'tests.tests']), zip_safe=False, - install_requires=['futures >= 2.1.3;python_version<"3.6"'], + install_requires=['python_version<"3.6"'], include_package_data=True, keywords=('django pipeline asset compiling concatenation compression' ' packaging'), diff --git a/tests/tests/test_utils.py b/tests/tests/test_utils.py index a3db9b7b..107ded8b 100644 --- a/tests/tests/test_utils.py +++ b/tests/tests/test_utils.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import mimetypes