sigma-terminal 3.2.0__py3-none-any.whl → 3.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sigma/setup.py CHANGED
@@ -1,4 +1,4 @@
1
- """Sigma v3.2.0 - Setup Wizard."""
1
+ """Sigma v3.3.0 - Setup Wizard."""
2
2
 
3
3
  import os
4
4
  import sys
@@ -19,10 +19,13 @@ from .config import (
19
19
  LLMProvider,
20
20
  AVAILABLE_MODELS,
21
21
  CONFIG_DIR,
22
+ detect_lean_installation,
23
+ detect_ollama,
24
+ install_lean_cli_sync,
22
25
  )
23
26
 
24
27
 
25
- __version__ = "3.2.0"
28
+ __version__ = "3.3.0"
26
29
  SIGMA = "σ"
27
30
  console = Console()
28
31
 
@@ -35,7 +38,7 @@ BANNER = """
35
38
  [bold blue]███████║██║╚██████╔╝██║ ╚═╝ ██║██║ ██║[/bold blue]
36
39
  [bold blue]╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝[/bold blue]
37
40
 
38
- [bold cyan]σ Finance Research Agent[/bold cyan] [dim]- Setup Wizard v3.2.0[/dim]
41
+ [bold cyan]σ Finance Research Agent[/bold cyan] [dim]- Setup Wizard v3.3.0[/dim]
39
42
  """
40
43
 
41
44
 
@@ -258,22 +261,87 @@ class SetupWizard:
258
261
  console.print(Panel("[bold]Step 5: Integrations[/bold]", border_style="blue"))
259
262
  console.print()
260
263
 
261
- # Ollama (if not primary)
264
+ # Ollama detection
262
265
  if self.settings.default_provider != LLMProvider.OLLAMA:
263
- if Confirm.ask("Setup Ollama for local fallback?", default=False):
264
- console.print("[dim]Install: https://ollama.ai/download[/dim]")
265
- console.print("[dim]Run: ollama pull llama3.2[/dim]")
266
-
267
- # LEAN
268
- if Confirm.ask("Setup LEAN/QuantConnect?", default=False):
269
- console.print("[dim]LEAN provides advanced backtesting.[/dim]")
270
- console.print("[dim]Install: pip install lean[/dim]")
266
+ ollama_running, ollama_host = detect_ollama()
267
+ if ollama_running and ollama_host:
268
+ console.print(f"[green]✓[/green] Ollama detected at {ollama_host}")
269
+ if Confirm.ask("Enable Ollama as local fallback?", default=True):
270
+ save_setting("ollama_host", ollama_host)
271
+ console.print(f"[cyan]{SIGMA}[/cyan] Ollama enabled")
272
+ else:
273
+ if Confirm.ask("Setup Ollama for local fallback?", default=False):
274
+ console.print("[dim]Install: https://ollama.ai/download[/dim]")
275
+ console.print("[dim]Run: ollama pull llama3.2[/dim]")
276
+
277
+ console.print()
278
+
279
+ # LEAN auto-detection
280
+ lean_installed, lean_cli, lean_dir = detect_lean_installation()
281
+
282
+ if lean_installed:
283
+ console.print(f"[green]✓[/green] LEAN/QuantConnect detected!")
284
+ if lean_cli:
285
+ console.print(f" [dim]CLI: {lean_cli}[/dim]")
286
+ if lean_dir:
287
+ console.print(f" [dim]Directory: {lean_dir}[/dim]")
288
+ console.print()
289
+
290
+ if Confirm.ask("Enable LEAN integration?", default=True):
291
+ save_setting("lean_enabled", "true")
292
+ if lean_cli:
293
+ save_setting("lean_cli_path", lean_cli)
294
+ if lean_dir:
295
+ save_setting("lean_directory", lean_dir)
296
+ console.print(f"[cyan]{SIGMA}[/cyan] LEAN integration enabled")
297
+ else:
298
+ save_setting("lean_enabled", "false")
299
+ else:
300
+ console.print("[yellow]![/yellow] LEAN/QuantConnect not detected")
301
+ console.print("[dim]LEAN provides institutional-grade backtesting with QuantConnect's engine.[/dim]")
271
302
  console.print()
272
303
 
273
- lean_path = Prompt.ask("LEAN CLI path (or Enter to skip)", default="")
274
- if lean_path:
275
- save_setting("lean_cli_path", lean_path)
276
- console.print(f"[cyan]{SIGMA}[/cyan] LEAN configured")
304
+ lean_choice = Prompt.ask(
305
+ "Would you like to",
306
+ choices=["install", "manual", "skip"],
307
+ default="skip"
308
+ )
309
+
310
+ if lean_choice == "install":
311
+ console.print()
312
+ console.print(f"[cyan]{SIGMA}[/cyan] Installing LEAN CLI via pip...")
313
+ console.print("[dim]This may take a minute...[/dim]")
314
+
315
+ with console.status("[bold blue]Installing LEAN...[/bold blue]"):
316
+ success, message = install_lean_cli_sync()
317
+
318
+ if success:
319
+ console.print(f"[green]✓[/green] {message}")
320
+ save_setting("lean_enabled", "true")
321
+ save_setting("lean_cli_path", "lean")
322
+
323
+ # Verify installation
324
+ lean_installed, lean_cli, lean_dir = detect_lean_installation()
325
+ if lean_cli:
326
+ console.print(f"[cyan]{SIGMA}[/cyan] LEAN CLI ready: {lean_cli}")
327
+ else:
328
+ console.print(f"[red]✗[/red] {message}")
329
+ console.print("[dim]You can install manually later: pip install lean[/dim]")
330
+
331
+ elif lean_choice == "manual":
332
+ console.print()
333
+ console.print("[bold]Manual Installation Options:[/bold]")
334
+ console.print(" 1. [cyan]pip install lean[/cyan] - LEAN CLI (recommended)")
335
+ console.print(" 2. [cyan]https://github.com/QuantConnect/Lean[/cyan] - Full source")
336
+ console.print()
337
+
338
+ lean_path = Prompt.ask("Enter LEAN CLI path (or Enter to skip)", default="")
339
+ if lean_path:
340
+ save_setting("lean_enabled", "true")
341
+ save_setting("lean_cli_path", lean_path)
342
+ console.print(f"[cyan]{SIGMA}[/cyan] LEAN configured: {lean_path}")
343
+ else:
344
+ console.print("[dim]Skipping LEAN setup. You can configure it later.[/dim]")
277
345
 
278
346
  def _show_summary(self):
279
347
  """Show summary."""