diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8c10de97..bfa50e96 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: exclude: hooks/ - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.0 hooks: - id: black diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 685bf90a..1ddab063 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -8,6 +8,7 @@ NOTE: TODO: restrict Cookiecutter Django project initialization to Python 3.x environments only """ + from __future__ import print_function import json diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 33dc2e83..2956b9ab 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -7,6 +7,7 @@ NOTE: TODO: restrict Cookiecutter Django project initialization to Python 3.x environments only """ + from __future__ import print_function import sys diff --git a/requirements.txt b/requirements.txt index aadf4abb..38df1e17 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==23.12.1 +black==24.1.0 isort==5.13.2 flake8==7.0.0 django-upgrade==1.15.0 diff --git a/scripts/create_django_issue.py b/scripts/create_django_issue.py index f9ff7654..2e59f18b 100644 --- a/scripts/create_django_issue.py +++ b/scripts/create_django_issue.py @@ -6,6 +6,7 @@ patches, only comparing major and minor version numbers. This script handles when there are multiple Django versions that need to keep up to date. """ + from __future__ import annotations import os diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 6afdc400..2ccac84b 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -1,4 +1,5 @@ """Unit tests for the hooks""" + import os from pathlib import Path diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index c0e1db7c..4eea9c62 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: [--py311-plus] - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.0 hooks: - id: black diff --git a/{{cookiecutter.project_slug}}/config/asgi.py b/{{cookiecutter.project_slug}}/config/asgi.py index 65e76ca0..c391bf87 100644 --- a/{{cookiecutter.project_slug}}/config/asgi.py +++ b/{{cookiecutter.project_slug}}/config/asgi.py @@ -7,6 +7,7 @@ For more information on this file, see https://docs.djangoproject.com/en/dev/howto/deployment/asgi/ """ + import os import sys from pathlib import Path diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index ecc5a540..3bf3a73c 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -1,6 +1,5 @@ -""" -Base settings to build other settings files upon. -""" +"""Base settings to build other settings files upon.""" + from pathlib import Path import environ diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 68126182..4d64c63f 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -32,7 +32,7 @@ TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa: F405 # MEDIA # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#media-url -MEDIA_URL = 'http://media.testserver' +MEDIA_URL = "http://media.testserver" {%- if cookiecutter.frontend_pipeline == 'Webpack' %} # django-webpack-loader diff --git a/{{cookiecutter.project_slug}}/config/wsgi.py b/{{cookiecutter.project_slug}}/config/wsgi.py index 3fd809ef..1dbd8a8d 100644 --- a/{{cookiecutter.project_slug}}/config/wsgi.py +++ b/{{cookiecutter.project_slug}}/config/wsgi.py @@ -13,6 +13,7 @@ middleware here, or combine a Django application with an application of another framework. """ + import os import sys from pathlib import Path diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 2a80055c..81e87ac8 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -31,7 +31,7 @@ sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild flake8==7.0.0 # https://github.com/PyCQA/flake8 flake8-isort==6.1.1 # https://github.com/gforcada/flake8-isort coverage==7.4.0 # https://github.com/nedbat/coveragepy -black==23.12.1 # https://github.com/psf/black +black==24.1.0 # https://github.com/psf/black djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pylint-django==2.5.5 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py index 023aad05..ca624c89 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py @@ -1,6 +1,5 @@ -""" -Module for all Form Tests. -""" +"""Module for all Form Tests.""" + from django.utils.translation import gettext_lazy as _ from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm