feat: add concore doctor command for system readiness checks#499
Conversation
Implements a new 'concore doctor' CLI command that performs comprehensive system readiness diagnostics including: - Core checks: Python version, concore installation, CONCOREPATH - Tool detection: C++, Python, Verilog, Octave, MATLAB, Docker - Configuration file validation (concore.tools, .octave, .mcr, .sudo) - Environment variable detection for tool overrides - Dependency checks for required and optional packages Includes 23 unit tests covering all diagnostic functions. Closes ControlCore-Project#495
There was a problem hiding this comment.
Pull request overview
This PR introduces a concore doctor CLI command that performs comprehensive system readiness diagnostics, allowing users to verify their environment before running concore studies. It checks Python version, tool availability (C++, Python, Verilog, Octave, MATLAB, Docker), configuration files (concore.tools, concore.octave, concore.mcr, concore.sudo), environment variables, and required/optional Python packages, then summarizes results with Rich-formatted output.
Changes:
concore_cli/commands/doctor.py: New file implementing the fulldoctor_checkdiagnostic function and helpers.concore_cli/cli.py+concore_cli/commands/__init__.py: Registration of the newdoctorcommand into the CLI group.tests/test_doctor.py: New test file with 23 unit tests covering the diagnostic functions and CLI integration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
concore_cli/commands/doctor.py |
Core implementation of all diagnostic checks and Rich output rendering |
concore_cli/cli.py |
Registers the doctor command following the existing Click command pattern |
concore_cli/commands/__init__.py |
Exports doctor_check from the commands package |
tests/test_doctor.py |
Unit and integration tests for all diagnostic helper functions and the CLI command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use importlib.metadata instead of __import__ for package version checks - Fix Python version check to use tuple comparison (sys.version_info >= (3, 9)) - Make MATLAB version_flag a list to handle multi-arg flags correctly - Support list-type version_flag in _get_version() - Show found executable name (e.g., [g++]) in tool output - Treat Docker-not-found as warning instead of error (optional tool) - Add concore.repo to config file checks - Fix concore.mcr passed counter not incrementing on valid path - Build env var list dynamically from TOOL_DEFINITIONS config_keys - Handle empty summary_parts gracefully - Remove unused IMPORT_NAME_MAP (replaced by importlib.metadata) - Remove duplicate test (test_resolved_path_contains_concore) - Patch os.name via correct module path in platform key tests - Use __version__ import instead of hardcoded version in test
|
hello @pradeeban the PR is ready to review please review it when you are free... |
Replace non-ASCII characters (U+2713, U+2717, U+2192, U+2014) with ASCII equivalents (+, x, ->, -) to prevent UnicodeEncodeError on Windows terminals using legacy cp1252 encoding. Rich color markup still conveys pass/fail/warn semantics via green/red/yellow styling.
Adds a new
concore doctorCLI command that performs comprehensive system readiness diagnostics, helping users quickly identify missing tools, misconfigured paths, and dependency issues before running concore studies.What it does
Running
concore doctorproduces a clean Rich-formatted report covering:concore.tools,concore.octave,concore.mcr,concore.sudoin CONCOREPATHCONCORE_CPPEXE,CONCORE_PYTHONEXE, etc.Files Changed
concore_cli/commands/doctor.pyconcore_cli/cli.pydoctorcommand in the CLI groupconcore_cli/commands/__init__.pydoctor_checktests/test_doctor.pyTesting
pytest tests/test_doctor.py)ruff checkpasses clean on all changed filesCloses #495