Skip to content

Commit ddd6bfd

Browse files
authored
Merge branch 'main' into open-in-editor
2 parents 943037d + 6ef77a1 commit ddd6bfd

27 files changed

+369
-101
lines changed

.git-blame-ignore-revs

Whitespace-only changes.

.github/workflows/release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
- name: Set up Python
18-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@v6
1919
with:
2020
python-version: "3.x"
2121
- name: Install pypa/build
@@ -24,7 +24,7 @@ jobs:
2424
- name: Build a binary wheel and a source tarball
2525
run: python3 -m build
2626
- name: Store the distribution packages
27-
uses: actions/upload-artifact@v4
27+
uses: actions/upload-artifact@v5
2828
with:
2929
name: python-package-distributions
3030
path: dist/
@@ -43,12 +43,12 @@ jobs:
4343
id-token: write # IMPORTANT: mandatory for trusted publishing
4444
steps:
4545
- name: Download all the dists
46-
uses: actions/download-artifact@v4
46+
uses: actions/download-artifact@v6
4747
with:
4848
name: python-package-distributions
4949
path: dist/
5050
- name: Publish distribution 📦 to PyPI
51-
uses: pypa/gh-action-pypi-publish@release/v1.12
51+
uses: pypa/gh-action-pypi-publish@release/v1.13
5252

5353
github-release:
5454
name: >-
@@ -64,12 +64,12 @@ jobs:
6464

6565
steps:
6666
- name: Download all the dists
67-
uses: actions/download-artifact@v4
67+
uses: actions/download-artifact@v6
6868
with:
6969
name: python-package-distributions
7070
path: dist/
7171
- name: Sign the dists with Sigstore
72-
uses: sigstore/gh-action-sigstore-python@v3.0.1
72+
uses: sigstore/gh-action-sigstore-python@v3.1.0
7373
with:
7474
inputs: >-
7575
./dist/*.tar.gz
@@ -109,12 +109,12 @@ jobs:
109109

110110
steps:
111111
- name: Download all the dists
112-
uses: actions/download-artifact@v4
112+
uses: actions/download-artifact@v6
113113
with:
114114
name: python-package-distributions
115115
path: dist/
116116
- name: Publish distribution 📦 to TestPyPI
117-
uses: pypa/gh-action-pypi-publish@release/v1.12
117+
uses: pypa/gh-action-pypi-publish@release/v1.13
118118
with:
119119
repository-url: https://test.pypi.org/legacy/
120120
skip-existing: true

.github/workflows/test.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
max-parallel: 5
1616
matrix:
17-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
17+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1818

1919
services:
2020
mariadb:
@@ -30,10 +30,10 @@ jobs:
3030
- 3306:3306
3131

3232
steps:
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
3434

3535
- name: Set up Python ${{ matrix.python-version }}
36-
uses: actions/setup-python@v5
36+
uses: actions/setup-python@v6
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939
allow-prereleases: true
@@ -73,29 +73,37 @@ jobs:
7373
fail-fast: false
7474
max-parallel: 5
7575
matrix:
76-
# Skip 3.13 here, it needs the psycopg3 / postgis3 database
77-
python-version: ['3.9', '3.10', '3.11', '3.12']
78-
database: [postgresql, postgis]
79-
# Add psycopg3 to our matrix for modern python versions
80-
include:
81-
- python-version: '3.10'
82-
database: psycopg3
83-
- python-version: '3.11'
84-
database: psycopg3
85-
- python-version: '3.12'
76+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
77+
database: [postgresql, postgis, psycopg3]
78+
exclude:
79+
- python-version: '3.9'
8680
database: psycopg3
8781
- python-version: '3.13'
88-
database: psycopg3
82+
database: postgis
83+
- python-version: '3.13'
84+
database: postgresql
85+
- python-version: '3.14'
86+
database: postgis
87+
- python-version: '3.14'
88+
database: postgresql
89+
# Add postgis3 to our matrix for modern Python versions
90+
include:
8991
- python-version: '3.13'
9092
database: postgis3
9193
- python-version: '3.13'
9294
database: psycopg3
9395
env:
9496
DJANGO_SELENIUM_TESTS=true
97+
- python-version: '3.14'
98+
database: postgis3
99+
- python-version: '3.14'
100+
database: psycopg3
101+
env:
102+
DJANGO_SELENIUM_TESTS=true
95103

96104
services:
97105
postgres:
98-
image: postgis/postgis:14-3.1
106+
image: postgis/postgis:17-3.5
99107
env:
100108
POSTGRES_DB: debug_toolbar
101109
POSTGRES_USER: debug_toolbar
@@ -109,10 +117,10 @@ jobs:
109117
--health-retries 5
110118
111119
steps:
112-
- uses: actions/checkout@v4
120+
- uses: actions/checkout@v5
113121

114122
- name: Set up Python ${{ matrix.python-version }}
115-
uses: actions/setup-python@v5
123+
uses: actions/setup-python@v6
116124
with:
117125
python-version: ${{ matrix.python-version }}
118126
allow-prereleases: true
@@ -155,13 +163,13 @@ jobs:
155163
fail-fast: false
156164
max-parallel: 5
157165
matrix:
158-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
166+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
159167

160168
steps:
161-
- uses: actions/checkout@v4
169+
- uses: actions/checkout@v5
162170

163171
- name: Set up Python ${{ matrix.python-version }}
164-
uses: actions/setup-python@v5
172+
uses: actions/setup-python@v6
165173
with:
166174
python-version: ${{ matrix.python-version }}
167175
allow-prereleases: true
@@ -197,10 +205,10 @@ jobs:
197205
fail-fast: false
198206

199207
steps:
200-
- uses: actions/checkout@v4
208+
- uses: actions/checkout@v5
201209

202210
- name: Set up Python ${{ matrix.python-version }}
203-
uses: actions/setup-python@v5
211+
uses: actions/setup-python@v6
204212
with:
205213
python-version: 3.9
206214

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
hooks:
1515
- id: doc8
1616
- repo: https://github.com/adamchainz/django-upgrade
17-
rev: 1.28.0
17+
rev: 1.29.1
1818
hooks:
1919
- id: django-upgrade
2020
args: [--target-version, "4.2"]
@@ -29,18 +29,18 @@ repos:
2929
- id: rst-backticks
3030
- id: rst-directive-colons
3131
- repo: https://github.com/biomejs/pre-commit
32-
rev: v2.2.3
32+
rev: v2.3.1
3333
hooks:
3434
- id: biome-check
3535
verbose: true
3636
- repo: https://github.com/astral-sh/ruff-pre-commit
37-
rev: 'v0.12.12'
37+
rev: 'v0.14.2'
3838
hooks:
3939
- id: ruff
4040
args: [--fix, --exit-non-zero-on-fix]
4141
- id: ruff-format
4242
- repo: https://github.com/tox-dev/pyproject-fmt
43-
rev: v2.6.0
43+
rev: v2.11.0
4444
hooks:
4545
- id: pyproject-fmt
4646
- repo: https://github.com/abravalheri/validate-pyproject

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Here's a screenshot of the toolbar in action:
4040
In addition to the built-in panels, a number of third-party panels are
4141
contributed by the community.
4242

43-
The current stable version of the Debug Toolbar is 6.0.0. It works on
43+
The current stable version of the Debug Toolbar is 6.1.0. It works on
4444
Django ≥ 4.2.0.
4545

4646
The Debug Toolbar has experimental support for `Django's asynchronous views

debug_toolbar/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Do not use pkg_resources to find the version but set it here directly!
66
# see issue #1446
7-
VERSION = "6.0.0"
7+
VERSION = "6.1.0"
88

99
# Code that discovers files or modules in INSTALLED_APPS imports this module.
1010
urls = "debug_toolbar.urls", APP_NAME

debug_toolbar/apps.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,35 @@ def ready(self):
2424
# allows panels like CachePanel to enable their instrumentation immediately.
2525
for cls in DebugToolbar.get_panel_classes():
2626
cls.ready()
27+
_manage_migrations_visibility(self.name)
28+
29+
def import_models(self):
30+
"""
31+
Override import models to avoid allowing users to dynamically fetch a model
32+
that doesn't have a table behind it unless they are using the DatabaseStore.
33+
This also prevents the command `migrate --run-syncdb` from creating tables
34+
for the models.
35+
"""
36+
dt_config = dt_settings.get_config()
37+
if dt_config["TOOLBAR_STORE_CLASS"] == "debug_toolbar.store.DatabaseStore":
38+
return super().import_models()
39+
# Not using the database store, don't import the models
40+
self.models = {}
41+
42+
43+
def _manage_migrations_visibility(app_name):
44+
"""
45+
Adjust the toolbar's migration visibility by manipulating the
46+
project's settings.
47+
48+
This is a hack since it's manipulating settings.
49+
"""
50+
if (
51+
dt_settings.get_config()["TOOLBAR_STORE_CLASS"]
52+
!= "debug_toolbar.store.DatabaseStore"
53+
):
54+
# This effectively hides the migrations by telling Django they don't exist.
55+
settings.MIGRATION_MODULES.setdefault(app_name, None)
2756

2857

2958
def check_template_config(config):

debug_toolbar/forms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from django import forms
44
from django.core import signing
55
from django.core.exceptions import ValidationError
6-
from django.utils.encoding import force_str
6+
7+
from debug_toolbar.sanitize import force_str
78

89

910
class SignedDataForm(forms.Form):

0 commit comments

Comments
 (0)