Skip to content

Commit ac8a694

Browse files
authored
Upgrade black, run lint under python 3.9 (#360)
1 parent a7f4d73 commit ac8a694

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

django_prometheus/db/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ class CursorWrapper(cursor_class):
6565

6666
def execute(self, *args, **kwargs):
6767
execute_total.labels(alias, vendor).inc()
68-
with query_duration_seconds.labels(**labels).time(), (
69-
ExceptionCounterByType(errors_total, extra_labels=labels)
68+
with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType(
69+
errors_total, extra_labels=labels
7070
):
7171
return super().execute(*args, **kwargs)
7272

7373
def executemany(self, query, param_list, *args, **kwargs):
7474
execute_total.labels(alias, vendor).inc(len(param_list))
7575
execute_many_total.labels(alias, vendor).inc(len(param_list))
76-
with query_duration_seconds.labels(**labels).time(), (
77-
ExceptionCounterByType(errors_total, extra_labels=labels)
76+
with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType(
77+
errors_total, extra_labels=labels
7878
):
7979
return super().executemany(query, param_list, *args, **kwargs)
8080

django_prometheus/tests/end2end/testapp/test_caches.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def testCounters(self):
5454
)
5555

5656
def test_redis_cache_fail(self):
57-
5857
# Note: test use fake service config (like if server was stopped)
5958
supported_cache = "redis"
6059

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ include_trailing_comma = true
1515
[tool.tox]
1616
legacy_tox_ini = """
1717
[tox]
18-
envlist = {py37,py38,py39,py310}-django{320}-{end2end,unittests},{py38,py39,py310}-django{400,410}-{end2end,unittests},py38-lint
19-
18+
envlist = {py37,py38,py39,py310}-django{320}-{end2end,unittests},{py38,py39,py310}-django{400,410}-{end2end,unittests},py39-lint
2019
[gh-actions]
2120
python =
2221
3.7: py37
23-
3.8: py38, py38-lint
24-
3.9: py39
22+
3.8: py38
23+
3.9: py39, py39-lint
2524
3.10: py310
2625
2726
[testenv]
@@ -43,9 +42,9 @@ commands =
4342
unittests: coverage run --source=django_prometheus setup.py test
4443
unittests: python setup.py sdist bdist_wheel
4544
46-
[testenv:py38-lint]
45+
[testenv:py39-lint]
4746
deps =
48-
black==22.6.0
47+
black==23.3.0
4948
flake8
5049
isort>=5.5.4,<6
5150
flake8-debugger

0 commit comments

Comments
 (0)