feat: rebuild app with Qt UI, installer and safer switch sync
- Replace the Tkinter app with a PySide6 UI: sidebar navigation, central profile switcher, autosave, light/dark theme, background tasks with progress and cancel, toasts and a filterable activity log - Split logic into netbox_sync.core (config, NetBox, VMware/Proxmox, VM import, switches) and netbox_sync.ui - Replace the three-dialog import chain with a four-step import wizard; support the global VRF and match VMs per cluster - Expose the previously unreachable VRF/prefix batch tool - Switch sync: no silent LLDP config changes, TOFU host key checks, platform auto-detection, Comware name normalization, fixed AOS-S and Comware LLDP parsing, FQDN/management-IP cable matching, dry-run preview, interface types only set on create - Add PyInstaller onedir spec, Inno Setup installer and build.ps1 - Add pytest suite with an in-memory NetBox fake - Stop tracking the built exe Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
e983791baa
commit
4878275f2a
50 files changed
+7960
-3186
No files matched your search
@@ -0,0 +1,64 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Baut NetBox Synchronizer: Tests, PyInstaller-Build und Inno-Setup-Installer.
|
||||
|
||||
.EXAMPLE
|
||||
.\build.ps1 # alles
|
||||
.\build.ps1 -SkipInstaller # nur dist\NetBoxSynchronizer\
|
||||
.\build.ps1 -SkipTests
|
||||
#>
|
||||
param(
|
||||
[switch]$SkipTests,
|
||||
[switch]$SkipInstaller,
|
||||
[string]$InnoSetupCompiler
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
Set-Location $PSScriptRoot
|
||||
|
||||
$python = Join-Path $PSScriptRoot ".venv\Scripts\python.exe"
|
||||
if (-not (Test-Path $python)) {
|
||||
Write-Host "Erstelle virtuelle Umgebung …" -ForegroundColor Cyan
|
||||
py -3 -m venv .venv
|
||||
if ($LASTEXITCODE) { throw "Virtuelle Umgebung konnte nicht erstellt werden." }
|
||||
}
|
||||
|
||||
Write-Host "Installiere Abhängigkeiten …" -ForegroundColor Cyan
|
||||
& $python -m pip install --quiet --disable-pip-version-check -r requirements-dev.txt
|
||||
if ($LASTEXITCODE) { throw "pip install fehlgeschlagen." }
|
||||
|
||||
if (-not $SkipTests) {
|
||||
Write-Host "Führe Tests aus …" -ForegroundColor Cyan
|
||||
& $python -m pytest -q
|
||||
if ($LASTEXITCODE) { throw "Tests fehlgeschlagen – Build abgebrochen." }
|
||||
}
|
||||
|
||||
$version = (Select-String -Path "netbox_sync\__init__.py" -Pattern 'APP_VERSION = "([^"]+)"').Matches[0].Groups[1].Value
|
||||
Write-Host "Baue NetBox Synchronizer $version …" -ForegroundColor Cyan
|
||||
& $python -m PyInstaller --noconfirm --clean --log-level WARN NetBoxSynchronizer.spec
|
||||
if ($LASTEXITCODE) { throw "PyInstaller fehlgeschlagen." }
|
||||
|
||||
if ($SkipInstaller) {
|
||||
Write-Host "Fertig: dist\NetBoxSynchronizer\NetBoxSynchronizer.exe" -ForegroundColor Green
|
||||
return
|
||||
}
|
||||
|
||||
if (-not $InnoSetupCompiler) {
|
||||
$candidates = @(
|
||||
(Get-Command iscc.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source),
|
||||
"$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe",
|
||||
"${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe",
|
||||
"$env:ProgramFiles\Inno Setup 6\ISCC.exe"
|
||||
) | Where-Object { $_ -and (Test-Path $_) }
|
||||
$InnoSetupCompiler = $candidates | Select-Object -First 1
|
||||
}
|
||||
if (-not $InnoSetupCompiler) {
|
||||
Write-Warning "Inno Setup 6 wurde nicht gefunden. Installation z. B. mit: winget install JRSoftware.InnoSetup"
|
||||
Write-Warning "Der Programmordner liegt trotzdem unter dist\NetBoxSynchronizer\."
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Erzeuge Installer …" -ForegroundColor Cyan
|
||||
& $InnoSetupCompiler /Q "/DAppVersion=$version" "installer\NetBoxSynchronizer.iss"
|
||||
if ($LASTEXITCODE) { throw "Inno Setup fehlgeschlagen." }
|
||||
Write-Host "Fertig: dist\installer\NetBoxSynchronizer-Setup-$version.exe" -ForegroundColor Green
|
||||
Reference in new issue
Block a user