From 8d33aa0e821ffccdd12c976dda2af4bd10266076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 31 Dec 2020 14:48:38 +0100 Subject: [PATCH] build: generate sourcemap for CSS files (#49794) --- MANIFEST.in | 2 +- setup.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 5facc5578..71675dd95 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,6 +7,6 @@ recursive-include data/web/ *.html *.css *.png recursive-include data/themes/default/ *.html *.css *.png *.gif *.jpg *.js *.ezt *.xml recursive-include data/themes/alto/ *.html *.css *.png *.gif *.jpg *.js *.ezt *.xml recursive-include data/vendor/ *.dat -recursive-include wcs/qommon/static/ *.css *.scss *.png *.gif *.jpg *.js *.eot *.svg *.ttf *.woff +recursive-include wcs/qommon/static/ *.css *.scss *.png *.gif *.jpg *.js *.eot *.svg *.ttf *.woff *.map recursive-include wcs/templates *.html *.txt recursive-include wcs/qommon/templates *.html *.txt diff --git a/setup.py b/setup.py index be6594c12..ac783c685 100644 --- a/setup.py +++ b/setup.py @@ -53,13 +53,9 @@ class compile_scss(Command): pass def run(self): - sass_bin = None - for program in ('sassc', 'sass'): - sass_bin = find_executable(program) - if sass_bin: - break + sass_bin = find_executable('sassc') if not sass_bin: - raise CompileError('A sass compiler is required but none was found. See sass-lang.com for choices.') + raise CompileError('sassc is required but was not found.') for path, dirnames, filenames in os.walk('wcs'): for filename in filenames: @@ -67,7 +63,10 @@ class compile_scss(Command): continue if filename.startswith('_'): continue - subprocess.check_call([sass_bin, '%s/%s' % (path, filename), + subprocess.check_call([ + sass_bin, + '--sourcemap', + '%s/%s' % (path, filename), '%s/%s' % (path, filename.replace('.scss', '.css'))]) @@ -97,7 +96,8 @@ class eo_sdist(sdist): def data_tree(destdir, sourcedir): extensions = ['.css', '.png', '.jpeg', '.jpg', '.gif', '.xml', '.html', - '.js', '.ezt', '.dat', '.eot', '.svg', '.ttf', '.woff'] + '.js', '.ezt', '.dat', '.eot', '.svg', '.ttf', '.woff', '.scss', + '.map'] r = [] for root, dirs, files in os.walk(sourcedir): l = [os.path.join(root, x) for x in files if os.path.splitext(x)[1] in extensions]