Skip to content

Commit ab9c702

Browse files
fix: include --from git+... in upgrade hint to avoid PyPI squat package (#2411)
The compatibility-error messages in extensions.py and presets.py, plus the extension troubleshooting guide, told users to upgrade with: uv tool install specify-cli --force Without `--from git+https://github.com/github/spec-kit.git`, uv resolves `specify-cli` from PyPI, where an unrelated package with the same name (no author, no project URLs) ships a stub CLI that lacks `extension`, `preset`, and most spec-kit commands. Users following the upgrade hint land on the squat package and report "extension command removed" (see #1982). Reuse the existing `REINSTALL_COMMAND` constant in extensions.py and import it from presets.py so all three call sites point at the GitHub source. The doc fix also adds a one-line note explaining the PyPI collision so the same advice doesn't get re-stripped later. Refs #1982
1 parent c079b2c commit ab9c702

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

extensions/EXTENSION-DEVELOPMENT-GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ hooks:
669669

670670
**Error**: `Extension requires spec-kit >=0.2.0`
671671

672-
- **Fix**: Update spec-kit with `uv tool install specify-cli --force`
672+
- **Fix**: Update spec-kit with `uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git`. The bare `specify-cli` package on PyPI is a different, unrelated project — installing it without `--from git+...` will give you a stub CLI that does not include `extension`, `preset`, or other spec-kit commands.
673673

674674
**Error**: `Command file not found`
675675

src/specify_cli/extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ def check_compatibility(
11081108
raise CompatibilityError(
11091109
f"Extension requires spec-kit {required}, "
11101110
f"but {speckit_version} is installed.\n"
1111-
f"Upgrade spec-kit with: uv tool install specify-cli --force"
1111+
f"Upgrade spec-kit with: {REINSTALL_COMMAND}"
11121112
)
11131113
except InvalidSpecifier:
11141114
raise CompatibilityError(f"Invalid version specifier: {required}")

src/specify_cli/presets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from packaging import version as pkg_version
2828
from packaging.specifiers import SpecifierSet, InvalidSpecifier
2929

30-
from .extensions import ExtensionRegistry, normalize_priority
30+
from .extensions import REINSTALL_COMMAND, ExtensionRegistry, normalize_priority
3131

3232

3333
def _substitute_core_template(
@@ -576,7 +576,7 @@ def check_compatibility(
576576
raise PresetCompatibilityError(
577577
f"Preset requires spec-kit {required}, "
578578
f"but {speckit_version} is installed.\n"
579-
f"Upgrade spec-kit with: uv tool install specify-cli --force"
579+
f"Upgrade spec-kit with: {REINSTALL_COMMAND}"
580580
)
581581
except InvalidSpecifier:
582582
raise PresetCompatibilityError(

0 commit comments

Comments
 (0)