• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemocracyClub / aggregator-api / 26192a4c-09ee-45f2-9fd7-d44d0520c829

04 Sep 2024 12:54PM UTC coverage: 76.041%. Remained the same
26192a4c-09ee-45f2-9fd7-d44d0520c829

push

circleci

chris48s
ensure setuptools is in frontend layer

1187 of 1561 relevant lines covered (76.04%)

0.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/frontend/s3_lambda_storage.py
1
from django.conf import settings
×
2
from django.contrib.staticfiles.storage import (
×
3
    ManifestStaticFilesStorage,
4
    staticfiles_storage,
5
)
6
from pipeline.compilers.sass import SASSCompiler
×
7
from pipeline.storage import PipelineMixin
×
8

9

10
class StaticStorage(PipelineMixin, ManifestStaticFilesStorage):
×
11
    pass
×
12

13

14
class LambdaSASSCompiler(SASSCompiler):
×
15
    """
16
    Use libsass's python API for converting scss files to css.
17

18
    The normal SASSCompiler opens a subprocess to call scss, but this confuses
19
    lambda as the script isn't on the PATH.
20

21
    """
22

23
    def compile_file(self, infile, outfile, outdated=False, force=False):
×
24
        if not outdated:
×
25
            with open(outfile) as f:
×
26
                return f.read()
×
27
        import sass
×
28

29
        out_value = sass.compile(
×
30
            filename=infile,
31
            output_style="compressed",
32
            include_paths=settings.SASS_INCLUDE_PATHS,
33
        )
34
        if isinstance(out_value, bytes):
×
35
            out_value = out_value.decode("utf8")
×
36

37
        with staticfiles_storage.open(outfile, "w") as out:
×
38
            out.write(out_value)
×
39
        return out_value
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc