feat: 本地 uv 与托管 Python 环境管理
- 新增 uv 管理:只认程序目录副本或指定路径,支持从科大镜像下载并按 sha256 校验 - uv 环境变量(UV_*)可配置,默认相对程序目录(python / uv-cache),同时注入 uv 调用与任务进程 - 新增托管虚拟环境与 Python 版本管理:用 uv 下载解释器、预创建环境、查看已装包 - 新建任务保存时自动创建 .venv,运行期只校验、不再自动装依赖;镜像只在装包时使用 - 前端改为顶部品牌栏 + 三栏工作台,uv / 镜像源 / 虚拟环境各自独立弹窗 - 发布包构建后去掉工作区继承的低完整性标签 - 修复调度集成测试并发时误取 skipped 运行的问题
This commit is contained in:
@@ -7,6 +7,12 @@ if (-not $releaseRoot.StartsWith($expectedPrefix, [System.StringComparison]::Ord
|
||||
throw "Refusing to build outside release directory: $releaseRoot"
|
||||
}
|
||||
|
||||
# 与 check.ps1 一致:临时目录放在仓库内,避免系统 %TEMP% 权限策略让 aws-lc-sys 的 cc 构建失败。
|
||||
$scratch = Join-Path $projectRoot '.tmp'
|
||||
[void](New-Item -ItemType Directory -Path $scratch -Force)
|
||||
$env:TMP = $scratch
|
||||
$env:TEMP = $scratch
|
||||
|
||||
function Assert-ExitCode {
|
||||
param([string]$Step)
|
||||
|
||||
@@ -33,6 +39,8 @@ try {
|
||||
}
|
||||
[void](New-Item -ItemType Directory -Path $releaseRoot -Force)
|
||||
[void](New-Item -ItemType Directory -Path (Join-Path $releaseRoot 'web') -Force)
|
||||
# uv 管理页默认从这个目录找自己下载的 uv.exe
|
||||
[void](New-Item -ItemType Directory -Path (Join-Path $releaseRoot 'uv') -Force)
|
||||
[void](New-Item -ItemType Directory -Path (Join-Path $releaseRoot 'data') -Force)
|
||||
[void](New-Item -ItemType Directory -Path (Join-Path $releaseRoot 'logs') -Force)
|
||||
|
||||
@@ -41,6 +49,10 @@ try {
|
||||
Copy-Item -Path 'frontend\dist\*' -Destination (Join-Path $releaseRoot 'web') -Recurse
|
||||
Copy-Item -LiteralPath 'docs\RELEASE.md' -Destination (Join-Path $releaseRoot 'README.md')
|
||||
|
||||
# 发布包不该继承工作区的低完整性标签:带着它启动的进程写不了 uv 缓存和用户文件。
|
||||
& icacls $releaseRoot /setintegritylevel '(OI)(CI)M' /T | Out-Null
|
||||
Assert-ExitCode 'Release integrity label'
|
||||
|
||||
Write-Host "Release package: $releaseRoot"
|
||||
}
|
||||
finally {
|
||||
|
||||
Reference in New Issue
Block a user