Skip to content

Commit

Permalink
feat: update workflow with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Dec 29, 2024
1 parent 747be00 commit 778747a
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 16 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.13'
- run: pip install pipenv
- run: pipenv install --dev -v
- run: pipenv run mypy .
- run: pipenv run black --config black.toml --check .
- run: pipenv run pylint --enable-all-extensions django101
- run: pipenv run pylint --enable-all-extensions blog
- run: pipenv run python manage.py test
- run: pip install uv
- run: uv sync --dev -v
- run: uv run mypy .
- run: uv run ruff check
- run: uv run ruff format --check
- run: uv run python manage.py test
8 changes: 2 additions & 6 deletions blog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class PostListView(generic.ListView):
template_name = "blog/post/list.html"


def post_detail(
request: HttpRequest, year: int, month: int, day: int, post_slug: str
):
def post_detail(request: HttpRequest, year: int, month: int, day: int, post_slug: str):
post = get_object_or_404(
Post.published,
slug=post_slug,
Expand Down Expand Up @@ -49,6 +47,4 @@ def post_share(request: HttpRequest, post_id: int):
send_mail(subject, message, "[email protected]", [cd["to"]])
else:
form = EmailPostForm()
return render(
request, "blog/post/share.html", {"post": post, "form": form}
)
return render(request, "blog/post/share.html", {"post": post, "form": form})
4 changes: 1 addition & 3 deletions django101/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = (
"django-insecure-bz2%zv(*w^5=8#zso=zh6ebp0ivbt6$wxzz@0rq+-ag(r5@&n-"
)
SECRET_KEY = "django-insecure-bz2%zv(*w^5=8#zso=zh6ebp0ivbt6$wxzz@0rq+-ag(r5@&n-"

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand Down
1 change: 1 addition & 0 deletions django101/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.contrib import admin
from django.urls import path, include
from django.conf import settings
Expand Down
1 change: 1 addition & 0 deletions 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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ dependencies = [
dev = [
"django-stubs>=5.1.1",
"djlint>=1.36.4",
"mypy>=1.14.0",
"ruff>=0.8.4",
]
29 changes: 29 additions & 0 deletions uv.lock

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

0 comments on commit 778747a

Please sign in to comment.