From 9b60a8b0fb43186b954d5c6f6e03116b476e1bc3 Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Sat, 25 Apr 2026 19:46:58 -0400 Subject: [PATCH] fix(update): force version rebuild after upgrade to stop update loop After make install, run uv sync --reinstall-package hate_crack so setuptools-scm regenerates the version from the new git tag. Without this, the installed version stays at the old value and the update checker loops indefinitely. Co-Authored-By: Claude Sonnet 4.6 --- hate_crack/main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hate_crack/main.py b/hate_crack/main.py index f1ef647..82fff3f 100755 --- a/hate_crack/main.py +++ b/hate_crack/main.py @@ -967,11 +967,16 @@ def _run_upgrade(): raise SystemExit(1) repo_root = git_root_result.stdout.strip() + import shutil + + uv = shutil.which("uv") or os.path.expanduser("~/.local/bin/uv") + result = subprocess.run( # git fetch --tags ensures new release tags are visible to setuptools-scm. - # make install handles system deps (transmission-daemon, p7zip) and - # reinstalls the Python package and CLI shim. - "git pull && git fetch --tags && make install", + # make install handles system deps and the CLI shim. + # uv sync --reinstall-package forces setuptools-scm to regenerate the + # version from the new tag so the version number updates correctly. + f"git pull && git fetch --tags && make install && {uv} sync --reinstall-package hate_crack", shell=True, cwd=repo_root, )