更新
This commit is contained in:
@@ -7,6 +7,7 @@ $ErrorActionPreference = "Stop"
|
||||
$ProjectRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
$BuildScript = Join-Path $PSScriptRoot "build_windows.ps1"
|
||||
$BuildEnvironment = Join-Path $ProjectRoot ".venv-build"
|
||||
$ProjectUvCache = Join-Path $ProjectRoot ".uv-cache"
|
||||
$BuildPython = Join-Path $BuildEnvironment "Scripts\python.exe"
|
||||
$FallbackPython = Join-Path $ProjectRoot ".venv\Scripts\python.exe"
|
||||
$CompanionRoot = Join-Path $ProjectRoot "video_companion"
|
||||
@@ -17,6 +18,7 @@ $DistributionRoot = Join-Path $ProjectRoot "dist"
|
||||
$ReleaseLauncherTemplate = Join-Path $ProjectRoot "packaging\windows\start_release.bat"
|
||||
$ReleaseLauncher = Join-Path $DistributionRoot "Start_DoctorWorkstation.bat"
|
||||
$ProjectMetadata = Join-Path $ProjectRoot "pyproject.toml"
|
||||
$MediaSmokeHook = Join-Path $ProjectRoot "packaging\runtime_media_smoke.py"
|
||||
|
||||
function Test-BuildPython {
|
||||
param([Parameter(Mandatory = $true)][string]$Candidate)
|
||||
@@ -48,6 +50,7 @@ try {
|
||||
$PackageLock,
|
||||
(Join-Path $ProjectRoot "uv.lock"),
|
||||
$ProjectMetadata,
|
||||
$MediaSmokeHook,
|
||||
$ReleaseLauncherTemplate
|
||||
)) {
|
||||
if (-not (Test-Path -LiteralPath $RequiredFile -PathType Leaf)) {
|
||||
@@ -83,11 +86,21 @@ try {
|
||||
"UV_PROJECT_ENVIRONMENT",
|
||||
"Process"
|
||||
)
|
||||
$PreviousUvCache = [Environment]::GetEnvironmentVariable(
|
||||
"UV_CACHE_DIR",
|
||||
"Process"
|
||||
)
|
||||
New-Item -ItemType Directory -Path $ProjectUvCache -Force | Out-Null
|
||||
[Environment]::SetEnvironmentVariable(
|
||||
"UV_PROJECT_ENVIRONMENT",
|
||||
$BuildEnvironment,
|
||||
"Process"
|
||||
)
|
||||
[Environment]::SetEnvironmentVariable(
|
||||
"UV_CACHE_DIR",
|
||||
$ProjectUvCache,
|
||||
"Process"
|
||||
)
|
||||
Push-Location $ProjectRoot
|
||||
try {
|
||||
& $Uv sync --frozen --extra build
|
||||
@@ -102,6 +115,11 @@ try {
|
||||
$PreviousProjectEnvironment,
|
||||
"Process"
|
||||
)
|
||||
[Environment]::SetEnvironmentVariable(
|
||||
"UV_CACHE_DIR",
|
||||
$PreviousUvCache,
|
||||
"Process"
|
||||
)
|
||||
}
|
||||
}
|
||||
elseif (Test-BuildPython -Candidate $BuildPython) {
|
||||
|
||||
Reference in New Issue
Block a user