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:
Vijay Janapa Reddi
2025-11-29 11:46:15 -05:00
parent 53cd2a90f0
commit f81ab97100
2 changed files with 20 additions and 8 deletions

View File

@@ -61,21 +61,32 @@ class HealthCommand(BaseCommand):
venv_status = "[red]❌ Missing[/red]"
env_table.add_row("Virtual Environment", venv_status)
# Dependencies - STATUS ONLY (no versions)
dependencies = [
# Required dependencies (from requirements.txt)
required_deps = [
('NumPy', 'numpy'),
('Pytest', 'pytest'),
('PyYAML', 'yaml'),
('Rich', 'rich'),
('JupyterLab', 'jupyterlab'),
('Jupytext', 'jupytext')
('PyYAML', 'yaml'),
('Pytest', 'pytest'),
('Jupytext', 'jupytext'),
]
for display_name, import_name in dependencies:
for display_name, import_name in required_deps:
try:
__import__(import_name)
env_table.add_row(display_name, "[green]✅ OK[/green]")
except ImportError:
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()

View File

@@ -31,7 +31,8 @@ class CLIConfig:
def __post_init__(self):
"""Initialize default values."""
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
def from_project_root(cls, project_root: Optional[Path] = None) -> 'CLIConfig':