Cross-platform application auto-updater for Python applications on Windows, macOS, and Linux.
pip install autoupdate
from autoupdate.autoupdate import perform_update
perform_update(
endpoint="https://example.com/update-check",
current_version="1.0.0",
app_name="MyApp",
update_available_callback=on_update_available,
progress_callback=on_download_progress,
update_complete_callback=on_complete
)
Your update endpoint must return JSON with this structure:
{
"current_version": "1.0.1",
"description": "Bug fixes and improvements",
"downloads": {
"Windows": "https://example.com/myapp-windows.zip",
"Darwin": "https://example.com/myapp-macos.zip",
"Linux": "https://example.com/myapp-linux.zip"
}
}
Updates are distributed as ZIP files containing:
- Your application files
- A platform-specific bootstrapper (
bootstrap.exe
,bootstrap-mac.sh
, orbootstrap-lin.sh
)
The bootstrapper:
- Waits for the current process to exit
- Replaces old files with new ones
- Restarts the application
update_available_callback(version, description)
- Called when a new version is found
- Return
False
to cancel the update
progress_callback(downloaded, total)
- Called during download with bytes downloaded and total size
update_complete_callback()
- Called after update is prepared and ready to install
perform_update(
endpoint="https://example.com/update-check",
current_version="1.0.0",
password=b"secret"
)
# Install dependencies
uv sync --all-groups
# Run tests
uv run pytest
# Run linting
uv run ruff check
uv run ruff format
# Type checking
uv run pyright
MIT