From 886c611c893d7d931113394b42405b41867f1bd4 Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Jul 21 2016 06:07:07 +0000 Subject: enabled more tests for filters which are now usable in Rawhide --- diff --git a/0001-fix-compass-tests-for-Sass-3.4.patch b/0001-fix-compass-tests-for-Sass-3.4.patch new file mode 100644 index 0000000..bea7ad4 --- /dev/null +++ b/0001-fix-compass-tests-for-Sass-3.4.patch @@ -0,0 +1,28 @@ +From 8d49d87e183e03a03ed9c2d7fd8ee3f3d982ddf3 Mon Sep 17 00:00:00 2001 +From: Dan Callaghan +Date: Thu, 21 Jul 2016 15:05:58 +1000 +Subject: [PATCH 1/2] fix compass tests for Sass 3.4 + +--- + tests/test_filters.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/test_filters.py b/tests/test_filters.py +index 07b03bc..8ce25f7 100644 +--- a/tests/test_filters.py ++++ b/tests/test_filters.py +@@ -1118,7 +1118,10 @@ def setup(self): + + def test_compass(self): + self.mkbundle('foo.sass', filters='compass', output='out.css').build() +- assert doctest_match("""/* ... */\nh1 {\n font-family: "Verdana";\n color: white;\n}\n""", self.get('out.css')) ++ assert (# Sass <= 3.3 ++ doctest_match("""/* ... */\nh1 {\n font-family: "Verdana";\n color: white;\n}\n""", self.get('out.css')) or ++ # Sass 3.4+ ++ doctest_match("""/* ... */\nh1 {\n font-family: "Verdana";\n color: #FFFFFF;\n}\n""", self.get('out.css'))) + + def test_compass_with_imports(self): + self.mkbundle('import.scss', filters='compass', output='out.css').build() +-- +2.9.0 + diff --git a/0002-fix-pyscss-tests.patch b/0002-fix-pyscss-tests.patch new file mode 100644 index 0000000..2521f10 --- /dev/null +++ b/0002-fix-pyscss-tests.patch @@ -0,0 +1,50 @@ +From 41549198b68d9471ec8282e7faf86a508738947f Mon Sep 17 00:00:00 2001 +From: Dan Callaghan +Date: Thu, 21 Jul 2016 16:04:56 +1000 +Subject: [PATCH 2/2] fix pyscss tests + +--- + tests/test_filters.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/tests/test_filters.py b/tests/test_filters.py +index 07b03bc..d34319d 100644 +--- a/tests/test_filters.py ++++ b/tests/test_filters.py +@@ -10,6 +10,7 @@ + from mock import patch, Mock, DEFAULT + from distutils.spawn import find_executable + import re ++from io import BytesIO + from webassets.utils import StringIO + from webassets import Environment + from webassets.exceptions import FilterError +@@ -1022,7 +1023,7 @@ def setup(self): + + def test(self): + self.mkbundle('foo.scss', filters='pyscss', output='out.css').build() +- assert self.get('out.css') == 'h1 {\n color: #ff0000;\n}\na {\n color: #ff8000;\n}\n' ++ assert self.get('out.css') == 'h1 {\n color: red; }\na {\n color: #ff8000; }\n' + + def test_assets(self): + try: +@@ -1030,14 +1031,14 @@ def test_assets(self): + # Travis does not support PNG files, see + # https://github.com/travis-ci/travis-ci/issues/746 + from PIL import Image +- Image.new('RGB', (10,10)).save(StringIO(), 'png') ++ Image.new('RGB', (10,10)).save(BytesIO(), 'png') + except (ImportError, IOError): + raise SkipTest() + self.create_files({'noise.scss': 'h1 {background: background-noise()}'}) + self.mkbundle('noise.scss', filters='pyscss', output='out.css').build() + + assert doctest_match( +- 'h1 {\n background: url("...png");\n}\n', ++ 'h1 {\n background: url("...png"); }\n', + self.get('out.css'),) + + +-- +2.9.0 + diff --git a/python-webassets.spec b/python-webassets.spec index b0185b9..075c0c2 100644 --- a/python-webassets.spec +++ b/python-webassets.spec @@ -13,6 +13,9 @@ Group: Development/Libraries License: BSD URL: http://github.com/miracle2k/%{mod_name} Source0: https://pypi.python.org/packages/source/w/%{mod_name}/%{mod_name}-%{version}.tar.gz +# XXX to be filed +Patch1: 0001-fix-compass-tests-for-Sass-3.4.patch +Patch2: 0002-fix-pyscss-tests.patch BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools @@ -21,15 +24,13 @@ Requires: python-setuptools BuildRequires: python-nose BuildRequires: pytest BuildRequires: python-mock +BuildRequires: python-pillow # v8 is just for jsmin.py BuildRequires: v8 -# skipping pyscss tests for now since 1.2+ is intentionally not supported -#BuildRequires: python-scss %if !0%{?epel} +BuildRequires: python-scss BuildRequires: /usr/bin/sass -# skipping compass tests for now since compass is currently broken: -# https://bugzilla.redhat.com/show_bug.cgi?id=1152676 -#BuildRequires: /usr/bin/compass +BuildRequires: /usr/bin/compass BuildRequires: python-cssutils BuildRequires: python-slimit %endif @@ -46,10 +47,11 @@ Requires: python3-setuptools BuildRequires: python3-nose BuildRequires: python3-pytest BuildRequires: python3-mock -# these are not ported to Python 3 yet -#BuildRequires: python3-slimit -#BuildRequires: python3-cssutils -#BuildRequires: python3-scss +BuildRequires: python3-pillow +BuildRequires: python3-slimit +BuildRequires: python3-cssutils +BuildRequires: python3-scss +# this is not ported to Python 3 yet #BuildRequires: python3-cssmin %endif @@ -79,6 +81,8 @@ sed -i "s|\r||g" docs/builtin_filters.rst sed -i "s|\r||g" docs/Makefile sed -i "s|\r||g" docs/make.bat sed -i "s|\r||g" docs/faq.rst +%patch1 -p1 +%patch2 -p1 %if 0%{?with_python3} rm -rf %{py3dir} @@ -135,6 +139,7 @@ popd * Thu Jul 21 2016 Dan Callaghan - 0.11.1-1 - new upstream release 0.11.1: https://github.com/miracle2k/webassets/blob/0.11.1/CHANGES +- enabled more tests for filters which are now usable in Rawhide * Tue Jul 19 2016 Fedora Release Engineering - 0.10.1-6 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages