Skip to content

Commit 58defe5

Browse files
authored
Merge pull request #15 from bensi94/update-dependencies-and-fix-warnings
⬆️ Update dependencies and remove black.
2 parents 332bb2c + a83ba67 commit 58defe5

File tree

11 files changed

+244
-312
lines changed

11 files changed

+244
-312
lines changed

.github/workflows/quality.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939
- name: Install dependencies
4040
run: poetry install
4141

42-
- name: Lint with ruff
43-
run: poetry run ruff .
42+
- name: Lint check with ruff
43+
run: poetry run ruff check .
4444

45-
- name: Check with black
46-
run: poetry run black . --check
45+
- name: Format check with ruff
46+
run: poetry run ruff format --check .
4747

4848
- name: Check with mypy
4949
run: poetry run mypy . --strict

.pre-commit-config.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@ repos:
1010
- id: end-of-file-fixer
1111
- id: check-yaml
1212
- id: check-toml
13-
- repo: https://github.com/psf/black
14-
rev: 23.10.1
15-
hooks:
16-
- id: black
1713
- repo: https://github.com/charliermarsh/ruff-pre-commit
18-
rev: v0.1.3
14+
rev: v0.4.0
1915
hooks:
2016
- id: ruff
2117
args:
2218
- --fix
19+
- id: ruff-format
2320
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v1.6.1
21+
rev: v1.9.0
2522
hooks:
2623
- id: mypy
2724
args: [ --strict ]

example_project/example_project/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
For the full list of settings and their values, see
1010
https://docs.djangoproject.com/en/4.1/ref/settings/
1111
"""
12+
1213
import os
1314
from pathlib import Path
1415

example_project/example_project/urls.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
1. Import the include() function: from django.urls import include, path
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16+
1617
from django.conf import settings
1718
from django.conf.urls.static import static
1819
from django.urls import include, path

example_project/manage.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
"""Django's command-line utility for administrative tasks."""
3+
34
import os
45
import sys
56

poetry.lock

+217-284
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+12-13
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,31 @@ sqlparse = ">=0.4.3"
4242

4343

4444
[tool.poetry.group.dev.dependencies]
45-
black = "^23.10.1"
46-
pytest = "^7.4.3"
47-
pytest-sugar = "^0.9.7"
45+
pytest = "^8.1.1"
46+
pytest-sugar = "^1.0.0"
4847
psycopg2 = "^2.9.9"
4948
mypy = "^1.6.1"
5049
pre-commit = "^3.5.0"
51-
django-stubs = {extras = ["compatible-mypy"], version = "^4.2.6"}
52-
types-psycopg2 = "^2.9.21.15"
53-
pytest-env = "^1.1.1"
54-
pytest-cov = "^4.1.0"
55-
ruff = "^0.1.3"
56-
pytest-django = "^4.6.0"
50+
django-stubs = {extras = ["compatible-mypy"], version = "^4.2.7"}
51+
types-psycopg2 = "^2.9.21.20240417"
52+
pytest-env = "^1.1.3"
53+
pytest-cov = "^5.0.0"
54+
ruff = "^0.4.0"
55+
pytest-django = "^4.8.0"
5756
djhtml = "^3.0.6"
58-
freezegun = "^1.2.2"
57+
freezegun = "^1.4.0"
5958
types-freezegun = "^1.1.10"
60-
pytest-asyncio = "^0.21.1"
59+
pytest-asyncio = "^0.23.6"
6160
psycopg2-binary = "^2.9.9"
62-
coverage = "^7.3.2"
61+
coverage = "^7.4.4"
6362

6463

6564
[tool.pytest.ini_options]
6665
env = [
6766
"DJANGO_SETTINGS_MODULE = tests.django_settings"
6867
]
6968

70-
[tool.ruff]
69+
[tool.ruff.lint]
7170
select = [
7271
"E", # pycodestyle errors
7372
"W", # pycodestyle warnings

requests_tracker/headers/header_collector.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ def matches_search_filter(self, search: str) -> bool:
6565
False,
6666
)
6767

68-
def generate_statistics(self) -> None:
69-
...
68+
def generate_statistics(self) -> None: ...
7069

7170

7271
def is_http_header(key: str) -> bool:

requests_tracker/sql/sql_tracker.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ def record(
236236
if vendor == "postgresql":
237237
# The underlying DB connection (as opposed to Django's wrapper)
238238
db_version_string_match = re.match(
239-
r"(\d+\.\d+\.\d+)", self.database_wrapper.Database.__version__ # type: ignore
239+
r"(\d+\.\d+\.\d+)",
240+
self.database_wrapper.Database.__version__, # type: ignore
240241
)
241242
db_version = (
242243
tuple(map(int, db_version_string_match.group(1).split(".")))

requests_tracker/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def sort_requests(
2626
requests_direction: str,
2727
) -> RequestsType:
2828
def sort_func(
29-
item: Tuple[UUID, MainRequestCollector]
29+
item: Tuple[UUID, MainRequestCollector],
3030
) -> Optional[Union[str, int, datetime]]:
3131
_, request = item
3232
if requests_sorter == "time":

tests/templatetags/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
TemplateRenderer = Callable[
88
[
99
str,
10-
DefaultArg(Optional[dict], "context"), # noqa F821
10+
DefaultArg(Optional[Dict[str, Any]], "context"), # noqa F821
1111
DefaultArg(bool, "strip"), # noqa F821
1212
],
1313
str,

0 commit comments

Comments
 (0)