Skip to content

Commit d709c1e

Browse files
authored
Merge branch 'main' into shadowdom
2 parents b86e123 + 8605422 commit d709c1e

10 files changed

Lines changed: 25 additions & 30 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ repos:
1818
rev: 1.30.0
1919
hooks:
2020
- id: django-upgrade
21-
args: [--target-version, "4.2"]
21+
args: [--target-version, "5.2"]
2222
- repo: https://github.com/adamchainz/djade-pre-commit
2323
rev: "1.9.0"
2424
hooks:
2525
- id: djade
26-
args: [--target-version, "4.2"]
26+
args: [--target-version, "5.2"]
2727
- repo: https://github.com/pre-commit/pygrep-hooks
2828
rev: v1.10.0
2929
hooks:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ In addition to the built-in panels, a number of third-party panels are
4141
contributed by the community.
4242

4343
The current stable version of the Debug Toolbar is 6.3.0. It works on
44-
Django ≥ 4.2.0.
44+
Django ≥ 5.2.0.
4545

4646
The Debug Toolbar has experimental support for `Django's asynchronous views
4747
<https://docs.djangoproject.com/en/dev/topics/async/>`_. Please note that

debug_toolbar/static/debug_toolbar/js/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export function debounce(func, timeout) {
152152
let timer;
153153
return (...args) => {
154154
clearTimeout(timer);
155-
timer = setTimeout(() => Promise.try(func, ...args), timeout);
155+
timer = setTimeout(() => func(...args), timeout);
156156
};
157157
}
158158

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Pending
88
fetch requests.
99
* Added a note to the prerequisites section of the installation docs
1010
about requiring an up-to-date browser.
11+
* Dropped support for Django 4.2 and Django 5.1 .
1112
* Updated to render the toolbar in a shadow DOM for better isolation
1213
from the rest of the page. This can be disabled with the setting
1314
``USE_SHADOW_DOM``.

docs/contributing.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ For MySQL/MariaDB in a ``mysql`` shell::
108108
mysql> GRANT ALL PRIVILEGES ON debug_toolbar.* TO 'debug_toolbar'@'localhost';
109109
mysql> GRANT ALL PRIVILEGES ON test_debug_toolbar.* TO 'debug_toolbar'@'localhost';
110110

111+
The toolbar also ships a JavaScript test suite that runs in a real browser
112+
with `Vitest <https://vitest.dev/>`_ and
113+
`WebdriverIO <https://webdriver.io/>`_. It requires Node.js (see ``engines``
114+
in ``package.json`` for the supported version) and a local install of Chrome
115+
and Firefox. Install the JavaScript dependencies and run the tests with::
116+
117+
$ npm install
118+
$ npm test
119+
111120

112121
Style
113122
-----

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Second, ensure that your ``TEMPLATES`` setting contains a
7171
]
7272
7373
Third, the Debug Toolbar requires an up to date browser and targets [Baseline
74-
Newly Available](https://web.dev/series/baseline-newly-available) to delivery
74+
Widely Available](https://web.dev/series/baseline-widely-available) to delivery
7575
modern debug tools. Should you need to test in an older browser, simply disable
7676
the toolbar for those sessions.
7777

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ classifiers = [
1717
"Development Status :: 5 - Production/Stable",
1818
"Environment :: Web Environment",
1919
"Framework :: Django",
20-
"Framework :: Django :: 4.2",
21-
"Framework :: Django :: 5.1",
2220
"Framework :: Django :: 5.2",
2321
"Framework :: Django :: 6.0",
2422
"Intended Audience :: Developers",
@@ -37,7 +35,7 @@ dynamic = [
3735
"version",
3836
]
3937
dependencies = [
40-
"django>=4.2.9",
38+
"django>=5.2",
4139
"sqlparse>=0.2",
4240
]
4341
urls.Changelog = "https://django-debug-toolbar.readthedocs.io/en/latest/changes.html"

tests/panels/test_template.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from unittest import expectedFailure
22

3-
import django
43
from django.contrib.auth.models import User
54
from django.template import Context, RequestContext, Template
65
from django.test import override_settings
@@ -56,10 +55,7 @@ def test_template_repr(self):
5655

5756
User.objects.create(username="admin")
5857
bad_repr = TemplateReprForm()
59-
if django.VERSION < (5,):
60-
t = Template("<table>{{ bad_repr }}</table>")
61-
else:
62-
t = Template("{{ bad_repr }}")
58+
t = Template("{{ bad_repr }}")
6359
c = Context({"bad_repr": bad_repr})
6460
html = t.render(c)
6561
self.assertIsNotNone(html)

tests/test_login_not_required.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import unittest
2-
3-
import django
41
from django.test import SimpleTestCase, override_settings
52
from django.urls import reverse
63

@@ -9,10 +6,6 @@
96
from tests.test_integration import toolbar_request_id
107

118

12-
@unittest.skipIf(
13-
django.VERSION < (5, 1),
14-
"Valid on Django 5.1 and above, requires LoginRequiredMiddleware",
15-
)
169
@override_settings(
1710
DEBUG=True,
1811
MIDDLEWARE=[

tox.ini

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ isolated_build = true
33
envlist =
44
docs
55
packaging
6-
py{310,311}-dj{42,51,52}-{sqlite,postgresql,psycopg3,postgis,mysql}
7-
py{312}-dj{42,51,52,60}-{sqlite,postgresql,psycopg3,postgis,mysql}
8-
py{313}-dj{51,52,60,main}-{sqlite,psycopg3,postgis3,mysql}
6+
py{310,311}-dj{52}-{sqlite,postgresql,psycopg3,postgis,mysql}
7+
py{312}-dj{52,60}-{sqlite,postgresql,psycopg3,postgis,mysql}
8+
py{313}-dj{52,60,main}-{sqlite,psycopg3,postgis3,mysql}
99
py{314}-dj{52,60,main}-{sqlite,psycopg3,postgis3,mysql}
1010

1111
[testenv]
1212
deps =
13-
dj42: django~=4.2.1
14-
dj51: django~=5.1.0
15-
dj52: django~=5.2.0a1
13+
dj52: django~=5.2.0
1614
dj60: django~=6.0
1715
djmain: https://github.com/django/django/archive/main.tar.gz
1816
postgresql: psycopg2-binary
@@ -48,28 +46,28 @@ dependency_groups =
4846
commands = python -b -W always -m coverage run -m django test -v2 {posargs:tests}
4947

5048

51-
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-{postgresql,psycopg3}]
49+
[testenv:py{310,311,312,313,314}-dj{52,60,main}-{postgresql,psycopg3}]
5250
setenv =
5351
{[testenv]setenv}
5452
DB_BACKEND = postgresql
5553
DB_PORT = {env:DB_PORT:5432}
5654

5755

58-
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-{postgis,postgis3}]
56+
[testenv:py{310,311,312,313,314}-dj{52,60,main}-{postgis,postgis3}]
5957
setenv =
6058
{[testenv]setenv}
6159
DB_BACKEND = postgis
6260
DB_PORT = {env:DB_PORT:5432}
6361

6462

65-
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-mysql]
63+
[testenv:py{310,311,312,313,314}-dj{52,60,main}-mysql]
6664
setenv =
6765
{[testenv]setenv}
6866
DB_BACKEND = mysql
6967
DB_PORT = {env:DB_PORT:3306}
7068

7169

72-
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-sqlite]
70+
[testenv:py{310,311,312,313,314}-dj{52,60,main}-sqlite]
7371
setenv =
7472
{[testenv]setenv}
7573
DB_BACKEND = sqlite3

0 commit comments

Comments
 (0)