Coverage for src / ezcompiler / __init__.py: 88.89%

16 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-27 06:49 +0000

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

2# EZCOMPILER - Main Module 

3# Project: ezcompiler 

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

5 

6""" 

7EzCompiler - Project compilation and distribution framework. 

8 

9EzCompiler is a comprehensive Python framework for project compilation, version 

10file generation, packaging, and distribution, with a clean and typed API suitable 

11for professional and industrial Python applications. 

12 

13**Main Features:** 

14 - Multi-compiler support (Cx_Freeze, PyInstaller, Nuitka) 

15 - Version file generation for Windows executables 

16 - Project packaging to ZIP archives 

17 - Upload backends (disk and HTTP server) 

18 - Template-based file generation (configuration, setup, version) 

19 - File utilities (validation, ZIP operations) 

20 - CLI for automation and batch operations 

21 

22**Architecture (v2.0.0):** 

23 - interfaces: Public interfaces (CLI, Python API) 

24 - services: Business logic services 

25 - adapters: Compiler protocol implementations 

26 - utils: Utility functions and exceptions 

27 

28**Quick Start:** 

29 >>> from ezcompiler import EzCompiler, CompilerConfig 

30 >>> config = CompilerConfig( 

31 ... version="1.0.0", 

32 ... project_name="MyProject", 

33 ... main_file="main.py", 

34 ... include_files={"files": [], "folders": []}, 

35 ... output_folder="dist", 

36 ... ) 

37 >>> compiler = EzCompiler(config) 

38 >>> compiler.compile_project() 

39 >>> compiler.zip_compiled_project() 

40 >>> compiler.upload_to_repo("disk", "releases/") 

41""" 

42 

43from __future__ import annotations 

44 

45# /////////////////////////////////////////////////////////////// 

46# IMPORTS 

47# /////////////////////////////////////////////////////////////// 

48# Standard library imports 

49import sys 

50 

51# Local imports 

52from .interfaces import EzCompiler 

53from .shared import ( 

54 CompilationError, 

55 CompilerConfig, 

56 ConfigurationError, 

57 EzCompilerError, 

58 FileOperationError, 

59 TemplateError, 

60 UploadError, 

61 VersionError, 

62) 

63from .types import CompilerName, FilePath, IncludeFiles, JsonMap, UploadTarget 

64from .version import __version__ 

65 

66# /////////////////////////////////////////////////////////////// 

67# METADATA INFORMATION 

68# /////////////////////////////////////////////////////////////// 

69 

70__author__ = "Neuraaak" 

71__maintainer__ = "Neuraaak" 

72__description__ = "Project compilation and distribution framework for Python" 

73__python_requires__ = ">=3.11" 

74__keywords__ = [ 

75 "compilation", 

76 "packaging", 

77 "distribution", 

78 "cx_freeze", 

79 "pyinstaller", 

80 "nuitka", 

81] 

82__url__ = "https://github.com/neuraaak/ezcompiler" 

83__repository__ = "https://github.com/neuraaak/ezcompiler" 

84 

85# /////////////////////////////////////////////////////////////// 

86# PYTHON VERSION CHECK 

87# /////////////////////////////////////////////////////////////// 

88 

89if sys.version_info < (3, 11): # noqa: UP036 89 ↛ 90line 89 didn't jump to line 90 because the condition on line 89 was never true

90 raise RuntimeError( 

91 f"EzCompiler {__version__} requires Python 3.11 or higher. " 

92 f"Current version: {sys.version}" 

93 ) 

94 

95# /////////////////////////////////////////////////////////////// 

96# PUBLIC API 

97# /////////////////////////////////////////////////////////////// 

98 

99__all__ = [ 

100 # Main orchestration class 

101 "EzCompiler", 

102 # Configuration 

103 "CompilerConfig", 

104 # Type aliases 

105 "FilePath", 

106 "CompilerName", 

107 "UploadTarget", 

108 "IncludeFiles", 

109 "JsonMap", 

110 # Exceptions 

111 "EzCompilerError", 

112 "CompilationError", 

113 "ConfigurationError", 

114 "TemplateError", 

115 "UploadError", 

116 "VersionError", 

117 "FileOperationError", 

118 # Metadata 

119 "__version__", 

120 "__author__", 

121 "__maintainer__", 

122 "__python_requires__", 

123 "__description__", 

124 "__keywords__", 

125 "__repository__", 

126 "__url__", 

127]