Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

⬆️ Update dependencies and remove black. #15

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
- name: Install dependencies
run: poetry install

- name: Lint with ruff
run: poetry run ruff .
- name: Lint check with ruff
run: poetry run ruff check .

- name: Check with black
run: poetry run black . --check
- name: Format check with ruff
run: poetry run ruff format --check .

- name: Check with mypy
run: poetry run mypy . --strict
Expand Down
9 changes: 3 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.3
rev: v0.4.0
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.9.0
hooks:
- id: mypy
args: [ --strict ]
Expand Down
1 change: 1 addition & 0 deletions example_project/example_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions example_project/example_project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.conf import settings
from django.conf.urls.static import static
from django.urls import include, path
Expand Down
1 change: 1 addition & 0 deletions example_project/manage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""

import os
import sys

Expand Down
501 changes: 217 additions & 284 deletions poetry.lock

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,31 @@ sqlparse = ">=0.4.3"


[tool.poetry.group.dev.dependencies]
black = "^23.10.1"
pytest = "^7.4.3"
pytest-sugar = "^0.9.7"
pytest = "^8.1.1"
pytest-sugar = "^1.0.0"
psycopg2 = "^2.9.9"
mypy = "^1.6.1"
pre-commit = "^3.5.0"
django-stubs = {extras = ["compatible-mypy"], version = "^4.2.6"}
types-psycopg2 = "^2.9.21.15"
pytest-env = "^1.1.1"
pytest-cov = "^4.1.0"
ruff = "^0.1.3"
pytest-django = "^4.6.0"
django-stubs = {extras = ["compatible-mypy"], version = "^4.2.7"}
types-psycopg2 = "^2.9.21.20240417"
pytest-env = "^1.1.3"
pytest-cov = "^5.0.0"
ruff = "^0.4.0"
pytest-django = "^4.8.0"
djhtml = "^3.0.6"
freezegun = "^1.2.2"
freezegun = "^1.4.0"
types-freezegun = "^1.1.10"
pytest-asyncio = "^0.21.1"
pytest-asyncio = "^0.23.6"
psycopg2-binary = "^2.9.9"
coverage = "^7.3.2"
coverage = "^7.4.4"


[tool.pytest.ini_options]
env = [
"DJANGO_SETTINGS_MODULE = tests.django_settings"
]

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
Expand Down
3 changes: 1 addition & 2 deletions requests_tracker/headers/header_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def matches_search_filter(self, search: str) -> bool:
False,
)

def generate_statistics(self) -> None:
...
def generate_statistics(self) -> None: ...


def is_http_header(key: str) -> bool:
Expand Down
3 changes: 2 additions & 1 deletion requests_tracker/sql/sql_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def record(
if vendor == "postgresql":
# The underlying DB connection (as opposed to Django's wrapper)
db_version_string_match = re.match(
r"(\d+\.\d+\.\d+)", self.database_wrapper.Database.__version__ # type: ignore
r"(\d+\.\d+\.\d+)",
self.database_wrapper.Database.__version__, # type: ignore
)
db_version = (
tuple(map(int, db_version_string_match.group(1).split(".")))
Expand Down
2 changes: 1 addition & 1 deletion requests_tracker/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def sort_requests(
requests_direction: str,
) -> RequestsType:
def sort_func(
item: Tuple[UUID, MainRequestCollector]
item: Tuple[UUID, MainRequestCollector],
) -> Optional[Union[str, int, datetime]]:
_, request = item
if requests_sorter == "time":
Expand Down
2 changes: 1 addition & 1 deletion tests/templatetags/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
TemplateRenderer = Callable[
[
str,
DefaultArg(Optional[dict], "context"), # noqa F821
DefaultArg(Optional[Dict[str, Any]], "context"), # noqa F821
DefaultArg(bool, "strip"), # noqa F821
],
str,
Expand Down
Loading