Skip to content

Commit 7baac9c

Browse files
committed
fix: type annotations for LSP/pyright compatibility
- Add Optional[str] to select_with_arrows() default_key parameter - Add module-level _specify_tracker_active variable (replaces sys dynamic attr) - Fix original_cwd initialization before try block in init_git_repo() - Fix zip_path initialization in preset add command - Bump version to 0.1.12
1 parent 1a0f8b8 commit 7baac9c

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ All notable changes to the Specify CLI and templates are documented here.
77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to to [Semantic Versioning](https://semver.org/spec/v2.0.0/).
99

10+
## [0.1.12] - 2026-03-19
11+
12+
### Fixed
13+
14+
- **Type annotations**: Fixed multiple LSP/type-checker warnings in `__init__.py`
15+
- Added `Optional[str]` type hint to `select_with_arrows()` parameter
16+
- Added module-level `_specify_tracker_active` variable instead of dynamic `sys` attribute
17+
- Fixed `original_cwd` possibly unbound error in `init_git_repo()`
18+
- Fixed `zip_path` initialization in `preset add` command
19+
1020
## [0.1.11] - 2026-03-19
1121

1222
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agentic-sdlc-specify-cli"
3-
version = "0.1.11"
3+
version = "0.1.12"
44
description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)."
55
requires-python = ">=3.11"
66
dependencies = [

src/specify_cli/__init__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
ssl_context = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
6262
client = httpx.Client(verify=ssl_context)
6363

64+
# Module-level tracker state (used to coordinate tracker output across functions)
65+
_specify_tracker_active: bool = False
66+
6467
# Color constants for orange theme
6568
ACCENT_COLOR = "#f47721"
6669
BANNER_COLORS = ["#ff6b35", "#ff8c42", "#f47721", "#ff5722", "white", "bright_white"]
@@ -830,7 +833,9 @@ def get_key():
830833

831834

832835
def select_with_arrows(
833-
options: dict, prompt_text: str = "Select an option", default_key: str = None
836+
options: dict,
837+
prompt_text: str = "Select an option",
838+
default_key: Optional[str] = None,
834839
) -> str:
835840
"""
836841
Interactive selection using arrow keys with Rich Live display.
@@ -1787,8 +1792,8 @@ def init_git_repo(
17871792
Returns:
17881793
Tuple of (success: bool, error_message: Optional[str])
17891794
"""
1795+
original_cwd = Path.cwd()
17901796
try:
1791-
original_cwd = Path.cwd()
17921797
os.chdir(project_path)
17931798
if not quiet:
17941799
console.print("[cyan]Initializing git repository...[/cyan]")
@@ -3391,7 +3396,8 @@ def init(
33913396

33923397
tracker = StepTracker("Initialize Specify Project")
33933398

3394-
sys._specify_tracker_active = True
3399+
global _specify_tracker_active
3400+
_specify_tracker_active = True
33953401

33963402
tracker.add("precheck", "Check required tools")
33973403
tracker.complete("precheck", "ok")
@@ -4056,14 +4062,15 @@ def preset_add(
40564062
f"Installing preset [cyan]{pack_info.get('name', pack_id)}[/cyan]..."
40574063
)
40584064

4065+
zip_path: Optional[Path] = None
40594066
try:
40604067
zip_path = catalog.download_pack(pack_id)
40614068
manifest = manager.install_from_zip(zip_path, speckit_version, priority)
40624069
console.print(
40634070
f"[green]✓[/green] Preset '{manifest.name}' v{manifest.version} installed (priority {priority})"
40644071
)
40654072
finally:
4066-
if "zip_path" in locals() and zip_path.exists():
4073+
if zip_path is not None and zip_path.exists():
40674074
zip_path.unlink(missing_ok=True)
40684075
else:
40694076
console.print(

0 commit comments

Comments
 (0)