Skip to content

Commit

Permalink
Merge branch support/wagtail-63 into dev
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 335042f
Author: Nick Moreton <[email protected]>
Date:   Mon Jan 6 14:58:27 2025 +0000

    Upgrdae django-basic-auth-ip-whitelist to 0.6.0

commit c3d019c
Author: Nick Moreton <[email protected]>
Date:   Mon Jan 6 14:45:13 2025 +0000

    Upgrade production dependencies where available

    Also update the pre-commit hook versions

commit ee30cac
Author: Nick Moreton <[email protected]>
Date:   Mon Jan 6 14:36:04 2025 +0000

    Upgrade wagtail packages where available

commit 9764060
Author: Nick Moreton <[email protected]>
Date:   Mon Jan 6 14:33:24 2025 +0000

    Upgrade development dependencies where available

commit 2a067a1
Author: Nick Moreton <[email protected]>
Date:   Mon Jan 6 14:29:00 2025 +0000

    Rename .env to .env.example

    This then matches the sites build process docs

commit 6acfb03
Author: Nick Moreton <[email protected]>
Date:   Mon Jan 6 14:22:05 2025 +0000

    Upgrade poetry to 1.8.5

commit 186328f
Author: Nick Moreton <[email protected]>
Date:   Mon Jan 6 14:14:18 2025 +0000

    Upgrade wagtail to 6.3.2

    Bump django to 4.2.17
  • Loading branch information
JakubMastalerz committed Jan 23, 2025
1 parent 9603da3 commit 9ebcbc8
Show file tree
Hide file tree
Showing 10 changed files with 239 additions and 176 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
python-version: 3.11
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.8.3
poetry-version: 1.8.5
- name: Install Poetry
run: |
poetry config virtualenvs.create false &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
python-version: 3.11
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.8.3
poetry-version: 1.8.5
- name: Install Poetry
run: |
poetry config virtualenvs.create false &&
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/python/black
rev: 24.4.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
Expand All @@ -12,7 +12,7 @@ repos:
- id: isort
- repo: https://github.com/pycqa/flake8
# flake8 config is in setup.cfg
rev: 5.0.4
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-eslint
Expand Down Expand Up @@ -45,16 +45,16 @@ repos:
- [email protected]
- [email protected]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.20.0
rev: 1.22.2
hooks:
- id: django-upgrade
args: [--target-version, '4.2'] # Replace with Django version
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.1
hooks:
- id: pyupgrade
- repo: https://github.com/python-poetry/poetry
rev: '1.8.3' # keep version in sync with version installed in the Dockerfile
rev: '1.8.5' # keep version in sync with version installed in the Dockerfile
hooks:
- id: poetry-check
- id: poetry-lock
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FROM python:3.11-bookworm as production
ARG POETRY_INSTALL_ARGS="--no-dev"

# IMPORTANT: Remember to review .circleci/config.yml when upgrading
ARG POETRY_VERSION=1.8.3
ARG POETRY_VERSION=1.8.5

# Install dependencies in a virtualenv
ENV VIRTUAL_ENV=/venv
Expand Down
310 changes: 164 additions & 146 deletions poetry.lock

Large diffs are not rendered by default.

45 changes: 23 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,73 @@ authors = ["Kevin Howbrook <[email protected]>"]
[tool.poetry.dependencies]
python = "~3.11"
django = "~4.2"
wagtail = "~6.2"
wagtail = "~6.3"
psycopg2 = "~2.9"
gunicorn = {version = "~23.0", optional = true}

# Django packages
django-basic-auth-ip-whitelist = "~0.5"
django-birdbath = "^2.0.0"
django-cors-headers = "^4.4.0"
django-basic-auth-ip-whitelist = "~0.6"
django-birdbath = "^2.0.1"
django-cors-headers = "^4.6.0"
django-countries = "^7.6.1"
django-csp = "~3.8"
django-import-export = "3.3.8" # Note: v4+ has breaking changes
# If you update django-import-export, comprehensive testing of the feature should be carried out.
django-pattern-library = "~1.2.0"
django-phonenumber-field = { extras = ["phonenumbers"], version = "^7.3.0" }
django-pattern-library = "~1.3.0"
django-phonenumber-field = {version = "^8.0.0", extras = ["phonenumbers"]}
django-redis = "~5.4"
django-referrer-policy = "~1.0"
django-storages = { version = "~1.14", extras = ["boto3"] }
dj-database-url = "~2.2"
django-storages = {version = "~1.14", extras = ["boto3"]}
dj-database-url = "~2.3"

# Wagtail packages
wagtail-accessibility = "^2.0.0"
wagtail-django-recaptcha = "^2.1.1"
wagtail-factories = "^4.1.0"
wagtail-modeladmin = "^2.0.0"
wagtail-modeladmin = "^2.1.0"
wagtail-orderable = "^1.2.0"
wagtail-rangefilter = "^0.2.1"
wagtail-storages = "^1.1.0"
wagtail-storages = "^2.0"

# Various
beautifulsoup4 = "^4.12.3"
coverage = "^7.6"
coverage = "^7.6.10"
freezegun = "^1.5.1"
html5lib = "^1.1"
lxml = "^5.3.0"
mailchimp-marketing = "^3.0.80"
scout-apm = "~3.2"
sentry-sdk = "^2.15.0"
sentry-sdk = "^2.19.2"
tblib = "^3.0.0"
urllib3 = "<2"
whitenoise = "~6.7"
urllib3 = "^2.3.0"
whitenoise = "^6.8.2"
social-auth-app-django = "^5.4.2"
django-xff = "^1.4.0"

[tool.poetry.extras]
gunicorn = ["gunicorn"]

[tool.poetry.group.dev.dependencies]
Werkzeug = "~3.0.4"
Werkzeug = "~3.1.3"
django-extensions = "~3.2"
fabric = "~3.2"
stellar = "~0.4"
wagtailmakeup = "^1.1.0"

# Linters etc.
black = "^24.8.0"
black = "^24.10.0"
detect-secrets = "~1.5"
flake8 = "5.0.4"
flake8 = "7.1.1"
isort = "5.13.2"
pre-commit = "~3.5"
pre-commit = "~4.0"

# Documentation
mkdocs = "~1.6"
mkdocs-material = "~9.5"
pymdown-extensions = "~10.11"
honcho = "^1.1.0"
django-upgrade = "^1.21.0"
pyupgrade = "^3.17.0"
pymdown-extensions = "~10.13"
honcho = "^2.0.0"
django-upgrade = "^1.22.2"
pyupgrade = "^3.19.1"

[build-system]
requires = ["poetry>=1,<2"]
Expand Down
18 changes: 18 additions & 0 deletions rca/documents/migrations/0005_wagtail_63_upgrade.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.17 on 2025-01-06 14:18

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("documents", "0004_amend_document_helptext"),
]

operations = [
migrations.AlterField(
model_name="customdocument",
name="file_size",
field=models.PositiveBigIntegerField(editable=False, null=True),
),
]
20 changes: 20 additions & 0 deletions rca/images/migrations/0008_wagtail_63_upgrade.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.17 on 2025-01-06 14:18

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("images", "0007_alter_customimage_alt"),
]

operations = [
migrations.AddField(
model_name="customimage",
name="description",
field=models.CharField(
blank=True, default="", max_length=255, verbose_name="description"
),
),
]
6 changes: 6 additions & 0 deletions rca/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
# SecurityMiddleware.
# http://whitenoise.evans.io/en/stable/#quickstart-for-django-apps
"whitenoise.middleware.WhiteNoiseMiddleware",
"xff.middleware.XForwardedForMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
Expand Down Expand Up @@ -394,6 +395,7 @@
"level": "WARNING",
"propagate": False,
},
"xff": {"handlers": ["console"], "level": "WARNING", "propagate": False},
},
}

Expand Down Expand Up @@ -667,6 +669,10 @@
BASIC_AUTH_GET_CLIENT_IP_FUNCTION = "rca.utils.clientip.get_client_real_ip"
BASIC_AUTH_WHITELISTED_PATHS = ["/api"]

# django-xff (https://github.com/ferrix/xff/?tab=readme-ov-file#configuration)
# --------------------------------------------------------------------------------------
XFF_TRUSTED_PROXY_DEPTH = int(env.get("XFF_TRUSTED_PROXY_DEPTH", 1))

AUTH_USER_MODEL = "users.User"

# Wagtail settings
Expand Down

0 comments on commit 9ebcbc8

Please sign in to comment.