Coverage for src/ezcompiler/shared/_compilation_result.py: 81.82%

9 statements  

« prev     ^ index     » next       coverage.py v7.14.3, created at 2026-07-04 11:22 +0000

1# /////////////////////////////////////////////////////////////// 

2# COMPILATION_RESULT - Result type for compilation operations 

3# Project: ezcompiler 

4# /////////////////////////////////////////////////////////////// 

5 

6""" 

7CompilationResult - Shared result type for compilation operations. 

8 

9Defined in shared/ so it can be consumed by services, pipeline, 

10and interfaces without creating inter-service dependencies. 

11""" 

12 

13from __future__ import annotations 

14 

15# /////////////////////////////////////////////////////////////// 

16# IMPORTS 

17# /////////////////////////////////////////////////////////////// 

18# Standard library imports 

19from typing import TYPE_CHECKING 

20 

21if TYPE_CHECKING: 21 ↛ 22line 21 didn't jump to line 22 because the condition on line 21 was never true

22 from .._types import CompilerPort 

23 

24# /////////////////////////////////////////////////////////////// 

25# CLASSES 

26# /////////////////////////////////////////////////////////////// 

27 

28 

29class CompilationResult: 

30 """ 

31 Result of a compilation operation. 

32 

33 Contains information about the compilation result, including whether 

34 the output needs to be zipped and the compiler instance used. 

35 

36 Attributes: 

37 zip_needed: Whether the compiled output needs to be zipped 

38 compiler_name: Name of the compiler used 

39 _compiler_instance: The compiler instance that performed the compilation 

40 

41 Example: 

42 >>> result = service.compile(compiler="PyInstaller") 

43 >>> if result.zip_needed: 

44 ... # Create ZIP archive 

45 """ 

46 

47 def __init__( 

48 self, 

49 zip_needed: bool, 

50 compiler_name: str, 

51 compiler_instance: CompilerPort, 

52 ) -> None: 

53 """ 

54 Initialize compilation result. 

55 

56 Args: 

57 zip_needed: Whether output needs to be zipped 

58 compiler_name: Name of compiler used 

59 compiler_instance: Compiler instance that performed compilation 

60 """ 

61 self.zip_needed = zip_needed 

62 self.compiler_name = compiler_name 

63 self._compiler_instance = compiler_instance