From 6d88e2aa67fe7543ac2fb11d26848d8c70939bfa Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Fri, 18 Jul 2025 00:40:04 -0400 Subject: [PATCH] fix: Python 3.8 compatibility for CLI - Replace str | None with Optional[str] in export.py - Replace list[str] with List[str] in config.py - Add missing typing imports for compatibility - Ensures CLI works on Python 3.8 systems --- tito/commands/export.py | 3 ++- tito/core/config.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tito/commands/export.py b/tito/commands/export.py index aa55a68f..29d2cecf 100644 --- a/tito/commands/export.py +++ b/tito/commands/export.py @@ -7,6 +7,7 @@ import sys import re from argparse import ArgumentParser, Namespace from pathlib import Path +from typing import Optional from rich.panel import Panel from rich.text import Text @@ -69,7 +70,7 @@ class ExportCommand(BaseCommand): return sorted(modules) - def _show_export_details(self, console, module_name: str | None = None): + def _show_export_details(self, console, module_name: Optional[str] = None): """Show detailed export information including where each module exports to.""" exports_text = Text() exports_text.append("📦 Export Details:\n", style="bold cyan") diff --git a/tito/core/config.py b/tito/core/config.py index dfa3a35e..1c0d57df 100644 --- a/tito/core/config.py +++ b/tito/core/config.py @@ -5,7 +5,7 @@ Configuration management for TinyTorch CLI. import os import sys from pathlib import Path -from typing import Dict, Any, Optional +from typing import Dict, Any, Optional, List from dataclasses import dataclass @dataclass @@ -52,7 +52,7 @@ class CLIConfig: bin_dir=project_root / 'bin' ) - def validate(self) -> list[str]: + def validate(self) -> List[str]: """Validate the configuration and return any issues.""" issues = []