support-ticker/pyproject.toml

134 lines
3.7 KiB
TOML

[tool.poetry]
name = "docker-mailserver-gate"
version = "0.0.1"
description = "Low-level API abstraction of setup.sh in docker-mailserver, accessible by API key."
authors = ["Sofus Albert Høgsbro Rose <sofus@dtumasters.org>"]
license = "AGPL3+"
[tool.poetry.dependencies]
python = "3.11.*"
fastapi = "^0.94.0"
uvicorn = "^0.21.0"
pydantic = {extras = ["email"], version = "^1.10.6"}
docker = "^6.0.1"
[tool.poetry.group.dev.dependencies]
devtools = "^0.10.0"
schemathesis = "^3.19.0"
pre-commit = "^3.2.1"
ruff = "^0.0.259"
tan = "^22.12.1"
mypy = "^1.1.1"
####################
# - Tooling: Static Analysis
####################
[tool.black]
## - Actually uses tan, which is identical to black but with tab support.
## - Run Before ruff
use-tabs = true
line-length = 79
target-version = ["py311"]
[tool.ruff]
## - Run After tan
target-version = "py311"
line-length = 79
select = [
"E", # pycodestyle ## General Purpose
"F", # pyflakes ## General Purpose
"PL", # Pylint ## General Purpose
## Code Quality
"TCH", # flake8-type-checking ## Type Checking Block Validator
"C90", # mccabe ## Avoid Too-Complex Functions
"ERA", # eradicate ## Ban Commented Code
"TRY", # tryceratops ## Exception Handling Style
"B", # flake8-bugbear ## Opinionated, Probable-Bug Patterns
#"N", # pep8-naming ## TODO: Force Good Naming Conventions
#"D", # pydocstyle ## TODO: Force docstrings
"SIM", # flake8-simplify ## Sanity-Check for Code Simplification
"SLF", # flake8-self ## Ban Private Member Access
"RUF", # Ruff-specific rules ## Extra Good-To-Have Rules
## Style
"I", # isort ## Force import Sorting
"UP", # pyupgrade ## Enforce Upgrade to Newer Python Syntaxes
"COM", # flake8-commas ## Enforce Trailing Commas
"Q", # flake8-quotes ## Finally - Quoting Style!
"PTH", # flake8-use-pathlib ## Enforce pathlib usage
"A", # flake8-builtins ## Prevent Builtin Shadowing
"C4", # flake8-comprehensions ## Check Compehension Appropriateness
"DTZ", # flake8-datetimez ## Ban naive Datetime Creation
"EM", # flake8-errmsg ## Check Exception String Formatting
"ISC", # flake8-implicit-str-concat ## Enforce Good String Literal Concat
"G", # flake8-logging-format ## Enforce Good Logging Practices
"INP", # flake8-no-pep420 ## Ban PEP420; Enforce __init__.py.
"PIE", # flake8-pie ## Misc Opinionated Checks
"T20", # flake8-print ## Ban print()
"RSE", # flake8-raise ## Check Niche Exception Raising Pattern
"RET", # flake8-return ## Enforce Good Returning
"ARG", # flake8-unused-arguments ## Ban Unused Arguments
# Specific
"PT", # flake8-pytest-style ## pytest-Specific Checks
]
ignore = [
"B008", # FastAPI uses this for Depends(), Security(), etc. .
"E701", # class foo(Parent): pass or if simple: return are perfectly elegant
]
task-tags = ["TODO", "REF", "FIXME"]
[tool.ruff.flake8-bugbear]
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query"]
[tool.ruff.pycodestyle]
ignore-overlong-task-comments = true
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.pylint]
max-args = 6
####################
# - Tooling: Type Checking
####################
[tool.mypy]
plugins = [
"pydantic.mypy"
]
follow_imports = "silent"
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
# for strict mypy: (this is the tricky one :-))
disallow_untyped_defs = true
[tool.pydantic-mypy]
# REF: https://docs.pydantic.dev/mypy_plugin/
init_forbid_extra = true
init_typed = false
warn_required_dynamic_aliases = true
warn_untyped_fields = true
####################
# - Poetry Integration
####################
[build-system]
requires = ["poetry>=1.0"]
build-backend = "poetry.masonry.api"