From 211019ede2cd3c228e1aefbde51798e5f99b52f2 Mon Sep 17 00:00:00 2001 From: Manfred Riem <15701806+mnriem@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:15:25 -0500 Subject: [PATCH 1/3] feat(init): deprecate --no-git flag, gate deprecations at v0.10.0 - Add deprecation warning when --no-git is used on specify init - Update --ai deprecation gate from 1.0.0 to 0.10.0 - Update test expectation for the new version gate Closes #2167 --- src/specify_cli/__init__.py | 9 ++++++++- tests/integrations/test_cli.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py index 1c3e63ec03..b175137236 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -127,7 +127,7 @@ def _build_ai_deprecation_warning( ai_commands_dir=ai_commands_dir, ) return ( - "[bold]--ai[/bold] is deprecated and will no longer be available in version 1.0.0 or later.\n\n" + "[bold]--ai[/bold] is deprecated and will no longer be available in version 0.10.0 or later.\n\n" f"Use [bold]{replacement}[/bold] instead." ) @@ -1088,6 +1088,13 @@ def init( 'use [bold]--integration generic --integration-options="--commands-dir "[/bold] instead.[/dim]' ) + if no_git: + console.print( + "[yellow]⚠️ --no-git is deprecated and will be removed in v0.10.0.[/yellow]\n" + "[yellow]The git extension will no longer be enabled by default " + "— use --extension git to opt in.[/yellow]" + ) + if project_name == ".": here = True project_name = None # Clear project_name to use existing validation logic diff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.py index 152c56813c..cce9fde62a 100644 --- a/tests/integrations/test_cli.py +++ b/tests/integrations/test_cli.py @@ -112,7 +112,7 @@ def test_ai_emits_deprecation_warning_with_integration_replacement(self, tmp_pat assert "--ai" in normalized_output assert "deprecated" in normalized_output assert "no longer be available" in normalized_output - assert "1.0.0" in normalized_output + assert "0.10.0" in normalized_output assert "--integration copilot" in normalized_output assert normalized_output.index("Deprecation Warning") < normalized_output.index("Next Steps") assert (project / ".github" / "agents" / "speckit.plan.agent.md").exists() From e55bd2ff43aec7f31d8b6c8156d4c35a82259ed7 Mon Sep 17 00:00:00 2001 From: Manfred Riem <15701806+mnriem@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:30:57 -0500 Subject: [PATCH 2/3] fix: address PR review feedback - Update --no-git deprecation message to reference existing 'specify extension' commands instead of non-existent --extension flag - Add test_no_git_emits_deprecation_warning CLI test --- src/specify_cli/__init__.py | 2 +- tests/integrations/test_cli.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py index b175137236..618492f306 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -1092,7 +1092,7 @@ def init( console.print( "[yellow]⚠️ --no-git is deprecated and will be removed in v0.10.0.[/yellow]\n" "[yellow]The git extension will no longer be enabled by default " - "— use --extension git to opt in.[/yellow]" + "— use the [bold]specify extension[/bold] commands to install or enable the git extension if needed.[/yellow]" ) if project_name == ".": diff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.py index cce9fde62a..93b82809ef 100644 --- a/tests/integrations/test_cli.py +++ b/tests/integrations/test_cli.py @@ -446,6 +446,31 @@ def test_no_git_skips_extension(self, tmp_path): ext_dir = project / ".specify" / "extensions" / "git" assert not ext_dir.exists(), "git extension should not be installed with --no-git" + def test_no_git_emits_deprecation_warning(self, tmp_path): + """Using --no-git emits a visible deprecation warning.""" + from typer.testing import CliRunner + from specify_cli import app + + project = tmp_path / "no-git-warn" + project.mkdir() + old_cwd = os.getcwd() + try: + os.chdir(project) + runner = CliRunner() + result = runner.invoke(app, [ + "init", "--here", "--ai", "claude", "--script", "sh", + "--no-git", "--ignore-agent-tools", + ], catch_exceptions=False) + finally: + os.chdir(old_cwd) + + normalized_output = _normalize_cli_output(result.output) + assert result.exit_code == 0, result.output + assert "--no-git" in normalized_output + assert "deprecated" in normalized_output + assert "0.10.0" in normalized_output + assert "specify extension" in normalized_output + def test_git_extension_commands_registered(self, tmp_path): """Git extension commands are registered with the agent during init.""" from typer.testing import CliRunner From 457171b46ef7aaeec1f46b0b8dfaec4a86aab4fb Mon Sep 17 00:00:00 2001 From: Manfred Riem <15701806+mnriem@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:36:27 -0500 Subject: [PATCH 3/3] fix: strengthen --no-git deprecation test assertions Add assertions unique to the --no-git message ('will be removed', 'git extension will no longer be enabled by default') to prevent false positives from the --ai deprecation panel. --- tests/integrations/test_cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.py index 93b82809ef..df48323ed2 100644 --- a/tests/integrations/test_cli.py +++ b/tests/integrations/test_cli.py @@ -470,6 +470,8 @@ def test_no_git_emits_deprecation_warning(self, tmp_path): assert "deprecated" in normalized_output assert "0.10.0" in normalized_output assert "specify extension" in normalized_output + assert "will be removed" in normalized_output + assert "git extension will no longer be enabled by default" in normalized_output def test_git_extension_commands_registered(self, tmp_path): """Git extension commands are registered with the agent during init."""