generated from ThalesGroup/template-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-install-enduser.ps1
40 lines (30 loc) · 1.15 KB
/
test-install-enduser.ps1
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
$cwd = Get-Location
# Create dist target directory
$targetDist = Join-Path $cwd "..\agi-pypi"
[System.IO.Directory]::CreateDirectory("$targetDist") | Out-Null
# Remove old files
Remove-Item -Force "$targetDist\*.whl","$targetDist\*.gz","$targetDist\uv.lock","$targetDist\pyproject.toml" -ErrorAction SilentlyContinue
Remove-Item -Force -Recurse "$targetDist\.venv" -ErrorAction SilentlyContinue
Remove-Item -Force -Recurse dist,build -ErrorAction SilentlyContinue
# Build sdist
uv build --sdist
Move-Item dist\*.gz $targetDist
# Build wheels from subdirectories
$subdirs = @("fwk/env", "fwk/core", "fwk/gui")
foreach ($dir in $subdirs) {
$srcDir = Join-Path $cwd "src\agilab\$dir"
Push-Location $srcDir
Remove-Item -Recurse -Force dist,build -ErrorAction SilentlyContinue
uv build --wheel
Move-Item dist\*.whl $targetDist
Pop-Location
}
# Initialize and install in agi-pypi folder
Push-Location $targetDist
Remove-Item -Recurse -Force .venv,uv.lock -ErrorAction SilentlyContinue
if (-not (Test-Path "pyproject.toml")) {
uv init --bare
}
$packages = Get-ChildItem *.whl, *.gz | ForEach-Object { $_.FullName }
uv add $packages
Pop-Location