sassutils.distutilssetuptools/distutils integration

This module provides extensions (and some magical monkey-patches, sorry) of the standard distutils and setuptools (now it’s named Distribute) for libsass.

To use this, add libsass into setup_requires (not install_requires) option of the script:

from setuptools import setup

    # ...,
    setup_requires=['libsass >= 0.6.0']

It will adds build_sass command to the script:

$ python build_sass

This commands builds SASS/SCSS files to compiled CSS files of the project and makes the package archive (made by sdist, bdist, and so on) to include these compiled CSS files.

To set the directory of SASS/SCSS source files and the directory to store compiled CSS files, specify sass_manifests option:

from setuptools import find_packages, setup

        'your.webapp': ('static/sass', 'static/css')
    setup_requires=['libsass >= 0.6.0']

The option should be a mapping of package names to pairs of paths, e.g.:

    'package': ('static/sass', 'static/css'),
    '': ('static/scss', 'static')

New in version 0.6.0: Added --output-style/-s option to build_sass command.

class sassutils.distutils.build_sass(dist, **kw)

Builds SASS/SCSS files to CSS files.


Returns the directory, relative to the top of the source distribution, where package package should be found (at least according to the package_dir option, if any).

Copied from distutils.command.build_py.get_package_dir() method.

sassutils.distutils.validate_manifests(dist, attr, value)

Verifies that value is an expected mapping of package to sassutils.builder.Manifest.