-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpyproject.toml
More file actions
156 lines (145 loc) · 5.56 KB
/
pyproject.toml
File metadata and controls
156 lines (145 loc) · 5.56 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
[tool.uv.workspace]
members = [
"flashdreams",
# Each populated subdir under ``integrations/`` is a standalone
# external integration repo (e.g. ``causal_forcing`` / ``self_forcing``
# plugins, ``omnidreams`` / ``lingbot`` integrations); empty stub
# folders alongside them are intentional placeholders for future
# extractions and don't ship a ``pyproject.toml`` yet.
"integrations/*",
# Nested sub-packages that the ``integrations/*`` glob does not reach.
"integrations/omnidreams/ludus-renderer",
]
# Override nvidia-cublas to >=13.4 because transformer-engine-cu13 2.14.0 was
# compiled against cuBLAS 13.4.x, while torch 2.11 pins nvidia-cublas 13.1.0.3.
# cuBLAS 13.4 is backwards compatible with 13.1.
[tool.uv]
managed = true
required-version = ">=0.11.8"
override-dependencies = [
"nvidia-cublas>=13.4",
# Keep transitive HTTP clients off urllib3 versions with sensitive-header
# redirect handling vulnerabilities.
"urllib3>=2.7.0",
# Keep protobuf off the 6.33.x line flagged by BDSA for the ParseDict
# recursion-depth follow-up.
"protobuf>=7.35.0,<8",
]
# `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.pyright]
extraPaths = [
"flashdreams",
"integrations/omnidreams",
"integrations/omnidreams/ludus-renderer",
"integrations/causal_forcing",
"integrations/cosmos_predict2",
"integrations/flashvsr",
"integrations/fastvideo_causal_wan22",
"integrations/hy_worldplay",
"integrations/lingbot",
"integrations/self_forcing",
"integrations/wan21",
"integrations/wan22",
]
# 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]
python-version = "3.10"
extra-paths = [
"flashdreams",
"integrations/omnidreams",
"integrations/omnidreams/ludus-renderer",
"integrations/causal_forcing",
"integrations/cosmos_predict2",
"integrations/flashvsr",
"integrations/fastvideo_causal_wan22",
"integrations/hy_worldplay",
"integrations/lingbot",
"integrations/self_forcing",
"integrations/wan21",
"integrations/wan22",
]
[tool.ty.src]
# Auto-generated protobuf stubs trigger `conflicting-metaclass` errors due to
# protobuf's EnumTypeWrapper pattern (known ty limitation).
# The ``omnidreams.interactive_drive`` subpackage's flashdreams / slangpy /
# numpy interop surface has known-untyped areas; exclude both the
# subpackage source and its tests so workspace ``ty`` stays clean.
# (The pre-fold sample's pyright config had a similar exclude list.)
exclude = [
"**/protos/*pb2*",
"integrations/omnidreams/omnidreams/interactive_drive/**",
"integrations/omnidreams/tests/interactive_drive/**",
# Bench / parity-debugging scaffolding for the hy_worldplay integration;
# not shipped product, mirrors the interactive_drive precedent above.
"integrations/hy_worldplay/tests/parity_check/**",
]
[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"
norecursedirs = [
"parity_check",
"baseline_fastvideo",
"baseline_lightx2v",
]
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]
# 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-asyncio>=0.23",
"pytest-manual-marker>=2.0",
"tomli>=2.0",
"imageio-ffmpeg>=0.5",
]
lint = ["pre-commit>=4.3.0", "ty>=0.0.39", {include-group = "test"}]
# Sphinx toolchain for building docs locally (`uv run --group docs sphinx-build ...`).
docs = [
"furo>=2024.0",
"sphinx>=7.0",
"sphinx-autobuild>=2024.0",
"sphinx-copybutton>=0.5",
"sphinx-design>=0.5",
"myst-parser>=4.0",
]
# CPU-only runtime deps needed by autodoc to import flashdreams on CI.
# Heavy GPU packages (transformer-engine, pynvml, boto3, mediapy, cv2) are
# mocked via `autodoc_mock_imports` in docs/source/conf.py.
# CI installs: `uv sync --only-group docs --only-group docs-ci`
# then `uv pip install --no-deps ./flashdreams` to make the package importable.
docs-ci = [
"einops>=0.7",
"ftfy>=6.0",
"huggingface-hub>=0.33",
"loguru>=0.7",
"numpy>=1.24",
"safetensors>=0.4",
"torch>=2.9",
"tqdm>=4.60",
"transformers>=5.0,<6",
]