Repository navigation
Replies: 2 comments
|
|
Keep the mirror's keyring CLI/backend in a separate venv outside Use your existing bootstrap utility to provision it, verify mirror access before resetting anything, and keep its interpreter until migration finishes. That breaks the dependency cycle without needing |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I encountered an interesting version migration problem recently where
pipxrunning under an older Python version had ended up with a copy ofcffiin the shared library folder.pipxwas subsequently migrated to a newer Python version, which couldn't import from that copy ofcffi(since it only provided an extension module for the previous Python version, not for the new one).This ended up breaking the installation completely because it was in a closed environment that required
keyringfor access to the private package mirror in front of PyPI,keyringwas provided viapipx, and had been updated to run under the new Python version alongsidepipxitself.The end result was that
keyringcouldn't load its Windows credential store backend because the outdated sharedcffiinstallation was preventing the acceleratedpywin32modules from loading. Sincekeyringcouldn't load credentials, neitherpipxnorpipcould talk to the private repository, and all the normal mechanisms to migrate between Python versions broke.I eventually resorted to getting the user to clear out their entire
~/.local/pipxtree and rerun the automation command that set uppipxfrom scratch (the setup utility is acx-freezeexecutable with its own bundled copies ofpipandkeyring, allowing it to get around the authentication bootstrapping problem).The cleanest way handling it that I currently see is to:
pipxinstallation is detected, runpipx list --jsonto export the details of what is installedpipxto the new Python versionpipx resetto ensure we're starting from a clean slatepipx installcommands beyond our default set (including injected packages and other optional settings)Step 4 feels like it would be messy and error prone, but I don't expect running
pipx reinstall-allto work reliably because of thekeyringCLI and the shared libraries potentially getting out of sync at some point during the process.What I think I really want is a
--no-sharedoption onpipx installto allowkeyringto run with a genuinely independent set of libraries and avoid any risk of version compatibility issues between it and the shared libraries, but I'm open to other suggestions for managing this update process more elegantly.All reactions