Files
rustytorch/scripts/migration/add-workspace-deps.sh
T
2026-03-04 00:08:42 +00:00

111 lines
5.5 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "📝 Adding RTX crates to workspace.dependencies"
echo "============================================="
# Create a temporary file with the workspace dependency entries
cat > workspace-deps.toml << 'EOF'
# RTX internal crates - Core
rtx-tensor = { path = "crates/core/rtx-tensor", version = "1.0.0" }
rtx-runtime = { path = "crates/core/rtx-runtime", version = "1.0.0" }
rtx-autograd = { path = "crates/core/rtx-autograd", version = "1.0.0" }
rtx-memory = { path = "crates/core/rtx-memory", version = "1.0.0" }
rtx-kernel = { path = "crates/core/rtx-kernel", version = "1.0.0" }
rtx-bindings = { path = "crates/core/rtx-bindings", version = "1.0.0" }
rtx-graph = { path = "crates/core/rtx-graph", version = "1.0.0" }
rtx-validation = { path = "crates/core/rtx-validation", version = "1.0.0" }
rtx-losses = { path = "crates/core/rtx-losses", version = "1.0.0" }
# RTX internal crates - Training
rtx-transformers = { path = "crates/training/rtx-transformers", version = "1.0.0" }
rtx-distributed = { path = "crates/training/rtx-distributed", version = "1.0.0" }
rtx-rl = { path = "crates/training/rtx-rl", version = "1.0.0" }
rtx-compress = { path = "crates/training/rtx-compress", version = "1.0.0" }
rtx-flash-attention = { path = "crates/training/rtx-flash-attention", version = "1.0.0" }
rtx-preprocessing = { path = "crates/training/rtx-preprocessing", version = "1.0.0" }
rtx-auto = { path = "crates/training/rtx-auto", version = "1.0.0" }
rtx-automeasure = { path = "crates/training/rtx-automeasure", version = "1.0.0" }
rtx-evolution = { path = "crates/training/rtx-evolution", version = "1.0.0" }
rtx-federated = { path = "crates/training/rtx-federated", version = "1.0.0" }
# RTX internal crates - Models
rtx-vision = { path = "crates/models/rtx-vision", version = "1.0.0" }
rtx-vision-advanced = { path = "crates/models/rtx-vision-advanced", version = "1.0.0" }
rtx-multimodal = { path = "crates/models/rtx-multimodal", version = "1.0.0" }
rtx-diffuse = { path = "crates/models/rtx-diffuse", version = "1.0.0" }
rtx-timeseries = { path = "crates/models/rtx-timeseries", version = "1.0.0" }
rtx-neuromorphic = { path = "crates/models/rtx-neuromorphic", version = "1.0.0" }
rtx-nlg = { path = "crates/models/rtx-nlg", version = "1.0.0" }
# RTX internal crates - Production
rtx-serving-api = { path = "crates/production/rtx-serving-api", version = "1.0.0" }
rtx-inference = { path = "crates/production/rtx-inference", version = "1.0.0" }
rtx-streaming = { path = "crates/production/rtx-streaming", version = "1.0.0" }
rtx-mlops-orchestrator = { path = "crates/production/rtx-mlops-orchestrator", version = "1.0.0" }
rtx-edge = { path = "crates/production/rtx-edge", version = "1.0.0" }
rtx-security = { path = "crates/production/rtx-security", version = "1.0.0" }
rtx-robust = { path = "crates/production/rtx-robust", version = "1.0.0" }
rtx-cloud = { path = "crates/production/rtx-cloud", version = "1.0.0" }
rtx-hub = { path = "crates/production/rtx-hub", version = "1.0.0" }
# RTX internal crates - Specialized
rtx-quantum = { path = "crates/specialized/rtx-quantum", version = "1.0.0" }
rtx-synthesis = { path = "crates/specialized/rtx-synthesis", version = "1.0.0" }
rtx-compiler = { path = "crates/specialized/rtx-compiler", version = "1.0.0" }
rtx-geom = { path = "crates/specialized/rtx-geom", version = "1.0.0" }
rtx-polygraph = { path = "crates/specialized/rtx-polygraph", version = "1.0.0" }
rtx-sklearn-py = { path = "crates/specialized/rtx-sklearn-py", version = "1.0.0" }
rtx-ml-classic = { path = "crates/specialized/rtx-ml-classic", version = "1.0.0" }
rtx-platform = { path = "crates/specialized/rtx-platform", version = "1.0.0" }
rtx-hardware-extended = { path = "crates/specialized/rtx-hardware-extended", version = "1.0.0" }
rtx-science = { path = "crates/specialized/rtx-science", version = "1.0.0" }
# RTX internal crates - Tooling
rtx-bench = { path = "crates/tooling/rtx-bench", version = "1.0.0" }
rtx-profiler = { path = "crates/tooling/rtx-profiler", version = "1.0.0" }
rtx-governance = { path = "crates/tooling/rtx-governance", version = "1.0.0" }
rtx-privacy = { path = "crates/tooling/rtx-privacy", version = "1.0.0" }
rtx-eval = { path = "crates/tooling/rtx-eval", version = "1.0.0" }
rtx-docs = { path = "crates/tooling/rtx-docs", version = "1.0.0" }
rtx-examples = { path = "crates/tooling/rtx-examples", version = "1.0.0" }
rtx-debug = { path = "crates/tooling/rtx-debug", version = "1.0.0" }
rtx-codegen = { path = "crates/tooling/rtx-codegen", version = "1.0.0" }
rtx-finance = { path = "crates/tooling/rtx-finance", version = "1.0.0" }
rtx-audio = { path = "crates/tooling/rtx-audio", version = "1.0.0" }
rtx-games = { path = "crates/tooling/rtx-games", version = "1.0.0" }
EOF
echo "Adding RTX crate dependencies to Cargo.toml..."
# Insert the RTX crate dependencies after the [workspace.dependencies] line
python3 << 'PYTHON'
import sys
with open('Cargo.toml', 'r') as f:
lines = f.readlines()
with open('workspace-deps.toml', 'r') as f:
deps = f.readlines()
# Find where to insert
insert_idx = -1
for i, line in enumerate(lines):
if '[workspace.dependencies]' in line:
insert_idx = i + 1
break
if insert_idx > 0:
# Insert RTX deps first, then other deps
lines[insert_idx:insert_idx] = deps
with open('Cargo.toml', 'w') as f:
f.writelines(lines)
print("✅ Added RTX workspace dependencies")
else:
print("❌ Could not find [workspace.dependencies] section")
sys.exit(1)
PYTHON
rm workspace-deps.toml
echo "✅ Workspace dependencies updated!"