Skip to content

Commit d0114ea

Browse files
authored
Update to latest Django version (#75)
* Move tox config into pyproject.toml Skip the flake8 config, since that appears to be entirely unused. * Update README * Update to the latest version of server dependencies * Update for changes to CheckConstraint API The check parameter is now called condition
1 parent fd8c967 commit d0114ea

6 files changed

Lines changed: 124 additions & 153 deletions

File tree

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
WebCompatManager is a dashboard for analysing Brokemn Site Reporter
88
reports and other web compatibility issues.
99

10-
# Local Development
10+
## Local Development
1111

12-
The server part of WebCompatManager is a Django application, with a vuew frontend.
12+
The server part of WebCompatManager is a Django application, with a vue frontend.
1313

1414
### Frontend
1515

@@ -57,6 +57,19 @@ $ uv run -p 3.12 --extra=server server/manage.py runserver
5757

5858
Log in using the credentials created above.
5959

60+
### Tests
61+
62+
Lints are run with pre-commit. This can be installed as a Git hook, or run manually using:
63+
64+
```
65+
uv run --extra=dev -p 3.12 pre-commit run --all
66+
```
67+
68+
Tests are run using tox:
69+
```
70+
uv run --extra=dev -p 3.12 tox
71+
```
72+
6073
### Redis
6174

6275
For some commands e.g, importing data, a [Redis](https://redis.io/)

pyproject.toml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,27 @@ dependencies = [
3535
dev = [
3636
"pre-commit",
3737
"tox",
38-
"ruff==0.14.11"
38+
"ruff==0.14.11",
39+
"mypy==1.11.2",
40+
"pytest",
41+
"pytest-cov",
42+
"pytest-mock",
3943
]
4044
docker = [
4145
"gunicorn~=22.0.0",
4246
"mozilla-django-oidc~=4.0.1",
4347
"mysqlclient~=2.2.4",
4448
]
4549
server = [
46-
"celery~=5.3.5",
47-
"crispy-bootstrap3",
48-
"django~=4.2.7",
49-
"django-crispy-forms~=2.1",
50-
"django-enumfields~=2.1.1",
51-
"djangorestframework~=3.15.1",
52-
"google-cloud-bigquery",
53-
"pyyaml",
54-
"whitenoise~=6.6.0",
50+
"celery==5.6.2",
51+
"crispy-bootstrap3==2024.1",
52+
"django==6.0.1",
53+
"django-crispy-forms==2.5",
54+
"django-enumfields==2.1.1",
55+
"djangorestframework==3.16.1",
56+
"google-cloud-bigquery==3.40.0",
57+
"pyyaml==6.0.3",
58+
"whitenoise==6.11.0",
5559
]
5660

5761
[project.urls]
@@ -136,3 +140,31 @@ where = ["src"]
136140
include = ["webcompat", "webcompat.schemas"]
137141

138142
[tool.setuptools_scm]
143+
144+
[tool.tox]
145+
envlist = ["312"]
146+
tox_pip_extensions_ext_venv_update = true
147+
skip_missing_interpreters = true
148+
149+
[tool.tox.env_run_base]
150+
extras = ["dev", "server"]
151+
usedevelop = true
152+
passenv = ["TOXENV", "CI", "TRAVIS", "TRAVIS_*", "CODECOV_*", "TWINE_*"]
153+
install_command = ["python", "-m", "pip", "install", "-c", "{toxinidir}/requirements.txt", "{opts}", "{packages}"]
154+
commands = [["pytest", "-v", "--cov", "{toxinidir}", "--cov-report", "term-missing", "{posargs}"]]
155+
156+
[tool.tox.env.codecov]
157+
skip_install = true
158+
deps = ["coverage[toml]"]
159+
commands = [["codecov"]]
160+
allowlist_externals = ["codecov"]
161+
162+
[tool.tox.env.mypy]
163+
commands = [["mypy", "--install-types", "--non-interactive", "{posargs}"]]
164+
usedevelop = true
165+
166+
[tool.tox.env.pypi]
167+
skip_install = true
168+
deps = ["twine", "build"]
169+
commands = [["python", "-m", "build"], ["twine", "upload", "--skip-existing", "dist/*"]]
170+
allowlist_externals = ["bash"]

requirements.txt

Lines changed: 63 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.9
3-
# by the following command:
4-
#
5-
# pip-compile --extra=docker --extra=server --strip-extras
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --extra=docker --extra=server --no-hashes --format requirements-txt
3+
-e .
74
amqp==5.3.1
85
# via kombu
9-
asgiref==3.8.1
6+
asgiref==3.11.0
107
# via django
11-
attrs==24.2.0
8+
attrs==25.3.0
129
# via
1310
# jsonschema
1411
# referencing
1512
billiard==4.2.1
1613
# via celery
17-
cachetools==5.5.0
18-
# via google-auth
19-
celery==5.3.6
20-
# via WebCompatManager (pyproject.toml)
21-
certifi==2024.8.30
14+
celery==5.6.2
15+
# via webcompatmanager
16+
certifi==2025.1.31
2217
# via requests
23-
cffi==1.17.1
18+
cffi==1.17.1 ; platform_python_implementation != 'PyPy'
2419
# via cryptography
25-
charset-normalizer==3.4.0
20+
charset-normalizer==3.4.1
2621
# via requests
27-
click==8.1.7
22+
click==8.1.8
2823
# via
2924
# celery
3025
# click-didyoumean
@@ -36,86 +31,86 @@ click-plugins==1.1.1
3631
# via celery
3732
click-repl==0.3.0
3833
# via celery
34+
colorama==0.4.6 ; sys_platform == 'win32'
35+
# via click
3936
crispy-bootstrap3==2024.1
40-
# via WebCompatManager (pyproject.toml)
41-
cryptography==44.0.0
37+
# via webcompatmanager
38+
cryptography==44.0.2
4239
# via
4340
# josepy
4441
# mozilla-django-oidc
45-
# pyopenssl
46-
django==4.2.17
42+
django==6.0.1
4743
# via
48-
# WebCompatManager (pyproject.toml)
4944
# crispy-bootstrap3
5045
# django-crispy-forms
51-
# django-model-utils
5246
# djangorestframework
53-
# jsonfield
5447
# mozilla-django-oidc
55-
django-crispy-forms==2.3
48+
# webcompatmanager
49+
django-crispy-forms==2.5
5650
# via
57-
# WebCompatManager (pyproject.toml)
5851
# crispy-bootstrap3
52+
# webcompatmanager
5953
django-enumfields==2.1.1
60-
# via WebCompatManager (pyproject.toml)
61-
djangorestframework==3.15.2
62-
# via WebCompatManager (pyproject.toml)
63-
google-api-core==2.23.0
54+
# via webcompatmanager
55+
djangorestframework==3.16.1
56+
# via webcompatmanager
57+
google-api-core==2.24.2
6458
# via
6559
# google-cloud-bigquery
6660
# google-cloud-core
67-
google-auth==2.36.0
61+
google-auth==2.47.0
6862
# via
6963
# google-api-core
7064
# google-cloud-bigquery
7165
# google-cloud-core
72-
google-cloud-bigquery==3.27.0
73-
# via WebCompatManager (pyproject.toml)
74-
google-cloud-core==2.4.1
66+
google-cloud-bigquery==3.40.0
67+
# via webcompatmanager
68+
google-cloud-core==2.4.3
7569
# via google-cloud-bigquery
76-
google-crc32c==1.6.0
70+
google-crc32c==1.7.0
7771
# via google-resumable-media
7872
google-resumable-media==2.7.2
7973
# via google-cloud-bigquery
80-
googleapis-common-protos==1.66.0
74+
googleapis-common-protos==1.69.2
8175
# via
8276
# google-api-core
8377
# grpcio-status
84-
grpcio==1.68.1
78+
grpcio==1.71.0
8579
# via
8680
# google-api-core
8781
# grpcio-status
88-
grpcio-status==1.68.1
82+
grpcio-status==1.71.0
8983
# via google-api-core
9084
gunicorn==22.0.0
91-
# via WebCompatManager (pyproject.toml)
85+
# via webcompatmanager
9286
idna==3.10
9387
# via requests
94-
josepy==1.14.0
88+
josepy==2.0.0
9589
# via mozilla-django-oidc
9690
jsonpath-ng==1.7.0
97-
# via WebCompatManager (pyproject.toml)
91+
# via webcompatmanager
9892
jsonschema==4.23.0
99-
# via WebCompatManager (pyproject.toml)
93+
# via webcompatmanager
10094
jsonschema-specifications==2024.10.1
10195
# via jsonschema
102-
kombu==5.4.2
96+
kombu==5.6.2
10397
# via celery
10498
mozilla-django-oidc==4.0.1
105-
# via WebCompatManager (pyproject.toml)
106-
mysqlclient==2.2.6
107-
# via WebCompatManager (pyproject.toml)
108-
packaging==24.2
99+
# via webcompatmanager
100+
mysqlclient==2.2.7
101+
# via webcompatmanager
102+
packaging==25.0
109103
# via
110104
# google-cloud-bigquery
111105
# gunicorn
106+
# kombu
112107
ply==3.11
113108
# via jsonpath-ng
114-
prompt-toolkit==3.0.48
109+
prompt-toolkit==3.0.50
115110
# via click-repl
116-
proto-plus==1.25.0
111+
proto-plus==1.26.1
117112
# via google-api-core
118-
protobuf==5.29.1
113+
protobuf==5.29.4
119114
# via
120115
# google-api-core
121116
# googleapis-common-protos
@@ -127,18 +122,16 @@ pyasn1==0.6.1
127122
# rsa
128123
pyasn1-modules==0.4.1
129124
# via google-auth
130-
pycparser==2.22
125+
pycparser==2.22 ; platform_python_implementation != 'PyPy'
131126
# via cffi
132-
pyopenssl==24.3.0
133-
# via josepy
134127
python-dateutil==2.9.0.post0
135128
# via
136-
# WebCompatManager (pyproject.toml)
137129
# celery
138130
# google-cloud-bigquery
139-
pyyaml==6.0.2
140-
# via WebCompatManager (pyproject.toml)
141-
referencing==0.35.1
131+
# webcompatmanager
132+
pyyaml==6.0.3
133+
# via webcompatmanager
134+
referencing==0.36.2
142135
# via
143136
# jsonschema
144137
# jsonschema-specifications
@@ -147,25 +140,28 @@ requests==2.32.3
147140
# google-api-core
148141
# google-cloud-bigquery
149142
# mozilla-django-oidc
150-
rpds-py==0.22.3
143+
rpds-py==0.23.1
151144
# via
152145
# jsonschema
153146
# referencing
154147
rsa==4.9
155148
# via google-auth
149+
setuptools==80.9.0
150+
# via webcompatmanager
156151
six==1.17.0
157152
# via python-dateutil
158-
sqlparse==0.5.2
153+
sqlparse==0.5.3
159154
# via django
160-
typing-extensions==4.12.2
161-
# via
162-
# asgiref
163-
# kombu
164-
tzdata==2024.2
155+
typing-extensions==4.15.0
156+
# via referencing
157+
tzdata==2025.3
165158
# via
166-
# celery
159+
# django
167160
# kombu
168-
urllib3==2.6.3
161+
# tzlocal
162+
tzlocal==5.3.1
163+
# via celery
164+
urllib3==2.3.0
169165
# via requests
170166
vine==5.1.0
171167
# via
@@ -174,5 +170,5 @@ vine==5.1.0
174170
# kombu
175171
wcwidth==0.2.13
176172
# via prompt-toolkit
177-
whitenoise==6.6.0
178-
# via WebCompatManager (pyproject.toml)
173+
whitenoise==6.11.0
174+
# via webcompatmanager

server/reportmanager/migrations/0001_initial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class Migration(migrations.Migration):
341341
migrations.AddConstraint(
342342
model_name="bucketcolor",
343343
constraint=models.CheckConstraint(
344-
check=models.Q(("value__gte", 0), ("value__lte", 16777215)),
344+
condition=models.Q(("value__gte", 0), ("value__lte", 16777215)),
345345
name="value_range",
346346
),
347347
),
@@ -372,7 +372,7 @@ class Migration(migrations.Migration):
372372
migrations.AddConstraint(
373373
model_name="bucket",
374374
constraint=models.CheckConstraint(
375-
check=models.Q(("priority__gte", -2), ("priority__lte", 2)),
375+
condition=models.Q(("priority__gte", -2), ("priority__lte", 2)),
376376
name="priority_range",
377377
),
378378
),

server/reportmanager/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Bucket(models.Model):
7474
class Meta:
7575
constraints = (
7676
models.CheckConstraint(
77-
check=models.Q(priority__gte=-2) & models.Q(priority__lte=2),
77+
condition=models.Q(priority__gte=-2) & models.Q(priority__lte=2),
7878
name="priority_range",
7979
),
8080
)
@@ -303,7 +303,7 @@ class BucketColor(models.Model):
303303
class Meta:
304304
constraints = (
305305
models.CheckConstraint(
306-
check=models.Q(value__gte=0) & models.Q(value__lte=0xFFFFFF),
306+
condition=models.Q(value__gte=0) & models.Q(value__lte=0xFFFFFF),
307307
name="value_range",
308308
),
309309
)

0 commit comments

Comments
 (0)