miracle2k / webassets

Asset management for Python web development.
BSD 2-Clause "Simplified" License
924 stars 259 forks source link

--line-comments is deprecated #522

Closed 1oglop1 closed 4 years ago

1oglop1 commented 5 years ago

I started to use webassests and I kept getting an exception with the message

webassets.exceptions.FilterError: sass: subprocess returned a non-success result code: 64, stdout=b'Could not find an option named "line-comments".

Implemented somewhere around here: https://github.com/miracle2k/webassets/blob/master/src/webassets/filter/sass.py#L95

This option seems to be part of ruby-sass which was deprecated in March 2019. according to: https://sass-lang.com/ruby-sass

Steps to reproduce the exception:

OS: MacOS 1) Install sass: brew install sass/sass/sass 2) prepare any style.scss 3) run the code:

from webassets import Environment, Bundle

my_env = Environment(
    directory='style',
    url='/media'
)

css = Bundle(
    'style.scss',
    filters='sass',
    output='gen/style.css'
)

my_env.register('css_all', css)
print(my_env['css_all'].urls())

I also tried to install sass with npm and the option was still missing.

There seems to be a python implementation of sass, would it be an option to implement this instead of relaying on sass directly? https://github.com/sass/libsass-python