Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
140 lines (126 loc) · 3.75 KB
/
Copy pathpyproject.toml
File metadata and controls
140 lines (126 loc) · 3.75 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
[project]
name = "trajectory-workspace"
version = "0.3.0"
description = "Development workspace for the trajectory evaluation harness"
requires-python = ">=3.12"
dependencies = [
"trajectory-core",
"trajectory-eval",
"trajectory-api",
]
[tool.uv.workspace]
members = ["packages/*"]
[tool.uv.sources]
trajectory-core = { workspace = true }
trajectory-eval = { workspace = true }
trajectory-api = { workspace = true }
[dependency-groups]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-cov>=6.0",
"pytest-timeout>=2.3",
"httpx>=0.28",
"testcontainers[postgres]>=4.9",
"ruff>=0.9",
"mypy>=1.14",
"types-PyYAML>=6.0",
"pre-commit>=4.0",
]
[tool.ruff]
line-length = 100
target-version = "py312"
extend-exclude = ["tasks", "fixtures", "web", "packages/api/migrations/versions"]
[tool.ruff.lint]
select = [
"E", "W", # pycodestyle
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # bugbear
"C4", # comprehensions
"SIM", # simplify
"RUF", # ruff
"ANN", # annotations
"ASYNC", # async correctness
"BLE", # blind except
"DTZ", # timezone aware datetimes
"S", # bandit
"PTH", # pathlib
"TID", # tidy imports
"D", # pydocstyle
]
ignore = [
"D100", "D104", # module and package docstrings are not mandatory
"D203", "D213", # mutually exclusive with the styles we do use
"S101", # assert is how pytest works
]
[tool.ruff.lint.per-file-ignores]
"**/tests/**" = ["D", "ANN", "S105", "S106", "S108", "PLR2004"]
"scripts/*" = ["D", "S603", "S607"]
"packages/api/migrations/*" = ["D", "ANN", "I"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
known-first-party = ["trajectory_core", "trajectory_runner", "trajectory_api"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.mypy]
python_version = "3.12"
strict = true
warn_unreachable = true
warn_no_return = true
disallow_any_generics = true
show_error_codes = true
pretty = true
files = [
"packages/core/src",
"packages/runner/src",
"packages/api/src",
"scripts",
]
exclude = ["packages/api/migrations/versions/.*"]
[[tool.mypy.overrides]]
module = [
"litellm.*",
"docker.*",
"testcontainers.*",
"slowapi.*",
"prometheus_client.*",
# Only installed where scripts/check_harbor_models.py runs, never in this workspace.
"harbor.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["packages/core/tests", "packages/runner/tests", "packages/api/tests", "tests"]
# `scripts/` is not a package and is deliberately not installed, because nothing should
# import it at runtime. `tests/` still has to, so it goes on the path here rather than
# through a `tests/conftest.py`: a second conftest at that level shadows the per package
# ones, and `packages/api/tests/test_api.py` imports its factories from `conftest` by name.
pythonpath = ["scripts"]
addopts = "-ra --strict-markers --strict-config"
timeout = 300
markers = [
"docker: requires a reachable Docker daemon",
"local_verify: runs a verify command on the local backend, so needs a host python with pytest",
"postgres: requires a reachable Postgres instance",
"slow: takes more than a few seconds",
]
[tool.coverage.run]
branch = true
source = [
"packages/core/src/trajectory_core",
"packages/runner/src/trajectory_runner",
"packages/api/src/trajectory_api",
]
omit = ["*/migrations/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@overload",
]