Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update All The Things October 2024 #477

Merged
merged 16 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.11'
python-version: '3.12'
- uses: actions/setup-node@v3
Comment on lines 19 to 22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be an excellent opportunity to upgrade the versions of the actions we use ;)

with:
node-version-file: '.nvmrc'
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
ALLOWED_HOSTS: localhost
services:
postgres:
image: postgres:13
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgress
Expand All @@ -70,13 +70,13 @@ jobs:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry==1.8.3 # Make sure this matches POETRY_VERSION in the Dockerfile
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
cache: 'poetry'
- name: Install Python dependencies
run: poetry install
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
default_language_version:
node: 20.15.0
python: python3.11
python: python3.12
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.10.0
hooks:
- id: black
language_version: python3
args: ['--target-version', 'py311']
- repo: https://github.com/pycqa/isort
# isort config is in setup.cfg
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/pycqa/flake8
# flake8 config is in setup.cfg
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
- flake8-assertive==2.1.0
- flake8-blind-except==0.2.1
- flake8-comprehensions==3.10.1
- flake8-comprehensions==3.15.0
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.2
hooks:
Expand All @@ -48,6 +48,6 @@ repos:
- [email protected]
- '@wagtail/[email protected]'
- repo: https://github.com/rtts/djhtml
rev: 3.0.4
rev: 3.0.7
hooks:
- id: djhtml
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN npm run build:prod


# Build Python app - this stage is a common base for the prod and dev stages
FROM python:3.11-bullseye AS backend
FROM python:3.12-bookworm AS backend

ARG POETRY_VERSION=1.8.3
ARG UID=1000
Expand All @@ -27,7 +27,7 @@ ENV DJANGO_SETTINGS_MODULE=wagtailio.settings.production \

# Install operating system dependencies.
RUN apt-get update --yes --quiet && \
apt-get install -y apt-transport-https rsync libmagickwand-dev unzip postgresql-client-13 \
apt-get install -y apt-transport-https rsync libmagickwand-dev unzip postgresql-client-15 \
jpegoptim pngquant gifsicle libjpeg-progs webp && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -46,7 +46,7 @@ RUN chown --recursive $UID:$GID /app /venv


# This stage builds the image that will run in production
FROM backend AS prod
FROM backend as prod

# Switch to application user
USER wagtailio
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
condition: service_healthy

db:
image: postgres:13
image: postgres:16
expose:
- 5432
environment:
Expand Down
1,140 changes: 581 additions & 559 deletions poetry.lock

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.dependencies]
python = "^3.11"
python = "^3.12"
django = "~5.0.6"
wagtail = "~6.1.2"
psycopg2 = "~2.9"
gunicorn = "~21.2.0"
dj-database-url = "~2.1.0"
wagtail = "~6.2.2"
psycopg = "~3.2"
gunicorn = "~23.0.0"
dj-database-url = "~2.3.0"
django-basic-auth-ip-whitelist = "~0.6"
django-csp = "~3.7"
django-csp = "~3.8"
django-manifest-loader = "~1.0.0"
django-pattern-library = "~1.2.0"
django-permissions-policy = "~4.18"
django-permissions-policy = "~4.22"
django-referrer-policy = "~1.0"
django-storages = { version ="~1.13", extras = ["boto3"] }
markdown = "~3.5"
pygments = "~2.17"
requests = "~2.28.1"
scout-apm = "~3.0"
sentry-sdk = "~1.38"
django-storages = { version ="~1.14", extras = ["s3"] }
markdown = "~3.7"
pygments = "~2.18"
requests = "~2.32.3"
scout-apm = "~3.2"
sentry-sdk = "~2.17"
wagtail-font-awesome-svg = "~1.0.1"

wagtailmedia = "~0.15.2"
whitenoise = "~6.6"
whitenoise = "~6.7"
django-redis = "~5.4"

[tool.poetry.group.dev.dependencies]
black = "23.1.0"
djhtml = "3.0.4"
flake8 = "6.0.0"
black = "24.10.0"
djhtml = "3.0.7"
flake8 = "7.1.1"
flake8-assertive = "2.1.0"
flake8-blind-except = "0.2.1"
flake8-comprehensions = "3.10.1"
isort = "5.12.0"
pre-commit = "2.20.0"
flake8-comprehensions = "3.15.0"
isort = "5.13.2"
pre-commit = "4.0.1"
2 changes: 1 addition & 1 deletion vagrant/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apt-get install -y unzip
export DEBIAN_FRONTEND=noninteractive
apt-get remove -y --purge postgresql*
apt-get update -y
apt-get install -y postgresql-13 postgresql-client-13 postgresql-contrib-13 libpq-dev
apt-get install -y postgresql-16 postgresql-client-16 postgresql-contrib-16 libpq-dev
su - postgres -c "createuser -s vagrant"

# Create database
Expand Down
6 changes: 3 additions & 3 deletions wagtailio/core/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ def clean(self, value):
)
]
)
errors["image_for_external_link"] = errors[
"heading_for_external_link"
] = errors["subheading_for_ext_link"] = error
errors["image_for_external_link"] = errors["heading_for_external_link"] = (
errors["subheading_for_ext_link"]
) = error

if errors:
raise StructBlockValidationError(errors)
Expand Down
4 changes: 2 additions & 2 deletions wagtailio/core/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from wagtail.documents.models import document_served
from wagtail.whitelist import allow_without_attributes

from storages.backends.s3boto3 import S3Boto3Storage
from storages.backends.s3 import S3Storage


@hooks.register("construct_whitelister_element_rules")
Expand Down Expand Up @@ -48,7 +48,7 @@ def serve_document_from_s3(document, request):
and potentially risking DoS attack and the server timing out.
"""
# Skip this hook if not using django-storages boto3 backend.
if not issubclass(get_storage_class(), S3Boto3Storage):
if not issubclass(get_storage_class(), S3Storage):
return

# Send document_served signal, same as Wagtail does.
Expand Down
8 changes: 5 additions & 3 deletions wagtailio/roadmap/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class ImportForm(forms.Form):
max_length=64,
required=requires_token,
label="GitHub access token",
help_text="Optional — if not supplied, a default token will be used"
if not requires_token
else None,
help_text=(
"Optional — if not supplied, a default token will be used"
if not requires_token
else None
),
)
1 change: 0 additions & 1 deletion wagtailio/roadmap/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def get_context(self, request, *args, **kwargs):
class MilestoneItem(Orderable):
NEEDS_SPONSORSHIP_LABEL = "needs sponsorship"

needs_sponsorship = models.BooleanField(default=False, editable=False)
sponsorship_url = models.URLField(
zerolab marked this conversation as resolved.
Show resolved Hide resolved
blank=True,
verbose_name="Sponsorship URL",
Expand Down
3 changes: 2 additions & 1 deletion wagtailio/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""

import os
import sys
from os.path import abspath, dirname, join
Expand Down Expand Up @@ -185,7 +186,7 @@
# S3 configuration

if "AWS_STORAGE_BUCKET_NAME" in env:
STORAGES["default"]["BACKEND"] = "storages.backends.s3boto3.S3Boto3Storage"
STORAGES["default"]["BACKEND"] = "storages.backends.s3.S3Storage"
AWS_STORAGE_BUCKET_NAME = env["AWS_STORAGE_BUCKET_NAME"]
AWS_S3_FILE_OVERWRITE = False

Expand Down
1 change: 1 addition & 0 deletions wagtailio/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""

from django.core.wsgi import get_wsgi_application

application = get_wsgi_application()
Loading