-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
154 lines (137 loc) · 3.46 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
142
143
144
145
146
147
148
149
150
151
152
153
154
[tool.poetry]
name = "bootstrap-fastapi-service"
version = "0.1.0"
description = ""
authors = ["Federico Busetti <729029+febus982@users.noreply.github.com>"]
readme = "README.md"
packages = [
{ include = "**/*.py", from = "src" }
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
############################
### Package requirements ###
############################
# https://python-poetry.org/docs/dependency-specification
[tool.poetry.dependencies]
aiosqlite = ">=0.18.0"
alembic = "^1.11.1"
asgiref = "^3.7.2"
celery = { version = "^5.3.1", extras = ["redis"] }
cloudevents = "^1.9.0"
dependency-injector = { version = "^4.41.0", extras = ["pydantic"] }
httpx = ">=0.23.0"
opentelemetry-distro = { version = "*", extras = ["otlp"] }
opentelemetry-instrumentation = "*"
opentelemetry-instrumentation-celery = "*"
opentelemetry-instrumentation-httpx = "*"
opentelemetry-instrumentation-sqlalchemy = "*"
pydantic = "^2.2.1"
pydantic-settings = "^2.0.3"
python = ">=3.9,<3.12"
rich = "^13.2.0"
SQLAlchemy = { version = "^2.0.0", extras = ["asyncio", "mypy"] }
sqlalchemy-bind-manager = "*"
structlog = "^24.0.0"
[tool.poetry.group.http]
optional = true
[tool.poetry.group.http.dependencies]
fastapi = ">=0.99.0"
jinja2 = "^3.1.2"
opentelemetry-instrumentation-fastapi = "*"
starlette-prometheus = "^0.9.0"
strawberry-graphql = { version = ">=0.204.0", extras = ["debug-server"] }
uvicorn = { version = "^0.30.0", extras = ["standard"] }
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
asynctest = "*"
coverage = "*"
mkdocs = "*"
mkdocs-awesome-pages-plugin = "*"
mkdocs-macros-adr-summary = "*"
mkdocs-material = "*"
mkdocs-mermaid2-plugin = "*"
mypy = "*"
mypy-protobuf = "*"
pytest = "*"
pytest-cov = "*"
pytest-factoryboy = "*"
pytest-xdist = "*"
ruff = "*"
strawberry-graphql = { version = "*", extras = ["debug-server", "fastapi"] }
pymdown-extensions = "*"
############################
### Tools configuration ###
############################
[tool.coverage.run]
branch = true
source = ["src"]
omit = [
"src/alembic/*",
"src/bootstrap/config.py",
"src/bootstrap/logs/*",
]
# It's not necessary to configure concurrency here
# because pytest-cov takes care of that
[tool.coverage.report]
fail_under = 100
exclude_also = [
"pragma: no cover",
"pass",
"\\.\\.\\.",
]
[tool.mypy]
files = ["src", "tests"]
exclude = ["alembic"]
plugins = "pydantic.mypy,strawberry.ext.mypy_plugin"
# We can remove celery by installing `celery-types` but needs
# at least python 3.10. For now we maintain the override.
[[tool.mypy.overrides]]
module = [
"celery.*"
]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-n auto --cov-report=term-missing"
testpaths = [
"tests",
]
[tool.ruff]
target-version = "py39"
extend-exclude = [
"docs",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"S", # flake8-bandit
"RUF", # ruff-specific-rules
]
# Ignoring rules problematic with formatter
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
ignore = [
"W191",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"ISC001",
"ISC002",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Ignore unused imports on init files
"tests/**/*.py" = ["S101"] # Allow assert usage on tests