Repository: ocf/ocfweb

Issue:
libsass>0.10.0 breaks dh-virtuaenv
https://jenkins.ocf.berkeley.edu/view/ocfweb-deploy/job/ocfweb-build-deb/232/console

```
# build sass, output static files
debian/ocfweb/usr/share/python/ocfweb/bin/python setup.py build_sass
running build_sass
building 'ocfweb' sass
/opt/jenkins/slave/workspace/ocfweb-build-deb/src/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/setuptools/dist.py:294: UserWarning: The version specified ('2016.01.30.23.27-git7cd5ebbd') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
Traceback (most recent call last):
  File "setup.py", line 44, in <module>
    'ocfweb-run-periodic-functions = ocfweb.bin.run_periodic_functions:main',
  File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/opt/jenkins/slave/workspace/ocfweb-build-deb/src/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sassutils/distutils.py", line 123, in run
    output_style=self.output_style
  File "/opt/jenkins/slave/workspace/ocfweb-build-deb/src/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sassutils/builder.py", line 177, in build
    ).values()
  File "/opt/jenkins/slave/workspace/ocfweb-build-deb/src/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sassutils/builder.py", line 73, in build_directory
    _root_css=_root_css)
  File "/opt/jenkins/slave/workspace/ocfweb-build-deb/src/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sassutils/builder.py", line 63, in build_directory
    include_paths=[_root_sass])
  File "/opt/jenkins/slave/workspace/ocfweb-build-deb/src/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sass.py", line 644, in compile
    raise CompileError(v)
sass.CompileError: b'Error: ".page-staff-hours .hour .ocf-staffhours-faces" failed to @extend ".list-inline".\n       The selector ".list-inline" was not found.\n       Use "@extend .list-inline !optional" if the extend should be able to fail.\n        on line 37 of ocfweb/static/scss/pages/staff-hours.scss\n>>             @extend .list-inline;\n   ------------^\n'
debian/rules:17: recipe for target 'override_dh_virtualenv' failed
```

reproduces locally, but only with `make builddeb` and not the regular `make scss`



Discussion:
downgrading to libsass==0.10.0 is a workaround for now

applied workaround in #129, build is fixed

If you try this with a built virtualenv inside the Debian package, you get:

```
jenkins-slave@reaper:/opt/jenkins/slave/workspace/ckuehl/ocfweb$ debian/ocfweb/usr/share/python/ocfweb/bin/python setup.py build_sass
/opt/jenkins/slave/workspace/ckuehl/ocfweb/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/setuptools/dist.py:294: UserWarning: The version specified ('2016.01.31.00.35-git1902c189') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
running build_sass
building 'ocfweb' sass
{'filename': 'ocfweb/static/scss/site.scss',
 'include_paths': ['ocfweb/static/scss'],
 'output_style': 'nested'}
{'filename': 'ocfweb/static/scss/pages/staff-hours.scss',
 'include_paths': ['ocfweb/static/scss'],
 'output_style': 'nested'}
Traceback (most recent call last):
  File "setup.py", line 44, in <module>
    'ocfweb-run-periodic-functions = ocfweb.bin.run_periodic_functions:main',
  File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/opt/jenkins/slave/workspace/ckuehl/ocfweb/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sassutils/distutils.py", line 123, in run
    output_style=self.output_style
  File "/opt/jenkins/slave/workspace/ckuehl/ocfweb/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sassutils/builder.py", line 181, in build
    ).values()
  File "/opt/jenkins/slave/workspace/ckuehl/ocfweb/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sassutils/builder.py", line 77, in build_directory
    _root_css=_root_css)
  File "/opt/jenkins/slave/workspace/ckuehl/ocfweb/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sassutils/builder.py", line 67, in build_directory
    include_paths=[_root_sass])
  File "/opt/jenkins/slave/workspace/ckuehl/ocfweb/debian/ocfweb/usr/share/python/ocfweb/lib/python3.4/site-packages/sass.py", line 644, in compile
    raise CompileError(v)
sass.CompileError: b'Error: ".page-staff-hours .hour .ocf-staffhours-faces" failed to @extend ".list-inline".\n       The selector ".list-inline" was not found.\n       Use "@extend .list-inline !optional" if the extend should be able to fail.\n        on line 37 of ocfweb/static/scss/pages/staff-hours.scss\n>>             @extend .list-inline;\n   ------------^\n'
```

...but trying the same thing using our dev virtualenv Python, it works fine:

```
jenkins-slave@reaper:/opt/jenkins/slave/workspace/ckuehl/ocfweb$ virtualenv_run/bin/python setup.py build_sass
/opt/jenkins/slave/workspace/ckuehl/ocfweb/virtualenv_run/lib/python3.4/site-packages/setuptools/dist.py:294: UserWarning: The version specified ('2016.01.31.00.35-git1902c189') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
running build_sass
building 'ocfweb' sass
```

I don't see any real changes between libsass-python 0.10.1 and 0.10.0 except the upstream libsass changes.

I also tested removing the bootstrap symlink and just copying the files into the same place, but that did not fix it.

Confirmed this still happens on the latest libsass version (0.11.1)


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@
         'django-redis',
         'django>=1.10,<1.10.999',
         'gunicorn',
-        'libsass<=0.10.0',  # https://github.com/ocf/ocfweb/issues/128
+        'libsass',
         'matplotlib',
         'mistune',
         'numpy',
@@ -34,9 +34,6 @@
         'pymysql',
         'python-dateutil',
     ],
-    sass_manifests={
-        'ocfweb': ('static/scss',),  # XXX: must be tuple
-    },
     entry_points={
         'console_scripts': [
             'ocfweb-run-periodic-functions = ocfweb.bin.run_periodic_functions:main',


Test patch: