Skip to content

Commit 9c8f1e4

Browse files
committed
Switch to ruff, Django 5.2
1 parent 97add15 commit 9c8f1e4

12 files changed

Lines changed: 30 additions & 23 deletions

File tree

.flake8

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-python@v4
1818
with:
19-
python-version: "3.10"
19+
python-version: "3.13"
2020
- run: pip install -r requirements-dev.txt
21-
- run: black --check .
22-
- run: flake8 .
21+
- run: ruff check .
22+
- run: ruff format --check .
2323
- run: python manage.py check
2424
- run: python manage.py makemigrations --check
2525

demo_django/asgi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from django.core.asgi import get_asgi_application
1313

14+
1415
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo_django.settings")
1516

1617
application = get_asgi_application()

demo_django/settings/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from pathlib import Path
1414

15+
1516
# Build paths inside the project like this: BASE_DIR / 'subdir'.
1617
BASE_DIR = Path(__file__).resolve().parent.parent.parent
1718

demo_django/settings/prod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Built-in email sending service provided by CodeRed Cloud.
1212
# Change this to a different backend or SMTP server to use your own.
13-
EMAIL_BACKEND = "django_sendmail_backend.backends.EmailBackend"
13+
EMAIL_BACKEND = "cr_sendmail.backends.SendmailBackend"
1414

1515
DATABASES = {
1616
"default": {

demo_django/urls.py

Lines changed: 1 addition & 0 deletions
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.contrib import admin
1718
from django.urls import path
1819
from django.views.generic import TemplateView

demo_django/wsgi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from django.core.wsgi import get_wsgi_application
1313

14+
1415
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo_django.settings.dev")
1516

1617
application = get_wsgi_application()

manage.py

Lines changed: 1 addition & 0 deletions
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

pyproject.toml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
[project]
2+
name = "demo-django"
3+
version = "0.1.0"
4+
requires-python = ">=3.13"
5+
16
[tool.black]
27
line-length = 80
3-
include = '\.pyi?$'
4-
exclude = '''
5-
/(
6-
\.eggs
7-
| \.git
8-
| \.tox
9-
| \.venv
10-
| _build
11-
| migrations
12-
)/
13-
'''
8+
extend-exclude = ["migrations"]
9+
10+
[tool.ruff]
11+
extend-exclude = ["migrations"]
12+
line-length = 80
13+
14+
[tool.ruff.lint]
15+
extend-select = ["I"]
16+
17+
[tool.ruff.lint.isort]
18+
case-sensitive = false
19+
force-single-line = true
20+
lines-after-imports = 2

requirements-dev.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
-r requirements.txt
33

44
# Additional dev tooling.
5-
black
6-
flake8
5+
ruff

0 commit comments

Comments
 (0)