diff --git a/packaging/README.md b/packaging/README.md index ed7f165..2045204 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -20,7 +20,7 @@ Zip packages are **not** published. Releases ship **Setup.exe only**. **Installer:** English + 简体中文 (language dialog). Icons use `packaging/assets/netx.ico`. -**Offline:** Setup ships portable PostgreSQL, **`python/runtime` + `.venv`** (portable; not tied to the build PC’s user profile), and WinSW. **First install** shows the Database page (built-in or external PostgreSQL; external credentials validated with `psql SELECT 1`). **Re-running Setup when `%ProgramData%\NetX\.env` has `NETX_DB_MODE` or a non-empty legacy `NETX_DATABASE_URL`** skips the DB wizard by default. Update stops and resumes an installed Windows service or startup task while replacing files. Service install uses bundled WinSW. Auto-update still needs network later, and is unchecked by default. +**Offline:** Setup ships portable PostgreSQL, **`python/runtime` + `.venv`** (portable; not tied to the build PC’s user profile), and WinSW. On upgrade, Setup removes the old runtime and virtual environment before copying the bundled pair, preventing stale standard-library files when Python versions have different layouts. **First install** shows the Database page (built-in or external PostgreSQL; external credentials validated with `psql SELECT 1`). **Re-running Setup when `%ProgramData%\NetX\.env` has `NETX_DB_MODE` or a non-empty legacy `NETX_DATABASE_URL`** skips the DB wizard by default. Update stops and resumes an installed Windows service or startup task while replacing files. Service install uses bundled WinSW. Auto-update still needs network later, and is unchecked by default. **OS:** Windows 10/11 or Windows Server **2016+** recommended. Packaging scripts are UTF-8 **with BOM** so Chinese UI works on Windows PowerShell 5.x. The Windows release workflow pins bundled Python to **3.12**, so local release builds should use the same version for consistent artifacts. diff --git a/packaging/build_release.ps1 b/packaging/build_release.ps1 index 0451b2b..4a83bea 100644 --- a/packaging/build_release.ps1 +++ b/packaging/build_release.ps1 @@ -210,6 +210,8 @@ if ($CreateVenv) { if (-not (Test-NetxVenvRunnable -VenvPython $venvPy)) { throw "venv_not_runnable_after_build: check python/runtime copy" } + & $venvPy -c "from pathlib import Path; import glob; print(Path.cwd()); print(glob.__file__)" + if ($LASTEXITCODE -ne 0) { throw "python_stdlib_smoke_failed: pathlib/glob import mismatch" } & $venvPy -m pip install --upgrade pip & $venvPy -m pip install -r (Join-Path $stage "requirements.txt") @@ -219,6 +221,8 @@ if ($CreateVenv) { if (-not (Test-NetxVenvRunnable -VenvPython $venvPy)) { throw "venv_not_runnable_after_pip" } + & $venvPy -c "from pathlib import Path; import glob; print(Path.cwd()); print(glob.__file__)" + if ($LASTEXITCODE -ne 0) { throw "python_stdlib_smoke_failed_after_pip: pathlib/glob import mismatch" } Write-Host "==> Slimming .venv (drop tests / __pycache__ / *.pyc)" $site = Join-Path $stage ".venv\Lib\site-packages" diff --git a/packaging/installer/netx.iss b/packaging/installer/netx.iss index 0f43470..49f0777 100644 --- a/packaging/installer/netx.iss +++ b/packaging/installer/netx.iss @@ -5,7 +5,7 @@ #define MyAppName "NetX" #ifndef MyAppVersion - #define MyAppVersion "0.4.14" + #define MyAppVersion "0.4.15" #endif #define MyAppPublisher "NetX" #define MyAppURL "https://github.com/hansjone/netx" @@ -154,6 +154,11 @@ Name: "{commonappdata}\NetX\pgdata"; Permissions: users-modify Name: "{commonappdata}\NetX\backups"; Permissions: users-modify [InstallDelete] +; Python minor releases can change stdlib layout (for example pathlib.py -> pathlib\\). +; Remove the previous runtime and venv before copying the new ones so an upgrade +; cannot leave orphaned modules that shadow files from the shipped Python version. +Type: filesandordirs; Name: "{app}\python\runtime" +Type: filesandordirs; Name: "{app}\.venv" ; Remove legacy desktop shortcuts from older Setup builds (keep a single NetX icon). Type: files; Name: "{commondesktop}\NetX Start.lnk" Type: files; Name: "{commondesktop}\NetX First-time setup.lnk" diff --git a/packaging/manifest.example.json b/packaging/manifest.example.json index ab97808..78d01c5 100644 --- a/packaging/manifest.example.json +++ b/packaging/manifest.example.json @@ -1,11 +1,11 @@ { "channel": "stable", - "latest": "0.4.14", + "latest": "0.4.15", "min_compatible": "0.3.0", - "notes_url": "https://github.com/hansjone/netx/releases/tag/v0.4.14", + "notes_url": "https://github.com/hansjone/netx/releases/tag/v0.4.15", "windows": { - "url": "https://github.com/hansjone/netx/releases/download/v0.4.14/NetX-Setup-0.4.14.exe", - "setup_url": "https://github.com/hansjone/netx/releases/download/v0.4.14/NetX-Setup-0.4.14.exe", + "url": "https://github.com/hansjone/netx/releases/download/v0.4.15/NetX-Setup-0.4.15.exe", + "setup_url": "https://github.com/hansjone/netx/releases/download/v0.4.15/NetX-Setup-0.4.15.exe", "package": "setup", "sha256": "", "size": 0 diff --git a/pyproject.toml b/pyproject.toml index 7f924ce..573a8de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "netx-ops" -version = "0.4.14" +version = "0.4.15" description = "netx operations tool: alarm-centric workflows with REST API and stdio MCP" readme = "README.md" requires-python = ">=3.11"