-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
141 lines (127 loc) · 3.38 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[tool.poetry]
name = "template-python"
version = "1.2.0"
description = ""
authors = ["Ben Wolfaardt <[email protected]>"]
readme = "README.md"
packages = [{include = "src"}]
#TODO determine licence
license = ""
[tool.poetry.dependencies]
python = "^3.11"
alembic = "1.13.1"
argparse = "1.4.0"
envyaml = "1.10.211231"
fastapi = "0.110.0"
psycopg2-binary = "2.9.9"
pydantic = "2.6.3"
sqlalchemy = "1.4.51"
sqlalchemy-utils = "0.41.1"
uvicorn = { version = "0.27.0", extras = ["standard"] }
[tool.poetry.group.dev.dependencies]
dotenv-linter = "0.5.0"
mypy = "1.10.0"
pre-commit = "3.7.0"
pre-commit-hooks = "4.4.0"
pytest = "7.4.4"
ruff = "0.4.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.mypy]
python_version = "3.11"
check_untyped_defs = true
disallow_untyped_defs = true
incremental = false
ignore_errors = false
pretty = true
show_error_context = true
show_traceback = true
strict_optional = true
warn_incomplete_stub = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
module = [
"alembic.*",
"envyaml.*",
"fastapi.*",
"psycopg2.*",
"pydantic.*",
"sqlalchemy.*",
"sqlalchemy_utils.*"
]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
log_cli = 0
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
python_files = ["test_*.py"]
testpaths = ["tests"]
[tool.ruff]
target-version = "py311"
exclude = ["alembic"]
indent-width = 4
line-length = 110
[tool.ruff.lint]
# rules from: https://docs.astral.sh/ruff/rules/
select = [
"ANN", # flake8-annotations
"ASYNC", # flake8-async
"S", # flake8-bandit
"B", # flake8-bugbear
# "A", # flake8-builtins
# "COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"EM", # flake8-errmsg
"LOG", # flake8-logging
"G", # flake8-logging-format
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
# "RET", # flake8-return
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"I", # isort
# "N", # pep8-naming # TODO: test first
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"UP", # pyupgrade
"RUF", # Ruff-specific rules
"TRY", # tryceratops
]
ignore = [
"ANN101", # Missing type annotation for `self` in method
"B008", # Do not perform function calls in argument defaults
"E501", # Line too long, handled by black
"G004", # Logging statements should not use f"..."
"W191", # Indentation contains tabs
"TRY301", # Abstract raise to an inner function
]
fixable = ["ALL"]
unfixable = []
# logger-objects = ["logging_setup.logger"] # TODO: test first
[tool.ruff.format]
line-ending = "auto"
quote-style = "double"
skip-magic-trailing-comma = false
[tool.ruff.lint.isort]
# force-sort-within-sections = true # TODO: test first
lines-after-imports = 2
lines-between-types = 1
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true