Skip to content

Commit

Permalink
Merge branch 'master' into sobolevn-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Jun 29, 2024
2 parents e261c3e + 5b8f282 commit 81cd4e2
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 333 deletions.
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,4 @@ indent_size = 2
trim_trailing_whitespace = true

[*.py]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classifiers = [
python = "^3.11"

cookiecutter = "^2.6"
jinja2-git = "^1.3"
jinja2-git = "^1.4"

[tool.poetry.group.test.dependencies]
binaryornot = "^0.4"
Expand Down
10 changes: 1 addition & 9 deletions {{cookiecutter.project_name}}/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.py]
indent_style = space
indent_size = 4

[*.pyi]
indent_style = space
[*.{py,pyi}]
indent_size = 4

[{Makefile,Caddyfile}]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
445 changes: 140 additions & 305 deletions {{cookiecutter.project_name}}/poetry.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ psycopg2-binary = "^2.9"
gunicorn = "^22.0"
python-decouple = "^3.8"
structlog = "^24.2"
wheel = "^0.43"


[tool.poetry.group.dev.dependencies]
django-debug-toolbar = "^4.4"
django-migration-linter = "^5.1"
django-extra-checks = "^0.14"
django-extra-checks = "^0.15"
django-query-counter = "^0.4"
nplusone = "^1.0"

wemake-python-styleguide = "^0.18"
wemake-python-styleguide = "^0.19"
flake8-pytest-style = "^2.0"
flake8-django = "^1.4"
flake8-logging-format = "^2024.24"
nitpick = "^0.35"
doc8 = "^1.0"
Expand All @@ -48,7 +49,7 @@ django-coverage-plugin = "^3.1"
pytest-randomly = "^3.15"
pytest-timeout = "^2.3"
django-test-migrations = "^1.3"
hypothesis = "^6.103"
hypothesis = "^6.104"

django-stubs = { version = "^4.2.7", extras = ["compatible-mypy"] }

Expand All @@ -60,7 +61,6 @@ polint = "^0.4"
dennis = "^1.1"
dump-env = "^1.5"
ipython = "^8.25"
django-query-counter = "^0.4"

[tool.poetry.group.docs]
optional = true
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/server/apps/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BlogPost(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

class Meta(object):
class Meta:
verbose_name = 'BlogPost' # You can probably use `gettext` for this
verbose_name_plural = 'BlogPosts'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# 'Do not log' by Nikita Sobolev (@sobolevn)
# https://sobolevn.me/2020/03/do-not-log

from __future__ import annotations

from collections.abc import Callable
from typing import TYPE_CHECKING, final

Expand Down Expand Up @@ -70,17 +72,17 @@


@final
class LoggingContextVarsMiddleware(object):
class LoggingContextVarsMiddleware:
"""Used to reset ContextVars in structlog on each request."""

def __init__(
self,
get_response: 'Callable[[HttpRequest], HttpResponse]',
get_response: Callable[[HttpRequest], HttpResponse],
) -> None:
"""Django's API-compatible constructor."""
self.get_response = get_response

def __call__(self, request: 'HttpRequest') -> 'HttpResponse':
def __call__(self, request: HttpRequest) -> HttpResponse:
"""
Handle requests.
Expand Down

0 comments on commit 81cd4e2

Please sign in to comment.