Help with compiling SASS to CSS in a Python package

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am the reviewer for “python-furo - A clean customizable documentation theme for Sphinx” (https://bugzilla.redhat.com/show_bug.cgi?id=1910798). The Python part of the package is clean and simple, and the submitter is responsive, competent, and helpful. I’d really like to be able to approve the package. However, the review is hung up on the web assets it includes.

Upstream uses gulp to compile/bundle and minify the JavaScript, and compile SASS to CSS, in order to produce the PyPI source tarball. Based on https://docs.fedoraproject.org/en-US/packaging-guidelines/JavaScript/#_compilationminification, https://docs.fedoraproject.org/en-US/packaging-guidelines/Web_Assets/#_css, and https://docs.fedoraproject.org/en-US/packaging-guidelines/what-can-be-packaged/#_pregenerated_code, it will be necessary to use the GitHub source tarball instead and do all of the additional work in the RPM build.

For the Python part, in which the GitHub tarball is a PEP 517/518 format source tree without a “legacy” setup.py, python3-flit can do the job of building a wheel, and %py3_install_wheel can install it. No problem.

For the JavaScript part, bundling and minification can’t use uglify-js because ES6 “const” is used, and it can’t use esbuild (golang-github-evanw-esbuild) as intended because upstream does not use ES6 modules and imports. However, “bundling” by simple concatenation with cat, optionally followed by minification with esbuild, should work fine. It would break source maps, but at least the original sources would still be included in the RPM.

The problem is the SASS. Upstream uses gulp-sass with the JavaScript-transpiled version of dart-sass, which seems to be the only SASS compiler that is not deprecated today. Trying to compile with rubygem-sass or either frontend to libsass (sassc/rubygem-sassc) gives an error like:

sassc -a src/furo/assets/styles/furo.sass 
Error: Invalid CSS after "...ow-y: scroll; }": expected 1 selector or at-rule, was "not(html):not(body)"
        on line 20:24 of src/furo/assets/styles/_scaffold.sass
        from line 5:1 of src/furo/assets/styles/furo.sass
>>   overflow-y: scroll; }

   -----------------------^

with various other errors following if the offending section is commented out. I don’t know SASS too well, but it doesn’t look too practical to patch our way out of this.

This is a call for help, then. Does anyone see a way forward for this package?

More details are in the review request Bugzilla issue, linked at the beginning of this email.

Thanks,
Ben Beasley
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux