mintchaos / django_compressor
- Source
- Commits
- Network (12)
- Issues (5)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
-
need package_data so templates are installed from tarball via easy_install or pip
1 comment Created 23 days ago by carljmsetup.py is missing the package_data argument. fixed here: http://github.com/carljm/django_compressor/commit/22909c9186b631f1ebe6338a615f3f6ce6ef8f41
Comments
-
Tests for YUI fail. Below is my diff of the project and the errors.
DIFFS
(env)root@broadwaydev:/home/django/broadway.com/env/src/django-compressor/tests# ./manage.py test Creating test database...
..........E.E.....E
ERROR: test_js_output (core.tests.CompressorTestCase)
Traceback (most recent call la(env)root@broadwaydev:/home/django/broadway.com/env/src/django-compressor/tests# ./manage.py test
Creating test database...
..........E.E.....E
ERROR: test_js_output (core.tests.CompressorTestCase)
Traceback (most recent call last):
File "/home/django/broadway.com/env/src/django-compressor/tests/core/tests.py", line 86, in test_js_outputself.assertEqual(out, self.jsNode.combined)File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 103, in combined
output = self.filter(output, 'output')File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 91, in filter
content = filter(**kwargs)File "/home/django/broadway.com/env/src/django-compressor/compressor/filters/yui.py", line 39, in output
raise FilterError(err)FilterError: Unable to apply YUI Compressor filter
======================================================================
ERROR: test_js_return_if_on (core.tests.CompressorTestCase)
Traceback (most recent call last):
File "/home/django/broadway.com/env/src/django-compressor/tests/core/tests.py", line 94, in test_js_return_if_onself.assertEqual(output, self.jsNode.output())File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 132, in output
url = "%s/%s" % (settings.MEDIA_URL.rstrip('/'), self.new_filepath)File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 113, in new_filepath
filename = "".join([self.hash, self.extension])File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 109, in hash
return get_hexdigest(self.combined)[:12]File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 103, in combined
output = self.filter(output, 'output')File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 91, in filter
content = filter(**kwargs)File "/home/django/broadway.com/env/src/django-compressor/compressor/filters/yui.py", line 39, in output
raise FilterError(err)FilterError: Unable to apply YUI Compressor filter
======================================================================
ERROR: test_js_tag (core.tests.TemplatetagTestCase)
Traceback (most recent call last):
File "/home/django/broadway.com/env/src/django-compressor/tests/core/tests.py", line 169, in test_js_tagself.assertEqual(out, self.render(template, context))File "/home/django/broadway.com/env/src/django-compressor/tests/core/tests.py", line 148, in render
return t.render(c).strip()File "/home/django/broadway.com/env/src/django/django/test/utils.py", line 29, in instrumented_test_render
return self.nodelist.render(context)File "/home/django/broadway.com/env/src/django/django/template/init.py", line 779, in render
bits.append(self.render_node(node, context))File "/home/django/broadway.com/env/src/django/django/template/init.py", line 792, in render_node
return node.render(context)File "/home/django/broadway.com/env/src/django-compressor/compressor/templatetags/compress.py", line 26, in render
output = compressor.output()File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 132, in output
url = "%s/%s" % (settings.MEDIA_URL.rstrip('/'), self.new_filepath)File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 113, in new_filepath
filename = "".join([self.hash, self.extension])File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 109, in hash
return get_hexdigest(self.combined)[:12]File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 103, in combined
output = self.filter(output, 'output')File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 91, in filter
content = filter(**kwargs)File "/home/django/broadway.com/env/src/django-compressor/compressor/filters/yui.py", line 39, in output
raise FilterError(err)FilterError: Unable to apply YUI Compressor filter
Ran 19 tests in 0.852s
FAILED (errors=3)
Destroying test database...
st):
File "/home/django/broadway.com/env/src/django-compressor/tests/core/tests.py", line 86, in test_js_outputself.assertEqual(out, self.jsNode.combined)File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 103, in combined
output = self.filter(output, 'output')File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 91, in filter
content = filter(**kwargs)File "/home/django/broadway.com/env/src/django-compressor/compressor/filters/yui.py", line 39, in output
raise FilterError(err)FilterError: Unable to apply YUI Compressor filter
======================================================================
ERROR: test_js_return_if_on (core.tests.CompressorTestCase)
Traceback (most recent call last):
File "/home/django/broadway.com/env/src/django-compressor/tests/core/tests.py", line 94, in test_js_return_if_onself.assertEqual(output, self.jsNode.output())File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 132, in output
url = "%s/%s" % (settings.MEDIA_URL.rstrip('/'), self.new_filepath)File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 113, in new_filepath
filename = "".join([self.hash, self.extension])File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 109, in hash
return get_hexdigest(self.combined)[:12]File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 103, in combined
output = self.filter(output, 'output')File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 91, in filter
content = filter(**kwargs)File "/home/django/broadway.com/env/src/django-compressor/compressor/filters/yui.py", line 39, in output
raise FilterError(err)FilterError: Unable to apply YUI Compressor filter
======================================================================
ERROR: test_js_tag (core.tests.TemplatetagTestCase)
Traceback (most recent call last):
File "/home/django/broadway.com/env/src/django-compressor/tests/core/tests.py", line 169, in test_js_tagself.assertEqual(out, self.render(template, context))File "/home/django/broadway.com/env/src/django-compressor/tests/core/tests.py", line 148, in render
return t.render(c).strip()File "/home/django/broadway.com/env/src/django/django/test/utils.py", line 29, in instrumented_test_render
return self.nodelist.render(context)File "/home/django/broadway.com/env/src/django/django/template/init.py", line 779, in render
bits.append(self.render_node(node, context))File "/home/django/broadway.com/env/src/django/django/template/init.py", line 792, in render_node
return node.render(context)File "/home/django/broadway.com/env/src/django-compressor/compressor/templatetags/compress.py", line 26, in render
output = compressor.output()File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 132, in output
url = "%s/%s" % (settings.MEDIA_URL.rstrip('/'), self.new_filepath)File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 113, in new_filepath
filename = "".join([self.hash, self.extension])File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 109, in hash
return get_hexdigest(self.combined)[:12]File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 103, in combined
output = self.filter(output, 'output')File "/home/django/broadway.com/env/src/django-compressor/compressor/init.py", line 91, in filter
content = filter(**kwargs)File "/home/django/broadway.com/env/src/django-compressor/compressor/filters/yui.py", line 39, in output
raise FilterError(err)FilterError: Unable to apply YUI Compressor filter
Ran 19 tests in 0.852s
FAILED (errors=3)
Destroying test database...DIFF
(env)root@broadwaydev:/home/django/broadway.com/env/src/django-compressor# git diff diff --git a/compressor/filters/yui.py b/compressor/filters/yui.py
index 948a50b..2df28ce 100644
--- a/compressor/filters/yui.py +++ b/compressor/filters/yui.py @@ -17,7 +17,7 @@ class YUICompressorFilter(FilterBase):if self.type == 'css': arguments = CSS_ARGUMENTScommand = '%s --type=%s %s' % (BINARY, type_, arguments)
@@ -41,4 +41,4 @@ class YUICompressorFilter(FilterBase):command = '%s --type=%s %s' % (BINARY, self.type, arguments) if self.verbose: command += ' --verbose'if self.verbose: print err
\ No newline at end of filereturn filtered
diff --git a/tests/settings.py b/tests/settings.pyreturn filtered
index 10a9c4b..9b55988 100644
--- a/tests/settings.py +++ b/tests/settings.py @@ -22,4 +22,6 @@ TEMPLATE_LOADERS = (
TEMPLATE_DIRS = (
join(TEST_DIR, 'templates'),-) \ No newline at end of file +) +COMPRESS_YUI_BINARY = '/usr/bin/java -jar /usr/share/yui/yuicompressor-2.4.2.jar' +COMPRESS_JS_FILTERS = ['compressor.filters.yui.YUICompressorFilter']
Comments
Is this still a problem? /me is finally tending to my projects. :(
justinlilly
Sun Nov 08 08:02:10 -0800 2009
| link
I don't think so. I'm pretty sure I fixed it in my branch and sent you a pull request (which you accepted already)
-
python setup.py install doesn't build correctly
The following directories /conf/ & /templates/... are not transferred to /site-packages/compressor/The fix to setup.py
line 3
from distutils.sysconfig import get_python_libline 22
'compressor.conf',line 27,29
data_files=[ ("%s/compressor/templates/compressor" % get_python_lib(), ['compressor/templates/compressor/css.html', 'compressor/templates/compressor/js.html']), ],Regards Shane
Comments





I had three pull requests of this same thing. I grabbed benspaulding's It's fixed in my master as of c5adc4276c. Thanks for your work!