From 198d7a148ee4842de7659152f97dae9f3050168e Mon Sep 17 00:00:00 2001 From: Jehiah Czebotar Date: Tue, 21 Dec 2021 15:20:20 -0500 Subject: [PATCH 1/3] use https://github.com/tdewolff/minify/tree/master/cmd/minify instead of yui_compressor --- assetman/compilers.py | 8 +++++--- assetman/settings.py | 2 +- assetman/tests/test_compiler.py | 2 +- assetman/tests/test_settings | 2 +- assetman/tests/test_settings.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/assetman/compilers.py b/assetman/compilers.py index 222f977..d842e23 100644 --- a/assetman/compilers.py +++ b/assetman/compilers.py @@ -150,10 +150,12 @@ class CSSCompiler(AssetCompiler, assetman.managers.CSSManager): include_expr = 'include_css' def do_compile(self, **kwargs): - """Compiles CSS files using the YUI compressor. Since the compressor + """Compiles CSS files using the minify compressor. Since the compressor will only accept a single input file argument, we have to manually concat the CSS files in the batch and pipe them into the compressor. + https://github.com/tdewolff/minify/tree/master/cmd/minify + This also allows us to accept a css_input argument, so this function can be used by the compile_less function as well. """ @@ -164,8 +166,8 @@ def do_compile(self, **kwargs): if not kwargs.get("skip_inline_images"): css_input = self.inline_images(css_input) cmd = [ - self.required_setting_file("java_bin"), '-Xss64m', '-jar', self.required_setting_file("yui_compressor_path"), - '--type', 'css', '--line-break', '160', + self.required_setting_file("minify_compressor_path"), + '--type=css' ] return run_proc(cmd, stdin=css_input) diff --git a/assetman/settings.py b/assetman/settings.py index 4299bd6..23cd58c 100644 --- a/assetman/settings.py +++ b/assetman/settings.py @@ -31,7 +31,7 @@ } default_settings = { "closure_compiler":"/bin/closure-compiler.jar", - "yui_compressor_path": "/bin/yuicompressor.jar", + "minify_compressor_path": "/bin/minify", "sass_compiler": "/bin/sass", "lessc_path": "/bin/lessc", "java_bin": "java" diff --git a/assetman/tests/test_compiler.py b/assetman/tests/test_compiler.py index 2d61c3c..83a77dc 100644 --- a/assetman/tests/test_compiler.py +++ b/assetman/tests/test_compiler.py @@ -27,7 +27,7 @@ def get_settings(**opts): force_recompile=False, skip_inline_images=True, closure_compiler=opts.get('closure_compiler', '/bitly/local/bin/closure-compiler.jar'), - yui_compressor_path=opts.get('yui_compressor_path', '/bitly/local/bin/yuicompressor.jar'), + minify_compressor_path=opts.get('minify_compressor_path', '/bitly/local/bin/minify'), sass_compiler=opts.get('sass_compiler', '/bitly/local/bin/sass'), lessc_path=opts.get('lessc_path', '/bitly/local/bin/lessc'), aws_username=None, diff --git a/assetman/tests/test_settings b/assetman/tests/test_settings index bb1d12a..bfa7d0f 100644 --- a/assetman/tests/test_settings +++ b/assetman/tests/test_settings @@ -1 +1 @@ -{"testkey2": "testvalue2", "testkey1": "testvalue1", "yui_compressor_path": "/bin/yuicompressor.jar", "lessc_path": "/bin/lessc", "sass_compiler": "/bin/sass", "closure_compiler": "/bin/closure-compiler.jar"} \ No newline at end of file +{"testkey2": "testvalue2", "testkey1": "testvalue1", "minify_compressor_path": "/bin/minify", "lessc_path": "/bin/lessc", "sass_compiler": "/bin/sass", "closure_compiler": "/bin/closure-compiler.jar"} \ No newline at end of file diff --git a/assetman/tests/test_settings.py b/assetman/tests/test_settings.py index 7e6ff35..0c8fe32 100644 --- a/assetman/tests/test_settings.py +++ b/assetman/tests/test_settings.py @@ -12,7 +12,7 @@ def test_settings_can_load_from_file(self): 'testkey2': "testvalue2", "lessc_path" : "asdf", "sass_compiler": "asdf", - "yui_compressor_path": "asdf", + "minify_compressor_path": "asdf", "closure_compiler": "asdf" } From 62d98dacd4e9803cd56e9563cc08f87a20cd183c Mon Sep 17 00:00:00 2001 From: Jehiah Czebotar Date: Tue, 21 Dec 2021 15:22:24 -0500 Subject: [PATCH 2/3] v0.1.22b --- assetman/__init__.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assetman/__init__.py b/assetman/__init__.py index 9994c39..01b288d 100644 --- a/assetman/__init__.py +++ b/assetman/__init__.py @@ -1,5 +1,5 @@ from assetman.manifest import Manifest # also update in setup.py -__version__ = "0.1.21" -version_info = (0, 1, 21) +__version__ = "0.1.21b" +version_info = (0, 1, 22) diff --git a/setup.py b/setup.py index acde016..87ed143 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='assetman', - version='0.1.21', # also update in __init__.py + version='0.1.22b', # also update in __init__.py description='AssetMan asset manager', url="http://github.com/bitly/assetman", license="Apache Software License", From 91ea7e6130ce6f2e99bf0be93f9ad58bce6ae1f0 Mon Sep 17 00:00:00 2001 From: Jehiah Czebotar Date: Tue, 25 Jan 2022 12:00:39 -0500 Subject: [PATCH 3/3] v0.2.0 bump minor version --- assetman/__init__.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assetman/__init__.py b/assetman/__init__.py index 01b288d..03f5dd5 100644 --- a/assetman/__init__.py +++ b/assetman/__init__.py @@ -1,5 +1,5 @@ from assetman.manifest import Manifest # also update in setup.py -__version__ = "0.1.21b" -version_info = (0, 1, 22) +__version__ = "0.2.0" +version_info = (0, 2, 0) diff --git a/setup.py b/setup.py index 87ed143..8c6d345 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='assetman', - version='0.1.22b', # also update in __init__.py + version='0.2.0', # also update in __init__.py description='AssetMan asset manager', url="http://github.com/bitly/assetman", license="Apache Software License",