pythoncsssasssetup.pylibsass

Cannot set output_style for libsass using python to compile SASS on each deploy


Here is a documentation on how to compile SASS to CSS via python including the possibility to set output_style='compressed': https://sass.github.io/libsass-python/

import sass
sass.compile(dirname=('sass', 'css'), output_style='compressed')

Here is how to do it on each deploymant which is exactly what I need: https://sass.github.io/libsass-python/frameworks/flask.html#building-sass-scss-for-each-deployment

# setyp.py

setup(
    # ...,
    setup_requires=['libsass >= 0.6.0'],
    sass_manifests={
        'myapp': ('static/sass', 'static/css', '/static/css')
    }
)

However, I need to set the output_style while compiling SASS on each deploy the way how it is described on the second page and I cannot figure out how to do it. Is there any way to do it at all?


Solution

  • Found a solution

    change the setup.cfg as follows:

    [aliases]
    sdist = build_sass --output-style compressed sdist
    bdist = build_sass --output-style compressed bdist
    

    insted of

    [aliases]
    sdist = build_sass sdist
    bdist = build_sass bdist