-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
297 lines (267 loc) · 9.81 KB
/
pyproject.toml
File metadata and controls
297 lines (267 loc) · 9.81 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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
[project]
name = "aignostics-foundry-core"
version = "0.12.1"
description = "🏭 Foundational infrastructure for Foundry components."
readme = "README.md"
authors = [{ name = "Oliver Meyer", email = "oliver.meyer@aignostics.com" }]
license = { file = "LICENSE" }
keywords = [
"aignostics-foundry-core",
"act",
"codecov",
"copier",
"cyclonedx",
"detect-secrets",
"jupyter",
"nox",
"foundry",
"foundry-python",
"pip-audit",
"pip-licenses",
"pre-commit",
"pytest",
"python",
"pypi",
"ruff",
"sonarqube",
"sonarcloud",
"uv",
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Framework :: Pytest",
"Typing :: Typed",
"Natural Language :: English"
]
requires-python = ">=3.11, <3.15"
dependencies = [
"asyncpg>=0.29,<1",
"auth0-fastapi>=1.0.0b5,<2",
"certifi>=2024",
"fastapi>=0.110,<1",
"loguru>=0.7,<1",
"platformdirs>=4,<5",
"psutil>=6",
"pydantic>=2,<3",
"pydantic-settings>=2,<3",
"python-dotenv>=1,<2",
"rich>=14,<15",
"sentry-sdk>=2,<3",
"sqlalchemy[postgresql-psycopgbinary,asyncio]>=2,<3",
"chancy[cron]>=0.25.1,<1",
"nicegui>=3,<4",
"truststore>=0.9,<1",
"typer>=0.14,<1",
]
[dependency-groups]
dev = [
"commitizen>=4.1.0,<5",
"cyclonedx-py>=1.0.1",
"detect-secrets>=1.5.0",
"enum-tools>=0.13.0",
"nox>=2025.11.12",
"pip-audit>=2.10.0,<3",
"pip-licenses @ git+https://github.com/neXenio/pip-licenses.git@master", # https://github.com/raimon49/pip-licenses/pull/224
"pre-commit>=4.5.0,<5",
"pyright>=1.1.408,<2", # Regression in 1.1.407, see https://github.com/microsoft/pyright/issues/11060
"pytest>=9.0.2,<10",
"pytest-asyncio>=1.3.0,<2",
"pytest-cov>=7.0.0,<8",
"pytest-env>=1.1.5,<2",
"pytest-md-report>=0.7.0,<1",
"pytest-regressions>=2.7.0,<3",
"pytest-retry>=1.7.0,<2",
"pytest-subprocess>=1.5.3,<2",
"pytest-timeout>=2.3.1,<3",
"pytest-watcher>=0.4.3,<1",
"pytest-xdist[psutil]>=3.6.1,<4",
"ruff>=0.14.8,<1",
"aiosqlite>=0.20,<1",
"tomli>=2.1.0",
"types-pyyaml>=6.0.12.20250402",
"types-requests>=2.32.0.20250328",
"watchdog>=6.0.0",
]
[tool.uv]
required-version = ">=0.9.7" # CVE-2025-54368, GHSA-w476-p2h3-79g9, GHSA-pqhf-p39g-3x64
override-dependencies = [ # https://github.com/astral-sh/uv/issues/4422
"pytest>=9.0.2", # pytest-md-report depends on pytest<9 unnecessarily
]
[project.urls]
Homepage = "https://github.com/aignostics/foundry-python-core"
Documentation = "https://github.com/aignostics/foundry-python-core#readme"
Source = "https://github.com/aignostics/foundry-python-core"
Changelog = "https://github.com/aignostics/foundry-python-core/releases"
Issues = "https://github.com/aignostics/foundry-python-core/issues"
[build-system]
requires = ["hatchling==1.29.0"]
build-backend = "hatchling.build"
[tool.hatch.build]
include = ["src/*"]
[tool.hatch.build.targets.wheel]
packages = ["src/aignostics_foundry_core"]
[tool.ruff]
target-version = "py311"
preview = true
fix = true
line-length = 120
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN002", # missing type annotation for `*args` -> provides no value
"ANN003", # missing type annotation for `**kwargs`` -> provides no value
"ASYNC109", # async function definition with a `timeout` parameter -> as mentioned by ruff, "This rule is highly opinionated and may not be suitable for all use cases."
"CPY001", # missing copyright notice -> not for OSS
"DOC502", # docstrings with exceptions not raised in the code of the function -> not always necessary
"D203", # incomptatible with D211 -> prefer D211
"D212", # incompatible with D213 -> prefer D213
"FBT001", # boolean positional arguments -> disagree
"FBT002", # boolean defautl value positionl arguments -> disagree
"FBT003", # boolean positional value in function call -> disagree
"PGH003", # use specific rule codes when ignoring type issues -> quite a hassle, no value
"TRY300", # else instead of return before except. -> strongly disagree, hinders readabilty.
"COM812", # conflicts with ruff formatter -> not feasible nor recommended
"ISC001", # conflicts with ruff formatter -> not feasible nor recommended
"S404", # subprocess` module is possibly insecure -> as mentioned by ruff, unstable and preview
"FIX002", # line contains todo -> yes, that's what todo's are for?!
"TD003", # missing issue link for todo -> not in OSS
"PTH123", # use of open to be replaced with Path.open
"T201", # Remove `print`
"INP001", # Checks for packages that are missing an __init__.py file.
"RUF067", # __init__ module contains conditional imports -> needed for optional dependencies (preview rule)
]
[tool.ruff.lint.per-file-ignores]
"**/tests/**/*.py" = [
# we are more relaxed in tests, while sill applying hundreds of rules
"S101", # asserts allowed in tests...
"ARG", # unused function args -> fixtures nevertheless are functionally relevant...
"FBT", # don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
"PLR2004", # magic value used in comparison, ...
"PLR6301", # method could be a function, class method, or static method -> test organization pattern
"PT011", # exception to broad
"PLC2701", # private import, but required for unit testing
"PLC0415", # local import
"PT012", # exception to broad
"S311", # standard pseudo-random generators are not suitable for cryptographic purposes
"SLF001", # private member access required for unit testing
"S603", # check for execution of untrusted input
"ANN001", # missing type annotation for function argument
"ANN002", # missing type annotation
"ANN003", # missing type annotation
"ANN202", # missing return type annotation
"DOC201", # `return` is not documented in docstring
"ASYNC230", # async functions should not open files with blocking methods like `open`
"S104", # bind to all ports
"S607", # subprocess with partial path
]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pytest.ini_options]
addopts = "-v --strict-markers --cov=aignostics_foundry_core --cov-report=term-missing --cov-report=xml:reports/coverage.xml --cov-report=html:reports/coverage_html"
testpaths = ["tests"]
python_files = ["*_test.py", "test_*.py"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
timeout = 10 # We use a rather short default timeout. Override with @pytest.mark.timeout(timeout=N)
env = ["COVERAGE_FILE=.coverage", "COVERAGE_PROCESS_START=pyproject.toml"]
markers = [
# Test Categories (following Martin Fowler's Solitary vs Sociable unit test distinction)
"scheduled: Tests to run on a schedule. They will still be part on non-scheduled test executions.",
"sequential: Exclude from parallel test execution.",
"unit: Solitary unit tests - test a layer of a module in isolation with all dependencies mocked. Unit tests must be able to pass offline, i.e. not calls to external services. The timeout should not be bigger than the default 10s, and must be <5 min.",
"integration: Sociable integration tests - test interactions across architectural layers, using real file I/O and real subprocesses. Integration test must be able to pass offline, i.e. mock external services. The timeout should not be bigger than the default 10s, and must be <5 min.",
"e2e: End-to-end tests - test complete workflows with real external network services.",
]
md_report = true
md_report_output = "reports/pytest.md"
md_report_verbose = 1
md_report_flavor = "github"
md_report_color = "never"
md_report_exclude_outcomes = ["passed", "skipped"]
[tool.coverage.run]
sigterm = true
relative_files = true
source = ["src"]
omit = []
branch = true
parallel = true
concurrency = ["thread", "multiprocessing"]
[tool.coverage.paths]
source = ["src/"]
[tool.commitizen]
name = "cz_conventional_commits"
use_shortcuts = true
version_provider = "scm"
change_type_map = { "feat" = "Feat", "fix" = "Fix", "refactor" = "Refactor", "perf" = "Perf", "chore" = "Chores", "docs" = "Documentation" }
version_files = [
"pyproject.toml:version",
"VERSION",
"sonar-project.properties:sonar.projectVersion",
]
update_changelog_on_bump = true
major_version_zero = true # Allows breaking changes in 0.x.x versions; remove this line using a breaking-change commit to bump to 1.0.0
version_scheme = "semver2"
tag_format = "v$version"
tag = true
bump_message = "bump: version $current_version → $new_version [skip-ci]"
breaking_change_exclamation_in_title = true
# Pre-release configuration
prerelease = "alpha" # Default prerelease type
prerelease_offset = 0
changelog_merge_prerelease = true
style = [
[
"qmark",
"fg:#ff9d00 bold",
],
[
"question",
"bold",
],
[
"answer",
"fg:#ff9d00 bold",
],
[
"pointer",
"fg:#ff9d00 bold",
],
[
"highlighted",
"fg:#ff9d00 bold",
],
[
"selected",
"fg:#cc5454",
],
[
"separator",
"fg:#cc5454",
],
[
"instruction",
"",
],
[
"text",
"",
],
[
"disabled",
"fg:#858585 italic",
],
]
# Changelog template configuration
template = ".cz-templates/CHANGELOG.md.j2"