forked from RC219805/Transformation_Portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
293 lines (272 loc) · 9.49 KB
/
Copy pathpyproject.toml
File metadata and controls
293 lines (272 loc) · 9.49 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
[build-system]
requires = ["setuptools>=65"]
build-backend = "setuptools.build_meta"
[project]
name = "transformation-portal"
version = "0.2.0"
description = "Professional image and video processing toolkit for luxury real estate rendering and architectural visualization."
readme = "README.md"
requires-python = ">=3.11"
authors = [{ name = "RC219805" }]
# Core dependencies - see requirements/base.in for pinned versions
dependencies = [
# Keep broad runtime ranges in pyproject and enforce tested combos via lockfiles/CI.
# Keep ranges compatible with requirements/base.in lockfile policy (ADR-032).
"numpy>=1.24,<2.5.0",
"Pillow>=10.0.0,<13",
"scipy>=1.15,<2",
"scikit-learn>=1.0,<2",
"opencv-python-headless>=4.8.0,<5 ; platform_system == 'Linux'", # required for depth_writer (core pipeline)
"opencv-python>=4.8.0,<5 ; platform_system != 'Linux'", # required for depth_writer (core pipeline)
"typer>=0.10.0,<1",
"tqdm>=4.66,<5",
# Web stack ranges are intentionally bounded here.
# Exact versions are enforced in requirements/base.in and compiled lockfiles.
"fastapi>=0.121.0,<0.137",
"starlette>=0.49.1,<1.1", # direct runtime import + curated Starlette 1.x validation window
"uvicorn>=0.29.0,<0.49",
"aiofiles>=23.2.1,<26",
"tifffile>=2023.7.18,<2027",
"imagecodecs>=2023.9.18,<2027",
"PyYAML>=6.0,<7", # required for APEX pipeline config parsing
"pydantic>=2.0,<3", # required for ingest contract schema validation
"jsonschema>=4.21.0,<5", # required for deterministic contract surface validation
"boto3>=1.34,<2", # required for TP_ARTIFACT_STORE=s3 ArtifactStore runtime
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: Other/Proprietary License",
"Operating System :: OS Independent",
]
[project.optional-dependencies]
# ML and deep learning - see requirements/ml-*.in for layered pinned versions
# ML dependencies. Note: `realesrgan` is BANNED (unmaintained).
# Enforcement: requirements/constraints.txt hard-block pins + scripts/security/verify_banned_dependencies.py
#
# LAYERED ML DEPENDENCY STRATEGY
# ==============================
# ML dependencies are organized into capability layers.
# The lockfile system (requirements/*.txt) is the operational source of truth.
# pyproject.toml extras are minimal capability pointers for editable installs.
#
# Standard Layers (lockfile-compiled):
# ml-core Cross-platform ML baseline
# ml-raw RAW camera file ingest
# ml.txt Standard umbrella (ml-core + ml-raw)
#
# Scripted-Only Layers (use bootstrap script):
# sam2 SAM2 segmentation - requires non-standard install semantics
# Install via: ./scripts/bootstrap/install_ml_stack.sh --profile core-cpu,sam2
#
# Platform-Specific Layers:
# coreml Apple CoreML acceleration (macOS only)
# ML Core - supported ML baseline (minimal spec, see ml-core.in for pins)
ml-core = [
"torch>=2.8.0",
"torchvision>=0.23.0",
"diffusers>=0.38.0,<1",
"transformers>=5.0.0,<5.1",
"huggingface-hub>=0.19",
"accelerate>=0.20",
]
# CoreML acceleration (optional, Apple Silicon only)
coreml = [
"coremltools>=7.0 ; platform_system == 'Darwin'",
]
# RAW camera file support (CR2, NEF, ARW, DNG, etc.)
raw = [
"rawpy>=0.18.0",
]
# Standard ML umbrella - supported metadata layers only (ml-core + ml-raw)
# Does NOT include: sam2 (scripted-only), coreml (platform-specific), research (experimental)
# For additional capabilities:
# SAM2: ./scripts/bootstrap/install_ml_stack.sh --profile core-cpu,sam2
# CoreML: ./scripts/bootstrap/install_ml_stack.sh --profile core-cpu,coreml (macOS only)
# Full: ./scripts/bootstrap/install_ml_stack.sh --profile full (same as ml.txt)
ml = [
"torch>=2.8.0",
"torchvision>=0.23.0",
"diffusers>=0.38.0,<1",
"transformers>=5.0.0,<5.1",
"rawpy>=0.18.0",
]
# Spatial AI research pipeline (Phase 2) — SAM2 + NVDiffRec + 3DGS
# SAM2 requires a non-standard scripted install in addition to the package:
# ./scripts/bootstrap/install_ml_stack.sh --profile core-cpu,sam2
# NVDiffRec requires manual install of nvdiffrast compiled CUDA extensions:
# ./scripts/bootstrap/install_ml_stack.sh --profile nvdiffrec
# 3DGS (graphdeco-inria/gaussian-splatting) requires SHA verification:
# python scripts/validation/verify_3dgs_artifacts.py
spatial-ai = [
"transformation-portal[ml-core]",
"huggingface-hub>=0.19",
# SAM2: pip install sam2 (requires scripted bootstrap for weights)
"sam2>=1.0; python_version >= '3.10'",
# nvdiffrast (compiled CUDA extension) must be installed separately:
# git clone https://github.com/NVlabs/nvdiffrast && pip install -e .
]
# Optional detached signing support for archive attestation CLIs
archive-signing = [
"cryptography>=46.0,<48",
]
# Development tools - see requirements/dev.in for pinned versions
dev = [
"pytest>=8.0,<10",
"pytest-cov>=4.0,<8",
"httpx>=0.28,<1", # required for FastAPI/Starlette TestClient in HTTP contract tests
"hypothesis>=6.0,<7",
"jsonschema>=4.21.0,<5", # required for machine-mode contract schema validation tests
"cryptography>=46.0,<48", # required for Phase 3.1 signing CLI tests
"moto[s3]>=5.0,<6", # required for moto-backed S3 ArtifactStore contract tests
"mypy>=1.10",
"flake8>=7.0",
"pylint>=3.0",
"black>=24.8",
"isort>=5.13,<9",
"autopep8>=2.0,<3",
"libcst>=1.2,<2",
"types-PyYAML>=6.0.12",
"pre-commit>=4.0,<5",
]
# CI/CD tools - see requirements/ci.in for pinned versions
ci = [
"bandit>=1.7,<2",
"safety>=2.3,<4",
"build>=1.0,<2",
"twine>=4.0,<7",
"tox>=4.5,<5",
"pypdf>=3.9.0",
]
# All dependencies combined (minimal pointer, not full graph)
# For production, use lockfiles: requirements/all.txt
all = [
"transformation-portal[ml,dev,ci]",
]
[project.scripts]
# Main CLI entry points
transform-render = "transformation_portal.cli:render_cli"
transform-process = "transformation_portal.cli:process_cli"
transform-analyze = "transformation_portal.cli:analyze_cli"
# Lux Depth V3 Pipeline CLI (APEX command variants)
lux-depth-v3 = "transformation_portal.lux_depth_v3.__main__:app"
# Depth-aware post-processing CLI
depth-aware-dof = "transformation_portal.depth.depth_aware_dof:main"
# Luxury TIFF Batch Processor CLI
luxury-tiff-batch = "luxury_tiff_batch_processor.cli:main"
# Legacy compatibility (can be removed in future versions)
luxury_video_grader = "transformation_portal.processors.luxury_video_master_grader:main"
lux_render = "transformation_portal.pipelines.lux_render_pipeline:main"
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["tests*", "data*", "docs*", "scripts"]
[tool.setuptools.package-data]
"transformation_portal.schemas.run_card" = ["*.json"]
[tool.pylint.main]
# Increase limits for complex image/video processing functions
max-args = 8
max-locals = 20
max-branches = 15
max-statements = 60
max-line-length = 127
max-module-lines = 1500
[tool.pylint.messages_control]
# Disable specific checks that are overly strict for this codebase
disable = [
"too-few-public-methods",
"missing-module-docstring",
"missing-function-docstring",
"missing-class-docstring",
"duplicate-code",
"fixme",
]
[tool.pytest.ini_options]
minversion = "8.0"
addopts = "--strict-markers --tb=short -p no:warnings"
testpaths = ["tests"]
pythonpath = [".", "src"]
python_files = "test_*.py"
python_classes = "Test*"
asyncio_mode = "auto"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"unit: fast unit tests (<1s each)",
"regression: regression tests with known fixtures",
"security: security-focused tests for hardening and trust boundaries",
"integration: tests requiring multiple components",
"ml: tests requiring ML models/large downloads",
"golden: golden regression tests with curated fixtures",
"stress: stress tests for large batches and resource limits (CI typically excludes; run manually)",
"benchmark: performance benchmarks with budgets (CI typically excludes; run manually)",
]
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/venv/*",
"*/venv_py311/*",
"*/.venv/*",
]
branch = true
parallel = true
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.xml]
output = "coverage.xml"
# Coverage thresholds - enforced in CI
# Strategy: Start at current baseline, ratchet upward
[tool.coverage.paths]
source = ["src/transformation_portal"]
# Black formatting configuration
[tool.black]
line-length = 127
target-version = ["py311", "py312"]
include = '\.pyi?$'
extend-exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| venv
| venv_py311
| _build
| buck-out
| build
| dist
| deprecated
)/
'''
# isort configuration (compatible with black)
[tool.isort]
profile = "black"
line_length = 127
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
skip_glob = ["*/deprecated/*", "*/archive/*", "*/.venv/*", "*/venv/*"]
[[tool.setuptools.ext-modules]]
name = "transformation_portal.determinism._fpstate"
sources = ["src/transformation_portal/determinism/_fpstate.c"]