pub fn run() -> Result<()>Expand description
Run environment diagnostics and display system information.
This function performs a comprehensive check of the development environment, reporting on the availability and versions of tools needed for proto-to-Python code generation. It checks for:
- Python interpreters (uv, python3, python)
- Required Python packages (grpcio-tools)
- Optional Python packages (mypy-protobuf, mypy-grpc)
- Type checkers (mypy, pyright)
- System tools (protoc, buf)
The function also attempts to load and validate a pyproject.toml configuration to provide targeted recommendations based on the current project setup.
§Returns
Returns Ok(()) on successful completion of all checks, or an error
if critical issues prevent the diagnostic from running.
§Example
use python_proto_importer::doctor;
fn main() -> anyhow::Result<()> {
doctor::run()
}