Draft
Add backend-agnostic self-update with uv + pipx support#2487
Conversation
Copilot created this pull request from a session on behalf of
glensc
May 28, 2026 07:56
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors PlexTraktSync’s self-update flow to be install-backend agnostic by introducing a managed-install abstraction with backend implementations for pipx and uv, then updating CLI/docs/tests accordingly.
Changes:
- Added a backend interface +
ManagedInstallmodel with discovery/update commands forpipxanduv. - Refactored
self-updateto discover all managed installs and run backend-specific latest/PR update commands. - Updated docs and added unit tests to cover backend detection and orchestration.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
plextraktsync/util/packaging.py |
Adds backend abstraction, pipx/uv discovery, and backend-specific update command generation. |
plextraktsync/commands/self_update.py |
Orchestrates self-update across discovered managed installs/backends (latest + PR flows). |
plextraktsync/factory/Factory.py |
Enables the self-update command based on backend-agnostic “managed install exists” detection. |
plextraktsync/util/Version.py |
Generalizes “managed install” detection for PR/dev version formatting. |
plextraktsync/cli.py |
Updates self-update help text/examples to mention both backends. |
README.md |
Documents uv install/upgrade and multi-backend update behavior; updates command list description. |
CONTRIBUTING.md |
Documents PR install workflow for both pipx and uv (including uninstall guidance). |
tests/test_self_update_packaging.py |
Adds unit tests for backend detection and update orchestration behaviors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+159
to
+166
| def latest_update_command(self, install: ManagedInstall) -> str: | ||
| return f"pipx upgrade {install.app_name}" | ||
|
|
||
| def pr_update_commands(self, pr: int, installs: list[ManagedInstall]) -> list[str]: | ||
| target_name = f"plextraktsync@{pr}" | ||
| commands = [] | ||
| if any(install.app_name.lower() == target_name for install in installs): | ||
| commands.append(f"pipx uninstall {target_name}") |
Comment on lines
46
to
+53
| def pipx_installed(package: str): | ||
| for install in PIPX_BACKEND.list_installs(): | ||
| if install.app_name.lower() == package.lower(): | ||
| return {"package": install.package_name, "package_or_url": install.source} | ||
|
|
||
| return None | ||
|
|
||
|
|
|
|
||
| installs = list_managed_installs() | ||
| if not installs: | ||
| print("No managed PlexTraktSync installation found in pipx or uv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change makes
uva first-class managed install backend alongsidepipx, and removes installer-specific logic from self-update/version gating paths.self-updatenow detects and updates all managed PlexTraktSync installs across supported backends, including PR flows.Install backend abstraction
plextraktsync/util/packaging.py.pipx(pipx list --jsondetection, upgrade/install PR commands)uv(uv tool listdetection, upgrade/install PR commands)Self-update orchestration
plextraktsync/commands/self_update.pyto:CLI/Factory/Version generalization
pipxanduv.Factory.enable_self_updateto use backend-agnostic managed-install detection.Docs + tests
uvand multi-backend update behavior.uvguidance.