Fix extension packaging with the new pipeline changes.
Review Request #8067 — Created March 21, 2016 and submitted
The new pipeline changes broke any extension-provided .less files that needed to include or reference anything from another module, along with any global variables provided by the app. There were also problems loading static media from installed packages. The arguments to lessc were still being set in the old setting, which Pipeline no longer respects, and it wasn't in a suitable format (it needed to be a list of strings, not a string). This fixes that setting, plus ensures that we don't have broken conflicts between what the app must now provide for normal use and what's needed for packaging. It does this by filtering out app-provided settings, replacing them with ours. It also disables the use of the special Djblets LessCompiler's import script for checking outdated dependencies. This isn't needed during packaging, and in fact fails due to static file storage access control checks. To fix the package static media, we now have specialized versions of the Pipeline CSS/JavaScript template nodes that change the rendering behavior to fall back on outputted (compiled) static media files if the sources are unavailable. This depends on a pending change in Pipeline (https://github.com/jazzband/django-pipeline/pull/552).
Tested against Power Pack, which wasn't working with the new Pipeline
changes due to referencing stylesheets in Review Board. I was able to
successfully compile them without problems.Tested loading Power Pack pages when installed via a package, and
tested when the package was in develop mode. Wiped myhtdocs/static/
tree each time, and verified that the page was loading the appropriate
files. Also verified that if I modified a file (source or output,
depending on which was being used), the changes were picked up when
next reloading the page.Existing unit tests pass.
- Change Summary:
-
Fixed a missing default variable declaration.
- Commit:
-
6f5166454a79373bc4fa5431ab81559bd19baae2152457155f944adecb06308b0e0405786b64adc6
-
Tool: Pyflakes Processed Files: djblets/extensions/templatetags/djblets_extensions.py djblets/extensions/packaging.py djblets/pipeline/compilers/less.py Tool: PEP8 Style Checker Processed Files: djblets/extensions/templatetags/djblets_extensions.py djblets/extensions/packaging.py djblets/pipeline/compilers/less.py
- Change Summary:
-
Packaging extensions now forces all
.less
files to be considered outdated. - Commit:
-
152457155f944adecb06308b0e0405786b64adc6678d1e6d058f4563109101955284b09a351a1270
-
Tool: Pyflakes Processed Files: djblets/extensions/templatetags/djblets_extensions.py djblets/extensions/packaging.py djblets/pipeline/compilers/less.py Tool: PEP8 Style Checker Processed Files: djblets/extensions/templatetags/djblets_extensions.py djblets/extensions/packaging.py djblets/pipeline/compilers/less.py
- Change Summary:
-
Renamed the internal setting to
_DJBLETS_LESS_ALWAYS_REBUILD
and put it inpipeline_settings
. - Commit:
-
678d1e6d058f4563109101955284b09a351a1270211a7d1e0d9d0dd5cbddc0e88b81cf31cb912f07
-
Tool: Pyflakes Processed Files: djblets/extensions/templatetags/djblets_extensions.py djblets/extensions/packaging.py djblets/pipeline/compilers/less.py Tool: PEP8 Style Checker Processed Files: djblets/extensions/templatetags/djblets_extensions.py djblets/extensions/packaging.py djblets/pipeline/compilers/less.py
-
- Change Summary:
-
Removed an unused import.
- Commit:
-
211a7d1e0d9d0dd5cbddc0e88b81cf31cb912f0752330b210cede83aba2a61812e9b1ecfddd3bb1e
-
Tool: PEP8 Style Checker Processed Files: djblets/extensions/templatetags/djblets_extensions.py djblets/extensions/packaging.py djblets/pipeline/compilers/less.py Tool: Pyflakes Processed Files: djblets/extensions/templatetags/djblets_extensions.py djblets/extensions/packaging.py djblets/pipeline/compilers/less.py