diff --git a/tito/commands/__init__.py b/tito/commands/__init__.py index 6a895933..debf1f6f 100644 --- a/tito/commands/__init__.py +++ b/tito/commands/__init__.py @@ -12,7 +12,7 @@ from .notebooks import NotebooksCommand from .info import InfoCommand from .test import TestCommand from .doctor import DoctorCommand -from .sync import SyncCommand +from .export import ExportCommand from .reset import ResetCommand from .jupyter import JupyterCommand from .nbdev import NbdevCommand @@ -31,7 +31,7 @@ __all__ = [ 'InfoCommand', 'TestCommand', 'DoctorCommand', - 'SyncCommand', + 'ExportCommand', 'ResetCommand', 'JupyterCommand', 'NbdevCommand', diff --git a/tito/commands/clean.py b/tito/commands/clean.py index a7b7be4a..0f8107f1 100644 --- a/tito/commands/clean.py +++ b/tito/commands/clean.py @@ -144,7 +144,7 @@ class CleanCommand(BaseCommand): result_text.append("\n๐Ÿ’ก Next steps:\n", style="bold yellow") result_text.append(" โ€ข Run: tito module notebooks - Regenerate notebooks\n", style="white") result_text.append(" โ€ข Run: tito module test --all - Test all modules\n", style="white") - result_text.append(" โ€ข Run: tito package sync - Export to package\n", style="white") + result_text.append(" โ€ข Run: tito package export - Export to package\n", style="white") border_style = "green" if error_count == 0 else "yellow" console.print(Panel(result_text, title="Cleanup Complete", border_style=border_style)) diff --git a/tito/commands/sync.py b/tito/commands/export.py similarity index 92% rename from tito/commands/sync.py rename to tito/commands/export.py index 8aa62c68..30309363 100644 --- a/tito/commands/sync.py +++ b/tito/commands/export.py @@ -11,22 +11,22 @@ from rich.text import Text from .base import BaseCommand -class SyncCommand(BaseCommand): +class ExportCommand(BaseCommand): @property def name(self) -> str: - return "sync" + return "export" @property def description(self) -> str: return "Export notebook code to Python package" def add_arguments(self, parser: ArgumentParser) -> None: - parser.add_argument("--module", help="Sync specific module (e.g., setup, tensor)") + parser.add_argument("--module", help="Export specific module (e.g., setup, tensor)") def run(self, args: Namespace) -> int: console = self.console - # Determine what to sync + # Determine what to export if hasattr(args, 'module') and args.module: module_path = f"modules/{args.module}" if not Path(module_path).exists(): @@ -34,14 +34,14 @@ class SyncCommand(BaseCommand): title="Module Not Found", border_style="red")) return 1 - console.print(Panel(f"๐Ÿ”„ Synchronizing Module: {args.module}", + console.print(Panel(f"๐Ÿ”„ Exporting Module: {args.module}", title="nbdev Export", border_style="bright_cyan")) console.print(f"๐Ÿ”„ Exporting {args.module} notebook to tinytorch package...") # Use nbdev_export with --path for specific module cmd = ["nbdev_export", "--path", module_path] else: - console.print(Panel("๐Ÿ”„ Synchronizing All Notebooks to Package", + console.print(Panel("๐Ÿ”„ Exporting All Notebooks to Package", title="nbdev Export", border_style="bright_cyan")) console.print("๐Ÿ”„ Exporting all notebook code to tinytorch package...") diff --git a/tito/commands/info.py b/tito/commands/info.py index 606ab498..a2810b55 100644 --- a/tito/commands/info.py +++ b/tito/commands/info.py @@ -85,7 +85,7 @@ class InfoCommand(BaseCommand): cmd_text.append("๐Ÿงช Run Tests: ", style="dim") cmd_text.append("tito module test --all\n", style="bold cyan") cmd_text.append("๐Ÿ”„ Export Code: ", style="dim") - cmd_text.append("tito package sync\n", style="bold cyan") + cmd_text.append("tito package export\n", style="bold cyan") cmd_text.append("๐Ÿฉบ Check Environment: ", style="dim") cmd_text.append("tito system doctor", style="bold cyan") diff --git a/tito/commands/nbdev.py b/tito/commands/nbdev.py index 5063b414..4c58b1c7 100644 --- a/tito/commands/nbdev.py +++ b/tito/commands/nbdev.py @@ -30,13 +30,13 @@ class NbdevCommand(BaseCommand): title="Notebook Tools", border_style="bright_cyan")) if args.export: - # Use the sync command logic - from .sync import SyncCommand - sync_cmd = SyncCommand(self.config) - sync_args = ArgumentParser() - sync_cmd.add_arguments(sync_args) - sync_args = sync_args.parse_args([]) # Empty args for sync - return sync_cmd.run(sync_args) + # Use the export command logic + from .export import ExportCommand + export_cmd = ExportCommand(self.config) + export_args = ArgumentParser() + export_cmd.add_arguments(export_args) + export_args = export_args.parse_args([]) # Empty args for export + return export_cmd.run(export_args) elif args.build_docs: console.print("๐Ÿ“š Building documentation from notebooks...") diff --git a/tito/commands/notebooks.py b/tito/commands/notebooks.py index 491df097..1657b00e 100644 --- a/tito/commands/notebooks.py +++ b/tito/commands/notebooks.py @@ -147,7 +147,7 @@ class NotebooksCommand(BaseCommand): summary_text.append("\n๐Ÿ’ก Next steps:\n", style="bold yellow") summary_text.append(" โ€ข Open notebooks with: jupyter lab\n", style="white") summary_text.append(" โ€ข Work interactively in the notebooks\n", style="white") - summary_text.append(" โ€ข Export code with: tito package sync\n", style="white") + summary_text.append(" โ€ข Export code with: tito package export\n", style="white") summary_text.append(" โ€ข Run tests with: tito module test\n", style="white") border_style = "green" if error_count == 0 else "yellow" diff --git a/tito/commands/package.py b/tito/commands/package.py index 7036922a..3aaf2832 100644 --- a/tito/commands/package.py +++ b/tito/commands/package.py @@ -6,7 +6,7 @@ from argparse import ArgumentParser, Namespace from rich.panel import Panel from .base import BaseCommand -from .sync import SyncCommand +from .export import ExportCommand from .reset import ResetCommand from .nbdev import NbdevCommand @@ -26,13 +26,13 @@ class PackageCommand(BaseCommand): metavar='SUBCOMMAND' ) - # Sync subcommand - sync_parser = subparsers.add_parser( - 'sync', + # Export subcommand + export_parser = subparsers.add_parser( + 'export', help='Export notebook code to Python package' ) - sync_cmd = SyncCommand(self.config) - sync_cmd.add_arguments(sync_parser) + export_cmd = ExportCommand(self.config) + export_cmd.add_arguments(export_parser) # Reset subcommand reset_parser = subparsers.add_parser( @@ -57,11 +57,11 @@ class PackageCommand(BaseCommand): console.print(Panel( "[bold cyan]Package Commands[/bold cyan]\n\n" "Available subcommands:\n" - " โ€ข [bold]sync[/bold] - Export notebook code to Python package\n" - " โ€ข [bold]reset[/bold] - Reset tinytorch package to clean state\n" - " โ€ข [bold]nbdev[/bold] - nbdev notebook development commands\n\n" + " โ€ข [bold]export[/bold] - Export notebook code to Python package\n" + " โ€ข [bold]reset[/bold] - Reset tinytorch package to clean state\n" + " โ€ข [bold]nbdev[/bold] - nbdev notebook development commands\n\n" "[dim]Examples:[/dim]\n" - "[dim] tito package sync --module tensor[/dim]\n" + "[dim] tito package export --module tensor[/dim]\n" "[dim] tito package reset --force[/dim]\n" "[dim] tito package nbdev --export[/dim]", title="Package Command Group", @@ -70,8 +70,8 @@ class PackageCommand(BaseCommand): return 0 # Execute the appropriate subcommand - if args.package_command == 'sync': - cmd = SyncCommand(self.config) + if args.package_command == 'export': + cmd = ExportCommand(self.config) return cmd.execute(args) elif args.package_command == 'reset': cmd = ResetCommand(self.config) diff --git a/tito/commands/reset.py b/tito/commands/reset.py index 2a12f282..f024192c 100644 --- a/tito/commands/reset.py +++ b/tito/commands/reset.py @@ -86,8 +86,8 @@ class ResetCommand(BaseCommand): if files_removed > 0: reset_text.append(f"\nโœ… Reset complete! Removed {files_removed} generated files.\n", style="bold green") reset_text.append("\n๐Ÿ’ก Next steps:\n", style="bold yellow") - reset_text.append(" โ€ข Run: tito sync - Re-export notebooks\n", style="white") - reset_text.append(" โ€ข Run: tito sync --module setup - Export specific module\n", style="white") + reset_text.append(" โ€ข Run: tito package export - Re-export notebooks\n", style="white") + reset_text.append(" โ€ข Run: tito package export --module setup - Export specific module\n", style="white") reset_text.append(" โ€ข Run: tito test --all - Test everything\n", style="white") console.print(Panel(reset_text, title="Reset Complete", border_style="green")) diff --git a/tito/main.py b/tito/main.py index e3228bc8..283ba43e 100644 --- a/tito/main.py +++ b/tito/main.py @@ -24,7 +24,7 @@ from .commands.notebooks import NotebooksCommand from .commands.info import InfoCommand from .commands.test import TestCommand from .commands.doctor import DoctorCommand -from .commands.sync import SyncCommand +from .commands.export import ExportCommand from .commands.reset import ResetCommand from .commands.jupyter import JupyterCommand from .commands.nbdev import NbdevCommand @@ -74,7 +74,7 @@ Command Groups: Examples: tito system info Show system information tito module status --metadata Module status with metadata - tito package sync Export notebooks to package + tito package export Export notebooks to package """ ) @@ -169,7 +169,7 @@ Examples: "[bold]Quick Start:[/bold]\n" " [dim]tito system info[/dim] - Show system information\n" " [dim]tito module status --metadata[/dim] - Module status with metadata\n" - " [dim]tito package sync[/dim] - Export notebooks to package\n\n" + " [dim]tito package export[/dim] - Export notebooks to package\n\n" "[bold]Get Help:[/bold]\n" " [dim]tito system[/dim] - Show system subcommands\n" " [dim]tito module[/dim] - Show module subcommands\n"