Repository navigation
[Bug]: bundle install rejects a local artifact with an upper-case .ZIP extension #5090
Description
Bug Description
_local_manifest_source recognises a local artifact only when candidate.suffix == ".zip" (src/specify_cli/bundles/sources.py:39). A file named DEMO-1.0.0.ZIP is rejected as "not a recognised bundle source". The remote download path in the same module lowercases the suffix before comparing it (sources.py:249), so the two paths disagree.
Steps to Reproduce
From the root of a fresh clone after uv sync, save the script below as repro.py and run uv run python -I repro.py.
import os, subprocess, tempfile, zipfile
from pathlib import Path
work = Path(tempfile.mkdtemp())
manifest = ('schema_version: "1.0"\n'
'bundle: {id: demo, name: D, version: "1.0.0", role: dev, description: d, author: a, license: MIT}\n'
'requires: {speckit_version: ">=0.1.0"}\n')
env = {"PATH": os.environ["PATH"], "HOME": str(work), "COLUMNS": "200"}
for name in ("demo-1.0.0.zip", "DEMO-1.0.0.ZIP"):
artifact = work / name
with zipfile.ZipFile(artifact, "w") as z:
z.writestr("bundle.yml", manifest)
project = work / f"project-{name}"; project.mkdir()
run = subprocess.run(["specify", "bundle", "install", str(artifact), "--offline"],
cwd=project, capture_output=True, text=True, env=env)
last = [l for l in (run.stdout + run.stderr).splitlines() if l.strip()][-1]
print(f"{name}: exit {run.returncode}: {last}")Expected Behavior
Both files install. docs/reference/bundles.md:75 says the argument may be "a local path to a built .zip artifact", and sources.py:249 treats the extension case-insensitively for downloaded artifacts.
Actual Behavior
demo-1.0.0.zip: exit 0: ✓ Installed 'demo' (0 added, 0 already present).
DEMO-1.0.0.ZIP: exit 1: Error: '/tmp/tmpejzq8qz0/DEMO-1.0.0.ZIP' is not a recognised bundle source (.zip artifact, bundle directory, or bundle.yml).
Specify CLI Version
1.2.4.dev0 (main at 27d14e2)
AI Agent
Not applicable
Operating System
Linux 6.18 (Ubuntu container)
Python Version
Python 3.12.3
Additional Context
Comparing candidate.suffix.lower() would match the remote path.
On macOS the reproducer as written stops early: its two projects (project-demo-1.0.0.zip and project-DEMO-1.0.0.ZIP) are the same directory on a case-insensitive filesystem, so mkdir raises FileExistsError. Run it on a case-sensitive filesystem (the output above came from Linux).
AI Disclosure
Found and reproduced with Claude Code (model: Claude Opus 4.8), run autonomously under human supervision. The human reporter re-ran every reproduction above before filing.
Activity