Skip to content

Commit 6d83406

Browse files
chore: CI clean up (#211)
* chore: Remove tests/ from coverage report * chore: Replace django-app-helper with pytest * chore: Update dependencies * fix: dj5 consistently applies empty_value_display for empty readonly fields empty_value_display is "-" * fix: dj6 add additional attribute as part of ARIA compatibility * chore: Repository clean-up * chore: Add dynamic badges * ci: Add django-cms5.1.0alpha1 * ci: auto fixes from pre-commit hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent dd7c255 commit 6d83406

38 files changed

+3753
-1252
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ jobs:
1616
strategy:
1717
matrix:
1818
python-version:
19-
- 3.9
2019
- '3.10'
2120
- '3.11'
21+
- '3.12'
22+
- '3.13'
2223

2324
steps:
2425
- uses: actions/checkout@v6
@@ -33,7 +34,7 @@ jobs:
3334
- name: Install dependencies
3435
run: |
3536
python -m pip install --upgrade pip setuptools wheel
36-
python -m pip install --upgrade 'tox>=4.0.0rc3'
37+
python -m pip install --upgrade tox
3738
3839
- name: Run tox targets for ${{ matrix.python-version }}
3940
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)

README.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
django CMS Snippet
33
==================
44

5-
|pypi| |coverage| |python| |django| |djangocms| |djangocms4|
5+
|pypi| |coverage| |python| |django| |djangocms|
66

77

88
**django CMS Snippet** provides a plugin for `django CMS <http://django-cms.org>`_
@@ -49,7 +49,7 @@ One of the easiest contributions you can make is helping to translate this addon
4949
Documentation
5050
=============
5151

52-
See ``REQUIREMENTS`` in the `setup.py <https://github.com/divio/djangocms-snippet/blob/master/setup.py>`_
52+
See ``REQUIREMENTS`` in the `setup.py <https://github.com/django-cms/djangocms-snippet/blob/master/setup.py>`_
5353
file for additional dependencies.
5454

5555

@@ -141,13 +141,11 @@ You can run tests by executing::
141141

142142
.. |pypi| image:: https://badge.fury.io/py/djangocms-snippet.svg
143143
:target: http://badge.fury.io/py/djangocms-snippet
144-
.. |coverage| image:: https://codecov.io/gh/django-cms/djangocms-snippet/branch/master/graph/badge.svg
144+
.. |coverage| image:: https://img.shields.io/codecov/c/github/django-cms/djangocms-snippet
145145
:target: https://codecov.io/gh/django-cms/djangocms-snippet
146-
.. |python| image:: https://img.shields.io/badge/python-3.9+-blue.svg
146+
.. |python| image:: https://img.shields.io/pypi/pyversions/djangocms-snippet
147147
:target: https://pypi.org/project/djangocms-snippet/
148-
.. |django| image:: https://img.shields.io/badge/django-4.2+-blue.svg
148+
.. |django| image:: https://img.shields.io/pypi/frameworkversions/django/djangocms-snippet
149149
:target: https://www.djangoproject.com/
150-
.. |djangocms| image:: https://img.shields.io/badge/django%20CMS-3.11-blue.svg
151-
:target: https://www.django-cms.org/
152-
.. |djangocms4| image:: https://img.shields.io/badge/django%20CMS-4%2B-blue.svg
150+
.. |djangocms| image:: https://img.shields.io/pypi/frameworkversions/django-cms/djangocms-snippet
153151
:target: https://www.django-cms.org/

pyproject.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ maintainers = [
1414
license = {file = "LICENSE"}
1515
description = "Adds snippet plugin to django CMS."
1616
readme = "README.rst"
17-
requires-python = ">=3.9"
17+
requires-python = ">=3.10"
1818
dependencies = [
19-
'django-cms>=3.7',
19+
'django-cms>=4.1',
2020
]
2121
classifiers=[
2222
"Development Status :: 5 - Production/Stable",
@@ -26,19 +26,17 @@ classifiers=[
2626
"Operating System :: OS Independent",
2727
"Programming Language :: Python",
2828
"Programming Language :: Python :: 3",
29-
"Programming Language :: Python :: 3.8",
30-
"Programming Language :: Python :: 3.9",
3129
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
3233
"Framework :: Django",
33-
"Framework :: Django :: 3.2",
34-
"Framework :: Django :: 4.2",
34+
"Framework :: Django :: 5.2",
35+
"Framework :: Django :: 6.0",
3536
"Framework :: Django CMS",
36-
"Framework :: Django CMS :: 3.8",
37-
"Framework :: Django CMS :: 3.9",
38-
"Framework :: Django CMS :: 3.10",
39-
"Framework :: Django CMS :: 3.11",
40-
"Framework :: Django CMS :: 4.0",
4137
"Framework :: Django CMS :: 4.1",
38+
"Framework :: Django CMS :: 5.0",
39+
"Framework :: Django CMS :: 5.1.0a1",
4240
"Topic :: Internet :: WWW/HTTP",
4341
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
4442
"Topic :: Software Development",
@@ -59,14 +57,13 @@ version = {attr = "djangocms_snippet.__version__"}
5957
"Bug Tracker" = "https://github.com/django-cms/djangocms-snippet/issues"
6058
Changelog = "https://github.com/django-cms/djangocms-snippet/blob/master/CHANGELOG.rst"
6159
Repository = "https://github.com/django-cms/djangocms-snippet"
62-
Support = "https://www.django-cms.org/slack/"
60+
Support = "https://discord-support-channel.django-cms.org"
6361

6462
[tool.coverage.run]
6563
branch = true
6664
parallel = true
6765
source = [
6866
"djangocms_snippet",
69-
"tests",
7067
]
7168

7269
[tool.coverage.paths]
@@ -143,6 +140,9 @@ lint.ignore = [
143140
"test_plugins.py" = [
144141
"FBT003", # Boolean positional value in function call
145142
]
143+
"tests/conftest.py" = [
144+
"N806", # Ignore lowercase for variable name in function
145+
]
146146

147147
[tool.ruff.lint.isort]
148148
combine-as-imports = true

setup.cfg

Lines changed: 0 additions & 23 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22
from setuptools import setup
33

4-
setup(test_suite="tests.settings.run")
4+
setup()

tests/conftest.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
import sys
3+
4+
import django
5+
from django.conf import settings
6+
from django.test.utils import get_runner
7+
8+
9+
def pytest_configure():
10+
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
11+
django.setup()
12+
13+
14+
def run(path):
15+
TestRunner = get_runner(settings)
16+
test_runner = TestRunner()
17+
failures = test_runner.run_tests(path)
18+
sys.exit(bool(failures))
19+
20+
21+
if __name__ == "__main__":
22+
run(sys.argv[1:])

tests/requirements/base.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/requirements/compile.py

Lines changed: 99 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,87 @@
66
import sys
77
from pathlib import Path
88

9+
CONFIG_MATRIX = [
10+
[
11+
"python3.10",
12+
"Django>=5.2,<6.0",
13+
"django-cms>=4.1,<5.0",
14+
"py310-django52-cms41.txt",
15+
],
16+
[
17+
"python3.10",
18+
"Django>=5.2,<6.0",
19+
"django-cms>=5.0,<5.1.0a1",
20+
"py310-django52-cms50.txt",
21+
],
22+
[
23+
"python3.11",
24+
"Django>=5.2,<6.0",
25+
"django-cms>=4.1,<5.0",
26+
"py311-django52-cms41.txt",
27+
],
28+
[
29+
"python3.11",
30+
"Django>=5.2,<6.0",
31+
"django-cms>=5.0,<5.1.0a1",
32+
"py311-django52-cms50.txt",
33+
],
34+
[
35+
"python3.12",
36+
"Django>=5.2,<6.0",
37+
"django-cms>=4.1,<5.0",
38+
"py312-django52-cms41.txt",
39+
],
40+
[
41+
"python3.12",
42+
"Django>=5.2,<6.0",
43+
"django-cms>=5.0,<5.1.0a1",
44+
"py312-django52-cms50.txt",
45+
],
46+
[
47+
"python3.12",
48+
"Django>=5.2,<6.0",
49+
"django-cms==5.1.0a1",
50+
"py312-django52-cms51alpha1.txt",
51+
],
52+
[
53+
"python3.12",
54+
"Django==6.0",
55+
"django-cms>=5.0,<5.1.0a1",
56+
"py312-django60-cms50.txt",
57+
],
58+
[
59+
"python3.12",
60+
"Django==6.0",
61+
"django-cms==5.1.0a1",
62+
"py312-django60-cms51alpha1.txt",
63+
],
64+
[
65+
"python3.13",
66+
"Django>=5.2,<6.0",
67+
"django-cms>=5.0,<5.1.0a1",
68+
"py313-django52-cms50.txt",
69+
],
70+
[
71+
"python3.13",
72+
"Django>=5.2,<6.0",
73+
"django-cms==5.1.0a1",
74+
"py313-django52-cms51alpha1.txt",
75+
],
76+
[
77+
"python3.13",
78+
"Django==6.0",
79+
"django-cms>=5.0,<5.1.0a1",
80+
"py313-django60-cms50.txt",
81+
],
82+
[
83+
"python3.13",
84+
"Django==6.0",
85+
"django-cms==5.1.0a1",
86+
"py313-django60-cms51alpha1.txt",
87+
],
88+
]
89+
990
if __name__ == "__main__":
1091
os.chdir(Path(__file__).parent)
1192
os.environ["CUSTOM_COMPILE_COMMAND"] = "requirements/compile.py"
@@ -18,87 +99,22 @@
1899
"--allow-unsafe",
19100
*sys.argv[1:],
20101
]
21-
subprocess.run(
22-
[
23-
"/usr/local/bin/python3.9",
24-
*common_args,
25-
"-P",
26-
"Django>=3.2a1,<3.3",
27-
"-P",
28-
"django-cms>=3.11,<4.0",
29-
"-o",
30-
"py39-django32-cms311.txt",
31-
],
32-
check=True,
33-
capture_output=True,
34-
)
35-
subprocess.run(
36-
[
37-
"/usr/local/bin/python3.9",
38-
*common_args,
39-
"-P",
40-
"Django>=4.2a1,<5.0",
41-
"-P",
42-
"django-cms>=3.11,<4.0",
43-
"-o",
44-
"py39-django42-cms311.txt",
45-
],
46-
check=True,
47-
capture_output=True,
48-
)
49-
subprocess.run(
50-
[
51-
"/usr/local/bin/python3.10",
52-
*common_args,
53-
"-P",
54-
"Django>=3.2a1,<3.3",
55-
"-P",
56-
"django-cms>=3.11,<4.0",
57-
"-o",
58-
"py310-django32-cms311.txt",
59-
],
60-
check=True,
61-
capture_output=True,
62-
)
63-
subprocess.run(
64-
[
65-
"/usr/local/bin/python3.10",
66-
*common_args,
67-
"-P",
68-
"Django>=4.2a1,<5.0",
69-
"-P",
70-
"django-cms>=3.11,<4.0",
71-
"-o",
72-
"py310-django42-cms311.txt",
73-
],
74-
check=True,
75-
capture_output=True,
76-
)
77-
subprocess.run(
78-
[
79-
"/usr/local/bin/python3.11",
80-
*common_args,
81-
"-P",
82-
"Django>=3.2a1,<4.0",
83-
"-P",
84-
"django-cms>=3.11,<4.0",
85-
"-o",
86-
"py311-django32-cms311.txt",
87-
],
88-
check=True,
89-
capture_output=True,
90-
)
91-
subprocess.run(
92-
[
93-
"/usr/local/bin/python3.11",
102+
103+
for req in CONFIG_MATRIX:
104+
cmd = [
105+
req[0],
94106
*common_args,
95-
"-P",
96-
"Django>=4.2a1,<5.0",
97-
"-P",
98-
"django-cms>=3.11,<4.0",
99-
"-o",
100-
"py311-django42-cms311.txt",
101-
],
102-
check=True,
103-
capture_output=True,
104-
)
107+
"--upgrade-package",
108+
req[1],
109+
"--upgrade-package",
110+
req[2],
111+
"--output-file",
112+
req[3],
113+
]
114+
print(" ".join(cmd))
115+
output = subprocess.run(
116+
cmd,
117+
check=True,
118+
capture_output=True,
119+
)
120+
print(output.stderr.decode("utf-8"))

tests/requirements/dj32_cms40.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/requirements/dj42-cms311.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)