This commit is contained in:
Jelmer Draaijer 2024-10-26 17:02:16 +02:00
parent 007de47f59
commit 00689b2d1a
2 changed files with 190 additions and 198 deletions

View File

@ -33,6 +33,5 @@ then
npm run build npm run build
fi fi
. .venv/bin/activate
# Generate the HTML for the documentation # Generate the HTML for the documentation
cd docs && uv run make html cd docs && uv run make html

View File

@ -6,9 +6,9 @@ python_files = [
"tests.py", "tests.py",
"test_*.py", "test_*.py",
] ]
{%- if cookiecutter.frontend_pipeline == 'Gulp' %} {%- if cookiecutter.frontend_pipeline == 'Gulp' % }
norecursedirs = ["node_modules"] norecursedirs = ["node_modules"]
{%- endif %} {%- endif % }
# ==== Coverage ==== # ==== Coverage ====
[tool.coverage.run] [tool.coverage.run]
@ -26,9 +26,9 @@ warn_redundant_casts = true
warn_unused_configs = true warn_unused_configs = true
plugins = [ plugins = [
"mypy_django_plugin.main", "mypy_django_plugin.main",
{%- if cookiecutter.use_drf == "y" %} {%- if cookiecutter.use_drf == "y" % }
"mypy_drf_plugin.main", "mypy_drf_plugin.main",
{%- endif %} {%- endif % }
] ]
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
@ -68,69 +68,69 @@ extend-exclude = [
[tool.ruff.lint] [tool.ruff.lint]
select = [ select = [
"F", "F",
"E", "E",
"W", "W",
"C90", "C90",
"I", "I",
"N", "N",
"UP", "UP",
"YTT", "YTT",
# "ANN", # flake8-annotations: we should support this in the future but 100+ errors atm # "ANN", # flake8-annotations: we should support this in the future but 100+ errors atm
"ASYNC", "ASYNC",
"S", "S",
"BLE", "BLE",
"FBT", "FBT",
"B", "B",
"A", "A",
"COM", "COM",
"C4", "C4",
"DTZ", "DTZ",
"T10", "T10",
"DJ", "DJ",
"EM", "EM",
"EXE", "EXE",
"FA", "FA",
'ISC', 'ISC',
"ICN", "ICN",
"G", "G",
'INP', 'INP',
'PIE', 'PIE',
"T20", "T20",
'PYI', 'PYI',
'PT', 'PT',
"Q", "Q",
"RSE", "RSE",
"RET", "RET",
"SLF", "SLF",
"SLOT", "SLOT",
"SIM", "SIM",
"TID", "TID",
"TCH", "TCH",
"INT", "INT",
# "ARG", # Unused function argument # "ARG", # Unused function argument
"PTH", "PTH",
"ERA", "ERA",
"PD", "PD",
"PGH", "PGH",
"PL", "PL",
"TRY", "TRY",
"FLY", "FLY",
# "NPY", # "NPY",
# "AIR", # "AIR",
"PERF", "PERF",
# "FURB", # "FURB",
# "LOG", # "LOG",
"RUF", "RUF",
] ]
ignore = [ ignore = [
"S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/ "S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"SIM102", # sometimes it's better to nest "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. # 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 # https://github.com/astral-sh/ruff/issues/7871
] ]
# The fixes in extend-unsafe-fixes will require # The fixes in extend-unsafe-fixes will require
# provide the `--unsafe-fixes` flag when fixing. # provide the `--unsafe-fixes` flag when fixing.
@ -143,47 +143,42 @@ force-single-line = true
[tool.uv] [tool.uv]
dev-dependencies = [ dev-dependencies = [
"watchdog==4.0.2", # https://github.com/gorakhargosh/watchdog "Werkzeug[watchdog]==3.0.6", # https://github.com/pallets/werkzeug
"Werkzeug[watchdog]==3.0.4", # https://github.com/pallets/werkzeug "ipdb==0.13.13", # https://github.com/gotcha/ipdb
"ipdb==0.13.13", # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' % }
{%- if cookiecutter.use_docker == 'y' %} "psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg
"psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg {%- else % }
{%- else %} "psycopg[binary]==3.2.3", # https://github.com/psycopg/psycopg
"psycopg[binary]==3.2.3", # https://github.com/psycopg/psycopg {%- endif % }
{%- endif %} {%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' % }
{%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %} "watchfiles==0.24.0", # https://github.com/samuelcolvin/watchfiles
"watchfiles==0.24.0", # https://github.com/samuelcolvin/watchfiles {%- endif % }
{%- endif %} # Testing
# Testing # ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------ "mypy==1.11.2", # https://github.com/python/mypy
"mypy==1.11.2", # https://github.com/python/mypy "django-stubs[compatible-mypy]==5.1.0", # https://github.com/typeddjango/django-stubs
"django-stubs[compatible-mypy]==5.1.0", # https://github.com/typeddjango/django-stubs "pytest==8.3.3", # https://github.com/pytest-dev/pytest
"pytest==8.3.3", # https://github.com/pytest-dev/pytest "pytest-sugar==1.0.0", # https://github.com/Frozenball/pytest-sugar
"pytest-sugar==1.0.0", # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" % }
{%- if cookiecutter.use_drf == "y" %} "djangorestframework-stubs==3.15.1", # https://github.com/typeddjango/djangorestframework-stubs
"djangorestframework-stubs==3.15.1", # https://github.com/typeddjango/djangorestframework-stubs {%- endif % }
{%- endif %} # Documentation
# ------------------------------------------------------------------------------
# Documentation "sphinx==7.4.7", # https://github.com/sphinx-doc/sphinx
# ------------------------------------------------------------------------------ "sphinx-autobuild==2024.10.3", # https://github.com/GaretJax/sphinx-autobuild
"sphinx==7.4.7", # https://github.com/sphinx-doc/sphinx # Code quality
"sphinx-autobuild==2024.10.3", # https://github.com/GaretJax/sphinx-autobuild # ------------------------------------------------------------------------------
"ruff==0.6.9", # https://github.com/astral-sh/ruff
# Code quality "coverage==7.6.1", # https://github.com/nedbat/coveragepy
# ------------------------------------------------------------------------------ "djlint==1.35.2", # https://github.com/Riverside-Healthcare/djLint
"ruff==0.6.9", # https://github.com/astral-sh/ruff "pre-commit==3.8.0", # https://github.com/pre-commit/pre-commit
"coverage==7.6.1", # https://github.com/nedbat/coveragepy # Django
"djlint==1.35.2", # https://github.com/Riverside-Healthcare/djLint # ------------------------------------------------------------------------------
"pre-commit==3.8.0", # https://github.com/pre-commit/pre-commit "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 "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
"factory-boy==3.3.1", # https://github.com/FactoryBoy/factory_boy "pytest-django==4.9.0", # https://github.com/pytest-dev/pytest-django
"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
] ]
[project] [project]
@ -198,95 +193,93 @@ authors = [
] ]
requires-python = "==3.12.*" requires-python = "==3.12.*"
dependencies = [ dependencies = [
"python-slugify==8.0.4", # https://github.com/un33k/python-slugify "python-slugify==8.0.4", # https://github.com/un33k/python-slugify
"Pillow==10.4.0", # https://github.com/python-pillow/Pillow "Pillow==10.4.0", # https://github.com/python-pillow/Pillow
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} {%- if cookiecutter.frontend_pipeline == 'Django Compressor' % }
{%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' % }
"rcssmin==1.1.2", # --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin "rcssmin==1.1.2", # --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin
{%- else %} {%- else % }
"rcssmin==1.1.2", # https://github.com/ndparker/rcssmin "rcssmin==1.1.2", # https://github.com/ndparker/rcssmin
{%- endif %} {%- endif % }
{%- endif %} {%- endif % }
"argon2-cffi==23.1.0", # https://github.com/hynek/argon2_cffi "argon2-cffi==23.1.0", # https://github.com/hynek/argon2_cffi
{%- if cookiecutter.use_whitenoise == 'y' %} {%- if cookiecutter.use_whitenoise == 'y' % }
"whitenoise==6.7.0", # https://github.com/evansd/whitenoise "whitenoise==6.7.0", # https://github.com/evansd/whitenoise
{%- endif %} {%- endif % }
"redis==5.1.1", # https://github.com/redis/redis-py "redis==5.1.1", # https://github.com/redis/redis-py
{%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} {%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" % }
"hiredis==3.0.0", # https://github.com/redis/hiredis-py "hiredis==3.0.0", # https://github.com/redis/hiredis-py
{%- endif %} {%- endif % }
{%- if cookiecutter.use_celery == "y" %} {%- if cookiecutter.use_celery == "y" % }
"celery==5.4.0", # pyup: < 6.0 # https://github.com/celery/celery "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 "django-celery-beat==2.7.0", # https://github.com/celery/django-celery-beat
{%- if cookiecutter.use_docker == 'y' %} {%- if cookiecutter.use_docker == 'y' % }
"flower==2.0.1", # https://github.com/mher/flower "flower==2.0.1", # https://github.com/mher/flower
{%- endif %} {%- endif % }
{%- endif %} {%- endif % }
{%- if cookiecutter.use_async == 'y' %} {%- if cookiecutter.use_async == 'y' % }
"uvicorn[standard]==0.31.0", # https://github.com/encode/uvicorn "uvicorn[standard]==0.31.0", # https://github.com/encode/uvicorn
"uvicorn-worker==0.2.0", # https://github.com/Kludex/uvicorn-worker "uvicorn-worker==0.2.0", # https://github.com/Kludex/uvicorn-worker
{%- endif %} {%- endif % }
# Django
# Django # ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------ "django==5.0.9", # pyup: < 5.1 # https://www.djangoproject.com/
"django==5.0.9", # pyup: < 5.1 # https://www.djangoproject.com/ "django-environ==0.11.2", # https://github.com/joke2k/django-environ
"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-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-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
"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
"crispy-bootstrap5==2024.10", # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' % }
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} "django-compressor==4.5.1", # https://github.com/django-compressor/django-compressor
"django-compressor==4.5.1", # https://github.com/django-compressor/django-compressor {%- endif % }
{%- endif %} "django-redis==5.4.0", # https://github.com/jazzband/django-redis
"django-redis==5.4.0", # https://github.com/jazzband/django-redis {%- if cookiecutter.use_drf == 'y' % }
{%- if cookiecutter.use_drf == 'y' %} # Django REST Framework
# Django REST Framework "djangorestframework==3.15.2", # https://github.com/encode/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
"django-cors-headers==4.4.0", # https://github.com/adamchainz/django-cors-headers # DRF-spectacular for api documentation
# DRF-spectacular for api documentation "drf-spectacular==0.27.2", # https://github.com/tfranzel/drf-spectacular
"drf-spectacular==0.27.2", # https://github.com/tfranzel/drf-spectacular {%- endif % }
{%- endif %} {%- if cookiecutter.frontend_pipeline == 'Webpack' % }
{%- if cookiecutter.frontend_pipeline == 'Webpack' %} "django-webpack-loader==3.1.1", # https://github.com/django-webpack/django-webpack-loader
"django-webpack-loader==3.1.1", # https://github.com/django-webpack/django-webpack-loader {%- endif % }
{%- endif %} "gunicorn==23.0.0", # https://github.com/benoitc/gunicorn
"gunicorn==23.0.0", # https://github.com/benoitc/gunicorn "psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg
"psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg {%- if cookiecutter.use_whitenoise == 'n' % }
{%- if cookiecutter.use_whitenoise == 'n' %} "Collectfasta==3.2.0", # https://github.com/jasongi/collectfasta
"Collectfasta==3.2.0", # https://github.com/jasongi/collectfasta {%- endif % }
{%- endif %} {%- if cookiecutter.use_sentry == "y" % }
{%- if cookiecutter.use_sentry == "y" %} "sentry-sdk==2.15.0", # https://github.com/getsentry/sentry-python
"sentry-sdk==2.15.0", # https://github.com/getsentry/sentry-python {%- endif % }
{%- endif %} {%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" % }
{%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} "hiredis==3.0.0", # https://github.com/redis/hiredis-py
"hiredis==3.0.0", # https://github.com/redis/hiredis-py {%- endif % }
{%- endif %} # Django
# ------------------------------------------------------------------------------
# Django {%- if cookiecutter.cloud_provider == 'AWS' % }
# ------------------------------------------------------------------------------ "django-storages[s3]==1.14.4", # https://github.com/jschneier/django-storages
{%- if cookiecutter.cloud_provider == 'AWS' %} {%- elif cookiecutter.cloud_provider == 'GCP' % }
"django-storages[s3]==1.14.4", # https://github.com/jschneier/django-storages "django-storages[google]==1.14.4", # https://github.com/jschneier/django-storages
{%- elif cookiecutter.cloud_provider == 'GCP' %} {%- elif cookiecutter.cloud_provider == 'Azure' % }
"django-storages[google]==1.14.4", # https://github.com/jschneier/django-storages "django-storages[azure]==1.14.4", # https://github.com/jschneier/django-storages
{%- elif cookiecutter.cloud_provider == 'Azure' %} {%- endif % }
"django-storages[azure]==1.14.4", # https://github.com/jschneier/django-storages {%- if cookiecutter.mail_service == 'Mailgun' % }
{%- endif %} "django-anymail[mailgun]==12.0", # https://github.com/anymail/django-anymail
{%- if cookiecutter.mail_service == 'Mailgun' %} {%- elif cookiecutter.mail_service == 'Amazon SES' % }
"django-anymail[mailgun]==12.0", # https://github.com/anymail/django-anymail "django-anymail[amazon-ses]==12.0", # https://github.com/anymail/django-anymail
{%- elif cookiecutter.mail_service == 'Amazon SES' %} {%- elif cookiecutter.mail_service == 'Mailjet' % }
"django-anymail[amazon-ses]==12.0", # https://github.com/anymail/django-anymail "django-anymail[mailjet]==12.0", # https://github.com/anymail/django-anymail
{%- elif cookiecutter.mail_service == 'Mailjet' %} {%- elif cookiecutter.mail_service == 'Mandrill' % }
"django-anymail[mailjet]==12.0", # https://github.com/anymail/django-anymail "django-anymail[mandrill]==12.0", # https://github.com/anymail/django-anymail
{%- elif cookiecutter.mail_service == 'Mandrill' %} {%- elif cookiecutter.mail_service == 'Postmark' % }
"django-anymail[mandrill]==12.0", # https://github.com/anymail/django-anymail "django-anymail[postmark]==12.0", # https://github.com/anymail/django-anymail
{%- elif cookiecutter.mail_service == 'Postmark' %} {%- elif cookiecutter.mail_service == 'Sendgrid' % }
"django-anymail[postmark]==12.0", # https://github.com/anymail/django-anymail "django-anymail[sendgrid]==12.0", # https://github.com/anymail/django-anymail
{%- elif cookiecutter.mail_service == 'Sendgrid' %} {%- elif cookiecutter.mail_service == 'Brevo' % }
"django-anymail[sendgrid]==12.0", # https://github.com/anymail/django-anymail "django-anymail[brevo]==12.0", # https://github.com/anymail/django-anymail
{%- elif cookiecutter.mail_service == 'Brevo' %} {%- elif cookiecutter.mail_service == 'SparkPost' % }
"django-anymail[brevo]==12.0", # https://github.com/anymail/django-anymail "django-anymail[sparkpost]==12.0", # https://github.com/anymail/django-anymail
{%- elif cookiecutter.mail_service == 'SparkPost' %} {%- elif cookiecutter.mail_service == 'Other SMTP' % }
"django-anymail[sparkpost]==12.0", # https://github.com/anymail/django-anymail "django-anymail==12.0", # https://github.com/anymail/django-anymail
{%- elif cookiecutter.mail_service == 'Other SMTP' %} {%- endif % }
"django-anymail==12.0", # https://github.com/anymail/django-anymail
{%- endif %}
] ]