mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-04-30 10:13:57 -05:00
Update dependency checks to match requirements.txt
Separate required vs optional dependencies in health checks: Required (from requirements.txt): - NumPy, Rich, PyYAML, Pytest, Jupytext Optional (nice to have): - JupyterLab, Matplotlib Now health check shows: - Required deps as ✅ OK or ❌ Missing - Optional deps as ✅ Installed or ○ Not installed (dim, not alarming) This prevents students from thinking they have issues when optional tools like JupyterLab aren't installed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -61,21 +61,32 @@ class HealthCommand(BaseCommand):
|
|||||||
venv_status = "[red]❌ Missing[/red]"
|
venv_status = "[red]❌ Missing[/red]"
|
||||||
env_table.add_row("Virtual Environment", venv_status)
|
env_table.add_row("Virtual Environment", venv_status)
|
||||||
|
|
||||||
# Dependencies - STATUS ONLY (no versions)
|
# Required dependencies (from requirements.txt)
|
||||||
dependencies = [
|
required_deps = [
|
||||||
('NumPy', 'numpy'),
|
('NumPy', 'numpy'),
|
||||||
('Pytest', 'pytest'),
|
|
||||||
('PyYAML', 'yaml'),
|
|
||||||
('Rich', 'rich'),
|
('Rich', 'rich'),
|
||||||
('JupyterLab', 'jupyterlab'),
|
('PyYAML', 'yaml'),
|
||||||
('Jupytext', 'jupytext')
|
('Pytest', 'pytest'),
|
||||||
|
('Jupytext', 'jupytext'),
|
||||||
]
|
]
|
||||||
for display_name, import_name in dependencies:
|
for display_name, import_name in required_deps:
|
||||||
try:
|
try:
|
||||||
__import__(import_name)
|
__import__(import_name)
|
||||||
env_table.add_row(display_name, "[green]✅ OK[/green]")
|
env_table.add_row(display_name, "[green]✅ OK[/green]")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
env_table.add_row(display_name, "[red]❌ Missing[/red]")
|
env_table.add_row(display_name, "[red]❌ Missing[/red]")
|
||||||
|
|
||||||
|
# Optional dependencies (nice to have, not required for core workflow)
|
||||||
|
optional_deps = [
|
||||||
|
('JupyterLab', 'jupyterlab'),
|
||||||
|
('Matplotlib', 'matplotlib'),
|
||||||
|
]
|
||||||
|
for display_name, import_name in optional_deps:
|
||||||
|
try:
|
||||||
|
__import__(import_name)
|
||||||
|
env_table.add_row(f"{display_name} (optional)", "[green]✅ Installed[/green]")
|
||||||
|
except ImportError:
|
||||||
|
env_table.add_row(f"{display_name} (optional)", "[dim]○ Not installed[/dim]")
|
||||||
|
|
||||||
console.print(env_table)
|
console.print(env_table)
|
||||||
console.print()
|
console.print()
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ class CLIConfig:
|
|||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
"""Initialize default values."""
|
"""Initialize default values."""
|
||||||
if self.required_packages is None:
|
if self.required_packages is None:
|
||||||
self.required_packages = ['numpy', 'pytest', 'rich']
|
# Core dependencies from requirements.txt (required section)
|
||||||
|
self.required_packages = ['numpy', 'rich', 'yaml', 'pytest', 'jupytext']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_project_root(cls, project_root: Optional[Path] = None) -> 'CLIConfig':
|
def from_project_root(cls, project_root: Optional[Path] = None) -> 'CLIConfig':
|
||||||
|
|||||||
Reference in New Issue
Block a user