2023-04-15 17:43:04 +03:00
|
|
|
# ==== pytest ====
|
|
|
|
[tool.pytest.ini_options]
|
|
|
|
minversion = "6.0"
|
2024-03-29 15:06:05 +03:00
|
|
|
addopts = "--ds=config.settings.test --reuse-db --import-mode=importlib"
|
2023-04-15 17:43:04 +03:00
|
|
|
python_files = [
|
|
|
|
"tests.py",
|
|
|
|
"test_*.py",
|
|
|
|
]
|
|
|
|
{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
|
|
|
|
norecursedirs = ["node_modules"]
|
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
# ==== Coverage ====
|
|
|
|
[tool.coverage.run]
|
|
|
|
include = ["{{cookiecutter.project_slug}}/**"]
|
|
|
|
omit = ["*/migrations/*", "*/tests/*"]
|
|
|
|
plugins = ["django_coverage_plugin"]
|
|
|
|
|
|
|
|
# ==== mypy ====
|
|
|
|
[tool.mypy]
|
2024-03-18 21:55:00 +03:00
|
|
|
python_version = "3.12"
|
2023-04-15 17:43:04 +03:00
|
|
|
check_untyped_defs = true
|
|
|
|
ignore_missing_imports = true
|
|
|
|
warn_unused_ignores = true
|
|
|
|
warn_redundant_casts = true
|
|
|
|
warn_unused_configs = true
|
|
|
|
plugins = [
|
|
|
|
"mypy_django_plugin.main",
|
|
|
|
{%- if cookiecutter.use_drf == "y" %}
|
|
|
|
"mypy_drf_plugin.main",
|
|
|
|
{%- endif %}
|
|
|
|
]
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
# Django migrations should not produce any errors:
|
|
|
|
module = "*.migrations.*"
|
|
|
|
ignore_errors = true
|
|
|
|
|
|
|
|
[tool.django-stubs]
|
|
|
|
django_settings_module = "config.settings.test"
|
|
|
|
|
2023-06-28 00:52:36 +03:00
|
|
|
# ==== djLint ====
|
|
|
|
[tool.djlint]
|
|
|
|
blank_line_after_tag = "load,extends"
|
|
|
|
close_void_tags = true
|
|
|
|
format_css = true
|
|
|
|
format_js = true
|
2024-04-23 23:54:47 +03:00
|
|
|
# TODO: remove T002 when fixed https://github.com/djlint/djLint/issues/687
|
2023-06-28 00:52:36 +03:00
|
|
|
ignore = "H006,H030,H031,T002"
|
|
|
|
include = "H017,H035"
|
|
|
|
indent = 2
|
|
|
|
max_line_length = 119
|
|
|
|
profile = "django"
|
|
|
|
|
|
|
|
[tool.djlint.css]
|
|
|
|
indent_size = 2
|
|
|
|
|
|
|
|
[tool.djlint.js]
|
|
|
|
indent_size = 2
|
2024-02-06 21:56:31 +03:00
|
|
|
|
|
|
|
[tool.ruff]
|
2024-08-15 18:36:59 +03:00
|
|
|
target-version = "py312"
|
2024-02-06 21:56:31 +03:00
|
|
|
# Exclude a variety of commonly ignored directories.
|
2024-08-15 18:36:59 +03:00
|
|
|
extend-exclude = [
|
2024-02-06 21:56:31 +03:00
|
|
|
"*/migrations/*.py",
|
2024-08-15 18:36:59 +03:00
|
|
|
"staticfiles/*",
|
2024-02-06 21:56:31 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
|
|
|
select = [
|
|
|
|
"F",
|
|
|
|
"E",
|
|
|
|
"W",
|
|
|
|
"C90",
|
|
|
|
"I",
|
|
|
|
"N",
|
|
|
|
"UP",
|
|
|
|
"YTT",
|
|
|
|
# "ANN", # flake8-annotations: we should support this in the future but 100+ errors atm
|
|
|
|
"ASYNC",
|
|
|
|
"S",
|
|
|
|
"BLE",
|
|
|
|
"FBT",
|
|
|
|
"B",
|
|
|
|
"A",
|
|
|
|
"COM",
|
|
|
|
"C4",
|
|
|
|
"DTZ",
|
|
|
|
"T10",
|
|
|
|
"DJ",
|
|
|
|
"EM",
|
|
|
|
"EXE",
|
|
|
|
"FA",
|
|
|
|
'ISC',
|
|
|
|
"ICN",
|
|
|
|
"G",
|
|
|
|
'INP',
|
|
|
|
'PIE',
|
|
|
|
"T20",
|
|
|
|
'PYI',
|
|
|
|
'PT',
|
|
|
|
"Q",
|
|
|
|
"RSE",
|
|
|
|
"RET",
|
|
|
|
"SLF",
|
|
|
|
"SLOT",
|
|
|
|
"SIM",
|
|
|
|
"TID",
|
|
|
|
"TCH",
|
|
|
|
"INT",
|
|
|
|
# "ARG", # Unused function argument
|
|
|
|
"PTH",
|
|
|
|
"ERA",
|
|
|
|
"PD",
|
|
|
|
"PGH",
|
|
|
|
"PL",
|
|
|
|
"TRY",
|
|
|
|
"FLY",
|
|
|
|
# "NPY",
|
|
|
|
# "AIR",
|
|
|
|
"PERF",
|
|
|
|
# "FURB",
|
|
|
|
# "LOG",
|
2024-08-15 18:36:59 +03:00
|
|
|
"RUF",
|
2024-02-06 21:56:31 +03:00
|
|
|
]
|
|
|
|
ignore = [
|
|
|
|
"S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/
|
|
|
|
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
|
2024-04-24 00:28:45 +03:00
|
|
|
"SIM102", # sometimes it's better to nest
|
2024-08-15 18:36:59 +03:00
|
|
|
"UP038", # Checks for uses of isinstance/issubclass that take a tuple
|
2024-04-24 00:28:45 +03:00
|
|
|
# of types for comparison.
|
2024-08-15 18:36:59 +03:00
|
|
|
# Deactivated because it can make the code slow:
|
2024-04-24 00:28:45 +03:00
|
|
|
# https://github.com/astral-sh/ruff/issues/7871
|
2024-02-06 21:56:31 +03:00
|
|
|
]
|
2024-08-15 18:36:59 +03:00
|
|
|
# The fixes in extend-unsafe-fixes will require
|
2024-04-24 00:28:45 +03:00
|
|
|
# provide the `--unsafe-fixes` flag when fixing.
|
|
|
|
extend-unsafe-fixes = [
|
2024-08-15 18:36:59 +03:00
|
|
|
"UP038",
|
2024-04-24 00:28:45 +03:00
|
|
|
]
|
2024-02-06 21:56:31 +03:00
|
|
|
|
|
|
|
[tool.ruff.lint.isort]
|
|
|
|
force-single-line = true
|
2024-10-06 12:55:59 +03:00
|
|
|
|
|
|
|
[tool.uv]
|
|
|
|
dev-dependencies = [
|
|
|
|
"watchdog==4.0.2", # https://github.com/gorakhargosh/watchdog
|
2024-10-06 13:16:31 +03:00
|
|
|
"Werkzeug[watchdog]==3.0.4", # https://github.com/pallets/werkzeug
|
|
|
|
"ipdb==0.13.13", # https://github.com/gotcha/ipdb
|
2024-10-06 12:55:59 +03:00
|
|
|
{%- if cookiecutter.use_docker == 'y' %}
|
2024-10-06 13:16:31 +03:00
|
|
|
"psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg
|
2024-10-06 12:55:59 +03:00
|
|
|
{%- else %}
|
2024-10-06 13:16:31 +03:00
|
|
|
"psycopg[binary]==3.2.3", # https://github.com/psycopg/psycopg
|
2024-10-06 12:55:59 +03:00
|
|
|
{%- endif %}
|
|
|
|
{%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %}
|
2024-10-06 13:16:31 +03:00
|
|
|
"watchfiles==0.24.0", # https://github.com/samuelcolvin/watchfiles
|
2024-10-06 12:55:59 +03:00
|
|
|
{%- endif %}
|
2024-10-06 13:16:31 +03:00
|
|
|
# Testing
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
"mypy==1.11.2", # https://github.com/python/mypy
|
|
|
|
"django-stubs[compatible-mypy]==5.1.0", # https://github.com/typeddjango/django-stubs
|
|
|
|
"pytest==8.3.3", # https://github.com/pytest-dev/pytest
|
|
|
|
"pytest-sugar==1.0.0", # https://github.com/Frozenball/pytest-sugar
|
2024-10-06 12:55:59 +03:00
|
|
|
{%- if cookiecutter.use_drf == "y" %}
|
2024-10-06 13:16:31 +03:00
|
|
|
"djangorestframework-stubs==3.15.1", # https://github.com/typeddjango/djangorestframework-stubs
|
2024-10-06 12:55:59 +03:00
|
|
|
{%- endif %}
|
|
|
|
|
2024-10-06 13:16:31 +03:00
|
|
|
# Documentation
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
"sphinx==7.4.7", # https://github.com/sphinx-doc/sphinx
|
|
|
|
"sphinx-autobuild==2024.10.3", # https://github.com/GaretJax/sphinx-autobuild
|
2024-10-06 12:55:59 +03:00
|
|
|
|
2024-10-06 13:16:31 +03:00
|
|
|
# Code quality
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
"ruff==0.6.9", # https://github.com/astral-sh/ruff
|
|
|
|
"coverage==7.6.1", # https://github.com/nedbat/coveragepy
|
|
|
|
"djlint==1.35.2", # https://github.com/Riverside-Healthcare/djLint
|
|
|
|
"pre-commit==3.8.0", # https://github.com/pre-commit/pre-commit
|
2024-10-06 12:55:59 +03:00
|
|
|
|
2024-10-06 13:16:31 +03:00
|
|
|
# Django
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
"factory-boy==3.3.1", # https://github.com/FactoryBoy/factory_boy
|
2024-10-06 12:55:59 +03:00
|
|
|
|
2024-10-06 13:16:31 +03:00
|
|
|
"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
|
|
|
|
"django-coverage-plugin==3.1.0", # https://github.com/nedbat/django_coverage_plugin
|
|
|
|
"pytest-django==4.9.0", # https://github.com/pytest-dev/pytest-django
|
2024-10-06 12:55:59 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
[project]
|
|
|
|
name = "cookiecutter-django"
|
|
|
|
version = "2024.10.04"
|
|
|
|
description = "A Cookiecutter template for creating production-ready Django projects quickly."
|
|
|
|
readme = "README.md"
|
|
|
|
|
|
|
|
license = { text = "BSD" }
|
|
|
|
authors = [
|
|
|
|
{ name = "Daniel Roy Greenfeld", email = "pydanny@gmail.com" },
|
|
|
|
]
|
2024-10-26 14:25:51 +03:00
|
|
|
requires-python = "==3.12.*"
|
2024-10-06 12:55:59 +03:00
|
|
|
dependencies = [
|
|
|
|
"python-slugify==8.0.4", # https://github.com/un33k/python-slugify
|
2024-10-06 13:16:31 +03:00
|
|
|
"Pillow==10.4.0", # https://github.com/python-pillow/Pillow
|
|
|
|
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
|
|
|
|
{%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %}
|
|
|
|
"rcssmin==1.1.2", # --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin
|
|
|
|
{%- else %}
|
|
|
|
"rcssmin==1.1.2", # https://github.com/ndparker/rcssmin
|
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|
|
|
|
"argon2-cffi==23.1.0", # https://github.com/hynek/argon2_cffi
|
|
|
|
{%- if cookiecutter.use_whitenoise == 'y' %}
|
|
|
|
"whitenoise==6.7.0", # https://github.com/evansd/whitenoise
|
|
|
|
{%- endif %}
|
|
|
|
"redis==5.1.1", # https://github.com/redis/redis-py
|
|
|
|
{%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %}
|
|
|
|
"hiredis==3.0.0", # https://github.com/redis/hiredis-py
|
|
|
|
{%- endif %}
|
|
|
|
{%- if cookiecutter.use_celery == "y" %}
|
|
|
|
"celery==5.4.0", # pyup: < 6.0 # https://github.com/celery/celery
|
|
|
|
"django-celery-beat==2.7.0", # https://github.com/celery/django-celery-beat
|
|
|
|
{%- if cookiecutter.use_docker == 'y' %}
|
|
|
|
"flower==2.0.1", # https://github.com/mher/flower
|
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- if cookiecutter.use_async == 'y' %}
|
|
|
|
"uvicorn[standard]==0.31.0", # https://github.com/encode/uvicorn
|
|
|
|
"uvicorn-worker==0.2.0", # https://github.com/Kludex/uvicorn-worker
|
|
|
|
{%- endif %}
|
2024-10-06 12:55:59 +03:00
|
|
|
|
|
|
|
# Django
|
|
|
|
# ------------------------------------------------------------------------------
|
2024-10-06 13:16:31 +03:00
|
|
|
"django==5.0.9", # pyup: < 5.1 # https://www.djangoproject.com/
|
|
|
|
"django-environ==0.11.2", # https://github.com/joke2k/django-environ
|
|
|
|
"django-model-utils==5.0.0", # https://github.com/jazzband/django-model-utils
|
|
|
|
"django-allauth[mfa]==65.0.2", # https://github.com/pennersr/django-allauth
|
|
|
|
"django-crispy-forms==2.3", # https://github.com/django-crispy-forms/django-crispy-forms
|
|
|
|
"crispy-bootstrap5==2024.10", # https://github.com/django-crispy-forms/crispy-bootstrap5
|
|
|
|
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
|
|
|
|
"django-compressor==4.5.1", # https://github.com/django-compressor/django-compressor
|
|
|
|
{%- endif %}
|
|
|
|
"django-redis==5.4.0", # https://github.com/jazzband/django-redis
|
|
|
|
{%- if cookiecutter.use_drf == 'y' %}
|
|
|
|
# Django REST Framework
|
|
|
|
"djangorestframework==3.15.2", # https://github.com/encode/django-rest-framework
|
|
|
|
"django-cors-headers==4.4.0", # https://github.com/adamchainz/django-cors-headers
|
|
|
|
# DRF-spectacular for api documentation
|
|
|
|
"drf-spectacular==0.27.2", # https://github.com/tfranzel/drf-spectacular
|
|
|
|
{%- endif %}
|
|
|
|
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
|
|
|
"django-webpack-loader==3.1.1", # https://github.com/django-webpack/django-webpack-loader
|
|
|
|
{%- endif %}
|
|
|
|
"gunicorn==23.0.0", # https://github.com/benoitc/gunicorn
|
|
|
|
"psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg
|
|
|
|
{%- if cookiecutter.use_whitenoise == 'n' %}
|
|
|
|
"Collectfasta==3.2.0", # https://github.com/jasongi/collectfasta
|
|
|
|
{%- endif %}
|
|
|
|
{%- if cookiecutter.use_sentry == "y" %}
|
|
|
|
"sentry-sdk==2.15.0", # https://github.com/getsentry/sentry-python
|
|
|
|
{%- endif %}
|
|
|
|
{%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %}
|
|
|
|
"hiredis==3.0.0", # https://github.com/redis/hiredis-py
|
|
|
|
{%- endif %}
|
2024-10-06 12:55:59 +03:00
|
|
|
|
2024-10-06 13:16:31 +03:00
|
|
|
# Django
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
|
|
|
"django-storages[s3]==1.14.4", # https://github.com/jschneier/django-storages
|
|
|
|
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
|
|
|
"django-storages[google]==1.14.4", # https://github.com/jschneier/django-storages
|
|
|
|
{%- elif cookiecutter.cloud_provider == 'Azure' %}
|
|
|
|
"django-storages[azure]==1.14.4", # https://github.com/jschneier/django-storages
|
|
|
|
{%- endif %}
|
|
|
|
{%- if cookiecutter.mail_service == 'Mailgun' %}
|
|
|
|
"django-anymail[mailgun]==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- elif cookiecutter.mail_service == 'Amazon SES' %}
|
|
|
|
"django-anymail[amazon-ses]==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- elif cookiecutter.mail_service == 'Mailjet' %}
|
|
|
|
"django-anymail[mailjet]==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- elif cookiecutter.mail_service == 'Mandrill' %}
|
|
|
|
"django-anymail[mandrill]==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- elif cookiecutter.mail_service == 'Postmark' %}
|
|
|
|
"django-anymail[postmark]==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- elif cookiecutter.mail_service == 'Sendgrid' %}
|
|
|
|
"django-anymail[sendgrid]==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- elif cookiecutter.mail_service == 'Brevo' %}
|
|
|
|
"django-anymail[brevo]==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- elif cookiecutter.mail_service == 'SparkPost' %}
|
|
|
|
"django-anymail[sparkpost]==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- elif cookiecutter.mail_service == 'Other SMTP' %}
|
|
|
|
"django-anymail==12.0", # https://github.com/anymail/django-anymail
|
|
|
|
{%- endif %}
|
2024-10-06 12:55:59 +03:00
|
|
|
]
|