update sensor bench
This commit is contained in:
+20
-3
@@ -8,6 +8,7 @@ $RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
|
||||
$DistDir = Join-Path $RepoRoot "dist"
|
||||
$WorkDir = Join-Path $RepoRoot "build\pyinstaller_work"
|
||||
$SpecPath = Join-Path $PSScriptRoot "sensor_bench.spec"
|
||||
$RepoConfig = Join-Path $RepoRoot "config"
|
||||
|
||||
if (-not (Get-Command conda -ErrorAction SilentlyContinue)) {
|
||||
throw "conda was not found on PATH. Open an Anaconda Prompt or initialize conda for PowerShell."
|
||||
@@ -16,10 +17,20 @@ if (-not (Get-Command conda -ErrorAction SilentlyContinue)) {
|
||||
Push-Location $RepoRoot
|
||||
try {
|
||||
conda run -n $EnvName python -m pip install --upgrade pip
|
||||
if ($LASTEXITCODE -ne 0) { throw "pip upgrade failed in env '$EnvName'." }
|
||||
|
||||
conda run -n $EnvName python -m pip install -e ".[pack]"
|
||||
if ($LASTEXITCODE -ne 0) { throw "Editable install failed in env '$EnvName'." }
|
||||
|
||||
conda run -n $EnvName python -m pip install --upgrade orisys
|
||||
if ($LASTEXITCODE -ne 0) { throw "orisys install failed in env '$EnvName'." }
|
||||
|
||||
# Sync Orisys wheel sensor configs into repo config/ before packaging.
|
||||
conda run -n $EnvName python build/sync_wheel_configs.py
|
||||
if ($LASTEXITCODE -ne 0) { throw "Config sync failed." }
|
||||
|
||||
conda run -n $EnvName python tests/test_smoke.py
|
||||
if ($LASTEXITCODE -ne 0) { throw "Smoke tests failed." }
|
||||
|
||||
if (Test-Path $WorkDir) {
|
||||
Remove-Item -Recurse -Force $WorkDir
|
||||
@@ -29,14 +40,20 @@ try {
|
||||
}
|
||||
|
||||
conda run -n $EnvName python -m PyInstaller --noconfirm --clean --distpath "$DistDir" --workpath "$WorkDir" "$SpecPath"
|
||||
if ($LASTEXITCODE -ne 0) { throw "PyInstaller failed." }
|
||||
|
||||
# Public package only: copy exhibition config/. Never ship internal/ operator assets.
|
||||
Copy-Item -Recurse -Force $RepoConfig (Join-Path $DistDir "SensorBench")
|
||||
$InternalLeak = Join-Path $DistDir "SensorBench\internal"
|
||||
if (Test-Path $InternalLeak) {
|
||||
throw "Public dist must not contain internal/: $InternalLeak"
|
||||
}
|
||||
|
||||
Copy-Item -Recurse -Force (Join-Path $RepoRoot "config") (Join-Path $DistDir "SensorBench")
|
||||
Copy-Item -Recurse -Force (Join-Path $RepoRoot "steps") (Join-Path $DistDir "SensorBench")
|
||||
conda run -n $EnvName python build/verify_dist.py
|
||||
if ($LASTEXITCODE -ne 0) { throw "Distribution verification failed." }
|
||||
|
||||
Write-Host "Build complete: dist\SensorBench\SensorBench.exe"
|
||||
}
|
||||
finally {
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user