Skip to content

Commit

Permalink
Remove gzip filter.
Browse files Browse the repository at this point in the history
It turns out that it is a problem on Python 2 as well. Obviously,
merging the output of the gzip filter with that of a text filter
(which all use unicode) wouldn't work. While that makes little
sense in practice, it turns out that the code that processes
filters failed with the gzip output due to it's assumptions about
unicode. While I could have worked around this in theory, I don't
think it's worthwhile adding another hack for this.

Either we want gzip or not, and if we do, we'll need to find a
proper solution that works on Python 3 as well.
  • Loading branch information
miracle2k committed May 8, 2013
1 parent c969a5c commit d0fb241
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 56 deletions.
6 changes: 0 additions & 6 deletions docs/builtin_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,6 @@ Other
.. autoclass:: webassets.filter.cssprefixer.CSSPrefixer


``gzip``
~~~~~~~~

.. autoclass:: webassets.filter.gzip.GZip


``jinja2``
~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion docs/bundles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ which allows you do something like this:

.. code-block:: jinja
{% assets filters="jsmin,gzip", output="gen/packed.js", "common/jquery.js", "site/base.js", "site/widgets.js" %}
{% assets filters="cssmin,datauri", output="gen/packed.css", "common/jquery.css", "site/base.css", "site/widgets.css" %}
...
Expand Down
2 changes: 1 addition & 1 deletion docs/integration/jinja2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ within your templates:

.. code-block:: jinja
{% assets filters="jsmin,gzip", output="gen/packed.js", "common/jquery.js", "site/base.js", "site/widgets.js" %}
{% assets filters="cssmin,datauri", output="gen/packed.css", "common/jquery.css", "site/base.css", "site/widgets.css" %}
...
Expand Down
34 changes: 0 additions & 34 deletions src/webassets/filter/gzip.py

This file was deleted.

14 changes: 0 additions & 14 deletions tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,20 +433,6 @@ class TestBuiltinFilters(TempEnvironmentHelper):
""",
}

def test_gzip(self):
try:
get_filter('gzip')
except ValueError:
# Not available on Python 3
raise SkipTest()
self.create_files({'in': 'a'*100})
self.mkbundle('in', filters='gzip', output='out.css').build()
# GZip contains a timestamp (which additionally Python only
# supports changing beginning with 2.7), so we can't compare
# the full string.
assert self.get('out.css')[:3] == '\x1f\x8b\x08'
assert len(self.get('out.css')) == 24

def test_cssmin(self):
try:
self.mkbundle('foo.css', filters='cssmin', output='out.css').build()
Expand Down

0 comments on commit d0fb241

Please sign in to comment.