forked from iloveitaly/python-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
228 lines (207 loc) · 6.34 KB
/
pyproject.toml
File metadata and controls
228 lines (207 loc) · 6.34 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
[project]
name = "python-starter-template"
version = "0.1.0"
description = ""
requires-python = ">=3.13"
dependencies = [
"activemodel>=0.2.0",
"aiosmtplib>=3.0.2",
"alembic>=1.14.0",
"alembic-postgresql-enum>=1.6.1",
"backoff>=2.2.1",
"cachetools>=5.5.1",
"celery-once>=3.0.1",
"celery[redis]>=5.4.0",
"clerk-backend-api>=3.3.1",
"css-inline>=0.14.3",
"fastapi[standard]>=0.115.3",
"flower>=2.0.1",
"funcy-pipe>=0.11.1",
"ipython>=8.28.0",
"itsdangerous>=2.2.0",
"jinja2>=3.1.4",
"mailers>=3.1.0",
"markdown2>=2.5.1",
"openai>=1.52.2",
"orjson>=3.10.11",
"posthog>=3.7.0",
"psycopg[binary]>=3.2.3",
"python-decouple-typed>=3.11.0",
"redis[hiredis]>=5.2.0",
"sentry-sdk[fastapi,celery,openai,sqlalchemy]>=2.17.0",
"sqlalchemy>=2.0.36",
"sqlmodel>=0.0.22",
"starlette-context>=0.3.6",
"structlog>=24.4.0",
"typeid-python[cli]>=0.3.2",
"typer>=0.14.0",
"uvicorn>=0.32.0",
"pydantic[email,timezone]",
"celery-types>=0.23.0",
"furl>=2.1.4",
"structlog-config[fastapi]",
"textcase>=0.4.0",
"whenever>=0.7.3",
"celery-healthcheck>=0.1.1",
"celery-redbeat>=2.3.2",
"ipython-playground>=0.3.0",
"stripe>=12.1.0",
"usaddress>=0.5.16",
"facebook-business>=23.0.1",
"beautiful-traceback>=0.1.0",
]
[dependency-groups]
debugging-extras = [
"colorama>=0.4.6",
"datamodel-code-generator>=0.26.3",
"debugpy>=1.8.8",
"docrepr>=0.2.0",
"funcy-pipe>=0.11.1",
"httpdbg>=0.31.1",
"icecream>=2.1.4",
"ipdb>=0.13.13",
"ipython>=9.0.2",
"ipython-autoimport",
"ipython-ctrlr-fzf>=0.2.1",
"ipython-suggestions>=1.0.0",
"ipythonclipboard>=1.0b2",
"jedi>=0.19.2",
"pdbr[ipython]>=0.8.9",
"pipdeptree>=2.25.0",
"pre-commit>=4.1.0",
"psutil>=6.1.0",
"pudb>=2024.1.3",
"py-spy>=0.4.0",
"pyfzf>=0.3.1",
"pytest-fzf>=0.1.2.post1",
"rich>=13.9.4",
"rpdb>=0.2.0",
"sqlparse>=0.5.2",
"uv-development-toggle>=0.2.1",
"aiautocommit",
]
dev = [
"covdefaults>=2.3.0",
"coverage>=7.6.7",
"deptry>=0.20.0",
"ipython>=8.28.0",
"pyright[nodejs]>=1.1.386",
"pytest-asyncio>=1.2.0",
"pytest-celery[redis]>=1.1.3",
"pytest-github-actions-annotate-failures>=0.2.0",
"pytest-httpx>=0.35.0",
"pytest>=8.3.3",
"ruff>=0.7.1",
"djlint>=1.36.1",
"pytest-sugar>=1.0.0",
"j2lint>=1.1.0",
"pytest-playwright>=0.6.2",
"pytest-cov>=6.0.0",
"pytest-timer[termcolor]>=1.0.0",
"gitignore-parser>=0.1.11",
"pytest-playwright-visual-snapshot",
"flexmock>=0.12.2",
"polyfactory>=2.20.0",
]
[tool.uv.config-settings]
# https://github.com/astral-sh/uv/issues/3898
# config-settings = { editable_mode = "compat" }
# Explicitly declare the package(s) to install in editable mode.
# Required for `editable_mode = "strict"` with flat layouts (app/ at project root).
# Without this, uv cannot auto-discover the package and will fail.
packages = ["app"]
# Use "strict" to create a real symlink in site-packages/app → /path/to/project/app
# Enables live edits, IDE path resolution, and avoids .pth file overhead. "compat" uses .pth files.
editable_mode = "strict"
# hatching is a modern replacement for the default setuptools
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["app"]
# create a nice cli for the application for various operational tasks
# https://discord.com/channels/1039017663004942429/1207998321562619954/1313194408069300225
[project.scripts]
python-starter-template = "app.cli:app"
[tool.ruff]
extend-exclude = [
"playground",
"playground.py",
"migrations/env.py",
"migrations/versions/*.py",
"tests/conftest.py",
".copier",
]
force-exclude = true
[tool.pyright]
exclude = [
".venv",
# exclude our local package clones
"pypi",
# sometimes python code can be bundled in node repos
"web/node_modules",
# migrations are autogen'd
"migrations/versions",
"playground.py",
# don't make playing less fun and force types
"playground",
".copier",
]
# https://github.com/microsoft/pylance-release/blob/71dcf9409c5ba65f1138069ac80ae9e2122d7867/USING_WITH_PYRIGHT.md
autoSearchPaths = false
extraPaths = [] # Include paths from PYTHONPATH env var and .env definition
typeCheckingMode = "standard"
reportShadowedImports = "warning"
[tool.djlint]
ignore = "H030,H031"
[tool.ruff.lint]
extend-select = ["I"]
[tool.ruff.lint.isort]
section-order = [
# https://docs.astral.sh/ruff/settings/#lint_isort_section-order
"future",
"standard-library",
"third-party",
"first-party",
# custom ordering
"orm",
"tests",
"local-folder",
]
[tool.ruff.lint.isort.sections]
orm = ["sqlmodel", "activemodel", "sqlalchemy", "app.models.*"]
tests = ["tests"]
# NOTE prefer conftest.py over toml configuration for pytest
[tool.pytest.ini_options]
# Not sure entirely why, but without tee-sys, the builtin fd-based log capture breaks on CI (but not locally)
addopts = ["-p no:logging", "--import-mode=importlib"]
filterwarnings = [
# avoid depreciation warnings causing spammy logs
"ignore::DeprecationWarning",
# raise level of these errors
"error:RuntimeWarning",
]
# by default, pytest seems to hijack many logs and output them to the terminal
# this is nice if you don't have a custom login like we do
testpaths = "tests"
# TODO would love if we could move this to conftest.py and put in the artifact folder
debug_file = "tmp/pytestdebug.log"
# TODO right now this option does not enable us to get it directly
asyncio_default_test_loop_scope = "function"
asyncio_default_fixture_loop_scope = "function"
# https://coverage.readthedocs.io/en/latest/config.html#run-data-file
[tool.coverage.run]
# data_file = "tmp/test-results/.coverage"
[tool.uv.sources]
flower = { git = "https://github.com/iloveitaly/flower", rev = "custom" }
ipdb = { git = "https://github.com/iloveitaly/ipdb", rev = "support-executables" }
pdbr = { git = "https://github.com/iloveitaly/pdbr", rev = "ipython-9.x" }
[tool.uv.sources.djlint]
git = "https://github.com/iloveitaly/djLint.git"
rev = "github-output"
[tool.uv.sources.polyfactory]
git = "https://github.com/iloveitaly/polyfactory.git"
rev = "custom"
[tool.uv.sources.docker]
git = "https://github.com/docker/docker-py.git"
rev = "orbstack-socket"