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
This commit is contained in:
Vijay Janapa Reddi
2025-07-18 00:40:04 -04:00
parent 2abd0d626d
commit 6d88e2aa67
2 changed files with 4 additions and 3 deletions

View File

@@ -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")

View File

@@ -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 = []