Add/apply pyproject-fmt

This commit is contained in:
Adam Goldsmith 2024-11-04 00:55:31 -05:00
parent 87ecd9b2a0
commit 0da62d1dfd
3 changed files with 178 additions and 148 deletions

View File

@ -24,6 +24,11 @@ repos:
hooks: hooks:
- id: pdm-lock-check - id: pdm-lock-check
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.0
hooks:
- id: pyproject-fmt
- repo: local - repo: local
hooks: hooks:
- id: django-migrations - id: django-migrations

View File

@ -5,7 +5,7 @@
groups = ["default", "debug", "dev", "lint", "server", "typing"] groups = ["default", "debug", "dev", "lint", "server", "typing"]
strategy = ["inherit_metadata"] strategy = ["inherit_metadata"]
lock_version = "4.5.0" lock_version = "4.5.0"
content_hash = "sha256:0370ba34b4b455984520a720fb294746c04f2c525c3bbcde2f3e81056877266e" content_hash = "sha256:62afd725635547b246ccd4644ad3882b3384f6c6c3ed49d8d9b164cc694219e1"
[[metadata.targets]] [[metadata.targets]]
requires_python = "==3.11.*" requires_python = "==3.11.*"
@ -1827,6 +1827,21 @@ files = [
{file = "pyphen-0.16.0.tar.gz", hash = "sha256:2c006b3ddf072c9571ab97606d9ab3c26a92eaced4c0d59fd1d26988f308f413"}, {file = "pyphen-0.16.0.tar.gz", hash = "sha256:2c006b3ddf072c9571ab97606d9ab3c26a92eaced4c0d59fd1d26988f308f413"},
] ]
[[package]]
name = "pyproject-fmt"
version = "2.5.0"
requires_python = ">=3.9"
summary = "Format your pyproject.toml file"
groups = ["lint"]
marker = "python_version == \"3.11\""
dependencies = [
"toml-fmt-common==1.0.1",
]
files = [
{file = "pyproject_fmt-2.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a167bb8598801e16dd69fe96530da843dffce83843a4b4fd52b91793399b1c7b"},
{file = "pyproject_fmt-2.5.0.tar.gz", hash = "sha256:d8d9064bf740cda9b30386fc40f34deb8014a9a59f10e89bfb991df4c9dcbf15"},
]
[[package]] [[package]]
name = "python-dateutil" name = "python-dateutil"
version = "2.9.0.post0" version = "2.9.0.post0"
@ -2127,6 +2142,21 @@ files = [
{file = "tinycss2-1.3.0.tar.gz", hash = "sha256:152f9acabd296a8375fbca5b84c961ff95971fcfc32e79550c8df8e29118c54d"}, {file = "tinycss2-1.3.0.tar.gz", hash = "sha256:152f9acabd296a8375fbca5b84c961ff95971fcfc32e79550c8df8e29118c54d"},
] ]
[[package]]
name = "toml-fmt-common"
version = "1.0.1"
requires_python = ">=3.9"
summary = "Common logic to the TOML formatter."
groups = ["lint"]
marker = "python_version == \"3.11\""
dependencies = [
"tomli>=2.0.2; python_version < \"3.11\"",
]
files = [
{file = "toml_fmt_common-1.0.1-py3-none-any.whl", hash = "sha256:7a6542e36a7167fa94b8b997d3f8debadbb4ab757c7d78a77304579bd7a0cc7d"},
{file = "toml_fmt_common-1.0.1.tar.gz", hash = "sha256:7a29e99e527ffac456043296a0f1d8c03aaa1b06167bd39ad5e3cc5041f31c17"},
]
[[package]] [[package]]
name = "tqdm" name = "tqdm"
version = "4.66.5" version = "4.66.5"

View File

@ -1,150 +1,68 @@
[build-system]
build-backend = "pdm.backend"
requires = [ "pdm-backend" ]
[project] [project]
name = "CMSManage" name = "cmsmanage"
version = "0.1.0" version = "0.1.0"
description = "" description = ""
authors = [ authors = [
{ name = "Adam Goldsmith", email = "contact@adamgoldsmith.name" }, { name = "Adam Goldsmith", email = "contact@adamgoldsmith.name" },
] ]
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [ dependencies = [
"bitstring~=4.2",
"django~=5.1", "django~=5.1",
"django-admin-logs~=1.3", "django-admin-logs~=1.3",
"django-auth-ldap~=5.0", "django-auth-ldap~=5.0",
"django-autocomplete-light~=3.11",
"django-bootstrap5~=24.3",
"django-configurations[database,email]~=2.5",
"django-db-views~=0.1",
"django-filter~=24.3",
"django-markdownx~=4.0", "django-markdownx~=4.0",
"django-model-utils~=5.0",
"django-nh3~=0.1",
"django-object-actions~=4.3",
"django-postgres-metrics~=0.15",
"django-q2~=1.7",
"django-recurrence~=1.11", "django-recurrence~=1.11",
"django-widget-tweaks~=1.5", "django-sendfile2~=0.7",
"django-simple-history~=3.7",
"django-stubs-ext~=5.1", "django-stubs-ext~=5.1",
"django-tables2~=2.7",
"django-template-partials~=24.4",
"django-vite~=3.0",
"django-weasyprint~=2.3",
"django-widget-tweaks~=1.5",
"djangorestframework~=3.15",
"google-api-python-client~=2.148",
"google-auth-oauthlib~=1.2",
"lxml~=5.3",
"markdownify~=0.13", "markdownify~=0.13",
"mdformat~=0.7", "mdformat~=0.7",
"mdformat-tables~=1.0", "mdformat-tables~=1.0",
"django-autocomplete-light~=3.11", "nh3~=0.2",
"weasyprint~=62.3", "openapi-client-udm~=1.0",
"psycopg[binary,pool]~=3.2",
"requests~=2.32", "requests~=2.32",
"semver~=3.0", "semver~=3.0",
"djangorestframework~=3.15",
"django-q2~=1.7",
"lxml~=5.3",
"django-object-actions~=4.3",
"bitstring~=4.2",
"udm-rest-client~=1.2",
"openapi-client-udm~=1.0",
"django-nh3~=0.1",
"nh3~=0.2",
"django-tables2~=2.7",
"tablib[ods,xlsx]~=3.7", "tablib[ods,xlsx]~=3.7",
"django-filter~=24.3", "udm-rest-client~=1.2",
"django-db-views~=0.1", "weasyprint~=62.3",
"django-weasyprint~=2.3",
"django-sendfile2~=0.7",
"django-bootstrap5~=24.3",
"django-configurations[database,email]~=2.5",
"django-vite~=3.0",
"django-template-partials~=24.4",
"google-api-python-client~=2.148",
"google-auth-oauthlib~=1.2",
"django-model-utils~=5.0",
"psycopg[binary,pool]~=3.2",
"django-simple-history~=3.7",
"django-postgres-metrics~=0.15",
] ]
requires-python = ">=3.11" optional-dependencies.server = [
[project.optional-dependencies]
server = [
"uvicorn[standard]~=0.31",
"setuptools~=75.1", "setuptools~=75.1",
"uvicorn[standard]~=0.31",
] ]
entry-points."djangoq.errorreporters".admin_email = "cmsmanage.django_q2_admin_email_reporter:AdminEmailReporter"
[project.entry-points."djangoq.errorreporters"]
admin_email = "cmsmanage.django_q2_admin_email_reporter:AdminEmailReporter"
[tool.ruff]
line-length = 88
[tool.ruff.lint]
select = [
"E4",
"E7",
"E9",
"F",
"I",
"C4",
"UP",
"PERF",
"PL",
"SIM",
"FIX003",
"DJ012",
"A",
"INP",
"ISC",
"Q",
"PIE",
"LOG",
"RSE",
"TCH",
"PTH",
"FURB",
"B",
]
ignore = ["ISC001"]
[tool.ruff.lint.isort]
known-first-party = [
"cmsmanage",
"dashboard",
"doorcontrol",
"membershipworks",
"paperwork",
"rentals",
"reservations",
"tasks",
]
section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"]
[tool.ruff.lint.isort.sections]
"django" = ["django"]
[tool.djlint]
profile="django"
extension = ".dj.html"
indent = 2
blank_line_after_tag = "load,extends"
max_blank_lines = 1
ignore = "T003,H017,H021,H030,H031"
custom_blocks = "partialdef"
format_css = true
format_js = true
[tool.djlint.css]
indent_size = 2
[tool.djlint.js]
indent_size = 2
[tool.mypy]
plugins = [
"./cmsmanage/mypy_django_configurations_plugin.py",
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
]
[tool.django-stubs]
django_settings_module = "cmsmanage.settings"
strict_settings = false
[tool.coverage.run]
source = [
"cmsmanage",
"dashboard",
"doorcontrol",
"membershipworks",
"paperwork",
"rentals",
"reservations",
]
omit = [
"*/migrations/*",
]
[[tool.pdm.source]] [[tool.pdm.source]]
url = "https://pypi.org/simple" url = "https://pypi.org/simple"
@ -161,6 +79,7 @@ include_packages = ["openapi-client-udm"]
lint = [ lint = [
"djlint~=1.35", "djlint~=1.35",
"ruff~=0.6", "ruff~=0.6",
"pyproject-fmt~=2.5",
] ]
typing = [ typing = [
"mypy~=1.11", "mypy~=1.11",
@ -192,6 +111,82 @@ dev = [
start = "./manage.py runserver" start = "./manage.py runserver"
fmt.shell = "ruff check --fix ; ruff format . ; djlint --reformat ." fmt.shell = "ruff check --fix ; ruff format . ; djlint --reformat ."
[build-system] [tool.ruff]
requires = ["pdm-backend"] line-length = 88
build-backend = "pdm.backend"
lint.select = [
"A",
"B",
"C4",
"DJ012",
"E4",
"E7",
"E9",
"F",
"FIX003",
"FURB",
"I",
"INP",
"ISC",
"LOG",
"PERF",
"PIE",
"PL",
"PTH",
"Q",
"RSE",
"SIM",
"TCH",
"UP",
]
lint.ignore = [ "ISC001" ]
lint.isort.known-first-party = [
"cmsmanage",
"dashboard",
"doorcontrol",
"membershipworks",
"paperwork",
"rentals",
"reservations",
"tasks",
]
lint.isort.section-order = [ "future", "standard-library", "django", "third-party", "first-party", "local-folder" ]
lint.isort.sections."django" = [ "django" ]
[tool.coverage.run]
source = [
"cmsmanage",
"dashboard",
"doorcontrol",
"membershipworks",
"paperwork",
"rentals",
"reservations",
]
omit = [
"*/migrations/*",
]
[tool.mypy]
plugins = [
"./cmsmanage/mypy_django_configurations_plugin.py",
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
]
[tool.djlint]
profile = "django"
extension = ".dj.html"
indent = 2
blank_line_after_tag = "load,extends"
max_blank_lines = 1
ignore = "T003,H017,H021,H030,H031"
custom_blocks = "partialdef"
format_css = true
format_js = true
css.indent_size = 2
js.indent_size = 2
[tool.django-stubs]
django_settings_module = "cmsmanage.settings"
strict_settings = false