diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b15e0c14..d10aff6e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Build image run: DOCKER_BUILDKIT=1 docker build --tag docs.ubuntu.com . @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Install dependencies run: yarn install --immutable @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Install node dependencies run: yarn install --immutable @@ -51,14 +51,16 @@ jobs: run: yarn lint-python test-python: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Install requirements run: | sudo apt-get update && sudo apt-get install --yes python3-setuptools + sudo pip3 install --upgrade pip setuptools wheel + sudo pip3 install "setuptools<72" "Cython<3.1" sudo pip3 install -r requirements.txt - name: Install node dependencies @@ -74,7 +76,7 @@ jobs: run: coverage run --source=. -m unittest discover tests - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v5 with: flags: python @@ -83,7 +85,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: woke uses: canonical-web-and-design/inclusive-naming@main diff --git a/Dockerfile b/Dockerfile index 6c9dc0cc..43d5478b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,15 +2,15 @@ # Build stage: Install python dependencies # === -FROM ubuntu:focal AS python-dependencies +FROM ubuntu:noble AS python-dependencies RUN apt update && apt install --no-install-recommends --yes python3 python3-pip python3-setuptools COPY requirements.txt /tmp/requirements.txt -RUN --mount=type=cache,target=/root/.cache/pip pip3 install --user --requirement /tmp/requirements.txt +RUN --mount=type=cache,target=/root/.cache/pip pip3 install --break-system-packages --user --requirement /tmp/requirements.txt # Build stage: Install yarn dependencies # === -FROM node:16 AS yarn-dependencies +FROM node:25 AS yarn-dependencies WORKDIR /srv COPY . . RUN --mount=type=cache,target=/usr/local/share/.cache/yarn yarn install @@ -18,10 +18,11 @@ RUN --mount=type=cache,target=/usr/local/share/.cache/yarn yarn install # Build stage: # === -FROM ubuntu:focal AS build-documentation +FROM ubuntu:noble AS build-documentation WORKDIR /srv RUN apt-get update && apt-get install --no-install-recommends --yes git ca-certificates python3 python3-pip python3-setuptools -RUN pip3 install ubuntudesign.documentation-builder gitdb2==3.0.1 MarkupSafe==2.0.1 +RUN pip3 install --break-system-packages "setuptools<72" "Cython<3.1" && \ + pip3 install --break-system-packages ubuntudesign.documentation-builder gitdb2==3.0.1 MarkupSafe==2.0.1 ADD build-docs.sh build-docs.sh ADD .git/index /dev/null RUN ./build-docs.sh @@ -39,7 +40,7 @@ RUN yarn run build-js # Build the production image # === -FROM ubuntu:focal +FROM ubuntu:noble # Set up environment ENV LANG C.UTF-8 diff --git a/package.json b/package.json index 13c025ff..041dfbc8 100644 --- a/package.json +++ b/package.json @@ -14,19 +14,19 @@ }, "dependencies": { "@canonical/cookie-policy": "^3.6.4", - "autoprefixer": "10.4.1", + "autoprefixer": "10.4.23", "sass-lint": "1.13.1", "vanilla-framework": "4.39.0", "watch-cli": "0.2.3", "postcss": "8.4.5", - "postcss-cli": "8.3.1", - "sass": "1.46.0", - "webpack": "5.65.0", - "webpack-cli": "4.9.1" + "postcss-cli": "10.1.0", + "sass": "1.97.2", + "webpack": "5.94.0", + "webpack-cli": "5.1.4" }, "devDependencies": { - "@babel/core": "7.16.7", - "@babel/preset-env": "7.16.7", - "babel-loader": "8.2.3" + "@babel/core": "7.28.6", + "@babel/preset-env": "7.28.6", + "babel-loader": "9.1.3" } } diff --git a/requirements.txt b/requirements.txt index 66672547..bacb2725 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -Django==3.2.14 +setuptools<70 +Django==4.2.27 canonicalwebteam.custom_response_headers==0.2.0 canonicalwebteam.versioned-static==1.0.2 canonicalwebteam.yaml-responses==1.2.0 @@ -6,8 +7,9 @@ django-static-root-finder==0.3.1 django-asset-server-url==0.1 django-template-finder-view==0.3 django-yaml-redirects==0.5.4 -talisker[gunicorn,gevent]==0.19.0 -whitenoise==5.3.0 +talisker[gunicorn,gevent]==0.22.0 +whitenoise==6.7.0 ubuntudesign.documentation-builder==1.7.0 -gitdb2==3.0.3.post1 -MarkupSafe==2.0.1 +gitdb2==4.0.2 +MarkupSafe==2.1.5 +Cython==0.29.37 \ No newline at end of file diff --git a/run b/run index 60dd6d2a..17f29931 100755 --- a/run +++ b/run @@ -1,3 +1,4 @@ + #! /usr/bin/env bash # CAUTION: diff --git a/webapp/urls.py b/webapp/urls.py index 086c246d..2e9808d7 100644 --- a/webapp/urls.py +++ b/webapp/urls.py @@ -1,13 +1,18 @@ # Modules -from django.conf.urls import url +from django.urls import re_path from django_template_finder_view import TemplateFinder from canonicalwebteam.yaml_responses.django_helpers import ( create_redirect_views, ) +# Compatibility shim for older packages expecting django.conf.urls.url +from django.conf import urls as django_urls + +django_urls.url = re_path + # Match any redirects first urlpatterns = create_redirect_views() # Try to find templates -urlpatterns += [url(r"^(?P