This fixes the ability to pass custom theme directories to
the management command which compiles site themes, a la:
./manage.py lms compile_sass --theme-dirs /my/custom/themes/dir
The exception, which was due to a incompatible use of @lru_cache, was:
File "openedx/core/djangoapps/theming/management/commands/compile_sass.py",
line 93, in parse_arguments:
available_themes.update({t.theme_dir_name: t for t in get_themes([theme_dir])})
TypeError: unhashable type: 'list'
This has been broken since the @lru_cache decorator was added, but it
wasn't noticed because:
* We weren't compiling any comprehensive themes in CI.
* Tutor supports compehensive theming, but not *site theming*, so
it doesn't use this management command at all
(site themeing == comp theming * site configuration).
* Although edx.org executes this management command, it does not provide
use the `--theme-dirs` argument, so the bug was not hit.
These changes should improve the performance caused by the file I/O
when it's running in docker, using lru_cache to save thousands of calls to listdir
when running with a handful of themes defined in COMPREHENSIVE_THEME_DIRS.
all dirs must now go into COMPREHENSIVE_THEME_DIRS.
Move comprehensive theming setup section out of startup.py and into
settings files using new 'derived' functionality.
Add 'derive_settings' at the end of all top-level Django settings files.
Move validation of comprehensive theming settings into new apps.py
theming file.
Split theming code into code safe to run before settings are initialized
-and- after settings are initialized.
2. Add site configuration overrides to theming/helpers.py
3. Move microsite.get_value from theming/helpers to site_configuration/helpers
4. Move microsite_configuration.microsite.get_value usages to site_configuration.helpers.values
2. Update COMPREHNSIVE_THEME_DIR to COMPREHENSIVE_THEME_DIRS
3. Update paver commands to support multi theme dirs
4. Updating template loaders
5. Add ENABLE_COMPREHENSIVE_THEMING flag to enable or disable theming via settings
6. Update tests
7. Add backward compatibility for COMPREHEHNSIVE_THEME_DIR
* mattdrayer: Add helpers.get_value test
* mattdrayer: Change to simpler implementation, per @douglashall
* mattdrayer: Address quality violations and test failures