Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: switch from libsass-python to node-sass #31617

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"jwt-decode": "^2.2.0",
"moment": "2.20.1",
"moment-timezone": "0.5.14",
"node-sass": "4.14.1",
"picturefill": "3.0.2",
"popper.js": "1.12.9",
"prop-types": "15.6.0",
Expand Down
18 changes: 8 additions & 10 deletions pavelib/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,6 @@ def _compile_sass(system, theme, debug, force, timing_info):
:param timing_info: list variable to keep track of timing for sass compilation
"""

# Note: import sass only when it is needed and not at the top of the file.
# This allows other paver commands to operate even without libsass being
# installed. In particular, this allows the install_prereqs command to be
# used to install the dependency.
import sass
if system == "common":
sass_dirs = get_common_sass_directories()
else:
Expand Down Expand Up @@ -555,11 +550,14 @@ def _compile_sass(system, theme, debug, force, timing_info):
sass_dir=sass_source_dir,
))
else:
sass.compile(
dirname=(sass_source_dir, css_dir),
include_paths=COMMON_LOOKUP_PATHS + lookup_paths,
source_comments=source_comments,
output_style=output_style,
include_paths = COMMON_LOOKUP_PATHS + lookup_paths
sh(
"node-sass"
+ f" --output-style {output_style}"
+ (" --source-comments" if source_comments else "")
+ " ".join(f"--include-path {path}" for path in include_paths)
+ sass_source_dir # input dir
+ css_dir # output dir
)

# For Sass files without explicit RTL versions, generate
Expand Down
4 changes: 1 addition & 3 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,7 @@ learner-pathway-progress==1.3.3
levenshtein==0.20.9
# via python-levenshtein
libsass==0.10.0
# via
# -r requirements/edx/paver.txt
# ora2
# via ora2
loremipsum==1.0.5
# via ora2
lti-consumer-xblock==7.2.1
Expand Down
1 change: 0 additions & 1 deletion requirements/edx/paver.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

edx-opaque-keys # Create and introspect course and xblock identities
lazy # Lazily-evaluated attributes for Python objects
libsass==0.10.0 # Python bindings for the LibSass CSS compiler
markupsafe # XML/HTML/XHTML Markup safe strings
mock # Stub out code with mock objects and make assertions about how they have been used
path # Easier manipulation of filesystem paths
Expand Down
3 changes: 0 additions & 3 deletions requirements/edx/paver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ idna==3.4
# via requests
lazy==1.5
# via -r requirements/edx/paver.in
libsass==0.10.0
# via -r requirements/edx/paver.in
markupsafe==2.1.2
# via -r requirements/edx/paver.in
mock==5.0.1
Expand All @@ -41,7 +39,6 @@ requests==2.28.2
# via -r requirements/edx/paver.in
six==1.16.0
# via
# libsass
# paver
# python-memcached
stevedore==4.1.1
Expand Down
1 change: 0 additions & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ attrs==22.2.0
# jsonschema
# lti-consumer-xblock
# openedx-events
# outcome
# pytest
babel==2.11.0
# via
Expand Down