Skip to content

Commit ec1da18

Browse files
feat: match django-cms core test matrix (#320)
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent 8eb0431 commit ec1da18

File tree

12 files changed

+40
-25
lines changed

12 files changed

+40
-25
lines changed

.github/workflows/codecov.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,34 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] # latest release minus two
19+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] # latest release minus two
2020
requirements-file: [
2121
dj42_cms311.txt,
2222
dj42_cms41.txt,
2323
dj50_cms41.txt,
2424
dj51_cms41.txt,
2525
dj52_cms50.txt,
26+
dj60_cms50.txt,
2627
]
2728
os: [
2829
ubuntu-latest,
2930
]
3031
exclude:
31-
- python-version: "3.9"
32+
# Python 3.14 only works with Django 5.2+
33+
- python-version: "3.14"
34+
requirements-file: dj42_cms311.txt
35+
- python-version: "3.14"
36+
requirements-file: dj42_cms41.txt
37+
- python-version: "3.14"
3238
requirements-file: dj50_cms41.txt
33-
- python-version: "3.9"
39+
- python-version: "3.14"
3440
requirements-file: dj51_cms41.txt
35-
- python-version: "3.9"
36-
requirements-file: dj52_cms50.txt
41+
# Python 3.10 and 3.11 only supported until Django 5.2
3742
- python-version: "3.10"
38-
requirements-file: dj52_cms50.txt
43+
requirements-file: dj60_cms50.txt
44+
- python-version: "3.11"
45+
requirements-file: dj60_cms50.txt
46+
# Python 3.12 and 3.13 don't support Django 4.2 with CMS 3.11
3947
- python-version: "3.12"
4048
requirements-file: dj42_cms311.txt
4149
- python-version: "3.13"
@@ -53,7 +61,8 @@ jobs:
5361
- name: Install dependencies
5462
run: |
5563
sudo apt install libcairo2-dev pkg-config python3-dev
56-
pip install -U -r tests/requirements/${{ matrix.requirements-file }}
64+
python -m pip install --upgrade pip uv
65+
uv pip install --system -r tests/requirements/${{ matrix.requirements-file }}
5766
- name: Run coverage
5867
run: |
5968
coverage run -m pytest

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
rev: v3.20.0
1313
hooks:
1414
- id: pyupgrade
15-
args: ["--py39-plus"]
15+
args: ["--py310-plus"]
1616

1717
- repo: https://github.com/adamchainz/django-upgrade
1818
rev: "1.29.0"
@@ -33,6 +33,6 @@ repos:
3333
- flake8-logging-format
3434

3535
- repo: https://github.com/tox-dev/pyproject-fmt
36-
rev: v2.7.0
36+
rev: v2.11.0
3737
hooks:
3838
- id: pyproject-fmt

djangocms_frontend/component_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import importlib
2-
import typing
32

43
from django import forms
54
from django.apps import apps
@@ -212,11 +211,11 @@ def get_registration(cls) -> tuple[type, type, list[type]]:
212211
)
213212

214213
@classproperty
215-
def _component_meta(cls) -> typing.Optional[type]:
214+
def _component_meta(cls) -> type | None:
216215
return getattr(cls, "Meta", None)
217216

218217
@classmethod
219-
def _generate_fieldset(cls) -> list[tuple[typing.Optional[str], dict]]:
218+
def _generate_fieldset(cls) -> list[tuple[str | None, dict]]:
220219
return [(None, {"fields": cls.declared_fields.keys()})]
221220

222221
def get_short_description(self) -> str:

djangocms_frontend/templatetags/frontend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def render_tag(self, context, slot_name, nodelist):
156156

157157

158158
class DummyPlugin:
159-
def __init__(self, nodelist, plugin_type, slot_name: typing.Optional[str] = None) -> "DummyPlugin":
159+
def __init__(self, nodelist, plugin_type, slot_name: str | None = None) -> "DummyPlugin":
160160
self.nodelist = nodelist
161161
self.plugin_type = (f"{plugin_type}{slot_name.capitalize()}Plugin") if slot_name else "DummyPlugin"
162162
if slot_name is None:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "BSD-3-Clause"
1111
authors = [
1212
{ name = "Fabian Braun", email = "[email protected]" },
1313
]
14-
requires-python = ">=3.9"
14+
requires-python = ">=3.10"
1515
classifiers = [
1616
"Development Status :: 5 - Production/Stable",
1717
"Framework :: Django",
@@ -24,11 +24,11 @@ classifiers = [
2424
"Framework :: Django CMS :: 4.1",
2525
"Framework :: Django CMS :: 5.0",
2626
"Programming Language :: Python :: 3 :: Only",
27-
"Programming Language :: Python :: 3.9",
2827
"Programming Language :: Python :: 3.10",
2928
"Programming Language :: Python :: 3.11",
3029
"Programming Language :: Python :: 3.12",
3130
"Programming Language :: Python :: 3.13",
31+
"Programming Language :: Python :: 3.14",
3232
]
3333
dynamic = [ "version" ]
3434
dependencies = [

tests/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def create_page(self, title, **kwargs):
7979
return create_page(title=title, **kwargs)
8080

8181
def get_placeholders(self, page):
82-
from cms.models import Placeholder, PageContent
82+
from cms.models import PageContent, Placeholder
8383
page_content = PageContent.admin_manager.latest_content().get(language=self.language, page=self.page)
8484
return Placeholder.objects.get_for_obj(page_content)
8585

tests/grid/test_forms.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from django.test import TestCase
22

3-
from djangocms_frontend.contrib.grid.forms import (
4-
GridColumnForm,
5-
GridRowForm,
6-
GridContainerForm)
3+
from djangocms_frontend.contrib.grid.forms import GridColumnForm, GridContainerForm, GridRowForm
74

85

96
class GridFormTestCase(TestCase):

tests/requirements/dj60_cms50.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-r base.txt
2+
3+
Django>=6.0a1,<6.1
4+
django-cms>=5.0,<5.1
5+
djangocms-versioning>=2.4
6+

tests/test_fields.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
from django import forms
22
from django.test import TestCase
33

4-
from djangocms_frontend.settings import DEVICE_CHOICES
54
from djangocms_frontend.fields import (
6-
AttributesField, TagTypeField,
7-
TagTypeFormField, DeviceChoiceField, OptionalDeviceChoiceField)
5+
AttributesField,
6+
DeviceChoiceField,
7+
OptionalDeviceChoiceField,
8+
TagTypeField,
9+
TagTypeFormField,
10+
)
11+
from djangocms_frontend.settings import DEVICE_CHOICES
812

913

1014
class FieldsTestCase(TestCase):

tests/test_plugin_tag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def test_non_frontend_plugin(self):
129129

130130
def test_autohero_component_registered_for_plugin_tag(self):
131131
from cms.plugin_pool import plugin_pool
132+
132133
from djangocms_frontend.plugin_tag import plugin_tag_pool
133134

134135
# Check that the AutoHero plugin is registered

0 commit comments

Comments
 (0)