Upgrades part 1
authorRadek Czajka <radekczajka@wolnelektury.pl>
Mon, 9 Nov 2026 00:11:58 +0000 (01:11 +0100)
committerRadek Czajka <radekczajka@wolnelektury.pl>
Mon, 9 Nov 2026 00:11:58 +0000 (01:11 +0100)
Dockerfile
requirements/requirements.txt
src/sponsors/models.py
src/wolnelektury/settings/basic.py
src/wolnelektury/settings/test.py

index 7d4c875..08ec723 100644 (file)
@@ -12,7 +12,7 @@
 # Global build arguments. Stages using UID/GID must redeclare them
 # (bare `ARG UID`) to bring them into scope; the defaults are set here.
 
-ARG PYTHON_IMAGE=python:3.9-trixie
+ARG PYTHON_IMAGE=python:3.10-trixie
 ARG UID=8100
 ARG GID=8100
 
@@ -43,8 +43,10 @@ RUN     apt-get update && apt-get install -y \
 
 COPY requirements/requirements.txt requirements.txt
 
-RUN pip install --no-cache-dir -r requirements.txt
-RUN pip install --no-cache-dir \
+RUN --mount=type=cache,target=/root/.cache/pip \
+    pip install -r requirements.txt
+RUN --mount=type=cache,target=/root/.cache/pip \
+    pip install \
     psycopg2-binary \
     django-debug-toolbar==3.2.2
 
@@ -73,7 +75,8 @@ FROM deps AS app
 
 USER root
 
-RUN pip install --no-cache-dir gunicorn
+RUN --mount=type=cache,target=/root/.cache/pip \
+    pip install gunicorn
 
 USER app
 
@@ -156,7 +159,8 @@ FROM app AS test
 
 USER root
 COPY requirements/requirements-test.txt /tmp/
-RUN pip install --no-cache-dir -r /tmp/requirements-test.txt
+RUN --mount=type=cache,target=/root/.cache/pip \
+    pip install -r /tmp/requirements-test.txt
 USER app
 RUN mkdir -p /app/var/counters
 COPY --from=static-builder /app/var/static/staticfiles.json /app/var/static/staticfiles.json
index 853c411..0ec9083 100644 (file)
@@ -3,17 +3,17 @@
 # django
 Django==4.0.8
 fnpdjango==0.6
-docutils==0.20
+docutils==0.23
 
-python-memcached==1.59
+pymemcache==4.0.0
 
 django-pipeline==3.1.0
-libsasscompiler==0.2.0
+libsasscompiler==0.2.1
 jsmin==3.0.1
 
-fnp-django-pagination==2.2.5
+fnp-django-pagination==2.2.12
 django-modeltranslation==0.18.12
-django-allauth==0.51
+django-allauth==0.54
 django-extensions==3.2.3
 djangorestframework==3.15.1
 django-filter==23.5
@@ -21,10 +21,9 @@ djangorestframework-xml==2.0.0
 django-admin-ordering==0.18
 django-countries==7.6.1
 
--e git+https://github.com/rczajka/django-forms-builder@6533f9442f004d44ed362202b6bdab82b73dd5e9#egg=django-forms-builder
+django-forms-builder @ git+https://github.com/rczajka/django-forms-builder@6533f9442f004d44ed362202b6bdab82b73dd5e9
 
-
-oauthlib>=3.0.1,<3.1
+oauthlib==4.0.1
 
 # contact
 pyyaml==6.0.3
@@ -33,35 +32,32 @@ polib==1.2
 
 django-honeypot==1.2.1
 
-python-fb==0.2
-
-Feedparser==6.0.11
+Feedparser==6.0.14
 
-Pillow==9.5.0
-mutagen==1.47
+Pillow==12.3.0
+mutagen==1.48.1
 sorl-thumbnail==12.10.0
 
-zipstream-ng==1.9.2
+zipstream-ng==1.9.3
 
 # home-brewed & dependencies
-librarian==26.5.1
+
+librarian==26.11
 
 # celery tasks
-celery[redis]==5.4.0
+celery[redis]==5.6.2
 
-# OAI-PMH
-#pyoai==2.5.1
--e git+https://github.com/infrae/pyoai@5ff2f15e869869e70d8139e4c37b7832854d7049#egg=pyoai
+oaipmh==3.2.1
 
-sentry-sdk==2.19.2
+sentry-sdk==2.74.0
 
-requests==2.32.3
+requests==2.34.2
 
 paypalrestsdk
 
-python-slugify==8.0.4
+python-slugify==9.1.3
 
-firebase-admin==6.6.0
+firebase-admin==7.7.0
 Wikidata==0.9.0
 
 ipython
index 80412fc..552fb07 100644 (file)
@@ -76,7 +76,7 @@ class SponsorPage(models.Model):
                     min(THUMB_HEIGHT,
                         round(simg.size[1] * THUMB_WIDTH / simg.size[0]))
                 )
-                simg = simg.resize(size, Image.ANTIALIAS)
+                simg = simg.resize(size, Image.Resampling.LANCZOS)
             sprite.paste(simg, (
                     round((THUMB_WIDTH - simg.size[0]) / 2),
                     round(i * THUMB_HEIGHT + (THUMB_HEIGHT - simg.size[1]) / 2),
index 50e0edd..fe048e4 100644 (file)
@@ -38,18 +38,30 @@ CACHE_MIDDLEWARE_SECONDS = 3 * 60
 
 CACHES = {
     'default': {
-        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+        'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
         'TIMEOUT': 180,
         'LOCATION': [
             'memcached:11211',
         ],
+        'OPTIONS': {
+            "no_delay": True,
+            "ignore_exc": True,       # treat memcached errors as cache misses
+            "max_pool_size": 4,
+            "use_pooling": True,
+        },
     },
     'template_fragments': {
-        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+        'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
         'TIMEOUT': 86400,
         'LOCATION': [
             'memcached:11211',
         ],
+        'OPTIONS': {
+            "no_delay": True,
+            "ignore_exc": True,       # treat memcached errors as cache misses
+            "max_pool_size": 4,
+            "use_pooling": True,
+        },
     },
 }
 
index 42a453e..21a1ba5 100644 (file)
@@ -7,13 +7,6 @@ THUMBNAIL_BACKEND = 'wolnelektury.test_utils.DummyThumbnailBackend'
 CATALOGUE_GET_MP3_LENGTH = 'catalogue.test_utils.get_mp3_length'
 MEDIA_URL = '/media/'
 
-SEARCH_CONFIG = 'english'
-SEARCH_CONFIG_SIMPLE = 'simple'
-SEARCH_USE_UNACCENT = False
-
-# Infrastructure: tests don't need Redis or Memcached.
-CELERY_BROKER_URL = 'memory://'
-CELERY_TASK_ALWAYS_EAGER = True
 CACHES = {
     'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'},
     'template_fragments': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'},