# Path: scss/compiler.py
# def compile_file(filename, compiler_class=Compiler, **kwargs):
#     """Compile a single file (provided as a :class:`pathlib.Path`), and return
#     a string of CSS.
# 
#     Keyword arguments are passed along to the underlying `Compiler`.
# 
#     Note that the search path is set to the file's containing directory by
#     default, unless you explicitly pass a ``search_path`` kwarg.
# 
#     :param filename: Path to the file to compile.
#     :type filename: str, bytes, or :class:`pathlib.Path`
#     """
#     filename = Path(filename)
#     if 'search_path' not in kwargs:
#         kwargs['search_path'] = [filename.parent.resolve()]
# 
#     compiler = compiler_class(**kwargs)
#     return compiler.compile(filename)
# 
# Path: scss/extension/core.py
# class CoreExtension(Extension):
#     name = 'core'
#     namespace = Namespace()
# 
#     def handle_import(self, name, compilation, rule):
#         """Implementation of the core Sass import mechanism, which just looks
#         for files on disk.
#         """
#         # TODO this is all not terribly well-specified by Sass.  at worst,
#         # it's unclear how far "upwards" we should be allowed to go.  but i'm
#         # also a little fuzzy on e.g. how relative imports work from within a
#         # file that's not actually in the search path.
#         # TODO i think with the new origin semantics, i've made it possible to
#         # import relative to the current file even if the current file isn't
#         # anywhere in the search path.  is that right?
#         path = PurePosixPath(name)
# 
#         search_exts = list(compilation.compiler.dynamic_extensions)
#         if path.suffix and path.suffix in search_exts:
#             basename = path.stem
#         else:
#             basename = path.name
#         relative_to = path.parent
#         search_path = []  # tuple of (origin, start_from)
#         if relative_to.is_absolute():
#             relative_to = PurePosixPath(*relative_to.parts[1:])
#         elif rule.source_file.origin:
#             # Search relative to the current file first, only if not doing an
#             # absolute import
#             search_path.append((
#                 rule.source_file.origin,
#                 rule.source_file.relpath.parent / relative_to,
#             ))
#         search_path.extend(
#             (origin, relative_to)
#             for origin in compilation.compiler.search_path
#         )
# 
#         for prefix, suffix in product(('_', ''), search_exts):
#             filename = prefix + basename + suffix
#             for origin, relative_to in search_path:
#                 relpath = relative_to / filename
#                 # Lexically (ignoring symlinks!) eliminate .. from the part
#                 # of the path that exists within Sass-space.  pathlib
#                 # deliberately doesn't do this, but os.path does.
#                 relpath = PurePosixPath(os.path.normpath(str(relpath)))
# 
#                 if rule.source_file.key == (origin, relpath):
#                     # Avoid self-import
#                     # TODO is this what ruby does?
#                     continue
# 
#                 path = origin / relpath
#                 if not path.exists():
#                     continue
# 
#                 # All good!
#                 # TODO if this file has already been imported, we'll do the
#                 # source preparation twice.  make it lazy.
#                 return SourceFile.read(origin, relpath)
# 
# Path: scss/extension/fonts.py
# class FontsExtension(Extension):
#     """Functions for creating and manipulating fonts."""
#     name = 'fonts'
#     namespace = Namespace()


import logging
import pytest
import scss
import scss.config
    import fontforge
from pathlib import Path
from scss.compiler import compile_file
from scss.errors import SassEvaluationError
from scss.errors import SassMissingDependency
from scss.extension.core import CoreExtension
from scss.extension.extra import ExtraExtension
from scss.extension.fonts import FontsExtension
from scss.extension.compass import CompassExtension

    def reportinfo(self):
        return (
            self.fspath.dirpath(),
            None,
            self.fspath.relto(self.session.fspath),
        )

    def _prunetraceback(self, excinfo):
        # Traceback implements __getitem__, but list implements __getslice__,
        # which wins in Python 2
        excinfo.traceback = excinfo.traceback.cut(__file__)

    def runtest(self):
        scss_file = Path(str(self.fspath))
        css_file = scss_file.with_suffix('.css')

        with css_file.open('rb') as fh:
            # Output is Unicode, so decode this here
            expected = fh.read().decode('utf8')

        scss.config.STATIC_ROOT = str(scss_file.parent / 'static')

        search_path = []
        include = scss_file.parent / 'include'
        if include.exists():
            search_path.append(include)
        search_path.append(scss_file.parent)

        try:

# Path: scss/compiler.py
# def compile_file(filename, compiler_class=Compiler, **kwargs):
#     """Compile a single file (provided as a :class:`pathlib.Path`), and return
#     a string of CSS.
# 
#     Keyword arguments are passed along to the underlying `Compiler`.
# 
#     Note that the search path is set to the file's containing directory by
#     default, unless you explicitly pass a ``search_path`` kwarg.
# 
#     :param filename: Path to the file to compile.
#     :type filename: str, bytes, or :class:`pathlib.Path`
#     """
#     filename = Path(filename)
#     if 'search_path' not in kwargs:
#         kwargs['search_path'] = [filename.parent.resolve()]
# 
#     compiler = compiler_class(**kwargs)
#     return compiler.compile(filename)
# 
# Path: scss/extension/core.py
# class CoreExtension(Extension):
#     name = 'core'
#     namespace = Namespace()
# 
#     def handle_import(self, name, compilation, rule):
#         """Implementation of the core Sass import mechanism, which just looks
#         for files on disk.
#         """
#         # TODO this is all not terribly well-specified by Sass.  at worst,
#         # it's unclear how far "upwards" we should be allowed to go.  but i'm
#         # also a little fuzzy on e.g. how relative imports work from within a
#         # file that's not actually in the search path.
#         # TODO i think with the new origin semantics, i've made it possible to
#         # import relative to the current file even if the current file isn't
#         # anywhere in the search path.  is that right?
#         path = PurePosixPath(name)
# 
#         search_exts = list(compilation.compiler.dynamic_extensions)
#         if path.suffix and path.suffix in search_exts:
#             basename = path.stem
#         else:
#             basename = path.name
#         relative_to = path.parent
#         search_path = []  # tuple of (origin, start_from)
#         if relative_to.is_absolute():
#             relative_to = PurePosixPath(*relative_to.parts[1:])
#         elif rule.source_file.origin:
#             # Search relative to the current file first, only if not doing an
#             # absolute import
#             search_path.append((
#                 rule.source_file.origin,
#                 rule.source_file.relpath.parent / relative_to,
#             ))
#         search_path.extend(
#             (origin, relative_to)
#             for origin in compilation.compiler.search_path
#         )
# 
#         for prefix, suffix in product(('_', ''), search_exts):
#             filename = prefix + basename + suffix
#             for origin, relative_to in search_path:
#                 relpath = relative_to / filename
#                 # Lexically (ignoring symlinks!) eliminate .. from the part
#                 # of the path that exists within Sass-space.  pathlib
#                 # deliberately doesn't do this, but os.path does.
#                 relpath = PurePosixPath(os.path.normpath(str(relpath)))
# 
#                 if rule.source_file.key == (origin, relpath):
#                     # Avoid self-import
#                     # TODO is this what ruby does?
#                     continue
# 
#                 path = origin / relpath
#                 if not path.exists():
#                     continue
# 
#                 # All good!
#                 # TODO if this file has already been imported, we'll do the
#                 # source preparation twice.  make it lazy.
#                 return SourceFile.read(origin, relpath)
# 
# Path: scss/extension/fonts.py
# class FontsExtension(Extension):
#     """Functions for creating and manipulating fonts."""
#     name = 'fonts'
#     namespace = Namespace()


# Path: conftest.py
import logging
import pytest
import scss
import scss.config
    import fontforge
from pathlib import Path
from scss.compiler import compile_file
from scss.errors import SassEvaluationError
from scss.errors import SassMissingDependency
from scss.extension.core import CoreExtension
from scss.extension.extra import ExtraExtension
from scss.extension.fonts import FontsExtension
from scss.extension.compass import CompassExtension


    def reportinfo(self):
        return (
            self.fspath.dirpath(),
            None,
            self.fspath.relto(self.session.fspath),
        )

    def _prunetraceback(self, excinfo):
        # Traceback implements __getitem__, but list implements __getslice__,
        # which wins in Python 2
        excinfo.traceback = excinfo.traceback.cut(__file__)

    def runtest(self):
        scss_file = Path(str(self.fspath))
        css_file = scss_file.with_suffix('.css')

        with css_file.open('rb') as fh:
            # Output is Unicode, so decode this here
            expected = fh.read().decode('utf8')

        scss.config.STATIC_ROOT = str(scss_file.parent / 'static')

        search_path = []
        include = scss_file.parent / 'include'
        if include.exists():
            search_path.append(include)
        search_path.append(scss_file.parent)

        try:

            actual = compile_file(