[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\nPlease see https://github.com/torchbox/django-libsass#reporting-bugs before reporting. Any bug reports relating to a third-party CSS framework are liable to be closed without further investigation.\n"
  },
  {
    "path": ".github/workflows/test.yml",
    "content": "name: Unit tests\n\non:\n  push:\n    branches: [ main ]\n  pull_request:\n    branches: [ main ]\n\njobs:\n  build:\n    name: Python ${{ matrix.python-version }}, django ${{ matrix.django-version }}\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:  # https://docs.djangoproject.com/en/5.0/faq/install/#faq-python-version-support\n        django-version: [\"42\", \"50\", \"51\"]\n        python-version: [\"3.9\", \"3.10\", \"3.11\", \"3.12\", \"3.13\"]\n\n        exclude:\n          - django-version: \"42\"\n            python-version: \"3.13\"\n          - django-version: \"50\"\n            python-version: \"3.9\"\n          - django-version: \"50\"\n            python-version: \"3.13\"\n          - django-version: \"51\"\n            python-version: \"3.9\"\n\n    steps:\n      - uses: actions/checkout@v4\n      - name: setup python\n        uses: actions/setup-python@v5\n        with:\n          python-version: ${{ matrix.python-version }}\n      - name: Install tox\n        run: pip install tox\n      - name: Run Tests\n        env:\n          TOXENV: django${{ matrix.django-version }}\n        run: tox\n"
  },
  {
    "path": ".gitignore",
    "content": "*.pyc\nbuild/\ndist/\ndjango_libsass.egg-info\nMANIFEST\n"
  },
  {
    "path": "CHANGELOG.txt",
    "content": "Changelog\n=========\n\nUnreleased\n~~~~~~~~~~~~~~~~\n\n* Added Django 4.1 & 4.2 support\n* Added Python 3.10 & 3.11 support\n* Drop support for Python 2.7, 3.4, 3.5, 3.6 & 3.7 (EOL)\n* Drop support for Django 1.8, 1.9, 1.10, 1.11, 2.2, 3.0 & 3.1 (EOL)\n\n0.9 (08.07.2021)\n~~~~~~~~~~~~~~~~\n * Added Django 3.1 and 3.2 support (Awais Qureshi)\n * Added tox and enable Github actions for testing across different Django and Python versions (Awais Qureshi)\n\n0.8 (06.01.2020)\n~~~~~~~~~~~~~~~~\n * Added Django 3.0 support (Tobias Kunze, Dan Kingston)\n * Included LICENSE file in distribution (Dougal J. Sutherland)\n * Added LIBSASS_ADDITIONAL_INCLUDE_PATHS setting (Iwan Trofimtschuk)\n * Removed unnecessary quoting from output of `static` function\n\n0.7 (02.05.2016)\n~~~~~~~~~~~~~~~~\n * Added LIBSASS_PRECISION setting (Liang-Bo Wang)\n\n0.6 (21.11.2015)\n~~~~~~~~~~~~~~~~\n * Fixed call to FilterBase super for django-compressor 1.6 compatibility (Dennis Vermeulen)\n\n0.5 (18.11.2015)\n~~~~~~~~~~~~~~~~\n * Added sourcemap support (Saulius Žemaitaitis)\n * Updated the `static` function to use the more versatile django.contrib.staticfiles implementation (Carl Johnson)\n\n0.4 (24.08.2015)\n~~~~~~~~~~~~~~~~\n * Added support for custom functions (Alexandre Pocquet)\n * Added a `static` function to generate paths to assets such as images and fonts (Alexandre Pocquet)\n\n0.3 (27.04.2015)\n~~~~~~~~~~~~~~~~\n * Enabled source comments when DEBUG is True; can be overridden with the LIBSASS_SOURCE_COMMENTS setting\n * Added LIBSASS_OUTPUT_STYLE setting\n\n0.2 (22.05.2014)\n~~~~~~~~~~~~~~~~\n * Made compatible with django-compressor 1.4 and Python 3.\n\n0.1 (05.03.2014)\n~~~~~~~~~~~~~~~~\n * Initial release.\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2014 Torchbox Ltd and individual contributors.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    1. Redistributions of source code must retain the above copyright notice,\n       this list of conditions and the following disclaimer.\n\n    2. Redistributions in binary form must reproduce the above copyright\n       notice, this list of conditions and the following disclaimer in the\n       documentation and/or other materials provided with the distribution.\n\n    3. Neither the name of Torchbox nor the names of its contributors may be used\n       to endorse or promote products derived from this software without\n       specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "MANIFEST.in",
    "content": "include LICENSE\n"
  },
  {
    "path": "README.rst",
    "content": "django-libsass\n==============\n\nA django-compressor filter to compile Sass files using libsass.\n\nInstallation\n~~~~~~~~~~~~\n\nStarting from a Django project with `django-compressor <https://github.com/django-compressor/django-compressor/>`_ set up::\n\n pip install django-libsass\n\nand add django_libsass.SassCompiler to your COMPRESS_PRECOMPILERS setting::\n\n COMPRESS_PRECOMPILERS = (\n     ('text/x-scss', 'django_libsass.SassCompiler'),\n )\n\nYou can now use the content type text/x-scss on your stylesheets, and have them\ncompiled seamlessly into CSS::\n\n {% load compress %}\n\n {% compress css %}\n     <link rel=\"stylesheet\" type=\"text/x-scss\" href=\"{% static \"myapp/css/main.scss\" %}\" />\n {% endcompress %}\n\n\nImports\n~~~~~~~\n\nRelative paths in @import lines are followed as you would expect::\n\n @import \"../variables.scss\";\n\nAdditionally, Django's STATICFILES_FINDERS setting is consulted, and all possible locations\nfor static files *on the local filesystem* are included on the search path. This makes it\npossible to import files across different apps::\n\n @import \"myotherapp/css/widget.scss\"\n\n\nSettings\n~~~~~~~~\n\nThe following settings can be used to control django-libsass's behaviour:\n\n* ``LIBSASS_SOURCE_COMMENTS`` - whether to enable SASS source comments (adds comments about source lines). Defaults to ``True`` when Django's ``DEBUG`` is ``True``, ``False`` otherwise.\n* ``LIBSASS_OUTPUT_STYLE`` - SASS output style. Options are ``'nested'``, ``'expanded'``, ``'compact'`` and ``'compressed'``, although as of libsass 3.0.2 only ``'nested'`` and ``'compressed'`` are implemented. Default is 'nested'. See `SASS documentation for output styles <http://sass-lang.com/documentation/file.SASS_REFERENCE.html#output_style>`_. Note that `django-compressor's settings <http://django-compressor.readthedocs.org/en/latest/settings/>`_ may also affect the formatting of the resulting CSS.\n* ``LIBSASS_CUSTOM_FUNCTIONS`` - A mapping of custom functions to be made available within the SASS compiler. By default, a ``static`` function is provided, analogous to Django's ``static`` template tag.\n* ``LIBSASS_SOURCEMAPS`` - Enable embedding sourcemaps into file output (default: False)\n* ``LIBSASS_PRECISION`` - Number of digits of numerical precision (default: 5)\n* ``LIBSASS_ADDITIONAL_INCLUDE_PATHS`` - a list of base paths to be recognised in @import lines, in addition to Django's recognised static file locations\n\n\nCustom functions\n~~~~~~~~~~~~~~~~\n\nThe SASS compiler can be extended with custom Python functions defined in the ``LIBSASS_CUSTOM_FUNCTIONS`` setting. By default, a ``static`` function is provided, for generating static paths to resources such as images and fonts::\n\n    .foo {\n        background: url(static(\"myapp/image/bar.png\"));\n    }\n\nIf your ``STATIC_URL`` is '/static/', this will be rendered as::\n\n    .foo {\n        background: url(\"/static/myapp/image/bar.png\"));\n    }\n\nWhy django-libsass?\n~~~~~~~~~~~~~~~~~~~\n\nWe wanted to use Sass in a Django project without introducing any external (non pip-installable)\ndependencies. (Actually, we wanted to use Less, but the same arguments apply...) There are a few\npure Python implementations of Sass and Less, but we found that they invariably didn't match the\nbehaviour of the reference compilers, either in their handling of @imports or lesser-used CSS\nfeatures such as media queries.\n\n`libsass <https://sass-lang.com/libsass>`_ is a mature C/C++ port of the Sass engine, co-developed by the\noriginal creator of Sass, and we can reasonably rely on it to stay in sync with the reference\nSass compiler - and, being C/C++, it's fast. Thanks to Hong Minhee's\n`libsass-python <https://github.com/dahlia/libsass-python>`_ project, it has Python bindings and\ninstalls straight from pip.\n\ndjango-libsass builds on libsass-python to make @import paths aware of Django's staticfiles\nmechanism, and provides a filter module for django-compressor which uses the libsass-python API\ndirectly, avoiding the overheads of calling an external executable to do the compilation.\n\n\nReporting bugs\n~~~~~~~~~~~~~~\n\nPlease see the `troubleshooting <https://github.com/torchbox/django-libsass/wiki/Troubleshooting>`_ page for help with some common setup issues.\n\nI do not provide support for getting django-libsass working with your CSS framework of choice. If you believe you've found a bug, please try to isolate it as a minimal reproducible test case before reporting it - ideally this will consist of a few edits / additions to the `hello-django-libsass <https://github.com/gasman/hello-django-libsass>`_ example project. If you cannot demonstrate the problem in a few standalone SCSS files, it is almost certainly not a django-libsass bug - any bug reports that relate to a third-party CSS framework are likely to be closed without further investigation.\n\n\nAuthor\n~~~~~~\n\nMatt Westcott matthew.westcott@torchbox.com\n"
  },
  {
    "path": "django_libsass.py",
    "content": "import base64\nimport json\nimport os\nimport re\n\nimport sass\nfrom compressor.filters.base import FilterBase\nfrom django.conf import settings\nfrom django.contrib.staticfiles.finders import get_finders\nfrom django.templatetags.static import static as django_static\n\n\ndef static(path):\n    \"\"\"\n    Use the Django builtin static file resolver to return an absolute path\n    usable as CSS url() argument. Sass equivalent of the 'static' template\n    tag.\n    \"\"\"\n    return django_static(path)\n\n\nOUTPUT_STYLE = getattr(settings, 'LIBSASS_OUTPUT_STYLE', 'nested')\nSOURCE_COMMENTS = getattr(settings, 'LIBSASS_SOURCE_COMMENTS', settings.DEBUG)\nCUSTOM_FUNCTIONS = getattr(settings, 'LIBSASS_CUSTOM_FUNCTIONS', {'static': static})\nSOURCEMAPS = getattr(settings, 'LIBSASS_SOURCEMAPS', False)\nPRECISION = getattr(settings, 'LIBSASS_PRECISION', None)  # None use libsass default\nADDITIONAL_INCLUDE_PATHS = getattr(settings, 'LIBSASS_ADDITIONAL_INCLUDE_PATHS', None)\n\n\nINCLUDE_PATHS = None  # populate this on first call to 'get_include_paths'\n\n\ndef get_include_paths():\n    \"\"\"\n    Generate a list of include paths that libsass should use to find files\n    mentioned in @import lines.\n    \"\"\"\n    global INCLUDE_PATHS\n    if INCLUDE_PATHS is not None:\n        return INCLUDE_PATHS\n\n    include_paths = []\n\n    # Look for staticfile finders that define 'storages'\n    for finder in get_finders():\n        try:\n            storages = finder.storages\n        except AttributeError:\n            continue\n\n        for storage in storages.values():\n            try:\n                include_paths.append(storage.path('.'))\n            except NotImplementedError:\n                # storages that do not implement 'path' do not store files locally,\n                # and thus cannot provide an include path\n                pass\n\n    global ADDITIONAL_INCLUDE_PATHS\n    if ADDITIONAL_INCLUDE_PATHS:\n        include_paths.extend(ADDITIONAL_INCLUDE_PATHS)\n\n    INCLUDE_PATHS = include_paths\n    return include_paths\n\n\ndef prefix_sourcemap(sourcemap, base_path):\n    decoded_sourcemap = json.loads(sourcemap)\n    source_urls = []\n    include_paths = get_include_paths()\n\n    for source_filename in decoded_sourcemap['sources']:\n        # expand source_filename into an absolute file path\n        full_source_path = os.path.normpath(os.path.join(base_path, source_filename))\n\n        # look for a path in include_paths that is a prefix of full_source_path\n        for path in include_paths:\n            if full_source_path.startswith(path):\n                # A matching path has been found; take the remainder as a relative path.\n                # include_paths entries do not include a trailing slash;\n                # [len(path) + 1:] ensures that we trim the path plus trailing slash\n                remainder = full_source_path[len(path) + 1:]\n\n                # Invoke the 'static' template tag to turn the relative path into a URL\n                source_urls.append(django_static(remainder))\n                break\n        else:\n            # no matching path was found in include_paths; return the original source filename\n            # as a fallback\n            source_urls.append(source_filename)\n\n    decoded_sourcemap['sources'] = source_urls\n    return json.dumps(decoded_sourcemap)\n\n\ndef embed_sourcemap(output, sourcemap):\n    encoded_sourcemap = base64.standard_b64encode(\n        sourcemap.encode('utf-8')\n    )\n    sourcemap_fragment = 'sourceMappingURL=data:application/json;base64,{} '\\\n        .format(encoded_sourcemap.decode('utf-8'))\n    url_re = re.compile(r'sourceMappingURL=[^\\s]+', re.M)\n    output = url_re.sub(sourcemap_fragment, output)\n\n    return output\n\n\ndef compile(**kwargs):\n    \"\"\"Perform sass.compile, but with the appropriate include_paths for Django added\"\"\"\n    kwargs = kwargs.copy()\n    if PRECISION is not None:\n        kwargs['precision'] = PRECISION\n    kwargs['include_paths'] = (kwargs.get('include_paths') or []) + get_include_paths()\n\n    custom_functions = CUSTOM_FUNCTIONS.copy()\n    custom_functions.update(kwargs.get('custom_functions', {}))\n    kwargs['custom_functions'] = custom_functions\n\n    if SOURCEMAPS and kwargs.get('filename', None):\n        # We need to pass source_map_file to libsass so it generates\n        # correct paths to source files.\n        base_path = os.path.dirname(kwargs['filename'])\n        sourcemap_filename = os.path.join(base_path, 'sourcemap.map')\n        kwargs['source_map_filename'] = sourcemap_filename\n\n        libsass_output, sourcemap = sass.compile(**kwargs)\n        sourcemap = prefix_sourcemap(sourcemap, base_path)\n        output = embed_sourcemap(libsass_output, sourcemap)\n    else:\n        output = sass.compile(**kwargs)\n    return output\n\n\nclass SassCompiler(FilterBase):\n    def __init__(self, content, attrs=None, filter_type=None, charset=None, filename=None):\n        # FilterBase doesn't handle being passed attrs, so fiddle the signature\n        super(SassCompiler, self).__init__(content=content,\n                                           filter_type=filter_type,\n                                           filename=filename)\n\n    def input(self, **kwargs):\n        if self.filename:\n            return compile(filename=self.filename,\n                           output_style=OUTPUT_STYLE,\n                           source_comments=SOURCE_COMMENTS)\n        else:\n            return compile(string=self.content,\n                           output_style=OUTPUT_STYLE)\n"
  },
  {
    "path": "runtests.py",
    "content": "#!/usr/bin/env python\n\nimport argparse\nimport os\nimport shutil\nimport sys\nimport warnings\n\nfrom django.core.management import execute_from_command_line\n\nos.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'\n\n\ndef make_parser():\n    parser = argparse.ArgumentParser()\n    parser.add_argument('--deprecation', choices=['pending', 'imminent', 'none'], default='imminent')\n    return parser\n\n\ndef parse_args(args=None):\n    return make_parser().parse_known_args(args)\n\n\ndef runtests():\n    args, rest = parse_args()\n\n    if args.deprecation == 'pending':\n        # Show all deprecation warnings\n        warnings.simplefilter('default', DeprecationWarning)\n        warnings.simplefilter('default', PendingDeprecationWarning)\n    elif args.deprecation == 'imminent':\n        # Show only imminent deprecation warnings\n        warnings.simplefilter('default', DeprecationWarning)\n    elif args.deprecation == 'none':\n        # Deprecation warnings are ignored by default\n        pass\n\n    argv = [sys.argv[0], 'test'] + rest\n\n    try:\n        execute_from_command_line(argv)\n    finally:\n        from tests.settings import STATIC_ROOT\n        shutil.rmtree(STATIC_ROOT, ignore_errors=True)\n\n\nif __name__ == '__main__':\n    runtests()\n"
  },
  {
    "path": "setup.cfg",
    "content": "[metadata]\nlicense-file = LICENSE\n"
  },
  {
    "path": "setup.py",
    "content": "#!/usr/bin/env python\n\ntry:\n    from setuptools import setup\nexcept ImportError:\n    from distutils.core import setup\n\nsetup(\n    name='django-libsass',\n    version='0.9',\n    description=\"A django-compressor filter to compile SASS files using libsass\",\n    author='Matt Westcott',\n    author_email='matthew.westcott@torchbox.com',\n    url='https://github.com/torchbox/django-libsass',\n    py_modules=['django_libsass'],\n    license='BSD',\n    long_description=open('README.rst').read(),\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Environment :: Web Environment',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.9',\n        'Programming Language :: Python :: 3.10',\n        'Programming Language :: Python :: 3.11',\n        'Programming Language :: Python :: 3.12',\n        'Programming Language :: Python :: 3.13',\n        'Framework :: Django',\n        'Framework :: Django :: 4.2',\n        'Framework :: Django :: 5.0',\n        'Framework :: Django :: 5.1',\n    ],\n    python_requires='>=3.9',\n    install_requires=[\n        \"django-compressor>=1.3\",\n        \"libsass>=0.7.0,<1\",\n    ],\n)\n"
  },
  {
    "path": "tests/__init__.py",
    "content": ""
  },
  {
    "path": "tests/extra_static/extra.scss",
    "content": ".extra-style {\n    color: blue;\n}\n"
  },
  {
    "path": "tests/settings.py",
    "content": "\"\"\"\nDjango settings for django_libsass tests.\n\nGenerated by 'django-admin startproject' using Django 2.0.13.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/2.0/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/2.0/ref/settings/\n\"\"\"\n\nimport os\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = 'snbicjfchnkjnyhcojinbcojnghjn=*uv2e$gr5-7w2^j2y9y!'\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nALLOWED_HOSTS = []\n\n\n# Application definition\n\nINSTALLED_APPS = [\n    'tests',\n\n    'compressor',\n\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n]\n\nMIDDLEWARE = [\n    'django.middleware.security.SecurityMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n]\n\nROOT_URLCONF = 'tests.urls'\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n            ],\n        },\n    },\n]\n\n# Database\n# https://docs.djangoproject.com/en/2.0/ref/settings/#databases\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),\n    }\n}\n\n\n# Password validation\n# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',\n    },\n]\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/2.0/topics/i18n/\n\nLANGUAGE_CODE = 'en-us'\n\nTIME_ZONE = 'UTC'\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/2.0/howto/static-files/\n\nSTATIC_URL = '/static/'\nSTATIC_ROOT = os.path.join(BASE_DIR, 'test-static')\n\n# List of finder classes that know how to find static files in\n# various locations.\nSTATICFILES_FINDERS = (\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n#    'django.contrib.staticfiles.finders.DefaultStorageFinder',\n    'compressor.finders.CompressorFinder',\n)\n\nCOMPRESS_PRECOMPILERS = (\n    ('text/x-scss', 'django_libsass.SassCompiler'),\n)\n\nLIBSASS_ADDITIONAL_INCLUDE_PATHS = [\n    os.path.join(BASE_DIR, 'tests', 'extra_static'),\n]\nLIBSASS_SOURCEMAPS = True\n"
  },
  {
    "path": "tests/static/css/imported.scss",
    "content": ".imported-style {\n    color: red;\n}\n"
  },
  {
    "path": "tests/static/css/index.scss",
    "content": "$background-color: #ddffdd;\n$foreground-color: #008800;\n\nbody {\n    background-color: $background-color;\n\n    h1 {\n        color: $foreground-color;\n    }\n}\n"
  },
  {
    "path": "tests/static/css/raw1.css",
    "content": ".raw-style-1 {\n    color: yellow;\n}\n"
  },
  {
    "path": "tests/static/css/raw2.css",
    "content": ".raw-style-2 {\n    color: green;\n}\n"
  },
  {
    "path": "tests/static/css/with_extra_include.scss",
    "content": "@import 'extra';\n"
  },
  {
    "path": "tests/static/css/with_import.scss",
    "content": "@import 'imported';\n"
  },
  {
    "path": "tests/static/css/with_raw_css_import.scss",
    "content": "@import 'raw1.css';\n@import 'raw2';\n"
  },
  {
    "path": "tests/static/css/with_static.scss",
    "content": "body {\n    background-image: url(static('images/my image.jpg'));\n}\n"
  },
  {
    "path": "tests/templates/index.html",
    "content": "{% load compress static %}\n<!DOCTYPE HTML>\n<html>\n    <head>\n        <title>Hello django-libsass</title>\n        {% compress css %}\n            <link rel=\"stylesheet\" type=\"text/x-scss\" href=\"{% static \"css/index.scss\" %}\" />\n        {% endcompress %}\n    </head>\n    <body>\n        <h1>It worked!</h1>\n    </body>\n</html>\n"
  },
  {
    "path": "tests/tests/__init__.py",
    "content": ""
  },
  {
    "path": "tests/tests/test_sass.py",
    "content": "import os.path\nfrom django.conf import settings\nfrom django.test import TestCase\n\nfrom django_libsass import compile\n\nclass TestSass(TestCase):\n    def test_invocation(self):\n        response = self.client.get('/')\n        self.assertEqual(response.status_code, 200)\n\n    def test_import(self):\n        result = compile(filename=os.path.join(settings.BASE_DIR, 'tests', 'static', 'css', 'with_import.scss'))\n        self.assertIn('.imported-style', result)\n\n    def test_extra_include_path(self):\n        result = compile(filename=os.path.join(settings.BASE_DIR, 'tests', 'static', 'css', 'with_extra_include.scss'))\n        self.assertIn('.extra-style', result)\n\n    def test_raw_css_import(self):\n        result = compile(filename=os.path.join(settings.BASE_DIR, 'tests', 'static', 'css', 'with_raw_css_import.scss'))\n        self.assertIn('@import url(raw1.css);', result)\n        self.assertIn('.raw-style-2', result)\n\n    def test_static_function(self):\n        result = compile(filename=os.path.join(settings.BASE_DIR, 'tests', 'static', 'css', 'with_static.scss'))\n        self.assertIn(r'background-image: url(/static/images/my%20image.jpg);', result)\n"
  },
  {
    "path": "tests/urls.py",
    "content": "from __future__ import absolute_import, unicode_literals\n\n\"\"\"hello_django_libsass URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    https://docs.djangoproject.com/en/2.0/topics/http/urls/\nExamples:\nFunction views\n    1. Add an import:  from my_app import views\n    2. Add a URL to urlpatterns:  path('', views.home, name='home')\nClass-based views\n    1. Add an import:  from other_app.views import Home\n    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')\nIncluding another URLconf\n    1. Import the include() function: from django.urls import include, path\n    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))\n\"\"\"\n\nfrom django.urls import path\n\nfrom tests.views import index\n\n\nurlpatterns = [\n    path('', index),\n]\n"
  },
  {
    "path": "tests/views.py",
    "content": "from django.shortcuts import render\n\n\ndef index(request):\n    return render(request, 'index.html')\n"
  },
  {
    "path": "tox.ini",
    "content": "[tox]\nenvlist = django{42,50,51}\n\n[testenv]\ncommands =\n    python runtests.py\ndeps =\n    django42: Django>=4.2,<5.0\n    django50: Django>=5.0,<5.1\n    django51: Django>=5.1,<5.2\n"
  }
]