Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
188 lines (172 loc) · 5.59 KB
/
Copy pathpyproject.toml
File metadata and controls
188 lines (172 loc) · 5.59 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
[project]
name = "qdash"
version = "0.1.0"
description = ""
authors = [
{name = "orangekame3", email = "oqtopus-team@googlegroups.com"}
]
readme = "README.md"
requires-python = ">=3.11,<3.13"
dependencies = [
"bunnet>=1.3.0",
"httpx>=0.27.0",
"numpy>=1.26.0",
"pendulum>=3.1.0",
"pydantic>=2.8.0",
"pymongo>=4.8.0",
"qdash-api",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = [
"src/qdash",
]
[tool.ruff]
line-length = 100
exclude = ["tools", "scripts"]
target-version = "py310"
lint.unfixable = ["F401"]
lint.select = [
"E", # pycodestyle errors
"F", # Pyflakes
"W", # pycodestyle warnings
"I", # isort
"B", # flake8-bugbear
"UP", # pyupgrade
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
"RET", # flake8-return
"TCH", # flake8-type-checking
"PIE", # flake8-pie
"PERF", # perflint
"PLC", # pylint convention
"PLE", # pylint error
"PLW", # pylint warning
"RUF", # ruff-specific rules
"S", # flake8-bandit (security)
]
lint.ignore = [
"E501", # line-too-long (handled by formatter)
"B904", # raise-without-from-inside-except (TODO: fix in exception handling task)
"B008", # function-call-in-default-argument (FastAPI Depends pattern)
"B007", # unused-loop-control-variable (minor style issue)
"B012", # return-in-finally (intentional in specific cases)
"B027", # empty-method-without-abstract-decorator (intentional default impl)
"RET505", # superfluous-else-return (style preference)
"RET506", # superfluous-else-raise (style preference)
"SIM102", # collapsible-if (readability preference)
"SIM108", # if-else-block-instead-of-if-exp (readability preference)
"PERF401", # manual-list-comprehension (readability over micro-optimization)
"PERF402", # manual-list-copy (readability over micro-optimization)
"PLW0603", # global-statement (used for singletons/caching)
"PLC0415", # import-outside-top-level (intentional lazy imports for optional deps/circular refs)
"RUF003", # ambiguous-unicode-character-comment (Japanese comments)
"RUF012", # mutable-class-default (Pydantic models)
"S101", # assert (used for runtime checks)
]
[tool.ruff.lint.per-file-ignores]
"src/qdash/workflow/service/calib_service.py" = ["E402"] # Circular import avoidance
"src/qdash/workflow/paths.py" = ["F401"] # Re-exports for backward compatibility
"src/qdash/api/routers/*.py" = ["TC001"] # FastAPI dependency annotations need runtime imports
"src/qdash/api/routers/auth.py" = ["S106"] # "bearer" is standard token type
"src/qdash/api/schemas/auth.py" = ["S105"] # "bearer" is standard OAuth token type
"src/qdash/client/services/models.py" = ["TC003", "S105"] # Generated file; keep source untouched
"src/qdash/api/services/flow_service.py" = ["S603", "S607"] # ruff format subprocess call
"src/qdash/agent/runner.py" = ["S603"] # Runs the configured local Codex binary
"src/qdash/api/lib/topology_config.py" = ["S112"] # Skip invalid config files
"tests/**" = [
"ANN201",
"ANN205",
"ANN401",
"CPY001",
"D",
"PLC1901",
"PLR2004",
"PLR6301",
"S101",
"S106", # Test data passwords
"S108", # /tmp usage in tests is acceptable
"RUF002", # Japanese in docstrings
]
[tool.mypy]
strict = true
ignore_missing_imports = true
exclude = ["tools", "scripts", "user_flows"]
# Disable error codes for known issues:
# - misc: FastAPI untyped decorator warnings
# - override: Liskov substitution violations in calibtasks (design issue)
# - no-untyped-call: Calls to untyped external library functions
disable_error_code = ["misc", "override", "no-untyped-call", "redundant-cast"]
# Use explicit package bases to avoid src.qdash vs qdash conflicts
explicit_package_bases = true
mypy_path = "src"
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_decorators = false
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
[tool.uv]
exclude-newer = "3 days"
[tool.coverage.run]
source = ["src/qdash"]
omit = [
# Data models - primarily type definitions
"src/qdash/datamodel/*",
# Database models - document definitions
"src/qdash/dbmodel/*",
# API schemas - request/response models
"src/qdash/api/schemas/*",
# Auto-generated client code
"src/qdash/client/*",
# Internal service modules
"src/qdash/workflow/service/_internal/*",
# Worker tasks
"src/qdash/workflow/worker/*",
# Setup scripts
"src/qdash/workflow/setup_work_pool.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"@abstractmethod",
]
[dependency-groups]
dev = [
"ruff==0.15.14",
"pytest==9.0.3",
"pytest-cov==7.1.0",
"pytest-env==1.6.0",
"pytest-mypy==1.0.1",
"pytest-asyncio==1.3.0",
"pytest-mock==3.15.1",
"mongomock==4.3.0",
"go-task-bin>=3.41.0",
"pyyaml==6.0.3",
"types-pyyaml>=6.0.12.20250809",
"types-python-dateutil>=2.9.0.20250809",
"types-croniter>=6.0.0.20250809",
"types-requests>=2.32.0.20250809",
"setuptools>=80.9.0",
]
[tool.uv.workspace]
members = [
"src/qdash/api",
"src/qdash/client",
"src/qdash/workflow",
]
[tool.uv.sources]
qdash-api = { workspace = true }
qubex = { git = "https://github.com/amachino/qubex.git", branch = "develop" }