💫 Toolkit to help you get started with SDD or any other process!
feat(init): deprecate --no-git flag, gate deprecations at v0.10.0 (#2357)
Manfred Riem03f3024c66ac
diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.pyindex 1c3e63ec0..618492f30 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 <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 the [bold]specify extension[/bold] commands to install or enable the git extension if needed.[/yellow]"+ )+if project_name == ".":here = Trueproject_name = None # Clear project_name to use existing validation logicdiff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.pyindex 152c56813..df48323ed 100644--- a/tests/integrations/test_cli.py+++ b/tests/integrations/test_cli.py@@ -112,7 +112,7 @@ class TestInitIntegrationFlag:assert "--ai" in normalized_outputassert "deprecated" in normalized_outputassert "no longer be available" in normalized_output- assert "1.0.0" in normalized_output+ assert "0.10.0" in normalized_outputassert "--integration copilot" in normalized_outputassert normalized_output.index("Deprecation Warning") < normalized_output.index("Next Steps")assert (project / ".github" / "agents" / "speckit.plan.agent.md").exists()@@ -446,6 +446,33 @@ class TestGitExtensionAutoInstall: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+ 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."""from typer.testing import CliRunner