Skip to main content

uv-tool-updater

English | 繁體中文

uv-tool-updater coordinates safe updates for Python CLI, desktop, and tray applications installed by uv tool install. It does not modify an environment itself: installation is delegated to uv tool upgrade, after the host process exits.

Status: early MVP (0.1.9). The public API and result schema may evolve before 1.0.

Install

uv add uv-tool-updater

The host must provide a private state directory. This avoids imposing a platform-directory dependency and lets GUI applications use their existing settings location.

Interactive update smoke test

Install this project as a uv tool, then run the bundled test command:

uv tool install uv-tool-updater
show-version

show-version prints the installed version, checks PyPI, and asks before updating when a newer release exists. Only y or Y starts the normal external-helper update flow. The command exits, and uv tool upgrade uv-tool-updater==<verified-version> runs after that process has ended. Console commands restart in the background without an interactive terminal; invoke show-version again to display the saved result.

For an isolated test state directory, set UV_TOOL_UPDATER_STATE_DIR before running the command.

Before the project is published to PyPI, simulate release metadata with:

show-version --latest-version 0.1.9

This option changes only the metadata used by the version check. The update itself still uses the source saved by uv, while qualifying the requirement as uv-tool-updater==<verified-version>. For a local-path installation, change the project version and source first, while leaving the installed tool on the older version, then run the command with that newer version number.

A console command restarted by the background helper does not receive an interactive terminal. It exits without consuming the result; run show-version once more in the existing terminal to display the completed update result. GUI and tray applications still restart normally.

Minimal integration

import os
from pathlib import Path

from uv_tool_updater import UpdateStatus, Updater

updater = Updater(
    package_name="fshot",
    command_name="fshot",
    state_dir=Path.home() / ".local" / "state" / "fshot" / "updates",
)

# Run this synchronous network operation on a worker thread in GUI applications.
check = updater.check()
if check.status is UpdateStatus.UPDATE_AVAILABLE and check.release is not None:
    # The host must first save data or receive explicit permission to discard it.
    session = updater.prepare_update(check.release, restart_args=[])
    session.start_helper(host_pid=os.getpid())
    # Only now ask the framework to quit normally.

On restart, use updater.consume_latest_result() (or consume a path returned by pending_results()). Consumption re-reads the actual installed distribution version; a zero uv exit code alone is never presented as proof that the version changed.

Guarantees and limits

  • Python 3.10–3.14; Windows, macOS, and Linux.
  • Public PyPI metadata by default; inject StaticProvider or a custom ReleaseProvider for tests/private indexes.
  • Stable releases by default; prereleases are opt-in.
  • Automatic installation is refused outside a detected uv tool environment and for editable installs.
  • The helper waits up to 10 minutes by default and never terminates the host.
  • Failed upgrades restart the original command by default and preserve a local log.
  • No telemetry and no GUI-framework dependency.

Documentation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uv_tool_updater-0.1.9.tar.gz (69.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uv_tool_updater-0.1.9-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file uv_tool_updater-0.1.9.tar.gz.

File metadata

  • Download URL: uv_tool_updater-0.1.9.tar.gz
  • Upload date:
  • Size: 69.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uv_tool_updater-0.1.9.tar.gz
Algorithm Hash digest
SHA256 e7be84b772903ad8e5b4ebda1689d729260d43d2c2a2c4399e90b5e17e07437b
MD5 0c491fade02cc4285273d7b8a7fd677c
BLAKE2b-256 938f0663c8ad45488ce374d2c59c3cd7e95f5adc4005fcbac62c6379c1e99544

See more details on using hashes here.

File details

Details for the file uv_tool_updater-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: uv_tool_updater-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uv_tool_updater-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 95b7a4fa84aa4d6d2b8567bf61e59b4541a3013a9fa0606edf3e4afea89e60c0
MD5 e27e1718ce31869dc82265ce90369865
BLAKE2b-256 8e1130d3dcc2a018c70afe0013dc31febaae3cfe77b6279577f7f148061a4c78

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page