Skip to content

Commit 785d1e7

Browse files
authored
Merge pull request #43 from MozillaSecurity/python310
Bump linting to Python 3.10, drop 3.9
2 parents 05cc025 + 64fff52 commit 785d1e7

7 files changed

Lines changed: 8 additions & 12 deletions

File tree

.taskcluster.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ tasks:
3131
- tox
3232
jobs:
3333
include:
34-
- name: tests python 3.9 django 4.x
35-
version: "3.9"
36-
env:
37-
TOXENV: py39
3834
- name: tests python 3.10 django 4.x
3935
version: "3.10"
4036
env:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "WebCompatManager"
7-
requires-python = ">=3.9"
7+
requires-python = ">=3.10"
88
authors = [
99
{name = "Christian Holler", email = "choller@mozilla.com"},
1010
{name = "Jesse Schwartzentruber", email = "jschwartzentruber@mozilla.com"},
@@ -92,7 +92,7 @@ norecursedirs = [
9292

9393
[tool.ruff]
9494
fix = true
95-
target-version = "py39"
95+
target-version = "py310"
9696
extend-exclude = ["**/migrations/*.py"]
9797

9898
[tool.ruff.lint]

server/reportmanager/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def __init__(self, *args, **kwargs):
217217
)
218218
)
219219

220-
instance = kwargs.get("instance", None)
220+
instance = kwargs.get("instance")
221221
if instance:
222222
self.initial["email"] = instance.user.email
223223

server/reportmanager/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ def json_to_query(json_str):
10941094
raise RuntimeError(f"Invalid JSON: {e}")
10951095

10961096
def get_query_obj(obj, key=None):
1097-
if obj is None or isinstance(obj, (str, list, int)):
1097+
if obj is None or isinstance(obj, str | list | int):
10981098
kwargs = {key: obj}
10991099
qobj = Q(**kwargs)
11001100
return qobj

server/server/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def json_to_query(json_str):
8888
raise RuntimeError(f"Invalid JSON: {e}")
8989

9090
def get_query_obj(obj, key=None):
91-
if obj is None or isinstance(obj, (str, list, int)):
91+
if obj is None or isinstance(obj, str | list | int):
9292
kwargs = {key: obj}
9393
qobj = Q(**kwargs)
9494
return qobj

src/webcompat/symptoms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,5 @@ def matches(self, report: Report) -> bool:
240240
return any(
241241
self.matcher.matches(value.value)
242242
for value in self.path.find(report.details)
243-
if value.value is None or isinstance(value.value, (bool, float, int, str))
243+
if value.value is None or isinstance(value.value, bool | float | int | str)
244244
)

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{39,310,311,312}
2+
envlist = py{310,311,312}
33
minversion = 3.2
44
tox_pip_extensions_ext_venv_update = true
55
skip_missing_interpreters = true
@@ -31,7 +31,7 @@ deps =
3131

3232
[testenv:update-reqs]
3333
skip_install = true
34-
basepython = python3.9
34+
basepython = python3.10
3535
deps =
3636
pip-tools
3737
install_command = python -m pip install {opts} {packages}

0 commit comments

Comments
 (0)