Repository: torchbox/wagtail-makeup (language: python)

Issue:
Clean up api requests
See https://github.com/jafacakes2011/wagtail-unsplash/blob/master/wagtail_unsplash/api.py

It would be nicer to clean these up a bit


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9d24075..e7a192d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,10 +9,10 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
       - name: Set up Python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: 3
 
@@ -23,7 +23,7 @@ jobs:
         run: python setup.py bdist_wheel sdist
 
       - name: Upload Python packages artifact
-        uses: actions/upload-artifact@v1
+        uses: actions/upload-artifact@v4
         with:
           name: Python Packages
           path: dist
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 438cd17..245c974 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
 default_language_version:
   node: system
-  python: python3.11
+  python: python3.12
 repos:
   - repo: https://github.com/python/black
     rev: 23.1.0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6ca5095..98240f7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 
 ## Unreleased
 
+- Add tests for Wagtail 5.1+
+- Drop tests for Wagtail 4.2 and 5.0 as they have reached EOL
+
 ## 1.0.1 (2023-07-27)
 
 - Adds support for Wagtail 5.0
diff --git a/setup.cfg b/setup.cfg
index f28d415..e1a5ce9 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -13,13 +13,13 @@ license_files =
   LICENSE.txt
 
 [options]
-python_requires = >= 3.7
+python_requires = >= 3.8
 setup_requires =
   setuptools >= 40.6
   pip >= 10
 include_package_data = true
 packages = find:
 install_requires =
-    Django>=3.2, <4.2
-    wagtail>=4.1, <5.0
+    Django>=3.2
+    wagtail>=5.2
     python-unsplash>=1.1.0, <1.2
diff --git a/setup.py b/setup.py
index c55a65a..f95d770 100644
--- a/setup.py
+++ b/setup.py
@@ -27,17 +27,17 @@
     license="MIT",
     packages=find_packages(exclude=["tests*"]),
     include_package_data=True,
-    install_requires=["wagtail>=4.1", "python-unsplash>=1.1.0"],
+    install_requires=["wagtail>=5.2", "python-unsplash>=1.1.0"],
     extras_require={"testing": testing_extras},
     classifiers=[
         "Development Status :: 3 - Alpha",
         "Environment :: Web Environment",
         "Framework :: Django",
         "Framework :: Django :: 3.2",
-        "Framework :: Django :: 4.1",
         "Framework :: Django :: 4.2",
+        "Framework :: Django :: 5.0",
         "Framework :: Wagtail",
-        "Framework :: Wagtail :: 4",
         "Framework :: Wagtail :: 5",
+        "Framework :: Wagtail :: 6",
     ],
 ),
diff --git a/tox.ini b/tox.ini
index c7b9e8f..5960173 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,25 +4,26 @@ python =
     3.9: py39
     3.10: py310
     3.11: py311
+    3.12: py312
 
 [gh-actions:env]
 DJANGO =
     3.2: dj32
-    4.1: dj41
     4.2: dj42
+    5.0: dj50
 
 WAGTAIL =
-    4.1: wt41
-    4.2: wt42
-    5.0: wt50
+    5.2: wt52
+    6.0: wt60
 
 [tox]
 skipsdist = True
 usedevelop = True
 
 envlist =
-    py{38,39,310}-dj{32,41}-wt{41,42,50}
-    py{311}-dj{41,42}-wt{50}
+    py{38,39,310}-dj32-wt52
+    py{38,39,310,311}-dj42-wt{52,60}
+    py{311,312}-dj50-wt{52,60}
 
 [testenv]
 description = Unit tests
@@ -34,11 +35,11 @@ basepython =
     py39: python3.9
     py310: python3.10
     py311: python3.11
+    py312: python3.12
 
 deps =
     dj32: Django>=3.2,<4.0
-    dj41: Django>=4.1,<4.2
     dj42: Django>=4.2,<4.3
-    wt41: wagtail>=4.1,<4.2
-    wt42: wagtail>=4.2,<5.0
-    wt50: wagtail>=5.0,<5.1
+    dj50: Django>=5.0,<5.1
+    wt52: wagtail>=5.2,<5.3
+    wt60: wagtail>=6.0,<6.1


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index e696225..8ee7086 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -6,39 +6,26 @@ on:
   pull_request:
     branches: [main]
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read # to fetch code (actions/checkout)
+
 jobs:
   build:
-    name: |
-      build (Python ${{ matrix.python-version }},
-      Django ${{ matrix.django-version }},
-      Wagtail ${{ matrix.wagtail-version }}),
     runs-on: ubuntu-latest
     strategy:
       fail-fast: false
       matrix:
-        python-version: ["3.8", "3.9", "3.10", "3.11"]
-        django-version: ["3.2", "4.1", "4.2"]
-        wagtail-version: ["4.1", "4.2", "5.0"]
-        exclude:
-          - python-version: "3.8"
-            django-version: "4.2"
-          - python-version: "3.9"
-            django-version: "4.2"
-          - python-version: "3.10"
-            django-version: "4.2"
-          - python-version: "3.11"
-            django-version: "3.2"
-          - python-version: "3.11"
-            wagtail-version: "4.1"
-          - python-version: "3.11"
-            wagtail-version: "4.2"
-          - django-version: "3.2"
-            wagtail-version: "5.0"
+        python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
+
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
 
@@ -53,6 +40,6 @@ jobs:
           WAGTAIL: ${{ matrix.wagtail-version }}
 
       - name: Upload coverage
-        uses: codecov/codecov-action@v1
+        uses: codecov/codecov-action@v4
         with:
           name: Python ${{ matrix.python-version }}
diff --git a/wagtailmakeup/tests/settings.py b/wagtailmakeup/tests/settings.py
index 7f621df..35574f9 100644
--- a/wagtailmakeup/tests/settings.py
+++ b/wagtailmakeup/tests/settings.py
@@ -18,7 +18,6 @@
     "wagtail.contrib.routable_page",
     "wagtail.contrib.frontend_cache",
     "wagtail.contrib.settings",
-    "wagtail.contrib.modeladmin",
     "wagtail.contrib.table_block",
     "wagtail.contrib.forms",
     "wagtail.embeds",
@@ -72,3 +71,5 @@
 USE_TZ = True
 
 WAGTAILADMIN_BASE_URL = "http://localhost:8000/admin/"
+
+STATIC_URL = "/static/"