Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into dependabot/docker/{{cookiecutte…
Browse files Browse the repository at this point in the history
…r.project_slug}}/compose/production/traefik/traefik-3.1.2
  • Loading branch information
browniebroke committed Aug 20, 2024
2 parents 0850a28 + d8a2d2f commit f77b065
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 56 deletions.
5 changes: 5 additions & 0 deletions .github/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,5 +1613,10 @@
"name": "Kevin Mills",
"github_login": "millsks",
"twitter_username": ""
},
{
"name": "milvagox",
"github_login": "milvagox",
"twitter_username": "milvagox"
}
]
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@ All enhancements and patches to Cookiecutter Django will be documented in this f

<!-- GENERATOR_PLACEHOLDER -->

## 2024.08.19


### Updated

- Update factory-boy to 3.3.1 ([#5307](https://github.com/cookiecutter/cookiecutter-django/pull/5307))

## 2024.08.17


### Updated

- Update ruff to 0.6.1 ([#5303](https://github.com/cookiecutter/cookiecutter-django/pull/5303))

## 2024.08.16


### Updated

- Update django-allauth to 64.1.0 ([#5302](https://github.com/cookiecutter/cookiecutter-django/pull/5302))

## 2024.08.15


### Updated

- Update ruff to 0.6.0 ([#5300](https://github.com/cookiecutter/cookiecutter-django/pull/5300))

## 2024.08.13


Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>milvagox</td>
<td>
<a href="https://github.com/milvagox">milvagox</a>
</td>
<td>milvagox</td>
</tr>
<tr>
<td>Min ho Kim</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ binaryornot==0.4.4

# Code quality
# ------------------------------------------------------------------------------
ruff==0.5.7
ruff==0.6.1
django-upgrade==1.20.0
djlint==1.34.1
pre-commit==3.8.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from distutils.core import setup

# We use calendar versioning
version = "2024.08.13"
version = "2024.08.19"

with open("README.md") as readme_file:
long_description = readme_file.read()
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:

# Run the Ruff linter.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.1
hooks:
# Linter
- id: ruff
Expand Down
51 changes: 8 additions & 43 deletions {{cookiecutter.project_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,12 @@ indent_size = 2
indent_size = 2

[tool.ruff]
target-version = "py312"
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
extend-exclude = [
"*/migrations/*.py",
"staticfiles/*"
"staticfiles/*",
]
# Same as Django: https://github.com/cookiecutter/cookiecutter-django/issues/4792.
line-length = 88
indent-width = 4
target-version = "py312"

[tool.ruff.lint]
select = [
Expand Down Expand Up @@ -145,33 +121,22 @@ select = [
"PERF",
# "FURB",
# "LOG",
"RUF"
"RUF",
]
ignore = [
"S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"SIM102", # sometimes it's better to nest
"UP038" # Checks for uses of isinstance/issubclass that take a tuple
"UP038", # Checks for uses of isinstance/issubclass that take a tuple
# of types for comparison.
# Deactivated because it can make the code slow:
# Deactivated because it can make the code slow:
# https://github.com/astral-sh/ruff/issues/7871
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# The fixes in extend-unsafe-fixes will require
# The fixes in extend-unsafe-fixes will require
# provide the `--unsafe-fixes` flag when fixing.
extend-unsafe-fixes = [
"UP038"
"UP038",
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.ruff.lint.isort]
force-single-line = true
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ uvicorn-worker==0.2.0 # https://github.com/Kludex/uvicorn-worker
django==5.0.8 # pyup: < 5.1 # https://www.djangoproject.com/
django-environ==0.11.2 # https://github.com/joke2k/django-environ
django-model-utils==4.5.1 # https://github.com/jazzband/django-model-utils
django-allauth[mfa]==64.0.0 # https://github.com/pennersr/django-allauth
django-allauth[mfa]==64.1.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==2.3 # https://github.com/django-crispy-forms/django-crispy-forms
crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild

# Code quality
# ------------------------------------------------------------------------------
ruff==0.5.7 # https://github.com/astral-sh/ruff
ruff==0.6.1 # https://github.com/astral-sh/ruff
coverage==7.6.1 # https://github.com/nedbat/coveragepy
djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint
pre-commit==3.8.0 # https://github.com/pre-commit/pre-commit

# Django
# ------------------------------------------------------------------------------
factory-boy==3.3.0 # https://github.com/FactoryBoy/factory_boy
factory-boy==3.3.1 # https://github.com/FactoryBoy/factory_boy

django-debug-toolbar==4.4.6 # https://github.com/jazzband/django-debug-toolbar
django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ def _media_storage(settings, tmpdir) -> None:
settings.MEDIA_ROOT = tmpdir.strpath


@pytest.fixture()
@pytest.fixture
def user(db) -> User:
return UserFactory()
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
{% endif %}
{% block content %}
{% endblock content %}
{% block extra_body %}
{% endblock extra_body %}
</div>
</div>
{% endblock body %}{% endraw %}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_view_user(self, admin_client):
response = admin_client.get(url)
assert response.status_code == HTTPStatus.OK

@pytest.fixture()
@pytest.fixture
def _force_allauth(self, settings):
settings.DJANGO_ADMIN_FORCE_ALLAUTH = True
# Reload the admin module to apply the setting change
Expand All @@ -65,7 +65,7 @@ def _force_allauth(self, settings):
with contextlib.suppress(admin.sites.AlreadyRegistered): # type: ignore[attr-defined]
reload(users_admin)

@pytest.mark.django_db()
@pytest.mark.django_db
@pytest.mark.usefixtures("_force_allauth")
def test_allauth_login(self, rf, settings):
request = rf.get("/fake-url")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class TestUserViewSet:
@pytest.fixture()
@pytest.fixture
def api_rf(self) -> APIRequestFactory:
return APIRequestFactory()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from {{ cookiecutter.project_slug }}.users.models import User


@pytest.mark.django_db()
@pytest.mark.django_db
class TestUserManager:
def test_create_user(self):
user = User.objects.create_user(
Expand Down Expand Up @@ -37,7 +37,7 @@ def test_create_superuser_username_ignored(self):
assert user.username is None


@pytest.mark.django_db()
@pytest.mark.django_db
def test_createsuperuser_command():
"""Ensure createsuperuser command works with our custom manager."""
out = StringIO()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_swagger_accessible_by_admin(admin_client):
assert response.status_code == HTTPStatus.OK


@pytest.mark.django_db()
@pytest.mark.django_db
def test_swagger_ui_not_accessible_by_normal_user(client):
url = reverse("api-docs")
response = client.get(url)
Expand Down

0 comments on commit f77b065

Please sign in to comment.