for windows installer, leave venv creation for the user machine - #1698
for windows installer, leave venv creation for the user machine#1698barentine wants to merge 4 commits into
Conversation
…co files, waiting to build the venv on the user machine
…in the destination directory instead of the user's roaming profile to keep everything self-contained
…tionGuard mitigation by default on Windows 11/10 22H2+, which blocks a non-elevated process from traversing junctions it creates — exactly what uv python install does for its per-minor-version Python link
|
I'd already got a bit out of step with what I'd explored and what I'd posted. I'd also come up with this idea (with a bit of agentic help). Downside to getting an installer to run uv on the client side is that we get whatever mix of packages uv decides to pull resolve when it runs (ie we don't get know good or consistent behaviour, unless we manually pin everything. For this reason, I'd pretty much settled on trying to use |
|
Copilots analysis on my machine ... User: next issue is that uv does not create a relocatable install. What options do I have? GitHub Copilot: The core problem: 1. 2. Online installer — install directly to
3.
Recommendation: try option 1 first — it's a one-word change. If it misbehaves on Windows (broken shortcuts, missing DLLs), option 2 (online installer) is the cleanest fallback with minimal script changes. User: Can rule 2 out, as the main goal of packaging is to get a fairly stable (and testable) set of dependencies between releases without having to manage huge numbers of pins. What about py-app-standalone? GitHub Copilot: PBS is a solid choice here. The key insight: skip the venv layer entirely and install directly into the PBS distribution. The PBS Python is designed to be moved — it finds its own standard library via relative paths, and How it would work:
Tradeoffs vs. uv venv:
Shortcut: uv actually downloads PBS distributions internally. Want me to rework User: I mean py-app-standalone (https://github.com/jlevy/py-app-standalone), not python-build-standalone GitHub Copilot: Fetched https://github.com/jlevy/py-app-standalone Good find.
The key question for your use case is whether it actually fixes the Windows If it works on Windows, the installer change is clean and simple — replace the venv block in uvx py-app-standalone --install-dir "%DEST%" %PACKAGE_NAME%
:: Rename the cpython-x.y.z-platform dir to a stable name
for /d %%d in ("%DEST%\cpython-*") do move "%%d" "%DEST%\python"Then update Honest assessment:
Would you like to proceed with the integration, or first validate that the |
Addresses issue following #1697 .
I had a quick go at the windows installer usage, and ran into the same issues @csoeller mentioned (
uv trampoline failed to canonicalize script path).The issue seems to be, as @David-Baddeley pointed out, that venv's aren't relocatable. I let Claude chew on it / pushed it through a local test on a Win11 machine.
This PR
Works locally building with inno setup 6, running the produced exe, and opening PYMEVis.
@David-Baddeley - I haven't looked into any implications of the RedirectionGuard=no flag.