Skip to content

feat: add concore doctor command for system readiness checks#499

Merged
pradeeban merged 4 commits intoControlCore-Project:devfrom
GaneshPatil7517:feature/concore-doctor-command
Mar 9, 2026
Merged

feat: add concore doctor command for system readiness checks#499
pradeeban merged 4 commits intoControlCore-Project:devfrom
GaneshPatil7517:feature/concore-doctor-command

Conversation

@GaneshPatil7517
Copy link

@GaneshPatil7517 GaneshPatil7517 commented Mar 9, 2026

Adds a new concore doctor CLI 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 doctor produces a clean Rich-formatted report covering:

  • Core Checks - Python version (≥3.9), concore installation, CONCOREPATH validity
  • Tool Detection - C++ compiler, Python, Verilog (iverilog), Octave, MATLAB, Docker (including daemon status)
  • Configuration Files - Validates concore.tools, concore.octave, concore.mcr, concore.sudo in CONCOREPATH
  • Environment Variables - Detects overrides like CONCORE_CPPEXE, CONCORE_PYTHONEXE, etc.
  • Dependency Checks - Required packages (click, rich, beautifulsoup4, lxml, psutil, numpy, pyzmq) and optional packages (scipy, matplotlib)
  • Summary - Total pass/warn/fail counts with a clear pass/fail verdict

Files Changed

File Change
concore_cli/commands/doctor.py New - full implementation of the doctor diagnostic command
concore_cli/cli.py Modified - register doctor command in the CLI group
concore_cli/commands/__init__.py Modified - export doctor_check
tests/test_doctor.py New - 23 unit tests covering all diagnostic functions

Testing

  • 23/23 new tests pass (pytest tests/test_doctor.py)
  • 152/152 existing tests pass (9 pre-existing Flask-related errors unaffected)
  • ruff check passes clean on all changed files

Closes #495

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
Copilot AI review requested due to automatic review settings March 9, 2026 03:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 full doctor_check diagnostic function and helpers.
  • concore_cli/cli.py + concore_cli/commands/__init__.py: Registration of the new doctor command 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
@GaneshPatil7517
Copy link
Author

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.
@pradeeban pradeeban merged commit a57666b into ControlCore-Project:dev Mar 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants