python_proto_importer/verification/mod.rs
1//! Verification modules for generated Python protobuf code.
2//!
3//! This module provides comprehensive verification capabilities to ensure that
4//! generated Python code is correct, importable, and ready for production use.
5//! The verification phase is the final quality gate before generated code is
6//! considered complete.
7//!
8//! # Verification Components
9//!
10//! - **Import Testing** ([`import_test`]): Validates that all generated modules can be imported
11//! - **Package Structure Analysis** ([`package_structure`]): Determines optimal Python package layout
12//! - **Test Script Generation** ([`script_generator`]): Creates dynamic test scripts for validation
13//!
14//! # Verification Pipeline
15//!
16//! The verification process follows these steps:
17//!
18//! 1. **Package Structure Detection**: Analyzes the output directory structure
19//! 2. **Import Script Generation**: Creates a Python test script to import all modules
20//! 3. **Import Execution**: Runs the test script in the appropriate Python environment
21//! 4. **Type Checking** (optional): Executes configured mypy/pyright commands
22//! 5. **Result Analysis**: Reports any failures with actionable error messages
23//!
24//! # Usage Example
25//!
26//! ```no_run
27//! use python_proto_importer::verification::import_test::verify;
28//! use python_proto_importer::config::AppConfig;
29//! use std::path::Path;
30//!
31//! // Load configuration and verify generated code
32//! let config = AppConfig::load(Some(Path::new("pyproject.toml")))?;
33//! verify(&config)?;
34//!
35//! println!("All generated code verified successfully!");
36//! # Ok::<(), anyhow::Error>(())
37//! ```
38
39pub mod import_test;
40pub mod package_structure;
41pub mod script_generator;
42
43pub use package_structure::{determine_package_structure, determine_package_structure_legacy};
44pub use script_generator::create_import_test_script;