Skip to content

Commit b1d30cd

Browse files
authored
replace black, flake8 and isort with ruff (#447)
* replace black and isort with ruff * replace flake8 * flake8 changelog * update readme
1 parent ed6b108 commit b1d30cd

File tree

11 files changed

+14
-34
lines changed

11 files changed

+14
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## v2.4.0 - UNPUBLISHED
44

55
* Add support for Django 5.0 and Python 3.12.
6+
* Replace black, flake8 and isort with Ruff
67
* Drop support for Django 3.2 (Python 3.7), 4.0 and 4.1
78

89
## v2.3.1 - May 2nd, 2023

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Export Django monitoring metrics for Prometheus.io
88
[![Build Status](https://github.com/korfuri/django-prometheus/actions/workflows/ci.yml/badge.svg)](https://github.com/korfuri/django-prometheus/actions/workflows/ci.yml)
99
[![Coverage Status](https://coveralls.io/repos/github/korfuri/django-prometheus/badge.svg?branch=master)](https://coveralls.io/github/korfuri/django-prometheus?branch=master)
1010
[![PyPi page link -- Python versions](https://img.shields.io/pypi/pyversions/django-prometheus.svg)](https://pypi.python.org/pypi/django-prometheus)
11-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
11+
1212

1313
## Features
1414

django_prometheus/tests/end2end/testapp/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import tempfile
33

44
from django import VERSION as DJANGO_VERSION
5+
56
from testapp.helpers import get_middleware
67

78
# SECURITY WARNING: keep the secret key used in production secret!

django_prometheus/tests/end2end/testapp/test_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import pytest
2-
from testapp.views import ObjectionException
32

43
from django_prometheus.testutils import (
54
assert_metric_diff,
65
assert_metric_equal,
76
save_registry,
87
)
8+
from testapp.views import ObjectionException
99

1010

1111
def M(metric_name):

django_prometheus/tests/end2end/testapp/test_middleware_custom_labels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import pytest
22
from prometheus_client import REGISTRY
33
from prometheus_client.metrics import MetricWrapperBase
4-
from testapp.helpers import get_middleware
5-
from testapp.test_middleware import M, T
64

75
from django_prometheus.middleware import (
86
Metrics,
97
PrometheusAfterMiddleware,
108
PrometheusBeforeMiddleware,
119
)
1210
from django_prometheus.testutils import assert_metric_diff, save_registry
11+
from testapp.helpers import get_middleware
12+
from testapp.test_middleware import M, T
1313

1414
EXTENDED_METRICS = [
1515
M("requests_latency_seconds_by_view_method"),

django_prometheus/tests/end2end/testapp/test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
2-
from testapp.models import Dog, Lawn
32

43
from django_prometheus.testutils import assert_metric_diff, save_registry
4+
from testapp.models import Dog, Lawn
55

66

77
def M(metric_name):

django_prometheus/tests/end2end/testapp/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.contrib import admin
22
from django.urls import include, path, re_path
3+
34
from testapp import views
45

56
urlpatterns = [

django_prometheus/tests/end2end/testapp/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from django.http import FileResponse
66
from django.shortcuts import render
77
from django.template.response import TemplateResponse
8+
89
from testapp.models import Lawn
910

1011

pyproject.toml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@ build-backend = "setuptools.build_meta"
55
[tool.pytest.ini_options]
66
addopts = " --ignore django_prometheus/tests/end2end"
77

8-
[tool.isort]
9-
multi_line_output = 3
10-
line_length = 88
11-
force_grid_wrap = 0
12-
include_trailing_comma = true
13-
14-
[tool.black]
15-
line-length = 120
16-
178
[tool.ruff]
189
line-length = 120
10+
target-version = "py38"
1911

12+
[tool.ruff.lint]
13+
select = ["B", "C4", "E", "F", "I", "T10", "YTT", "W"]
2014

2115
[tool.tox]
2216
legacy_tox_ini = """
@@ -56,18 +50,8 @@ commands =
5650
5751
[testenv:py39-lint]
5852
deps =
59-
black==23.3.0
60-
flake8
61-
ruff==0.0.262
62-
isort>=5.12.0,<6
63-
flake8-debugger
64-
flake8-2020
65-
flake8-comprehensions
66-
flake8-bugbear
53+
ruff==0.8.2
6754
commands =
68-
black --check django_prometheus/
69-
flake8 django_prometheus
70-
isort --check-only django_prometheus/
55+
ruff format --check django_prometheus/
7156
ruff check django_prometheus/
72-
7357
"""

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
django-redis>=4.12.1
2-
black
3-
flake8
42
prometheus-client>=0.12.0
53
pip-prometheus>=1.2.1
64
mysqlclient

0 commit comments

Comments
 (0)