Repository: svthalia/concrexit

Issue:
Replace compressor
[django-compressor](https://django-compressor.readthedocs.io/) has proven to be a pain lately, with #3121, problems getting static files on S3, as well as requiring libsass to be installed on production (it should only be needed as a build-time dependency and during development). 

It would be nice to replace it with something else, that needs to do:
- At least compiling sass/scss. Preferebly, this should be done transparently during development.
- Minifying CSS/JS would be really nice. But that doesn't need to be done automatically in development.







Discussion:

Resolving patch:
diff --git a/website/thaliawebsite/settings.py b/website/thaliawebsite/settings.py
--- a/website/thaliawebsite/settings.py
+++ b/website/thaliawebsite/settings.py
@@ -218,9 +218,6 @@ def from_env(
 # https://docs.djangoproject.com/en/dev/ref/settings/#internal-ips
 INTERNAL_IPS = setting(development=["127.0.0.1", "172.17.0.1"], production=[])
 
-# https://django-compressor.readthedocs.io/en/stable/settings/#django.conf.settings.COMPRESS_OFFLINE
-COMPRESS_OFFLINE = setting(development=False, production=False)
-
 # https://docs.djangoproject.com/en/dev/ref/settings/#static-url
 STATIC_URL = "/static/"
 # https://docs.djangoproject.com/en/dev/ref/settings/#static-root
@@ -465,8 +462,8 @@ def from_env(
     "tinymce",
     "rest_framework",
     "rest_framework.authtoken",
-    "compressor",
     "debug_toolbar",
+    "sass_processor",
     "admin_auto_filters",
     "django_drf_filepond",
     "django_filepond_widget",
@@ -758,10 +755,13 @@ def from_env(
 STATICFILES_FINDERS = (
     "django.contrib.staticfiles.finders.FileSystemFinder",
     "django.contrib.staticfiles.finders.AppDirectoriesFinder",
-    # other finders
-    "compressor.finders.CompressorFinder",
+    "sass_processor.finders.CssFinder",
 )
 
+# Allow importing .scss files that don't start with an underscore.
+# See https://github.com/jrief/django-sass-processor
+SASS_PROCESSOR_INCLUDE_FILE_PATTERN = r"^.+\.scss$"
+
 NORMAL_STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
 MANIFEST_STATICFILES_STORAGE = (
     "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
@@ -771,17 +771,6 @@ def from_env(
     production=MANIFEST_STATICFILES_STORAGE,
 )
 
-# Compressor settings
-COMPRESS_ENABLED = True
-COMPRESS_PRECOMPILERS = (("text/x-scss", "django_libsass.SassCompiler"),)
-COMPRESS_FILTERS = {
-    "css": [
-        "compressor.filters.css_default.CssAbsoluteFilter",
-        "compressor.filters.cssmin.rCSSMinFilter",
-    ],
-    "js": ["compressor.filters.jsmin.JSMinFilter"],
-}
-
 # See utils/model/signals.py for explanation
 SUSPEND_SIGNALS = False
 


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -79,7 +79,7 @@ jobs:
             ${{ runner.os }}-poetry-
 
       - name: Install any new dependencies
-        run: poetry install --extras "postgres"
+        run: poetry install --with postgres
         if: steps.cache.outputs.cache-hit != 'true'
 
       - name: Run tests
@@ -132,7 +132,7 @@ jobs:
             ${{ runner.os }}-poetry-
 
       - name: Install any new dependencies
-        run: poetry install --extras "postgres"
+        run: poetry install --with postgres
         if: steps.cache.outputs.cache-hit != 'true'
 
       - name: Run create fixtures