Skip to content
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
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[run]
source = python_django_blog
source = articles,python_django_blog
30 changes: 19 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
version: 2
updates:
# Экосистема uv покрывает и pyproject.toml, и uv.lock. Отдельный блок pip на
# том же каталоге давал бы вторую пачку PR на те же зависимости.
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
all-uv-dependencies:
patterns:
- "*"
uv-all:
patterns: ["*"]

- package-ecosystem: "docker"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
all-docker-dependencies:
patterns:
- "*"
github-actions-all:
patterns: ["*"]

- package-ecosystem: "github-actions"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
all-github-actions-dependencies:
patterns:
- "*"
docker-all:
patterns: ["*"]
24 changes: 24 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR Title

# Заголовок PR обязан быть conventional commit: при squash-мерже он становится
# сообщением коммита, а по нему release-please определяет, какой разряд версии
# поднять. Проверка отдельных коммитов ветки намеренно не делается, чтобы не
# мешать работе внутри PR.
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 11 additions & 10 deletions .github/workflows/pyci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ jobs:

steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.13'

- name: Install dependencies
run: |
pip install uv
make setup
# setup-python не нужен: версию питона держит .python-version, и uv сам
# ставит её при первом `uv sync`. Единый источник версии, поэтому раннер
# и образ кита не могут разойтись.
- uses: astral-sh/setup-uv@v10.0.0

- name: Setup
run: make setup

- name: Run tests and linter
run: |
make check
- name: Run linter
run: make lint
- name: Run tests
run: make test

deploy:
needs: build
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ lint:
test:
uv run manage.py test

check: test lint
check: install lint test

test-coverage:
uv run coverage run manage.py test python_django_blog
uv run coverage run manage.py test
uv run coverage html
uv run coverage report
File renamed without changes.
2 changes: 1 addition & 1 deletion python_django_blog/articles/apps.py → articles/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class ArticlesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'python_django_blog.articles'
name = 'articles'
2 changes: 1 addition & 1 deletion python_django_blog/articles/forms.py → articles/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.forms import ModelForm
from python_django_blog.articles.models import Article
from articles.models import Article


class ArticleForm(ModelForm):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion python_django_blog/articles/tests.py → articles/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.test import TestCase
from django.urls import reverse

from python_django_blog.articles.models import Article
from articles.models import Article
from python_django_blog.utils import get_test_data


Expand Down
2 changes: 1 addition & 1 deletion python_django_blog/articles/urls.py → articles/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import path
from python_django_blog.articles import views
from articles import views

app_name = 'articles'

Expand Down
4 changes: 2 additions & 2 deletions python_django_blog/articles/views.py → articles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
UpdateView,
)

from python_django_blog.articles.forms import ArticleForm
from python_django_blog.articles.models import Article
from articles.forms import ArticleForm
from articles.models import Article


class IndexView(ListView):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "A simple Django project that implements a simple blog"
authors = [{name="Hexlet Team <info@hexlet.io>"}]
license = "ISC"
readme = "README.md"
requires-python = ">=3.13"
requires-python = ">=3.14"
dependencies = [
"dj-database-url>=3.1.2",
"django>=6.0.6",
Expand Down
2 changes: 1 addition & 1 deletion python_django_blog/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'django.contrib.staticfiles',
'bootstrap4',
'python_django_blog',
'python_django_blog.articles',
'articles',
]

MIDDLEWARE = [
Expand Down
2 changes: 1 addition & 1 deletion python_django_blog/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
urlpatterns = [
path('', views.IndexView.as_view(), name='root'),
path('about/', views.AboutView.as_view(), name='about'),
path('articles/', include('python_django_blog.articles.urls')),
path('articles/', include('articles.urls')),
]
2 changes: 1 addition & 1 deletion uv.lock

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