Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
237 lines (226 loc) · 8.98 KB
/
Copy pathpyproject.toml
File metadata and controls
237 lines (226 loc) · 8.98 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
[tool.uv.workspace]
members = [
"flashdreams",
# Each populated subdir under ``integrations_v2/`` is a standalone
# external integration repo (e.g. ``causal_forcing`` / ``self_forcing``
# plugins, ``omnidreams`` / ``lingbot`` integrations).
"integrations_v2/*",
"apps/*",
# Nested sub-packages that the app/integration globs do not reach.
"apps/handdreams/controller_input",
"integrations_v2/omnidreams/impl/ludus-renderer",
]
exclude = [
"apps/__init__.py",
"apps/README.md",
"integrations_v2/README.md",
]
# Override nvidia-cublas to >=13.4.1.3 because transformer-engine-cu13 2.14.0 was
# compiled against cuBLAS 13.4.x, while torch 2.12 caps nvidia-cublas at 13.1.1.3.
# cuBLAS 13.4 is backwards compatible with 13.1.
# Require 13.4.1.3 or newer for Windows wheels; 13.4.1.1 only ships Linux wheels.
[tool.uv]
managed = true
required-version = ">=0.11.8"
override-dependencies = [
"nvidia-cublas>=13.4.1.3",
# Temporary cap for mediapy 1.2.6: numpy 2.5 makes npt.NDArray a PEP 695
# TypeAliasType that mediapy subclasses during import.
# https://github.com/NVIDIA/flashdreams/issues/355
"numpy>=1.24,<2.5",
# Security floors for HTTP proxy TLS, chunked decoding, and items-view leaks.
"urllib3>=2.8.0,<3",
"multidict>=6.9.1,<7",
# Security floors for transitive async/TLS dependencies.
"anyio>=4.14.2",
"cryptography>=50.0.0",
"pyOpenSSL>=26.4.0",
# Keep protobuf off the 6.33.x line flagged by BDSA for the ParseDict
# recursion-depth follow-up. 7.x is outside the published affected range;
# use the latest compatible patch to avoid scanner version-map ambiguity.
"protobuf>=7.36.2,<8",
# CVE-2026-59890; PyTorch's <82 cap was unnecessary.
# ponytail: override legacy metadata until all profiles use torch>=2.13.
# https://github.com/pytorch/pytorch/pull/188190
"setuptools>=83.0.0,<84",
]
# Keep isolated builds on the same patched, validated setuptools line.
build-constraint-dependencies = ["setuptools>=83.0.0,<84"]
# `transformer-engine-torch` has no prebuilt wheel and must be built against
# the project's PyTorch + system CUDA. uv's default per-package build isolation
# spins up a clean venv with a fresh CPU-only torch (no numpy, no CUDA), so
# TE's `parse(torch.version.cuda)` crashes with `TypeError: ... got 'NoneType'`.
# This is the upstream-acknowledged workaround tracked in
# https://github.com/NVIDIA/TransformerEngine/issues/1323 — disable isolation
# so TE builds against the resolved torch from the project venv.
no-build-isolation-package = ["transformer-engine-torch"]
[tool.uv.sources]
flashdreams = { workspace = true }
[tool.pyright]
exclude = ["flashdreams/flashdreams/accelerated/multi_head_attention/triton/**", "flashdreams/flashdreams/accelerated/quantization/triton.py"]
ignore = ["flashdreams/flashdreams/accelerated/multi_head_attention/triton/**", "flashdreams/flashdreams/accelerated/quantization/triton.py"]
extraPaths = [
"flashdreams",
"apps",
"apps/cam2v",
"apps/t2v",
"apps/minimal_t2v",
"apps/crazy_robotaxi",
"apps/interactive_drive",
"apps/omnidreams_game_engine",
"apps/v2v",
"integrations_v2",
"integrations_v2/omnidreams/impl/ludus-renderer",
"integrations_v2/causal_forcing",
"apps/handdreams/controller_input",
"integrations_v2/cosmos_predict2",
"integrations_v2/flashvsr",
"integrations_v2/swiftvr",
"integrations_v2/fastvideo_causal_wan22",
"integrations_v2/lingbot",
"integrations_v2/sana_wm",
"integrations_v2/self_forcing",
"integrations_v2/wan21",
"integrations_v2/wan22",
"integrations_v2/color_fade",
"integrations_v2/null_model",
"integrations_v2/red_screen",
"integrations_v2/slangpy_ui_demo",
"integrations_v2/waypoint",
"integrations_v2/cosmos_interactive",
"apps/handdreams",
]
# For pyright to pickup the correct python.
venvPath = "."
venv = ".venv"
# Mirror the ty rule `invalid-method-override = "ignore"` below.
reportIncompatibleMethodOverride = "none"
reportIncompatibleVariableOverride = "none"
[tool.ty.environment]
# The complete workspace includes demos that require Python 3.12, as used in CI.
python-version = "3.12"
# Check applications independently of the lint host's OS (Some demos are Linux only, this is valid for CI).
python-platform = "all"
extra-paths = [
"flashdreams",
"apps",
"apps/cam2v",
"apps/t2v",
"apps/minimal_t2v",
"apps/action2v",
"apps/crazy_robotaxi",
"apps/interactive_drive",
"apps/omnidreams_game_engine",
"apps/v2v",
"integrations_v2",
"integrations_v2/omnidreams/impl/ludus-renderer",
"integrations_v2/causal_forcing",
"apps/handdreams/controller_input",
"integrations_v2/cosmos_predict2",
"integrations_v2/flashvsr",
"integrations_v2/swiftvr",
"integrations_v2/fastvideo_causal_wan22",
"integrations_v2/lingbot",
"integrations_v2/sana_wm",
"integrations_v2/self_forcing",
"integrations_v2/wan21",
"integrations_v2/wan22",
"integrations_v2/color_fade",
"integrations_v2/null_model",
"integrations_v2/red_screen",
"integrations_v2/slangpy_ui_demo",
"integrations_v2/waypoint",
"integrations_v2/cosmos_interactive",
"apps/handdreams",
]
[tool.ty.src]
# Auto-generated protobuf stubs trigger `conflicting-metaclass` errors due to
# protobuf's EnumTypeWrapper pattern (known ty limitation).
# Interactive Drive's imported scene/simulation support has known-untyped
# flashdreams / slangpy / numpy interop areas; keep it out of workspace ``ty``.
# (The pre-fold sample's pyright config had a similar exclude list.)
exclude = [
# Preserve pinned vLLM-Omni typing; the local network.py adapter is checked.
"integrations_v2/cosmos_interactive/cosmos_interactive/_lidar_codec/transformer_vae.py",
"integrations_v2/cosmos_interactive/cosmos_interactive/_lidar_codec/rope.py",
"integrations_v2/cosmos_interactive/cosmos_interactive/_lidar_codec/encoding.py",
"integrations_v2/cosmos_interactive/cosmos_interactive/_lidar_codec/neighborhood_attention.py",
"**/protos/*pb2*",
"apps/interactive_drive/interactive_drive/**",
# Same files as above; tests live beside the package, not inside it.
"apps/interactive_drive/tests/**",
# These map/archive parsers and numerical PhysX adapters intentionally
# accept dynamically shaped YAML, Arrow, and NumPy values. Keep the new
# V2 application, session, engine contracts, rollout, input, and renderer
# boundaries type-checked while isolating that data-oriented edge code.
"apps/omnidreams_game_engine/omnidreams_game_engine/game_map/**",
"apps/omnidreams_game_engine/omnidreams_game_engine/math_utils.py",
"apps/omnidreams_game_engine/omnidreams_game_engine/patterns.py",
"apps/omnidreams_game_engine/omnidreams_game_engine/ply_io.py",
"apps/omnidreams_game_engine/omnidreams_game_engine/scene_loader.py",
"apps/omnidreams_game_engine/omnidreams_game_engine/simulation/components.py",
"apps/omnidreams_game_engine/omnidreams_game_engine/simulation/game_physics.py",
]
[tool.ty.rules]
# Intentional pattern: integration subclasses override base methods with more specific
# signatures (violates Liskov but is the established design in this codebase).
invalid-method-override = "ignore"
[tool.ty.analysis]
# These packages have no useful type stubs (Triton kernels rewrite their
# call signatures via ``@triton.jit``) or are unavailable in CI; treat
# imports as Any.
replace-imports-with-any = ["flash_attn.**", "transformer_engine.**", "triton.**"]
[tool.pytest.ini_options]
addopts = "--import-mode=importlib -p flashdreams._pytest_plugins.marker_enforcement"
# Spawned test workers must be able to import their repository test modules.
pythonpath = ["."]
norecursedirs = [
"artifacts",
"parity_check",
"parity_check_v2",
"baseline_fastvideo",
"baseline_lightx2v",
"3rdparty",
# Copied third-party sources. Collecting them imports another project's
# modules under our conftest, and its test_* names are not our tests.
"vendor",
]
markers = [
"ci_cpu: CPU-safe test, runs on the CPU CI runner",
"ci_gpu: requires GPU or libGL (cv2), runs on the GPU CI runner",
"manual: heavy or environment-specific test, opt-in only",
]
[dependency-groups]
# Build tools and presentation assets collected by the offline executable packager.
offline-exe = [
"flashdreams[local-window]",
"ninja>=1.11",
"packaging>=24",
"pyinstaller>=6.22.2",
]
# Test-specific dependencies shared across workspace members. Listed here so
# that the type checker (ty) can resolve imports in test files and in
# flashdreams/_pytest_plugins.
test = [
"pytest>=8.0",
"pytest-benchmark>=5.1",
"pytest-asyncio>=0.23",
"pytest-manual-marker>=2.0",
"tomli>=2.0",
"imageio-ffmpeg>=0.5",
]
lint = [
"pre-commit>=4.3.0",
"ruff==0.12.7",
"sphinx>=7.0",
"ty>=0.0.39",
{include-group = "test"},
]
# Documentation site generator.
docs = [
"mkdocstrings-python>=2.0.9",
"zensical==0.0.67",
]
dev = [
"python-dotenv>=1.2.2",
]