mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-05-31 19:11:34 -05:00
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:
@@ -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")
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user