Coverage for src/ezcompiler/shared/_compilation_result.py: 100.00%
7 statements
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-03 15:46 +0000
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-03 15:46 +0000
1# ///////////////////////////////////////////////////////////////
2# COMPILATION_RESULT - Result type for compilation operations
3# Project: ezcompiler
4# ///////////////////////////////////////////////////////////////
6"""
7CompilationResult - Shared result type for compilation operations.
9Defined in shared/ so it can be consumed by services, pipeline,
10and interfaces without creating inter-service dependencies.
11"""
13from __future__ import annotations
15# ///////////////////////////////////////////////////////////////
16# IMPORTS
17# ///////////////////////////////////////////////////////////////
18# Standard library imports
19from typing import Any
21# ///////////////////////////////////////////////////////////////
22# CLASSES
23# ///////////////////////////////////////////////////////////////
26class CompilationResult:
27 """
28 Result of a compilation operation.
30 Contains information about the compilation result, including whether
31 the output needs to be zipped and the compiler instance used.
33 Attributes:
34 zip_needed: Whether the compiled output needs to be zipped
35 compiler_name: Name of the compiler used
36 _compiler_instance: The compiler instance that performed the compilation
38 Example:
39 >>> result = service.compile(compiler="PyInstaller")
40 >>> if result.zip_needed:
41 ... # Create ZIP archive
42 """
44 def __init__(
45 self,
46 zip_needed: bool,
47 compiler_name: str,
48 # TODO [AUDIT P2]: remplacer Any par CompilerPort une fois BaseCompiler migré en Protocol
49 # Voir adapters/base_compiler.py — migrer ABC → Protocol (adapters/ports.py)
50 compiler_instance: Any,
51 ) -> None:
52 """
53 Initialize compilation result.
55 Args:
56 zip_needed: Whether output needs to be zipped
57 compiler_name: Name of compiler used
58 compiler_instance: Compiler instance that performed compilation
59 """
60 self.zip_needed = zip_needed
61 self.compiler_name = compiler_name
62 self._compiler_instance = compiler_instance