From a2d8a65c576cff523e1a401624517e0677156eaa Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Mon, 4 Mar 2024 15:17:36 +0800 Subject: [PATCH 1/6] Update test matrix and dependencies on tox.ini --- tox.ini | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/tox.ini b/tox.ini index e755842..5a13c89 100644 --- a/tox.ini +++ b/tox.ini @@ -3,8 +3,9 @@ skipsdist = True usedevelop = True envlist = - python{3.8,3.9,3.10,3.11}-django3.2-wagtail{4.1,5.1,5.2}-{sqlite,postgres} - python3.11-django4.2-wagtail{5.1,5.2,6.0}-{sqlite,postgres} + python{3.8,3.9,3.10}-django3.2-wagtail5.2 + python{3.8,3.9,3.10,3.11}-django4.2-wagtail{5.2,6.0} + python{3.11,3.12}-django5.0-wagtail{5.2,6.0} flake8 [flake8] @@ -28,32 +29,24 @@ basepython = python3.9: python3.9 python3.10: python3.10 python3.11: python3.11 + python3.12: python3.12 deps = coverage django3.2: Django>=3.2,<4.0 django4.2: Django>=4.2,<4.3 - - ; The current Django version for main is 5.x, which is not supported by any Wagtail versions yet + django5.0: Django>=5.0,<5.1 djangomain: git+https://github.com/django/django.git@main#egg=Django - wagtail4.1: wagtail>=4.1,<4.2 - wagtail5.1: wagtail>=5.1,<5.2 wagtail5.2: wagtail>=5.2,<5.3 - - ; Starting with wagtail 6.0 the wagtail.contrib.modeladmin module has been removed. - ; TODO: replace wagtail==6.0rc1 with wagtail>=6.0,<6.1 when wagtail 6.0 gets released - wagtail6.0: wagtail==6.0rc1 - wagtail6.0: wagtail-modeladmin - + wagtail6.0: wagtail>=6.0,<6.1 wagtailmain: git+https://github.com/wagtail/wagtail.git - wagtailmain: wagtail-modeladmin postgres: psycopg2>=2.6 [testenv:interactive] -basepython = python3.10 +basepython = python3.12 commands_pre = python {toxinidir}/manage.py makemigrations @@ -68,7 +61,7 @@ setenv = INTERACTIVE = 1 [testenv:flake8] -basepython=python3.7 +basepython=python3.12 deps=flake8>=2.2.0 commands=flake8 src/wagtail_rangefilter tests/ @@ -78,6 +71,7 @@ python = 3.9: python3.9 3.10: python3.10 3.11: python3.11 + 3.12: python3.12 [gh-actions:env] DB_BACKEND = From b4fe2d1b570406c17d3e80faec44799506561d27 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Mon, 4 Mar 2024 15:18:21 +0800 Subject: [PATCH 2/6] Update classifiers, Add wagtail-modeladmin to testing dependencies, Bump Wagtail version lowerbound on pyproject.toml --- pyproject.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4f1308f..dbe14b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,11 +22,11 @@ classifiers = [ "Development Status :: 4 - Beta", "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", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", @@ -36,18 +36,20 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] requires-python = ">=3.8" dependencies = [ "django-admin-rangefilter>=0.12", "Django>=3.2", - "wagtail>=4.1", + "wagtail>=5.2", ] [project.optional-dependencies] testing = [ "coverage~=6.4.4", "tox~=3.26.0", + "wagtail-modeladmin==2.0.0", ] [project.urls] From d62b764131dc76806568dd8f0c9bc56432948762 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Mon, 4 Mar 2024 15:21:48 +0800 Subject: [PATCH 3/6] Update supported versions on README.md --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7688df0..06dcf8f 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ Integrates [django-admin-rangefilter](https://pypi.org/project/django-admin-rang ## Supported versions -- Python 3.8, 3.9, 3.10, 3.11 -- Django 3.2, 4.2 -- Wagtail 4.1, 5.1, 5.2, 6.0 (with external package [wagtail-modeladmin](https://pypi.org/project/wagtail-modeladmin/)) +- Python 3.8, 3.9, 3.10, 3.11, 3.12 +- Django 3.2, 4.2, 5.0 +- Wagtail 5.2, 6.0 (with external package [wagtail-modeladmin](https://pypi.org/project/wagtail-modeladmin/)) ## Installation @@ -41,9 +41,7 @@ INSTALLED_APPS = [ ## Example usage ```python -# Starting with Wagtail 6.0, the external package "wagtail-modeladmin" is required: -# from wagtail_modeladmin.options import ModelAdmin -from wagtail.contrib.modeladmin.options import ModelAdmin +from wagtail_modeladmin.options import ModelAdmin from wagtail_rangefilter.filters import DateRangeFilter, DateTimeRangeFilter class ExampleAdmin(ModelAdmin): From d60646ac1ae04d9c732ba46c0443dae3a0b661fc Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Mon, 4 Mar 2024 15:23:22 +0800 Subject: [PATCH 4/6] Add 3.12 to python-version, Bump Github workflow actions on test.yml --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d670398..6933619 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,12 +15,12 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['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 }} - name: Install Tox @@ -42,9 +42,9 @@ jobs: python-version: ['3.8', '3.9', '3.10', '3.11'] 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 }} - name: Install Tox From f25f140df3c0f211fcc3f9f62b5508f35e4c6868 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Mon, 4 Mar 2024 15:23:56 +0800 Subject: [PATCH 5/6] Get rid of the conditional import for modeladmin --- tests/settings.py | 8 +------- tests/testapp/wagtail_hooks.py | 5 +---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/settings.py b/tests/settings.py index 44b0d0e..e7ddea2 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -22,12 +22,6 @@ # Application definition -try: - import wagtail_modeladmin -except ImportError: - modeladmin_package_name = "wagtail.contrib.modeladmin" -else: - modeladmin_package_name = "wagtail_modeladmin" INSTALLED_APPS = [ "tests.testapp", @@ -44,7 +38,7 @@ "wagtail.search", "wagtail.admin", "wagtail.api.v2", - modeladmin_package_name, + "wagtail_modeladmin", "wagtail.contrib.routable_page", "wagtail.contrib.styleguide", "wagtail.sites", diff --git a/tests/testapp/wagtail_hooks.py b/tests/testapp/wagtail_hooks.py index 9df54b0..2a1cc99 100644 --- a/tests/testapp/wagtail_hooks.py +++ b/tests/testapp/wagtail_hooks.py @@ -1,7 +1,4 @@ -try: - from wagtail_modeladmin.options import ModelAdmin, modeladmin_register -except ImportError: - from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register +from wagtail_modeladmin.options import ModelAdmin, modeladmin_register from wagtail_rangefilter.filters import DateRangeFilter, DateTimeRangeFilter From 5031b6f1184e03302db91f180b75483357d06712 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Mon, 4 Mar 2024 15:42:27 +0800 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 056ce17..7b57d0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- +- Drop tests for Wagtail < 5.2 as they have reached EOL (@katdom13) +- Drop tests for Django 4.1 as it has reached EOL (@katdom13) +- Add tests for Python 3.12 (@katdom13) +- Add `wagtail-modeladmin` to testing dependencies (@katdom13) ## [0.2.1] - 2024-02-07