Nuitka-winsvc 1.8__cp311-cp311-win_amd64.whl → 2.5.1__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Nuitka-winsvc might be problematic. Click here for more details.

Files changed (728) hide show
  1. Nuitka_winsvc-1.8.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.5.1.data/scripts/nuitka-run.cmd +9 -9
  2. Nuitka_winsvc-1.8.data/scripts/nuitka.bat → Nuitka_winsvc-2.5.1.data/scripts/nuitka.cmd +15 -15
  3. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/METADATA +5 -3
  4. Nuitka_winsvc-2.5.1.dist-info/RECORD +977 -0
  5. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/WHEEL +1 -1
  6. nuitka/Builtins.py +49 -17
  7. nuitka/BytecodeCaching.py +24 -20
  8. nuitka/Bytecodes.py +23 -19
  9. nuitka/CacheCleanup.py +28 -23
  10. nuitka/Constants.py +19 -17
  11. nuitka/Errors.py +23 -17
  12. nuitka/HardImportRegistry.py +408 -0
  13. nuitka/MainControl.py +209 -116
  14. nuitka/ModuleRegistry.py +83 -20
  15. nuitka/OptionParsing.py +467 -221
  16. nuitka/Options.py +701 -225
  17. nuitka/OutputDirectories.py +47 -23
  18. nuitka/PostProcessing.py +133 -79
  19. nuitka/Progress.py +73 -24
  20. nuitka/PythonFlavors.py +141 -32
  21. nuitka/PythonOperators.py +18 -17
  22. nuitka/PythonVersions.py +107 -19
  23. nuitka/Serialization.py +70 -55
  24. nuitka/SourceCodeReferences.py +19 -17
  25. nuitka/Tracing.py +176 -70
  26. nuitka/TreeXML.py +31 -26
  27. nuitka/Variables.py +39 -41
  28. nuitka/Version.py +22 -8
  29. nuitka/__init__.py +5 -4
  30. nuitka/__main__.py +95 -29
  31. nuitka/__past__.py +44 -34
  32. nuitka/build/Backend.scons +243 -141
  33. nuitka/build/CCompilerVersion.scons +45 -31
  34. nuitka/build/DataComposerInterface.py +20 -17
  35. nuitka/build/Onefile.scons +56 -54
  36. nuitka/build/SconsCaching.py +105 -92
  37. nuitka/build/SconsCompilerSettings.py +167 -68
  38. nuitka/build/SconsHacks.py +25 -19
  39. nuitka/build/SconsInterface.py +155 -54
  40. nuitka/build/SconsProgress.py +19 -18
  41. nuitka/build/SconsSpawn.py +62 -33
  42. nuitka/build/SconsUtils.py +152 -55
  43. nuitka/build/__init__.py +5 -4
  44. nuitka/build/include/nuitka/allocator.h +228 -22
  45. nuitka/build/include/nuitka/builtins.h +17 -17
  46. nuitka/build/include/nuitka/calling.h +24 -24
  47. nuitka/build/include/nuitka/checkers.h +17 -18
  48. nuitka/build/include/nuitka/checksum_tools.h +14 -19
  49. nuitka/build/include/nuitka/compiled_asyncgen.h +28 -25
  50. nuitka/build/include/nuitka/compiled_cell.h +33 -18
  51. nuitka/build/include/nuitka/compiled_coroutine.h +18 -18
  52. nuitka/build/include/nuitka/compiled_frame.h +93 -54
  53. nuitka/build/include/nuitka/compiled_function.h +42 -20
  54. nuitka/build/include/nuitka/compiled_generator.h +24 -18
  55. nuitka/build/include/nuitka/compiled_method.h +17 -18
  56. nuitka/build/include/nuitka/constants.h +35 -18
  57. nuitka/build/include/nuitka/constants_blob.h +17 -17
  58. nuitka/build/include/nuitka/debug_settings.h +60 -0
  59. nuitka/build/include/nuitka/environment_variables.h +30 -0
  60. nuitka/build/include/nuitka/environment_variables_system.h +45 -0
  61. nuitka/build/include/nuitka/exception_groups.h +23 -26
  62. nuitka/build/include/nuitka/exceptions.h +717 -171
  63. nuitka/build/include/nuitka/filesystem_paths.h +26 -20
  64. nuitka/build/include/nuitka/freelists.h +38 -18
  65. nuitka/build/include/nuitka/helper/attributes.h +24 -22
  66. nuitka/build/include/nuitka/helper/boolean.h +17 -17
  67. nuitka/build/include/nuitka/helper/bytearrays.h +17 -17
  68. nuitka/build/include/nuitka/helper/bytes.h +14 -15
  69. nuitka/build/include/nuitka/helper/calling_generated.h +69 -69
  70. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  71. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  72. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  73. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  74. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  75. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  76. nuitka/build/include/nuitka/helper/comparisons_eq.h +17 -17
  77. nuitka/build/include/nuitka/helper/comparisons_ge.h +17 -17
  78. nuitka/build/include/nuitka/helper/comparisons_gt.h +17 -17
  79. nuitka/build/include/nuitka/helper/comparisons_le.h +17 -17
  80. nuitka/build/include/nuitka/helper/comparisons_lt.h +17 -17
  81. nuitka/build/include/nuitka/helper/comparisons_ne.h +17 -17
  82. nuitka/build/include/nuitka/helper/complex.h +17 -17
  83. nuitka/build/include/nuitka/helper/dictionaries.h +89 -51
  84. nuitka/build/include/nuitka/helper/floats.h +17 -18
  85. nuitka/build/include/nuitka/helper/import_hard.h +25 -17
  86. nuitka/build/include/nuitka/helper/indexes.h +17 -18
  87. nuitka/build/include/nuitka/helper/ints.h +115 -54
  88. nuitka/build/include/nuitka/helper/iterators.h +99 -51
  89. nuitka/build/include/nuitka/helper/lists.h +26 -24
  90. nuitka/build/include/nuitka/helper/lists_generated.h +22 -22
  91. nuitka/build/include/nuitka/helper/mappings.h +17 -18
  92. nuitka/build/include/nuitka/helper/operations.h +20 -17
  93. nuitka/build/include/nuitka/helper/operations_binary_add.h +23 -17
  94. nuitka/build/include/nuitka/helper/operations_binary_bitand.h +17 -17
  95. nuitka/build/include/nuitka/helper/operations_binary_bitor.h +17 -17
  96. nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +17 -17
  97. nuitka/build/include/nuitka/helper/operations_binary_divmod.h +17 -17
  98. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  99. nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +17 -17
  100. nuitka/build/include/nuitka/helper/operations_binary_lshift.h +17 -17
  101. nuitka/build/include/nuitka/helper/operations_binary_matmult.h +17 -17
  102. nuitka/build/include/nuitka/helper/operations_binary_mod.h +17 -17
  103. nuitka/build/include/nuitka/helper/operations_binary_mult.h +17 -17
  104. nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +17 -17
  105. nuitka/build/include/nuitka/helper/operations_binary_pow.h +17 -17
  106. nuitka/build/include/nuitka/helper/operations_binary_rshift.h +17 -17
  107. nuitka/build/include/nuitka/helper/operations_binary_sub.h +23 -17
  108. nuitka/build/include/nuitka/helper/operations_binary_truediv.h +17 -17
  109. nuitka/build/include/nuitka/helper/operations_builtin_types.h +17 -17
  110. nuitka/build/include/nuitka/helper/operations_inplace_add.h +20 -17
  111. nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +17 -17
  112. nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +17 -17
  113. nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +17 -17
  114. nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +17 -17
  115. nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +17 -17
  116. nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +17 -17
  117. nuitka/build/include/nuitka/helper/operations_inplace_mod.h +17 -17
  118. nuitka/build/include/nuitka/helper/operations_inplace_mult.h +17 -17
  119. nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +17 -17
  120. nuitka/build/include/nuitka/helper/operations_inplace_pow.h +17 -17
  121. nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +17 -17
  122. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +20 -17
  123. nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +17 -17
  124. nuitka/build/include/nuitka/helper/raising.h +68 -37
  125. nuitka/build/include/nuitka/helper/rangeobjects.h +17 -17
  126. nuitka/build/include/nuitka/helper/richcomparisons.h +21 -14
  127. nuitka/build/include/nuitka/helper/sequences.h +19 -13
  128. nuitka/build/include/nuitka/helper/sets.h +11 -12
  129. nuitka/build/include/nuitka/helper/slices.h +31 -25
  130. nuitka/build/include/nuitka/helper/strings.h +16 -17
  131. nuitka/build/include/nuitka/helper/subscripts.h +18 -201
  132. nuitka/build/include/nuitka/helper/tuples.h +64 -52
  133. nuitka/build/include/nuitka/helpers.h +50 -22
  134. nuitka/build/include/nuitka/importing.h +28 -21
  135. nuitka/build/include/nuitka/jit_sources.h +25 -0
  136. nuitka/build/include/nuitka/prelude.h +163 -71
  137. nuitka/build/include/nuitka/printing.h +29 -22
  138. nuitka/build/include/nuitka/python_pgo.h +19 -18
  139. nuitka/build/include/nuitka/safe_string_ops.h +20 -18
  140. nuitka/build/include/nuitka/threading.h +45 -32
  141. nuitka/build/include/nuitka/tracing.h +28 -18
  142. nuitka/build/include/nuitka/type_aliases.h +30 -0
  143. nuitka/build/include/nuitka/unfreezing.h +29 -23
  144. nuitka/build/inline_copy/bin/scons.py +14 -0
  145. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +6 -6
  146. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
  147. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  148. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  149. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  150. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  151. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  152. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  153. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  154. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  155. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  156. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  157. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  158. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  159. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  160. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  161. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  162. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  163. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  164. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  165. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  166. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  167. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  168. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  169. nuitka/build/inline_copy/stubgen/six.py +998 -0
  170. nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
  171. nuitka/build/inline_copy/tqdm/tqdm/__init__.py +2 -2
  172. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  173. nuitka/build/inline_copy/tqdm/tqdm/utils.py +14 -8
  174. nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -8
  175. nuitka/build/inline_copy/zlib/LICENSE +22 -0
  176. nuitka/build/inline_copy/zlib/crc32.c +1049 -0
  177. nuitka/build/inline_copy/zlib/crc32.h +9446 -0
  178. nuitka/build/inline_copy/zlib/zconf.h +551 -0
  179. nuitka/build/inline_copy/zlib/zlib.h +1938 -0
  180. nuitka/build/inline_copy/zlib/zutil.h +275 -0
  181. nuitka/build/static_src/CompiledAsyncgenType.c +221 -221
  182. nuitka/build/static_src/CompiledCellType.c +69 -44
  183. nuitka/build/static_src/CompiledCodeHelpers.c +276 -159
  184. nuitka/build/static_src/CompiledCoroutineType.c +229 -226
  185. nuitka/build/static_src/CompiledFrameType.c +323 -138
  186. nuitka/build/static_src/CompiledFunctionType.c +547 -231
  187. nuitka/build/static_src/CompiledGeneratorType.c +416 -290
  188. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +593 -228
  189. nuitka/build/static_src/CompiledMethodType.c +91 -82
  190. nuitka/build/static_src/HelpersAllocator.c +352 -45
  191. nuitka/build/static_src/HelpersAttributes.c +30 -72
  192. nuitka/build/static_src/HelpersBuiltin.c +65 -46
  193. nuitka/build/static_src/HelpersBuiltinTypeMethods.c +17 -17
  194. nuitka/build/static_src/HelpersBytes.c +19 -20
  195. nuitka/build/static_src/HelpersCalling.c +40 -37
  196. nuitka/build/static_src/HelpersCallingGenerated.c +1061 -242
  197. nuitka/build/static_src/HelpersChecksumTools.c +35 -21
  198. nuitka/build/static_src/HelpersClasses.c +17 -17
  199. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  200. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  201. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  202. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  203. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  204. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  205. nuitka/build/static_src/HelpersComparisonEq.c +536 -496
  206. nuitka/build/static_src/HelpersComparisonEqUtils.c +22 -19
  207. nuitka/build/static_src/HelpersComparisonGe.c +531 -501
  208. nuitka/build/static_src/HelpersComparisonGt.c +530 -500
  209. nuitka/build/static_src/HelpersComparisonLe.c +531 -501
  210. nuitka/build/static_src/HelpersComparisonLt.c +530 -500
  211. nuitka/build/static_src/HelpersComparisonNe.c +538 -496
  212. nuitka/build/static_src/HelpersConsole.c +122 -0
  213. nuitka/build/static_src/HelpersConstantsBlob.c +550 -521
  214. nuitka/build/static_src/HelpersDeepcopy.c +33 -33
  215. nuitka/build/static_src/HelpersDictionaries.c +232 -63
  216. nuitka/build/static_src/HelpersDictionariesGenerated.c +130 -127
  217. nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
  218. nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
  219. nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +93 -0
  220. nuitka/build/static_src/HelpersExceptions.c +147 -62
  221. nuitka/build/static_src/HelpersFiles.c +116 -22
  222. nuitka/build/static_src/HelpersFilesystemPaths.c +292 -181
  223. nuitka/build/static_src/HelpersFloats.c +37 -31
  224. nuitka/build/static_src/HelpersHeapStorage.c +21 -17
  225. nuitka/build/static_src/HelpersImport.c +61 -29
  226. nuitka/build/static_src/HelpersImportHard.c +74 -61
  227. nuitka/build/static_src/HelpersJitSources.c +46 -0
  228. nuitka/build/static_src/HelpersLists.c +237 -58
  229. nuitka/build/static_src/HelpersListsGenerated.c +41 -41
  230. nuitka/build/static_src/HelpersMappings.c +17 -17
  231. nuitka/build/static_src/HelpersMatching.c +137 -51
  232. nuitka/build/static_src/HelpersOperationBinaryAdd.c +397 -152
  233. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +102 -52
  234. nuitka/build/static_src/HelpersOperationBinaryBitand.c +55 -55
  235. nuitka/build/static_src/HelpersOperationBinaryBitor.c +55 -55
  236. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +55 -55
  237. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +49 -43
  238. nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +17 -17
  239. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  240. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +55 -49
  241. nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +20 -21
  242. nuitka/build/static_src/HelpersOperationBinaryLshift.c +83 -83
  243. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +25 -24
  244. nuitka/build/static_src/HelpersOperationBinaryMod.c +129 -117
  245. nuitka/build/static_src/HelpersOperationBinaryMult.c +98 -82
  246. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +33 -30
  247. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +55 -49
  248. nuitka/build/static_src/HelpersOperationBinaryPow.c +68 -68
  249. nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +12 -12
  250. nuitka/build/static_src/HelpersOperationBinaryRshift.c +51 -51
  251. nuitka/build/static_src/HelpersOperationBinarySub.c +309 -88
  252. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +49 -43
  253. nuitka/build/static_src/HelpersOperationInplaceAdd.c +333 -163
  254. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +24 -22
  255. nuitka/build/static_src/HelpersOperationInplaceBitand.c +58 -58
  256. nuitka/build/static_src/HelpersOperationInplaceBitor.c +58 -58
  257. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +58 -58
  258. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +73 -68
  259. nuitka/build/static_src/HelpersOperationInplaceLshift.c +64 -64
  260. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +38 -37
  261. nuitka/build/static_src/HelpersOperationInplaceMod.c +145 -140
  262. nuitka/build/static_src/HelpersOperationInplaceMult.c +89 -84
  263. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +73 -68
  264. nuitka/build/static_src/HelpersOperationInplacePow.c +82 -82
  265. nuitka/build/static_src/HelpersOperationInplaceRshift.c +48 -48
  266. nuitka/build/static_src/HelpersOperationInplaceSub.c +275 -122
  267. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +68 -63
  268. nuitka/build/static_src/HelpersProfiling.c +25 -24
  269. nuitka/build/static_src/HelpersPythonPgo.c +22 -22
  270. nuitka/build/static_src/HelpersRaising.c +296 -283
  271. nuitka/build/static_src/HelpersSafeStrings.c +34 -22
  272. nuitka/build/static_src/HelpersSequences.c +18 -19
  273. nuitka/build/static_src/HelpersSlices.c +29 -23
  274. nuitka/build/static_src/HelpersStrings.c +235 -38
  275. nuitka/build/static_src/HelpersTuples.c +46 -34
  276. nuitka/build/static_src/HelpersTypes.c +166 -25
  277. nuitka/build/static_src/InspectPatcher.c +108 -27
  278. nuitka/build/static_src/MainProgram.c +464 -280
  279. nuitka/build/static_src/MetaPathBasedLoader.c +381 -257
  280. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +39 -26
  281. nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +17 -18
  282. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +227 -29
  283. nuitka/build/static_src/OnefileBootstrap.c +281 -164
  284. nuitka/build/static_src/OnefileSplashScreen.cpp +51 -27
  285. nuitka/code_generation/AsyncgenCodes.py +21 -23
  286. nuitka/code_generation/AttributeCodes.py +31 -27
  287. nuitka/code_generation/BinaryOperationHelperDefinitions.py +290 -184
  288. nuitka/code_generation/BranchCodes.py +19 -17
  289. nuitka/code_generation/BuiltinCodes.py +29 -18
  290. nuitka/code_generation/CallCodes.py +35 -33
  291. nuitka/code_generation/ClassCodes.py +19 -17
  292. nuitka/code_generation/CodeGeneration.py +61 -28
  293. nuitka/code_generation/CodeHelperSelection.py +20 -18
  294. nuitka/code_generation/CodeHelpers.py +28 -21
  295. nuitka/code_generation/CodeObjectCodes.py +36 -26
  296. nuitka/code_generation/ComparisonCodes.py +51 -22
  297. nuitka/code_generation/ComparisonHelperDefinitions.py +42 -25
  298. nuitka/code_generation/ConditionalCodes.py +19 -17
  299. nuitka/code_generation/ConstantCodes.py +82 -28
  300. nuitka/code_generation/Contexts.py +180 -42
  301. nuitka/code_generation/CoroutineCodes.py +21 -23
  302. nuitka/code_generation/CtypesCodes.py +19 -17
  303. nuitka/code_generation/DictCodes.py +28 -26
  304. nuitka/code_generation/Emission.py +21 -18
  305. nuitka/code_generation/ErrorCodes.py +57 -79
  306. nuitka/code_generation/EvalCodes.py +24 -20
  307. nuitka/code_generation/ExceptionCodes.py +182 -104
  308. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +45 -27
  309. nuitka/code_generation/ExpressionCodes.py +19 -17
  310. nuitka/code_generation/FrameCodes.py +28 -31
  311. nuitka/code_generation/FunctionCodes.py +26 -27
  312. nuitka/code_generation/GeneratorCodes.py +25 -26
  313. nuitka/code_generation/GlobalConstants.py +51 -25
  314. nuitka/code_generation/GlobalsLocalsCodes.py +23 -21
  315. nuitka/code_generation/IdCodes.py +19 -17
  316. nuitka/code_generation/ImportCodes.py +90 -50
  317. nuitka/code_generation/Indentation.py +23 -22
  318. nuitka/code_generation/IndexCodes.py +19 -17
  319. nuitka/code_generation/InjectCCodes.py +14 -12
  320. nuitka/code_generation/IntegerCodes.py +19 -17
  321. nuitka/code_generation/IteratorCodes.py +86 -71
  322. nuitka/code_generation/JitCodes.py +44 -0
  323. nuitka/code_generation/LabelCodes.py +19 -17
  324. nuitka/code_generation/LineNumberCodes.py +20 -20
  325. nuitka/code_generation/ListCodes.py +32 -36
  326. nuitka/code_generation/LoaderCodes.py +22 -17
  327. nuitka/code_generation/LocalsDictCodes.py +56 -32
  328. nuitka/code_generation/LoopCodes.py +19 -17
  329. nuitka/code_generation/MatchCodes.py +42 -22
  330. nuitka/code_generation/ModuleCodes.py +71 -29
  331. nuitka/code_generation/Namify.py +27 -23
  332. nuitka/code_generation/NetworkxCodes.py +51 -0
  333. nuitka/code_generation/OperationCodes.py +80 -51
  334. nuitka/code_generation/PackageResourceCodes.py +96 -23
  335. nuitka/code_generation/PrintCodes.py +19 -17
  336. nuitka/code_generation/PythonAPICodes.py +19 -17
  337. nuitka/code_generation/RaisingCodes.py +183 -107
  338. nuitka/code_generation/Reports.py +32 -22
  339. nuitka/code_generation/ReturnCodes.py +20 -32
  340. nuitka/code_generation/SetCodes.py +19 -17
  341. nuitka/code_generation/SliceCodes.py +22 -20
  342. nuitka/code_generation/StringCodes.py +19 -17
  343. nuitka/code_generation/SubscriptCodes.py +24 -30
  344. nuitka/code_generation/TensorflowCodes.py +54 -0
  345. nuitka/code_generation/TryCodes.py +31 -41
  346. nuitka/code_generation/TupleCodes.py +20 -18
  347. nuitka/code_generation/TypeAliasCodes.py +119 -0
  348. nuitka/code_generation/VariableCodes.py +118 -55
  349. nuitka/code_generation/VariableDeclarations.py +28 -25
  350. nuitka/code_generation/YieldCodes.py +23 -21
  351. nuitka/code_generation/__init__.py +5 -4
  352. nuitka/code_generation/c_types/CTypeBases.py +29 -19
  353. nuitka/code_generation/c_types/CTypeBooleans.py +19 -17
  354. nuitka/code_generation/c_types/CTypeCFloats.py +19 -17
  355. nuitka/code_generation/c_types/CTypeCLongs.py +19 -18
  356. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +22 -17
  357. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +22 -21
  358. nuitka/code_generation/c_types/CTypeNuitkaInts.py +89 -43
  359. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +20 -18
  360. nuitka/code_generation/c_types/CTypePyObjectPointers.py +43 -31
  361. nuitka/code_generation/c_types/CTypeVoids.py +20 -17
  362. nuitka/code_generation/c_types/__init__.py +5 -4
  363. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +20 -19
  364. nuitka/code_generation/templates/CodeTemplatesConstants.py +143 -39
  365. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +20 -19
  366. nuitka/code_generation/templates/CodeTemplatesExceptions.py +33 -33
  367. nuitka/code_generation/templates/CodeTemplatesFrames.py +36 -27
  368. nuitka/code_generation/templates/CodeTemplatesFunction.py +20 -19
  369. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +21 -19
  370. nuitka/code_generation/templates/CodeTemplatesIterators.py +19 -53
  371. nuitka/code_generation/templates/CodeTemplatesLoader.py +25 -19
  372. nuitka/code_generation/templates/CodeTemplatesModules.py +278 -169
  373. nuitka/code_generation/templates/CodeTemplatesVariables.py +115 -27
  374. nuitka/code_generation/templates/TemplateDebugWrapper.py +19 -18
  375. nuitka/code_generation/templates/__init__.py +5 -4
  376. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +19 -19
  377. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +21 -21
  378. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +79 -28
  379. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +22 -22
  380. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +19 -19
  381. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +19 -19
  382. nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +17 -17
  383. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +74 -106
  384. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +19 -20
  385. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +19 -19
  386. nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +6 -6
  387. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +23 -23
  388. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  389. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +35 -35
  390. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +37 -37
  391. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  392. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +17 -17
  393. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +18 -18
  394. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +50 -38
  395. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +27 -27
  396. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +37 -37
  397. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +31 -31
  398. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +35 -31
  399. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +20 -20
  400. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +28 -28
  401. nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +17 -17
  402. nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +17 -17
  403. nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +17 -17
  404. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +48 -48
  405. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +21 -18
  406. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +27 -25
  407. nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +17 -17
  408. nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +17 -17
  409. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +21 -18
  410. nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +17 -17
  411. nuitka/containers/Namedtuples.py +25 -18
  412. nuitka/containers/OrderedSets.py +105 -5
  413. nuitka/containers/OrderedSetsFallback.py +19 -17
  414. nuitka/containers/__init__.py +5 -4
  415. nuitka/distutils/Build.py +33 -18
  416. nuitka/distutils/DistutilCommands.py +84 -33
  417. nuitka/distutils/__init__.py +5 -4
  418. nuitka/finalizations/Finalization.py +21 -18
  419. nuitka/finalizations/FinalizeMarkups.py +31 -55
  420. nuitka/finalizations/__init__.py +5 -4
  421. nuitka/freezer/DependsExe.py +60 -30
  422. nuitka/freezer/DllDependenciesCommon.py +47 -20
  423. nuitka/freezer/DllDependenciesMacOS.py +165 -58
  424. nuitka/freezer/DllDependenciesPosix.py +29 -19
  425. nuitka/freezer/DllDependenciesWin32.py +55 -33
  426. nuitka/freezer/ImportDetection.py +23 -17
  427. nuitka/freezer/IncludedDataFiles.py +142 -48
  428. nuitka/freezer/IncludedEntryPoints.py +104 -39
  429. nuitka/freezer/Onefile.py +32 -22
  430. nuitka/freezer/Standalone.py +166 -53
  431. nuitka/freezer/__init__.py +5 -4
  432. nuitka/importing/IgnoreListing.py +19 -17
  433. nuitka/importing/ImportCache.py +24 -21
  434. nuitka/importing/ImportResolving.py +103 -95
  435. nuitka/importing/Importing.py +319 -98
  436. nuitka/importing/PreloadedPackages.py +21 -18
  437. nuitka/importing/Recursion.py +142 -47
  438. nuitka/importing/StandardLibrary.py +96 -80
  439. nuitka/importing/__init__.py +5 -4
  440. nuitka/nodes/AsyncgenNodes.py +22 -23
  441. nuitka/nodes/AttributeLookupNodes.py +19 -17
  442. nuitka/nodes/AttributeNodes.py +19 -17
  443. nuitka/nodes/AttributeNodesGenerated.py +49 -24
  444. nuitka/nodes/BuiltinAllNodes.py +19 -17
  445. nuitka/nodes/BuiltinAnyNodes.py +19 -17
  446. nuitka/nodes/BuiltinComplexNodes.py +20 -17
  447. nuitka/nodes/BuiltinDecodingNodes.py +19 -17
  448. nuitka/nodes/BuiltinDecoratorNodes.py +19 -17
  449. nuitka/nodes/BuiltinDictNodes.py +19 -17
  450. nuitka/nodes/BuiltinFormatNodes.py +20 -17
  451. nuitka/nodes/BuiltinHashNodes.py +19 -17
  452. nuitka/nodes/BuiltinInputNodes.py +19 -17
  453. nuitka/nodes/BuiltinIntegerNodes.py +19 -17
  454. nuitka/nodes/BuiltinIteratorNodes.py +25 -21
  455. nuitka/nodes/BuiltinLenNodes.py +19 -17
  456. nuitka/nodes/BuiltinNextNodes.py +19 -17
  457. nuitka/nodes/BuiltinOpenNodes.py +52 -18
  458. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +40 -23
  459. nuitka/nodes/BuiltinRangeNodes.py +21 -19
  460. nuitka/nodes/BuiltinRefNodes.py +73 -40
  461. nuitka/nodes/BuiltinSumNodes.py +20 -18
  462. nuitka/nodes/BuiltinTypeNodes.py +19 -17
  463. nuitka/nodes/BuiltinVarsNodes.py +19 -18
  464. nuitka/nodes/BytesNodes.py +19 -17
  465. nuitka/nodes/CallNodes.py +19 -17
  466. nuitka/nodes/Checkers.py +19 -17
  467. nuitka/nodes/ChildrenHavingMixins.py +1624 -283
  468. nuitka/nodes/ClassNodes.py +49 -29
  469. nuitka/nodes/CodeObjectSpecs.py +29 -18
  470. nuitka/nodes/ComparisonNodes.py +19 -17
  471. nuitka/nodes/ConditionalNodes.py +24 -25
  472. nuitka/nodes/ConstantRefNodes.py +57 -17
  473. nuitka/nodes/ContainerMakingNodes.py +19 -17
  474. nuitka/nodes/ContainerOperationNodes.py +19 -17
  475. nuitka/nodes/CoroutineNodes.py +22 -23
  476. nuitka/nodes/CtypesNodes.py +19 -18
  477. nuitka/nodes/DictionaryNodes.py +19 -18
  478. nuitka/nodes/ExceptionNodes.py +131 -43
  479. nuitka/nodes/ExecEvalNodes.py +19 -17
  480. nuitka/nodes/ExpressionBases.py +34 -26
  481. nuitka/nodes/ExpressionBasesGenerated.py +341 -35
  482. nuitka/nodes/ExpressionShapeMixins.py +19 -17
  483. nuitka/nodes/FrameNodes.py +41 -28
  484. nuitka/nodes/FunctionAttributeNodes.py +19 -17
  485. nuitka/nodes/FunctionNodes.py +84 -38
  486. nuitka/nodes/FutureSpecs.py +35 -20
  487. nuitka/nodes/GeneratorNodes.py +24 -25
  488. nuitka/nodes/GlobalsLocalsNodes.py +22 -17
  489. nuitka/nodes/HardImportNodesGenerated.py +746 -148
  490. nuitka/nodes/ImportHardNodes.py +46 -38
  491. nuitka/nodes/ImportNodes.py +438 -448
  492. nuitka/nodes/IndicatorMixins.py +19 -17
  493. nuitka/nodes/InjectCNodes.py +19 -18
  494. nuitka/nodes/IterationHandles.py +55 -34
  495. nuitka/nodes/KeyValuePairNodes.py +19 -17
  496. nuitka/nodes/ListOperationNodes.py +33 -21
  497. nuitka/nodes/LocalsDictNodes.py +19 -17
  498. nuitka/nodes/LocalsScopes.py +41 -41
  499. nuitka/nodes/LoopNodes.py +28 -17
  500. nuitka/nodes/MatchNodes.py +37 -24
  501. nuitka/nodes/ModuleAttributeNodes.py +18 -35
  502. nuitka/nodes/ModuleNodes.py +90 -31
  503. nuitka/nodes/NetworkxNodes.py +45 -0
  504. nuitka/nodes/NodeBases.py +73 -44
  505. nuitka/nodes/NodeMakingHelpers.py +92 -69
  506. nuitka/nodes/NodeMetaClasses.py +45 -28
  507. nuitka/nodes/OperatorNodes.py +28 -26
  508. nuitka/nodes/OperatorNodesUnary.py +148 -20
  509. nuitka/nodes/OsSysNodes.py +97 -18
  510. nuitka/nodes/OutlineNodes.py +24 -22
  511. nuitka/nodes/PackageMetadataNodes.py +37 -27
  512. nuitka/nodes/PackageResourceNodes.py +29 -23
  513. nuitka/nodes/PrintNodes.py +19 -17
  514. nuitka/nodes/ReturnNodes.py +20 -18
  515. nuitka/nodes/SideEffectNodes.py +19 -17
  516. nuitka/nodes/SliceNodes.py +20 -18
  517. nuitka/nodes/StatementBasesGenerated.py +125 -79
  518. nuitka/nodes/StatementNodes.py +27 -24
  519. nuitka/nodes/StrNodes.py +19 -17
  520. nuitka/nodes/StringConcatenationNodes.py +20 -17
  521. nuitka/nodes/SubscriptNodes.py +27 -25
  522. nuitka/nodes/TensorflowNodes.py +38 -0
  523. nuitka/nodes/TryNodes.py +19 -17
  524. nuitka/nodes/TypeMatchNodes.py +19 -17
  525. nuitka/nodes/TypeNodes.py +68 -18
  526. nuitka/nodes/VariableAssignNodes.py +122 -64
  527. nuitka/nodes/VariableDelNodes.py +19 -17
  528. nuitka/nodes/VariableNameNodes.py +19 -17
  529. nuitka/nodes/VariableRefNodes.py +63 -26
  530. nuitka/nodes/VariableReleaseNodes.py +19 -17
  531. nuitka/nodes/YieldNodes.py +21 -19
  532. nuitka/nodes/__init__.py +5 -4
  533. nuitka/nodes/shapes/BuiltinTypeShapes.py +169 -46
  534. nuitka/nodes/shapes/ControlFlowDescriptions.py +19 -17
  535. nuitka/nodes/shapes/ShapeMixins.py +57 -17
  536. nuitka/nodes/shapes/StandardShapes.py +80 -21
  537. nuitka/nodes/shapes/__init__.py +5 -4
  538. nuitka/optimizations/BytecodeDemotion.py +21 -18
  539. nuitka/optimizations/FunctionInlining.py +22 -23
  540. nuitka/optimizations/Graphs.py +19 -17
  541. nuitka/optimizations/Optimization.py +39 -35
  542. nuitka/optimizations/OptimizeBuiltinCalls.py +31 -27
  543. nuitka/optimizations/Tags.py +19 -18
  544. nuitka/optimizations/TraceCollections.py +67 -24
  545. nuitka/optimizations/ValueTraces.py +92 -25
  546. nuitka/optimizations/__init__.py +5 -4
  547. nuitka/pgo/PGO.py +33 -23
  548. nuitka/pgo/__init__.py +5 -4
  549. nuitka/plugins/PluginBase.py +655 -112
  550. nuitka/plugins/Plugins.py +247 -61
  551. nuitka/plugins/YamlPluginBase.py +121 -0
  552. nuitka/plugins/__init__.py +5 -4
  553. nuitka/plugins/standard/AntiBloatPlugin.py +374 -135
  554. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +20 -19
  555. nuitka/plugins/standard/DataFilesPlugin.py +65 -29
  556. nuitka/plugins/standard/DelvewheelPlugin.py +32 -24
  557. nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
  558. nuitka/plugins/standard/DillPlugin/dill-postLoad.py +256 -0
  559. nuitka/plugins/standard/DillPlugin.py +42 -134
  560. nuitka/plugins/standard/DllFilesPlugin.py +125 -42
  561. nuitka/plugins/standard/EnumPlugin.py +19 -17
  562. nuitka/plugins/standard/EventletPlugin.py +19 -17
  563. nuitka/plugins/standard/GeventPlugin.py +19 -17
  564. nuitka/plugins/standard/GiPlugin.py +44 -28
  565. nuitka/plugins/standard/GlfwPlugin.py +20 -17
  566. nuitka/plugins/standard/ImplicitImports.py +403 -54
  567. nuitka/plugins/standard/KivyPlugin.py +24 -20
  568. nuitka/plugins/standard/MatplotlibPlugin.py +99 -42
  569. nuitka/plugins/standard/MultiprocessingPlugin.py +35 -39
  570. nuitka/plugins/standard/NumpyPlugin.py +19 -17
  571. nuitka/plugins/standard/OptionsNannyPlugin.py +48 -76
  572. nuitka/plugins/standard/PbrPlugin.py +21 -19
  573. nuitka/plugins/standard/PkgResourcesPlugin.py +34 -23
  574. nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
  575. nuitka/plugins/standard/PmwPlugin.py +30 -27
  576. nuitka/plugins/standard/PySidePyQtPlugin.py +82 -80
  577. nuitka/plugins/standard/PywebViewPlugin.py +19 -17
  578. nuitka/plugins/standard/SpacyPlugin.py +136 -0
  579. nuitka/plugins/standard/TensorflowPlugin.py +20 -17
  580. nuitka/plugins/standard/TkinterPlugin.py +102 -108
  581. nuitka/plugins/standard/TorchPlugin.py +20 -17
  582. nuitka/plugins/standard/TransformersPlugin.py +90 -231
  583. nuitka/plugins/standard/TrioPlugin.py +18 -15
  584. nuitka/plugins/standard/UpxPlugin.py +21 -19
  585. nuitka/plugins/standard/__init__.py +5 -4
  586. nuitka/plugins/standard/standard.nuitka-package.config.yml +3925 -1293
  587. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +14 -14
  588. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +154 -66
  589. nuitka/reports/CompilationReportReader.py +79 -0
  590. nuitka/reports/LicenseReport.rst.j2 +21 -21
  591. nuitka/reports/Reports.py +363 -76
  592. nuitka/reports/__init__.py +5 -4
  593. nuitka/specs/BuiltinBytesOperationSpecs.py +18 -17
  594. nuitka/specs/BuiltinDictOperationSpecs.py +18 -17
  595. nuitka/specs/BuiltinListOperationSpecs.py +18 -17
  596. nuitka/specs/BuiltinParameterSpecs.py +35 -21
  597. nuitka/specs/BuiltinStrOperationSpecs.py +19 -18
  598. nuitka/specs/BuiltinTypeOperationSpecs.py +18 -18
  599. nuitka/specs/BuiltinUnicodeOperationSpecs.py +18 -17
  600. nuitka/specs/HardImportSpecs.py +74 -22
  601. nuitka/specs/ParameterSpecs.py +60 -45
  602. nuitka/specs/__init__.py +5 -4
  603. nuitka/tools/Basics.py +20 -18
  604. nuitka/tools/__init__.py +5 -4
  605. nuitka/tools/commercial/__init__.py +7 -6
  606. nuitka/tools/data_composer/DataComposer.py +78 -62
  607. nuitka/tools/data_composer/__init__.py +5 -4
  608. nuitka/tools/data_composer/__main__.py +18 -17
  609. nuitka/tools/environments/CreateEnvironment.py +20 -17
  610. nuitka/tools/environments/Virtualenv.py +60 -32
  611. nuitka/tools/environments/__init__.py +5 -4
  612. nuitka/tools/general/__init__.py +5 -4
  613. nuitka/tools/general/dll_report/__init__.py +5 -4
  614. nuitka/tools/general/dll_report/__main__.py +29 -22
  615. nuitka/tools/general/find_module/FindModuleCode.py +35 -22
  616. nuitka/tools/general/find_module/__init__.py +5 -4
  617. nuitka/tools/onefile_compressor/OnefileCompressor.py +213 -131
  618. nuitka/tools/onefile_compressor/__init__.py +5 -4
  619. nuitka/tools/onefile_compressor/__main__.py +18 -17
  620. nuitka/tools/podman/Podman.py +19 -17
  621. nuitka/tools/podman/__init__.py +5 -4
  622. nuitka/tools/podman/__main__.py +35 -19
  623. nuitka/tools/profiler/__init__.py +5 -4
  624. nuitka/tools/profiler/__main__.py +18 -17
  625. nuitka/tools/scanning/DisplayPackageDLLs.py +47 -22
  626. nuitka/tools/scanning/DisplayPackageData.py +31 -19
  627. nuitka/tools/scanning/__init__.py +5 -4
  628. nuitka/tools/specialize/CTypeDescriptions.py +251 -80
  629. nuitka/tools/specialize/Common.py +18 -17
  630. nuitka/tools/specialize/SpecializeC.py +248 -82
  631. nuitka/tools/specialize/SpecializePython.py +108 -45
  632. nuitka/tools/specialize/__init__.py +5 -4
  633. nuitka/tools/testing/Common.py +175 -114
  634. nuitka/tools/testing/Constructs.py +19 -17
  635. nuitka/tools/testing/OutputComparison.py +54 -18
  636. nuitka/tools/testing/Pythons.py +19 -18
  637. nuitka/tools/testing/RuntimeTracing.py +20 -19
  638. nuitka/tools/testing/SearchModes.py +26 -20
  639. nuitka/tools/testing/Valgrind.py +19 -17
  640. nuitka/tools/testing/__init__.py +5 -4
  641. nuitka/tools/testing/check_reference_counts/__init__.py +5 -4
  642. nuitka/tools/testing/check_reference_counts/__main__.py +18 -18
  643. nuitka/tools/testing/compare_with_cpython/__init__.py +5 -4
  644. nuitka/tools/testing/compare_with_cpython/__main__.py +39 -30
  645. nuitka/tools/testing/find_sxs_modules/__init__.py +5 -4
  646. nuitka/tools/testing/find_sxs_modules/__main__.py +17 -17
  647. nuitka/tools/testing/measure_construct_performance/__init__.py +5 -4
  648. nuitka/tools/testing/measure_construct_performance/__main__.py +23 -33
  649. nuitka/tools/testing/run_nuitka_tests/__init__.py +5 -4
  650. nuitka/tools/testing/run_nuitka_tests/__main__.py +134 -51
  651. nuitka/tools/watch/AutoStage.py +145 -0
  652. nuitka/tools/watch/GitHub.py +113 -0
  653. nuitka/tools/watch/__init__.py +5 -4
  654. nuitka/tools/watch/__main__.py +322 -91
  655. nuitka/tree/Building.py +184 -182
  656. nuitka/tree/ComplexCallHelperFunctions.py +84 -58
  657. nuitka/tree/Extractions.py +19 -17
  658. nuitka/tree/InternalModule.py +29 -20
  659. nuitka/tree/Operations.py +19 -17
  660. nuitka/tree/ReformulationAssertStatements.py +51 -31
  661. nuitka/tree/ReformulationAssignmentStatements.py +96 -91
  662. nuitka/tree/ReformulationBooleanExpressions.py +19 -17
  663. nuitka/tree/ReformulationCallExpressions.py +20 -18
  664. nuitka/tree/ReformulationClasses.py +45 -39
  665. nuitka/tree/ReformulationClasses3.py +239 -116
  666. nuitka/tree/ReformulationComparisonExpressions.py +29 -35
  667. nuitka/tree/ReformulationContractionExpressions.py +58 -55
  668. nuitka/tree/ReformulationDictionaryCreation.py +41 -35
  669. nuitka/tree/ReformulationExecStatements.py +42 -39
  670. nuitka/tree/ReformulationForLoopStatements.py +30 -34
  671. nuitka/tree/ReformulationFunctionStatements.py +59 -55
  672. nuitka/tree/ReformulationImportStatements.py +34 -29
  673. nuitka/tree/ReformulationLambdaExpressions.py +23 -24
  674. nuitka/tree/ReformulationMatchStatements.py +246 -92
  675. nuitka/tree/ReformulationMultidist.py +22 -18
  676. nuitka/tree/ReformulationNamespacePackages.py +55 -46
  677. nuitka/tree/ReformulationPrintStatements.py +23 -24
  678. nuitka/tree/ReformulationSequenceCreation.py +50 -49
  679. nuitka/tree/ReformulationSubscriptExpressions.py +19 -17
  680. nuitka/tree/ReformulationTryExceptStatements.py +19 -17
  681. nuitka/tree/ReformulationTryFinallyStatements.py +34 -17
  682. nuitka/tree/ReformulationWhileLoopStatements.py +19 -17
  683. nuitka/tree/ReformulationWithStatements.py +39 -41
  684. nuitka/tree/ReformulationYieldExpressions.py +44 -24
  685. nuitka/tree/SourceHandling.py +76 -31
  686. nuitka/tree/SyntaxErrors.py +19 -17
  687. nuitka/tree/TreeHelpers.py +33 -20
  688. nuitka/tree/VariableClosure.py +35 -39
  689. nuitka/tree/__init__.py +5 -4
  690. nuitka/utils/AppDirs.py +41 -20
  691. nuitka/utils/CStrings.py +66 -21
  692. nuitka/utils/CommandLineOptions.py +111 -22
  693. nuitka/utils/Distributions.py +445 -54
  694. nuitka/utils/Download.py +89 -57
  695. nuitka/utils/Execution.py +102 -58
  696. nuitka/utils/FileOperations.py +357 -128
  697. nuitka/utils/Hashing.py +55 -33
  698. nuitka/utils/Images.py +26 -19
  699. nuitka/utils/Importing.py +119 -37
  700. nuitka/utils/InlineCopies.py +52 -0
  701. nuitka/utils/InstalledPythons.py +85 -75
  702. nuitka/utils/InstanceCounters.py +20 -17
  703. nuitka/utils/Jinja2.py +30 -22
  704. nuitka/utils/Json.py +21 -19
  705. nuitka/utils/MacOSApp.py +26 -18
  706. nuitka/utils/MemoryUsage.py +20 -18
  707. nuitka/utils/ModuleNames.py +42 -26
  708. nuitka/utils/PackageResources.py +44 -0
  709. nuitka/utils/ReExecute.py +50 -28
  710. nuitka/utils/Rest.py +20 -17
  711. nuitka/utils/SharedLibraries.py +161 -75
  712. nuitka/utils/Shebang.py +20 -17
  713. nuitka/utils/Signing.py +63 -18
  714. nuitka/utils/SlotMetaClasses.py +57 -0
  715. nuitka/utils/StaticLibraries.py +83 -56
  716. nuitka/utils/ThreadedExecutor.py +18 -17
  717. nuitka/utils/Timing.py +22 -20
  718. nuitka/utils/Utils.py +132 -25
  719. nuitka/utils/WindowsFileUsage.py +22 -20
  720. nuitka/utils/WindowsResources.py +25 -18
  721. nuitka/utils/Yaml.py +62 -24
  722. nuitka/utils/__init__.py +5 -4
  723. Nuitka_winsvc-1.8.dist-info/RECORD +0 -905
  724. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_gui.py +0 -9
  725. nuitka/build/inline_copy/tqdm/tqdm/gui.py +0 -191
  726. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/LICENSE.txt +0 -0
  727. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/entry_points.txt +0 -0
  728. {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/top_level.txt +0 -0
nuitka/Options.py CHANGED
@@ -1,20 +1,6 @@
1
- # Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com
2
- #
3
- # Part of "Nuitka", an optimizing Python compiler that is compatible and
4
- # integrates with CPython, but also works on its own.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
1
+ # Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
3
+
18
4
  """ Options module
19
5
 
20
6
  This exposes the choices made by the user. Defaults will be applied here, and
@@ -34,13 +20,25 @@ import sys
34
20
 
35
21
  from nuitka import Progress, Tracing
36
22
  from nuitka.containers.OrderedDicts import OrderedDict
37
- from nuitka.containers.OrderedSets import OrderedSet
38
- from nuitka.OptionParsing import parseOptions
23
+ from nuitka.containers.OrderedSets import (
24
+ OrderedSet,
25
+ recommended_orderedset_package_name,
26
+ )
27
+ from nuitka.importing.StandardLibrary import isStandardLibraryPath
28
+ from nuitka.OptionParsing import (
29
+ parseOptions,
30
+ run_time_variable_names,
31
+ runSpecialCommandsFromOptions,
32
+ )
39
33
  from nuitka.PythonFlavors import (
40
34
  getPythonFlavorName,
41
35
  isAnacondaPython,
42
36
  isApplePython,
37
+ isArchPackagePython,
38
+ isCPythonOfficialPackage,
43
39
  isDebianPackagePython,
40
+ isHomebrewPython,
41
+ isManyLinuxPython,
44
42
  isMSYS2MingwPython,
45
43
  isNuitkaPython,
46
44
  isPyenvPython,
@@ -48,24 +46,31 @@ from nuitka.PythonFlavors import (
48
46
  isUninstalledPython,
49
47
  )
50
48
  from nuitka.PythonVersions import (
49
+ getLaunchingSystemPrefixPath,
51
50
  getNotYetSupportedPythonVersions,
52
51
  getSupportedPythonVersions,
53
52
  isDebugPython,
53
+ isPythonWithGil,
54
54
  python_version,
55
55
  python_version_str,
56
56
  )
57
57
  from nuitka.utils.Execution import getExecutablePath
58
58
  from nuitka.utils.FileOperations import (
59
+ getNormalizedPath,
60
+ isLegalPath,
59
61
  isPathExecutable,
60
62
  openTextFile,
61
63
  resolveShellPatternToFilenames,
62
64
  )
63
65
  from nuitka.utils.Images import checkIconUsage
66
+ from nuitka.utils.Importing import getInlineCopyFolder
64
67
  from nuitka.utils.StaticLibraries import getSystemStaticLibPythonPath
65
68
  from nuitka.utils.Utils import (
66
69
  getArchitecture,
67
70
  getCPUCoreCount,
71
+ getLaunchingNuitkaProcessEnvironmentValue,
68
72
  getLinuxDistribution,
73
+ getMacOSRelease,
69
74
  getOS,
70
75
  getWindowsRelease,
71
76
  hasOnefileSupportedOS,
@@ -88,75 +93,137 @@ is_nuitka_run = None
88
93
  is_debug = None
89
94
  is_non_debug = None
90
95
  is_full_compat = None
91
- is_report_missing = None
96
+ report_missing_code_helpers = None
97
+ report_missing_trust = None
92
98
  is_verbose = None
93
99
 
94
100
 
101
+ def _convertOldStylePathSpecQuotes(value):
102
+ quote = None
103
+
104
+ result = ""
105
+ for c in value:
106
+ if c == "%":
107
+ if quote is None:
108
+ quote = "{"
109
+ result += quote
110
+ elif quote == "{":
111
+ result += "}"
112
+ quote = None
113
+ else:
114
+ result += c
115
+
116
+ return result
117
+
118
+
95
119
  def checkPathSpec(value, arg_name, allow_disable):
96
120
  # There are never enough checks here, pylint: disable=too-many-branches
121
+ old = value
122
+ value = _convertOldStylePathSpecQuotes(value)
123
+ if old != value:
124
+ Tracing.options_logger.warning(
125
+ "Adapted '%s' option value from legacy quoting style to '%s' -> '%s'"
126
+ % (arg_name, old, value)
127
+ )
128
+
129
+ # This changes the '/' to '\' on Windows at least.
130
+ value = getNormalizedPath(value)
131
+
132
+ if "\n" in value or "\r" in value:
133
+ Tracing.options_logger.sysexit(
134
+ "Using a new line in value '%s=%r' value is not allowed."
135
+ % (arg_name, value)
136
+ )
97
137
 
98
- if "%NONE%" in value:
138
+ if "{NONE}" in value:
99
139
  if not allow_disable:
100
140
  Tracing.options_logger.sysexit(
101
- "Using value '%%NONE%%' in '%s=%s' value is not allowed."
141
+ "Using value '{NONE}' in '%s=%s' value is not allowed."
102
142
  % (arg_name, value)
103
143
  )
104
144
 
105
- if value != "%NONE%":
145
+ if value != "{NONE}":
106
146
  Tracing.options_logger.sysexit(
107
- "Using value '%%NONE%%' in '%s=%s' value does not allow anything else used too."
147
+ "Using value '{NONE}' in '%s=%s' value does not allow anything else used too."
108
148
  % (arg_name, value)
109
149
  )
110
150
 
111
- if "%NULL%" in value:
151
+ if "{NULL}" in value:
112
152
  if not allow_disable:
113
153
  Tracing.options_logger.sysexit(
114
- "Using value '%%NULL%%' in '%s=%s' value is not allowed."
154
+ "Using value '{NULL}' in '%s=%s' value is not allowed."
115
155
  % (arg_name, value)
116
156
  )
117
157
 
118
- if value != "%NULL%":
158
+ if value != "{NULL}":
119
159
  Tracing.options_logger.sysexit(
120
- "Using value '%%NULL%%' in '%s=%s' value does not allow anything else used too."
160
+ "Using value '{NULL}' in '%s=%s' value does not allow anything else used too."
121
161
  % (arg_name, value)
122
162
  )
123
163
 
124
- if "%COMPANY%" in value and not getCompanyName():
164
+ if "{COMPANY}" in value and not getCompanyName():
125
165
  Tracing.options_logger.sysexit(
126
- "Using value '%%COMPANY%%' in '%s=%s' value without being specified."
166
+ "Using value '{COMPANY}' in '%s=%s' value without being specified."
127
167
  % (arg_name, value)
128
168
  )
129
169
 
130
- if "%PRODUCT%" in value and not getProductName():
170
+ if "{PRODUCT}" in value and not getProductName():
131
171
  Tracing.options_logger.sysexit(
132
- "Using value '%%PRODUCT%%' in '%s=%s' value without being specified."
172
+ "Using value '{PRODUCT}' in '%s=%s' value without being specified."
133
173
  % (arg_name, value)
134
174
  )
135
175
 
136
- if "%VERSION%" in value and not (getFileVersion() or getProductVersion()):
176
+ if "{VERSION}" in value and not (getFileVersionTuple() or getProductVersionTuple()):
137
177
  Tracing.options_logger.sysexit(
138
- "Using value '%%VERSION%%' in '%s=%s' value without being specified."
178
+ "Using value '{VERSION}' in '%s=%s' value without being specified."
139
179
  % (arg_name, value)
140
180
  )
141
181
 
142
- if value.count("%") % 2 != 0:
143
- Tracing.options_logger.warning(
144
- """Unmatched '%%' is suspicious for '%s=%s' and may \
145
- not do what you want it to do."""
182
+ if value.count("{") != value.count("}"):
183
+ Tracing.options_logger.sysexit(
184
+ """Unmatched '{}' is wrong for '%s=%s' and may \
185
+ definitely not do what you want it to do."""
146
186
  % (arg_name, value)
147
187
  )
148
188
 
189
+ # Catch nested or illegal variable names.
190
+ var_name = None
191
+ for c in value:
192
+ if c in "{":
193
+ if var_name is not None:
194
+ Tracing.options_logger.sysexit(
195
+ """Nested '{' is wrong for '%s=%s'.""" % (arg_name, value)
196
+ )
197
+ var_name = ""
198
+ elif c == "}":
199
+ if var_name is None:
200
+ Tracing.options_logger.sysexit(
201
+ """Stray '}' is wrong for '%s=%s'.""" % (arg_name, value)
202
+ )
203
+
204
+ if var_name not in run_time_variable_names:
205
+ Tracing.onefile_logger.sysexit(
206
+ "Found unknown variable name '%s' in for '%s=%s'."
207
+ "" % (var_name, arg_name, value)
208
+ )
209
+
210
+ var_name = None
211
+ else:
212
+ if var_name is not None:
213
+ var_name += c
214
+
149
215
  for candidate in (
150
- "%PROGRAM%",
151
- "%PROGRAM_BASE%",
152
- "%CACHE_DIR%",
153
- "%HOME%",
154
- "%TEMP%",
216
+ "{PROGRAM}",
217
+ "{PROGRAM_BASE}",
218
+ "{CACHE_DIR}",
219
+ "{HOME}",
220
+ "{TEMP}",
155
221
  ):
156
222
  if candidate in value[1:]:
157
223
  Tracing.options_logger.sysexit(
158
- """Absolute run time path of '%s' can only be at the \
159
- start of '%s=%s', using it in the middle is not allowed."""
224
+ """\
225
+ Absolute run time paths of '%s' can only be at the start of \
226
+ '%s=%s', using it in the middle of it is not allowed."""
160
227
  % (candidate, arg_name, value)
161
228
  )
162
229
 
@@ -167,9 +234,27 @@ start of '%s=%s', using that alone is not allowed."""
167
234
  % (candidate, arg_name, value)
168
235
  )
169
236
 
237
+ if value.startswith(candidate):
238
+ if value[len(candidate)] != os.path.sep:
239
+ Tracing.options_logger.sysexit(
240
+ """Cannot use general system folder %s, without a path \
241
+ separator '%s=%s', just appending to these is not allowed, needs to be \
242
+ below them."""
243
+ % (candidate, arg_name, value)
244
+ )
245
+
246
+ is_legal, reason = isLegalPath(value)
247
+ if not is_legal:
248
+ Tracing.options_logger.sysexit(
249
+ """Cannot use illegal paths '%s=%s', due to %s."""
250
+ % (arg_name, value, reason)
251
+ )
252
+
253
+ return value
254
+
170
255
 
171
256
  def _checkOnefileTargetSpec():
172
- checkPathSpec(
257
+ options.onefile_tempdir_spec = checkPathSpec(
173
258
  options.onefile_tempdir_spec,
174
259
  arg_name="--onefile-tempdir-spec",
175
260
  allow_disable=False,
@@ -183,7 +268,7 @@ you cannot unpack the onefile payload into the same directory as the binary,
183
268
  as that would overwrite it and cause locking issues as well."""
184
269
  )
185
270
 
186
- if options.onefile_tempdir_spec.count("%") == 0:
271
+ if options.onefile_tempdir_spec.count("{") == 0:
187
272
  Tracing.options_logger.warning(
188
273
  """Not using any variables for '--onefile-tempdir-spec' should only be \
189
274
  done if your program absolutely needs to be in the same path always: '%s'"""
@@ -192,16 +277,20 @@ done if your program absolutely needs to be in the same path always: '%s'"""
192
277
 
193
278
  if os.path.isabs(options.onefile_tempdir_spec):
194
279
  Tracing.options_logger.warning(
195
- """Using an absolute path should be avoided unless you are targeting a \
196
- very well known environment: anchor with e.g. %%TEMP%%, %%CACHE_DIR%% is recommended: '%s'"""
280
+ """\
281
+ Using an absolute path should be avoided unless you are targeting a \
282
+ very well known environment: anchoring it with e.g. '{TEMP}', \
283
+ '{CACHE_DIR}' is recommended: You seemingly gave the value '%s'"""
197
284
  % options.onefile_tempdir_spec
198
285
  )
199
286
  elif not options.onefile_tempdir_spec.startswith(
200
- ("%TEMP%", "%HOME%", "%CACHE_DIR%")
287
+ ("{TEMP}", "{HOME}", "{CACHE_DIR}")
201
288
  ):
202
289
  Tracing.options_logger.warning(
203
- """Using an relative to the executable should be avoided unless you are targeting a \
204
- very well known environment, anchor with e.g. %%TEMP%%, %%CACHE_DIR%% is recommended: '%s'"""
290
+ """\
291
+ Using a relative to the onefile executable should be avoided \
292
+ unless you are targeting a very well known environment, anchoring \
293
+ it with e.g. '{TEMP}', '{CACHE_DIR}' is recommended: '%s'"""
205
294
  % options.onefile_tempdir_spec
206
295
  )
207
296
 
@@ -213,6 +302,8 @@ def _getVersionInformationValues():
213
302
  yield "Commercial: %s" % getCommercialVersion()
214
303
  yield "Python: %s" % sys.version.split("\n", 1)[0]
215
304
  yield "Flavor: %s" % getPythonFlavorName()
305
+ if python_version >= 0x3D0:
306
+ yield "GIL: %s" % ("yes" if isPythonWithGil() else "no")
216
307
  yield "Executable: %s" % sys.executable
217
308
  yield "OS: %s" % getOS()
218
309
  yield "Arch: %s" % getArchitecture()
@@ -232,6 +323,9 @@ def _getVersionInformationValues():
232
323
  if isWin32OrPosixWindows():
233
324
  yield "WindowsRelease: %s" % getWindowsRelease()
234
325
 
326
+ if isMacOS():
327
+ yield "macOSRelease: %s" % getMacOSRelease()
328
+
235
329
 
236
330
  def printVersionInformation():
237
331
  print("\n".join(_getVersionInformationValues()))
@@ -252,6 +346,38 @@ def printVersionInformation():
252
346
  )
253
347
 
254
348
 
349
+ def _warnOnefileOnlyOption(option_name):
350
+ if not options.is_onefile:
351
+ Tracing.options_logger.warning(
352
+ """\
353
+ Using onefile specific option '%s' has no effect \
354
+ when '--onefile' is not specified."""
355
+ % option_name
356
+ )
357
+
358
+
359
+ def _checkDataDirOptionValue(data_dir, option_name):
360
+ if "=" not in data_dir:
361
+ Tracing.options_logger.sysexit(
362
+ "Error, malformed '%s' value '%s' description, must specify a relative target path with '=' separating it."
363
+ % (option_name, data_dir)
364
+ )
365
+
366
+ src, dst = data_dir.split("=", 1)
367
+
368
+ if os.path.isabs(dst):
369
+ Tracing.options_logger.sysexit(
370
+ "Error, malformed '%s' value, must specify relative target path for data dir, not '%s' as in '%s'."
371
+ % (option_name, dst, data_dir)
372
+ )
373
+
374
+ if not os.path.isdir(src):
375
+ Tracing.options_logger.sysexit(
376
+ "Error, malformed '%s' value, must specify existing source data directory, not '%s' as in '%s'."
377
+ % (option_name, dst, data_dir)
378
+ )
379
+
380
+
255
381
  def parseArgs():
256
382
  """Parse the command line arguments
257
383
 
@@ -260,7 +386,7 @@ def parseArgs():
260
386
  # singleton with many cases checking the options right away.
261
387
  # pylint: disable=global-statement,too-many-branches,too-many-locals,too-many-statements
262
388
  global is_nuitka_run, options, positional_args, extra_args, is_debug, is_non_debug
263
- global is_full_compat, is_report_missing, is_verbose
389
+ global is_full_compat, report_missing_code_helpers, report_missing_trust, is_verbose
264
390
 
265
391
  if os.name == "nt":
266
392
  # Windows store Python's don't allow looking at the python, catch that.
@@ -271,7 +397,7 @@ def parseArgs():
271
397
  Tracing.general.sysexit(
272
398
  """\
273
399
  Error, the Python from Windows app store is not supported.""",
274
- mnemonic="unsupported-python",
400
+ mnemonic="unsupported-windows-app-store-python",
275
401
  )
276
402
 
277
403
  is_nuitka_run, options, positional_args, extra_args = parseOptions(
@@ -293,10 +419,10 @@ Error, the Python from Windows app store is not supported.""",
293
419
  if getattr(options, "disable_dll_dependency_cache", False):
294
420
  options.disabled_caches.append("dll-dependencies")
295
421
 
296
- # TODO: Have dedicated option for it.
297
- is_report_missing = is_debug
422
+ report_missing_code_helpers = options.report_missing_code_helpers
423
+ report_missing_trust = options.report_missing_trust
298
424
 
299
- if options.quiet or int(os.environ.get("NUITKA_QUIET", "0")):
425
+ if options.quiet or int(os.getenv("NUITKA_QUIET", "0")):
300
426
  Tracing.setQuiet()
301
427
 
302
428
  def _quoteArg(arg):
@@ -310,17 +436,26 @@ Error, the Python from Windows app store is not supported.""",
310
436
  else:
311
437
  return arg
312
438
 
439
+ # This will not return if a non-compiling command is given.
440
+ runSpecialCommandsFromOptions(options)
441
+
313
442
  if not options.version:
314
443
  Tracing.options_logger.info(
315
444
  "Used command line options: %s"
316
445
  % " ".join(_quoteArg(arg) for arg in sys.argv[1:])
317
446
  )
318
447
 
319
- if os.environ.get("NUITKA_REEXECUTION") and not isAllowedToReexecute():
448
+ if (
449
+ getLaunchingNuitkaProcessEnvironmentValue("NUITKA_RE_EXECUTION")
450
+ and not isAllowedToReexecute()
451
+ ):
320
452
  Tracing.general.sysexit(
321
453
  "Error, not allowed to re-execute, but that has happened."
322
454
  )
323
455
 
456
+ # Force to persist this one early.
457
+ getLaunchingSystemPrefixPath()
458
+
324
459
  if options.progress_bar:
325
460
  Progress.enableProgressBar()
326
461
 
@@ -358,11 +493,52 @@ Error, the Python from Windows app store is not supported.""",
358
493
 
359
494
  Tracing.progress_logger.is_quiet = not options.show_progress
360
495
 
496
+ if options.compilation_mode is not None:
497
+ if options.is_onefile or options.is_standalone or options.module_mode:
498
+ Tracing.options_logger.sysexit(
499
+ "Cannot use both '--mode=' and deprecated options that specify mode."
500
+ )
501
+
502
+ if options.compilation_mode == "onefile":
503
+ options.is_onefile = True
504
+ elif options.compilation_mode == "standalone":
505
+ options.is_standalone = True
506
+ elif options.compilation_mode == "module":
507
+ options.module_mode = True
508
+
361
509
  # Onefile implies standalone build.
362
510
  if options.is_onefile:
363
511
  options.is_standalone = True
364
512
 
365
- # Standalone implies no_site build
513
+ # macOS bundle implies standalone build.
514
+ if shallCreateAppBundle():
515
+ options.is_standalone = True
516
+
517
+ if isMacOS():
518
+ macos_target_arch = getMacOSTargetArch()
519
+
520
+ if macos_target_arch == "universal":
521
+ Tracing.options_logger.sysexit(
522
+ "Cannot create universal macOS binaries (yet), please pick an arch and create two binaries."
523
+ )
524
+
525
+ if (options.macos_target_arch or "native") != "native":
526
+ from nuitka.utils.SharedLibraries import (
527
+ hasUniversalOrMatchingMacOSArchitecture,
528
+ )
529
+
530
+ if not hasUniversalOrMatchingMacOSArchitecture(
531
+ os.path.realpath(sys.executable)
532
+ ):
533
+ Tracing.options_logger.sysexit(
534
+ """\
535
+ Cannot cross compile to other arch, using non-universal Python binaries \
536
+ for macOS. Please install the "universal" Python package as offered on \
537
+ the Python download page."""
538
+ )
539
+
540
+ # Standalone implies no_site build unless overridden, therefore put it
541
+ # at start of flags, so "site" can override it.
366
542
  if options.is_standalone:
367
543
  options.python_flags.insert(0, "no_site")
368
544
 
@@ -370,12 +546,7 @@ Error, the Python from Windows app store is not supported.""",
370
546
  if options.onefile_tempdir_spec:
371
547
  _checkOnefileTargetSpec()
372
548
 
373
- if not options.is_onefile:
374
- Tracing.options_logger.warning(
375
- """\
376
- Using onefile specific option '--onefile-windows-splash-screen-image' has no effect \
377
- when '--onefile' is not specified."""
378
- )
549
+ _warnOnefileOnlyOption("--onefile-tempdir-spec")
379
550
 
380
551
  # Check onefile splash image
381
552
  if options.splash_screen_image:
@@ -385,34 +556,27 @@ when '--onefile' is not specified."""
385
556
  % options.splash_screen_image
386
557
  )
387
558
 
388
- if not options.is_onefile:
389
- Tracing.options_logger.warning(
390
- """\
391
- Using onefile specific option '--onefile-windows-splash-screen-image' has no effect \
392
- when '--onefile' is not specified."""
393
- )
559
+ _warnOnefileOnlyOption("--onefile-windows-splash-screen-image")
394
560
 
395
561
  if options.onefile_child_grace_time is not None:
396
562
  if not options.onefile_child_grace_time.isdigit():
397
563
  Tracing.options_logger.sysexit(
398
564
  """\
399
- Error, value given for '--onefile-child-grace-time' must be integer."""
565
+ Error, the value given for '--onefile-child-grace-time' must be integer."""
400
566
  )
401
567
 
402
- if not options.is_onefile:
403
- Tracing.options_logger.warning(
404
- """\
405
- Using onefile specific option '--onefile-windows-splash-screen-image' has no effect \
406
- when '--onefile-child-grace-time' is not specified."""
407
- )
568
+ _warnOnefileOnlyOption("--onefile-child-grace-time")
569
+
570
+ if getShallIncludeExternallyDataFilePatterns():
571
+ _warnOnefileOnlyOption("--include-onefile-external-data")
408
572
 
409
573
  if options.force_stdout_spec:
410
- checkPathSpec(
574
+ options.force_stdout_spec = checkPathSpec(
411
575
  options.force_stdout_spec, "--force-stdout-spec", allow_disable=True
412
576
  )
413
577
 
414
578
  if options.force_stderr_spec:
415
- checkPathSpec(
579
+ options.force_stderr_spec = checkPathSpec(
416
580
  options.force_stderr_spec, "--force-stderr-spec", allow_disable=True
417
581
  )
418
582
 
@@ -504,18 +668,18 @@ it before using it: '%s' (from --output-filename='%s')."""
504
668
  )
505
669
 
506
670
  if isLinux():
507
- if len(getIconPaths()) > 1:
671
+ if len(getLinuxIconPaths()) > 1:
508
672
  Tracing.options_logger.sysexit(
509
673
  "Error, can only use one icon file on Linux."
510
674
  )
511
675
 
512
676
  if isMacOS():
513
- if len(getIconPaths()) > 1:
677
+ if len(getMacOSIconPaths()) > 1:
514
678
  Tracing.options_logger.sysexit(
515
679
  "Error, can only use one icon file on macOS."
516
680
  )
517
681
 
518
- for icon_path in getIconPaths():
682
+ for icon_path in getWindowsIconPaths():
519
683
  if "#" in icon_path and isWin32Windows():
520
684
  icon_path, icon_index = icon_path.rsplit("#", 1)
521
685
 
@@ -525,13 +689,6 @@ it before using it: '%s' (from --output-filename='%s')."""
525
689
  % (icon_path + "#" + icon_index)
526
690
  )
527
691
 
528
- if not os.path.exists(icon_path):
529
- Tracing.options_logger.sysexit(
530
- "Error, icon path '%s' does not exist." % icon_path
531
- )
532
-
533
- checkIconUsage(logger=Tracing.options_logger, icon_path=icon_path)
534
-
535
692
  if getWindowsIconExecutablePath():
536
693
  Tracing.options_logger.sysexit(
537
694
  "Error, can only use icons from template executable or from icon files, but not both."
@@ -543,13 +700,8 @@ it before using it: '%s' (from --output-filename='%s')."""
543
700
  "Error, icon path executable '%s' does not exist." % icon_exe_path
544
701
  )
545
702
 
546
- if isMacOS() and not shallCreateAppBundle() and shallDisableConsoleWindow():
547
- Tracing.options_logger.sysexit(
548
- "Error, cannot disable console unless also using '--macos-create-app-bundle'."
549
- )
550
-
551
703
  try:
552
- file_version = getFileVersion()
704
+ file_version = getFileVersionTuple()
553
705
  # Catch all the things, don't want any interface, pylint: disable=broad-except
554
706
  except Exception:
555
707
  Tracing.options_logger.sysexit(
@@ -557,7 +709,7 @@ it before using it: '%s' (from --output-filename='%s')."""
557
709
  )
558
710
 
559
711
  try:
560
- product_version = getProductVersion()
712
+ product_version = getProductVersionTuple()
561
713
  # Catch all the things, don't want any interface, pylint: disable=broad-except
562
714
  except Exception:
563
715
  Tracing.options_logger.sysexit(
@@ -639,18 +791,20 @@ it before using it: '%s' (from --output-filename='%s')."""
639
791
 
640
792
  if data_file_desc.count("=") == 1:
641
793
  src, dst = data_file_desc.split("=", 1)
642
-
643
- filenames = resolveShellPatternToFilenames(src)
644
-
645
- if len(filenames) > 1 and not dst.endswith(("/", os.path.sep)):
646
- Tracing.options_logger.sysexit(
647
- "Error, pattern '%s' matches more than one file, but target has no trailing slash, not a directory."
648
- % src
649
- )
794
+ src = os.path.expanduser(src)
795
+ src_pattern = src
650
796
  else:
651
797
  src, dst, pattern = data_file_desc.split("=", 2)
798
+ src = os.path.expanduser(src)
799
+ src_pattern = os.path.join(src, pattern)
652
800
 
653
- filenames = resolveShellPatternToFilenames(os.path.join(src, pattern))
801
+ filenames = resolveShellPatternToFilenames(src_pattern)
802
+
803
+ if len(filenames) > 1 and not dst.endswith(("/", os.path.sep)):
804
+ Tracing.options_logger.sysexit(
805
+ "Error, pattern '%s' matches more than one file, but target has no trailing slash, not a directory."
806
+ % src
807
+ )
654
808
 
655
809
  if not filenames:
656
810
  Tracing.options_logger.sysexit(
@@ -664,29 +818,31 @@ it before using it: '%s' (from --output-filename='%s')."""
664
818
  )
665
819
 
666
820
  for data_dir in options.data_dirs:
667
- if "=" not in data_dir:
668
- Tracing.options_logger.sysexit(
669
- "Error, malformed data dir description, must specify relative target path with '=' separating it."
670
- )
821
+ _checkDataDirOptionValue(data_dir=data_dir, option_name="--include-data-dir")
671
822
 
672
- src, dst = data_dir.split("=", 1)
823
+ for data_dir in options.raw_dirs:
824
+ _checkDataDirOptionValue(data_dir=data_dir, option_name="--include-raw-dir")
673
825
 
674
- if os.path.isabs(dst):
826
+ for pattern in getShallFollowExtraFilePatterns():
827
+ if os.path.isdir(pattern):
675
828
  Tracing.options_logger.sysexit(
676
- "Error, must specify relative target path for data dir, not '%s' as in '%s'."
677
- % (dst, data_dir)
829
+ "Error, pattern '%s' given to '--include-plugin-files' cannot be a directory name."
830
+ % pattern
678
831
  )
679
832
 
680
- if not os.path.isdir(src):
833
+ for directory_name in getShallFollowExtra():
834
+ if not os.path.isdir(directory_name):
681
835
  Tracing.options_logger.sysexit(
682
- "Error, must specify existing source data directory, not '%s' as in '%s'."
683
- % (dst, data_dir)
836
+ "Error, value '%s' given to '--include-plugin-directory' must be a directory name."
837
+ % directory_name
684
838
  )
685
839
 
686
- for pattern in getShallFollowExtraFilePatterns():
687
- if os.path.isdir(pattern):
840
+ if isStandardLibraryPath(directory_name):
688
841
  Tracing.options_logger.sysexit(
689
- "Error, pattern '%s' given to '--include-plugin-files' cannot be a directory name."
842
+ """\
843
+ Error, directory '%s' given to '--include-plugin-directory' must not be a \
844
+ standard library path. Use '--include-module' or '--include-package' \
845
+ options instead."""
690
846
  % pattern
691
847
  )
692
848
 
@@ -717,11 +873,14 @@ download. With that, your program will work on macOS 10.9 or higher."""
717
873
  "Error, Apple Python 2.7 from macOS is not usable as per Apple decision, use e.g. CPython 2.7 instead."
718
874
  )
719
875
 
720
- if isStandaloneMode() and isLinux() and getExecutablePath("patchelf") is None:
721
- Tracing.options_logger.sysexit(
722
- "Error, standalone mode on Linux requires 'patchelf' to be installed. Use 'apt/dnf/yum install patchelf' first."
876
+ if isStandaloneMode() and isLinux():
877
+ # Cyclic dependency
878
+ from nuitka.utils.SharedLibraries import (
879
+ checkPatchElfPresenceAndUsability,
723
880
  )
724
881
 
882
+ checkPatchElfPresenceAndUsability(Tracing.options_logger)
883
+
725
884
  pgo_executable = getPgoExecutable()
726
885
  if pgo_executable and not isPathExecutable(pgo_executable):
727
886
  Tracing.options_logger.sysexit(
@@ -740,6 +899,14 @@ Error, onefile mode on Termux requires 'termux-elf-cleaner' to be installed, \
740
899
  use 'pkg install termux-elf-cleaner' to use it."""
741
900
  )
742
901
 
902
+ for user_yaml_filename in getUserProvidedYamlFiles():
903
+ if not os.path.exists(user_yaml_filename):
904
+ Tracing.options_logger.sysexit(
905
+ """\
906
+ Error, cannot find user provider yaml file '%s'."""
907
+ % user_yaml_filename
908
+ )
909
+
743
910
  # This triggers checks inside that code
744
911
  getCompilationReportUserData()
745
912
 
@@ -752,6 +919,20 @@ def commentArgs():
752
919
  """
753
920
  # A ton of cases to consider, pylint: disable=too-many-branches,too-many-statements
754
921
 
922
+ # Check files to exist or be suitable first before giving other warnings.
923
+ for filename in getMainEntryPointFilenames():
924
+ if not os.path.exists(filename):
925
+ Tracing.general.sysexit("Error, file '%s' is not found." % filename)
926
+
927
+ if (
928
+ shallMakeModule()
929
+ and os.path.normcase(os.path.basename(filename)) == "__init__.py"
930
+ ):
931
+ Tracing.general.sysexit(
932
+ """\
933
+ Error, to compile a package, specify its directory but, not the '__init__.py'."""
934
+ )
935
+
755
936
  # Inform the user about potential issues with the running version. e.g. unsupported
756
937
  # version.
757
938
  if python_version_str not in getSupportedPythonVersions():
@@ -770,8 +951,28 @@ version '%s' instead or newer Nuitka."""
770
951
  )
771
952
  )
772
953
 
954
+ # spell-checker: ignore releaselevel
955
+ if sys.version_info.releaselevel not in ("final", "candidate"):
956
+ if python_version_str not in getNotYetSupportedPythonVersions():
957
+ Tracing.general.sysexit(
958
+ """\
959
+ Non-final versions '%s' '%s' are not supported by Nuitka, use the \
960
+ final version instead."""
961
+ % (python_version_str, sys.version_info.releaselevel)
962
+ )
963
+
773
964
  if python_version_str in getNotYetSupportedPythonVersions():
774
- if not isExperimental("python" + python_version_str):
965
+ if sys.version_info.releaselevel != "final" and not isExperimental(
966
+ "python" + python_version_str
967
+ ):
968
+ Tracing.general.warning(
969
+ """\
970
+ The Python version '%s' '%s' is only experimentally supported by \
971
+ and recommended only for use in Nuitka development and testing."""
972
+ % (python_version_str, sys.version_info.releaselevel)
973
+ )
974
+
975
+ elif not isExperimental("python" + python_version_str):
775
976
  Tracing.general.sysexit(
776
977
  """\
777
978
  The Python version '%s' is not supported by Nuitka '%s', but an upcoming \
@@ -783,6 +984,13 @@ release will add it. In the mean time use '%s' instead."""
783
984
  )
784
985
  )
785
986
 
987
+ if not isPythonWithGil():
988
+ Tracing.general.warning(
989
+ """\
990
+ The Python without GIL is only experimentally supported by \
991
+ and recommended only for use in Nuitka development and testing."""
992
+ )
993
+
786
994
  default_reference_mode = (
787
995
  "runtime" if shallMakeModule() or isStandaloneMode() else "original"
788
996
  )
@@ -848,6 +1056,14 @@ release will add it. In the mean time use '%s' instead."""
848
1056
  % getMsvcVersion()
849
1057
  )
850
1058
 
1059
+ try:
1060
+ getJobLimit()
1061
+ except ValueError:
1062
+ Tracing.options_logger.sysexit(
1063
+ "For '--jobs' value, use integer values only, not, but not '%s'."
1064
+ % options.jobs
1065
+ )
1066
+
851
1067
  if isOnefileMode():
852
1068
  standalone_mode = "onefile"
853
1069
  elif isStandaloneMode():
@@ -893,7 +1109,8 @@ to work. You need to instead selectively add them with \
893
1109
  )
894
1110
 
895
1111
  if (
896
- not standalone_mode
1112
+ not shallCreatePythonPgoInput()
1113
+ and not standalone_mode
897
1114
  and options.follow_all is None
898
1115
  and not options.follow_modules
899
1116
  and not options.follow_stdlib
@@ -921,7 +1138,7 @@ make sure that is intended."""
921
1138
  options.static_libpython = "no"
922
1139
 
923
1140
  if (
924
- not isPgoMode()
1141
+ not isCPgoMode()
925
1142
  and not isPythonPgoMode()
926
1143
  and (getPgoArgs() or getPgoExecutable())
927
1144
  ):
@@ -929,15 +1146,19 @@ make sure that is intended."""
929
1146
  "Providing PGO arguments without enabling PGO mode has no effect."
930
1147
  )
931
1148
 
932
- if isPgoMode():
1149
+ if isCPgoMode():
933
1150
  if isStandaloneMode():
934
1151
  Tracing.optimization_logger.warning(
935
- "Using PGO with standalone/onefile mode is not currently working. Expect errors."
1152
+ """\
1153
+ Using C level PGO with standalone/onefile mode is not \
1154
+ currently working. Expect errors."""
936
1155
  )
937
1156
 
938
1157
  if shallMakeModule():
939
1158
  Tracing.optimization_logger.warning(
940
- "Using PGO with module mode is not currently working. Expect errors."
1159
+ """\
1160
+ Using C level PGO with module mode is not currently \
1161
+ working. Expect errors."""
941
1162
  )
942
1163
 
943
1164
  if (
@@ -945,6 +1166,7 @@ make sure that is intended."""
945
1166
  and not shallMakeModule()
946
1167
  and not shallUseStaticLibPython()
947
1168
  and getSystemStaticLibPythonPath() is not None
1169
+ and not shallUsePythonDebug()
948
1170
  ):
949
1171
  Tracing.options_logger.info(
950
1172
  """Detected static libpython to exist, consider '--static-libpython=yes' for better performance, \
@@ -957,11 +1179,6 @@ but errors may happen."""
957
1179
  "The '--debugger' option has no effect outside of '--debug' without '--run' option."
958
1180
  )
959
1181
 
960
- if not shallClearPythonPathEnvironment():
961
- Tracing.options_logger.warning(
962
- "The '--execute-with-pythonpath' option has no effect without '--run' option."
963
- )
964
-
965
1182
  # Check if the fallback is used, except for Python2 on Windows, where we cannot
966
1183
  # have it.
967
1184
  if hasattr(OrderedSet, "is_fallback") and not (
@@ -972,7 +1189,7 @@ but errors may happen."""
972
1189
  """\
973
1190
  Using very slow fallback for ordered sets, please install '%s' \
974
1191
  PyPI package for best Python compile time performance."""
975
- % ("ordered-set" if python_version >= 0x370 else "orderedset")
1192
+ % recommended_orderedset_package_name
976
1193
  )
977
1194
 
978
1195
  if shallUsePythonDebug() and not isDebugPython():
@@ -983,15 +1200,10 @@ and not with the non-debug version.
983
1200
  """
984
1201
  )
985
1202
 
986
- if (
987
- isMacOS()
988
- and shallCreateAppBundle()
989
- and shallDisableConsoleWindow()
990
- and not getIconPaths()
991
- ):
1203
+ if isMacOS() and shallCreateAppBundle() and not getMacOSIconPaths():
992
1204
  Tracing.general.warning(
993
1205
  """\
994
- For GUI applications, you ought to specify an icon with '--macos-app-icon'.", \
1206
+ For application bundles, you ought to specify an icon with '--macos-app-icon'.", \
995
1207
  otherwise a dock icon may not be present."""
996
1208
  )
997
1209
 
@@ -1007,23 +1219,10 @@ notarization capable signature, the default identify 'ad-hoc' is not going \
1007
1219
  to work."""
1008
1220
  )
1009
1221
 
1010
- for filename in getMainEntryPointFilenames():
1011
- if not os.path.exists(filename):
1012
- Tracing.general.sysexit("Error, file '%s' is not found." % filename)
1013
-
1014
- if (
1015
- shallMakeModule()
1016
- and os.path.normcase(os.path.basename(filename)) == "__init__.py"
1017
- ):
1018
- Tracing.general.sysexit(
1019
- """\
1020
- Error, to compile a package, specify its directory but, not the '__init__.py'."""
1021
- )
1022
-
1023
1222
  if (
1024
1223
  isWin32Windows()
1025
1224
  and 0x340 <= python_version < 0x380
1026
- and not shallDisableConsoleWindow()
1225
+ and getWindowsConsoleMode() != "disable"
1027
1226
  ):
1028
1227
  Tracing.general.warning(
1029
1228
  """\
@@ -1036,6 +1235,49 @@ console window for deployment.
1036
1235
  mnemonic="old-python-windows-console",
1037
1236
  )
1038
1237
 
1238
+ if shallMakeModule() and (getForcedStderrPath() or getForcedStdoutPath()):
1239
+ Tracing.general.warning(
1240
+ """\
1241
+ Extension modules do not control process outputs, therefore the \
1242
+ options '--force-stdout-spec' and '--force-stderr-spec' have no \
1243
+ impact and should not be specified."""
1244
+ )
1245
+
1246
+ if shallMakeModule() and options.console_mode is not None:
1247
+ Tracing.general.warning(
1248
+ """\
1249
+ Extension modules are not binaries, and therefore the option \
1250
+ '--windows-console-mode' does not have an impact and should \
1251
+ not be specified."""
1252
+ )
1253
+
1254
+ if options.disable_console in (True, False):
1255
+ if isWin32Windows():
1256
+ Tracing.general.warning(
1257
+ """\
1258
+ The old console option '%s' should not be given anymore, use '%s' \
1259
+ instead. It also has the extra mode 'attach' to consider."""
1260
+ % (
1261
+ (
1262
+ "--disable-console"
1263
+ if options.disable_console
1264
+ else "--enable-console"
1265
+ ),
1266
+ "--windows-console-mode=%s"
1267
+ % ("disable" if options.disable_console else "force"),
1268
+ )
1269
+ )
1270
+ else:
1271
+ Tracing.general.warning(
1272
+ """The old console option '%s' should not be given anymore, and doesn't
1273
+ have any effect anymore on non-Windows."""
1274
+ % (
1275
+ "--disable-console"
1276
+ if options.disable_console
1277
+ else "--enable-console"
1278
+ )
1279
+ )
1280
+
1039
1281
 
1040
1282
  def isVerbose():
1041
1283
  """:returns: bool derived from ``--verbose``"""
@@ -1049,7 +1291,7 @@ def shallTraceExecution():
1049
1291
 
1050
1292
  def shallExecuteImmediately():
1051
1293
  """:returns: bool derived from ``--run``"""
1052
- return options.immediate_execution
1294
+ return options is not None and options.immediate_execution
1053
1295
 
1054
1296
 
1055
1297
  def shallRunInDebugger():
@@ -1095,7 +1337,7 @@ def getModuleNameMode():
1095
1337
 
1096
1338
  def shallMakeModule():
1097
1339
  """:returns: bool derived from ``--module``"""
1098
- return options.module_mode
1340
+ return options is not None and options.module_mode
1099
1341
 
1100
1342
 
1101
1343
  def shallCreatePyiFile():
@@ -1103,6 +1345,11 @@ def shallCreatePyiFile():
1103
1345
  return options.pyi_file
1104
1346
 
1105
1347
 
1348
+ def shallCreatePyiFileContainStubs():
1349
+ """*bool* = **not** ``--no-pyi-stubs``"""
1350
+ return options.pyi_stubs
1351
+
1352
+
1106
1353
  def isAllowedToReexecute():
1107
1354
  """*bool* = **not** ``--must-not-re-execute``"""
1108
1355
  return options.allow_reexecute
@@ -1120,6 +1367,9 @@ def shallFollowNoImports():
1120
1367
 
1121
1368
  def shallFollowAllImports():
1122
1369
  """:returns: bool derived from ``--follow-imports``"""
1370
+ if shallCreatePythonPgoInput() and options.is_standalone:
1371
+ return True
1372
+
1123
1373
  return options.is_standalone or options.follow_all is True
1124
1374
 
1125
1375
 
@@ -1133,7 +1383,7 @@ def getShallFollowInNoCase():
1133
1383
 
1134
1384
 
1135
1385
  def getShallFollowModules():
1136
- """*list*, items of ``--follow-import-to=``"""
1386
+ """*list*, items of ``--follow-import-to=`` amended with what ``--include-module`` and ``--include-package`` got"""
1137
1387
  return sum(
1138
1388
  [
1139
1389
  _splitShellPattern(x)
@@ -1198,11 +1448,15 @@ def getShallIncludeDataFiles():
1198
1448
  src, dest = data_file_desc.split("=", 1)
1199
1449
 
1200
1450
  for pattern in _splitShellPattern(src):
1451
+ pattern = os.path.expanduser(pattern)
1452
+
1201
1453
  yield pattern, None, dest, data_file_desc
1202
1454
  else:
1203
1455
  src, dest, pattern = data_file_desc.split("=", 2)
1204
1456
 
1205
1457
  for pattern in _splitShellPattern(pattern):
1458
+ pattern = os.path.expanduser(pattern)
1459
+
1206
1460
  yield os.path.join(src, pattern), src, dest, data_file_desc
1207
1461
 
1208
1462
 
@@ -1214,12 +1468,26 @@ def getShallIncludeDataDirs():
1214
1468
  yield src, dest
1215
1469
 
1216
1470
 
1471
+ def getShallIncludeRawDirs():
1472
+ """*list*, items of ``--include-raw-dir=``"""
1473
+ for data_file in options.raw_dirs:
1474
+ src, dest = data_file.split("=", 1)
1475
+
1476
+ yield src, dest
1477
+
1478
+
1217
1479
  def getShallNotIncludeDataFilePatterns():
1218
1480
  """*list*, items of ``--noinclude-data-files=``"""
1219
1481
 
1220
1482
  return options.data_files_inhibited
1221
1483
 
1222
1484
 
1485
+ def getShallIncludeExternallyDataFilePatterns():
1486
+ """*list*, items of ``--include-onefile-external-data=``"""
1487
+
1488
+ return options.data_files_external
1489
+
1490
+
1223
1491
  def getShallNotIncludeDllFilePatterns():
1224
1492
  """*list*, items of ``--noinclude-dlls=``"""
1225
1493
 
@@ -1315,9 +1583,15 @@ def getMainEntryPointFilenames():
1315
1583
  if len(options.mains) == 1:
1316
1584
  assert not positional_args
1317
1585
 
1318
- return tuple(options.mains)
1586
+ result = tuple(options.mains)
1319
1587
  else:
1320
- return [positional_args[0]]
1588
+ result = (positional_args[0],)
1589
+
1590
+ return tuple(getNormalizedPath(r) for r in result)
1591
+
1592
+
1593
+ def isMultidistMode():
1594
+ return options is not None and options.mains and len(options.mains) > 1
1321
1595
 
1322
1596
 
1323
1597
  def shallOptimizeStringExec():
@@ -1325,16 +1599,11 @@ def shallOptimizeStringExec():
1325
1599
  return False
1326
1600
 
1327
1601
 
1328
- def shallClearPythonPathEnvironment():
1329
- """*bool* = **not** ``--execute-with-pythonpath``"""
1330
- return not options.keep_pythonpath
1331
-
1332
-
1333
1602
  _shall_use_static_lib_python = None
1334
1603
 
1335
1604
 
1336
1605
  def _shallUseStaticLibPython():
1337
- # return driven, pylint: disable=too-many-return-statements
1606
+ # many cases and return driven, pylint: disable=too-many-branches,too-many-return-statements
1338
1607
 
1339
1608
  if shallMakeModule():
1340
1609
  return False, "not used in module mode"
@@ -1342,7 +1611,10 @@ def _shallUseStaticLibPython():
1342
1611
  if options.static_libpython == "auto":
1343
1612
  # Nuitka-Python is good to to static linking.
1344
1613
  if isNuitkaPython():
1345
- return True, "Nuitka-Python is broken."
1614
+ return True, "Nuitka-Python is unexpectedly broken."
1615
+
1616
+ if isHomebrewPython():
1617
+ return True, "Homebrew Python is unexpectedly broken."
1346
1618
 
1347
1619
  # Debian packages with are usable if the OS is new enough
1348
1620
  from nuitka.utils.StaticLibraries import (
@@ -1355,6 +1627,14 @@ def _shallUseStaticLibPython():
1355
1627
  and isDebianSuitableForStaticLinking()
1356
1628
  and not shallUsePythonDebug()
1357
1629
  ):
1630
+ if python_version >= 0x3C0 and not os.path.exists(
1631
+ getInlineCopyFolder("python_hacl")
1632
+ ):
1633
+ return (
1634
+ False,
1635
+ "Nuitka on Debian-Python needs inline copy of hacl not included.",
1636
+ )
1637
+
1358
1638
  return True, "Nuitka on Debian-Python needs package '%s' installed." % (
1359
1639
  "python2-dev" if str is bytes else "python3-dev"
1360
1640
  )
@@ -1364,14 +1644,38 @@ def _shallUseStaticLibPython():
1364
1644
 
1365
1645
  # For Anaconda default to trying static lib python library, which
1366
1646
  # normally is just not available or if it is even unusable.
1367
- if isAnacondaPython() and not isMacOS() and not isWin32Windows():
1647
+ if isAnacondaPython():
1648
+ if isMacOS():
1649
+ # TODO: Maybe some linker options can make it happen.
1650
+ return (
1651
+ False,
1652
+ "Anaconda on macOS exports not all symbols when using it.",
1653
+ )
1654
+ elif not isWin32Windows():
1655
+ return (
1656
+ True,
1657
+ """\
1658
+ Nuitka on Anaconda needs package for static libpython installed. \
1659
+ Execute 'conda install libpython-static'.""",
1660
+ )
1661
+
1662
+ if isPyenvPython():
1663
+ return True, "Nuitka on pyenv should not use '--enable-shared'."
1664
+
1665
+ if isManyLinuxPython():
1368
1666
  return (
1369
1667
  True,
1370
- "Nuitka on Anaconda needs package for static libpython installed. Execute 'conda install libpython-static'.",
1668
+ """\
1669
+ Nuitka on 'manylinux' has no shared libraries. Use container with \
1670
+ the command 'RUN cd /opt/_internal && tar xf static-libs-for-embedding-only.tar.xz' \
1671
+ added to provide the static link library.""",
1371
1672
  )
1372
1673
 
1373
- if isPyenvPython():
1374
- return True, "Nuitka on pyenv should not use '--enable-shared'."
1674
+ if isMacOS() and isCPythonOfficialPackage():
1675
+ return True, None
1676
+
1677
+ if isArchPackagePython():
1678
+ return True, None
1375
1679
 
1376
1680
  return options.static_libpython == "yes", None
1377
1681
 
@@ -1438,17 +1742,25 @@ def isShowScons():
1438
1742
 
1439
1743
  def getJobLimit():
1440
1744
  """*int*, value of ``--jobs`` / "-j" or number of CPU kernels"""
1441
- if options.jobs is None:
1442
- if isLowMemory():
1443
- return 1
1444
- else:
1445
- return getCPUCoreCount()
1745
+ jobs = options.jobs
1746
+
1747
+ # Low memory has a default of 1.
1748
+ if jobs is None and isLowMemory():
1749
+ return 1
1446
1750
 
1447
- return int(options.jobs)
1751
+ if jobs is None:
1752
+ result = getCPUCoreCount()
1753
+ else:
1754
+ result = int(jobs)
1755
+
1756
+ if result <= 0:
1757
+ result = max(1, getCPUCoreCount() + result)
1758
+
1759
+ return result
1448
1760
 
1449
1761
 
1450
1762
  def getLtoMode():
1451
- """:returns: bool derived from ``--lto`` or ``--pgo``"""
1763
+ """:returns: bool derived from ``--lto``"""
1452
1764
  return options.lto
1453
1765
 
1454
1766
 
@@ -1507,16 +1819,18 @@ def shallDisableBytecodeCacheUsage():
1507
1819
  return shallDisableCacheUsage("bytecode")
1508
1820
 
1509
1821
 
1510
- def shallDisableConsoleWindow():
1511
- """:returns: None (not given), False, or True derived from ``--disable-console or ``--enable-console``"""
1512
- return options.disable_console
1513
-
1822
+ def shallDisableCompressionCacheUsage():
1823
+ """:returns: bool derived from ``--disable-cache=compression``"""
1824
+ return shallDisableCacheUsage("compression")
1514
1825
 
1515
- def mayDisableConsoleWindow():
1516
- """:returns: bool derived from platform support of disabling the console,"""
1517
1826
 
1518
- # TODO: What about MSYS2?
1519
- return isWin32Windows() or isMacOS()
1827
+ def getWindowsConsoleMode():
1828
+ """:returns: str from ``--windows-console-mode``"""
1829
+ if options.disable_console is True:
1830
+ return "disable"
1831
+ if options.disable_console is False:
1832
+ return "force"
1833
+ return options.console_mode or "force"
1520
1834
 
1521
1835
 
1522
1836
  def _isFullCompat():
@@ -1577,10 +1891,6 @@ def enableExperimental(indication):
1577
1891
  _experimental.add(indication)
1578
1892
 
1579
1893
 
1580
- def disableExperimental(indication):
1581
- _experimental.remove(indication)
1582
-
1583
-
1584
1894
  def getExperimentalIndications():
1585
1895
  """*tuple*, items of ``--experimental=``"""
1586
1896
  if hasattr(options, "experimental"):
@@ -1589,6 +1899,23 @@ def getExperimentalIndications():
1589
1899
  return ()
1590
1900
 
1591
1901
 
1902
+ def getDebugModeIndications():
1903
+ result = []
1904
+
1905
+ for debug_option_value_name in ("debug_immortal",):
1906
+ if debug_option_value_name == "debug_immortal" and python_version < 0x3C0:
1907
+ continue
1908
+
1909
+ if _isDebug():
1910
+ if getattr(options, debug_option_value_name) is not False:
1911
+ result.append(debug_option_value_name)
1912
+ else:
1913
+ if getattr(options, debug_option_value_name) is True:
1914
+ result.append(debug_option_value_name)
1915
+
1916
+ return result
1917
+
1918
+
1592
1919
  def shallExplainImports():
1593
1920
  """:returns: bool derived from ``--explain-imports``"""
1594
1921
  return options is not None and options.explain_imports
@@ -1596,12 +1923,18 @@ def shallExplainImports():
1596
1923
 
1597
1924
  def isStandaloneMode():
1598
1925
  """:returns: bool derived from ``--standalone``"""
1599
- return options.is_standalone
1926
+ if shallCreatePythonPgoInput():
1927
+ return False
1928
+
1929
+ return bool(options.is_standalone or options.list_package_dlls)
1600
1930
 
1601
1931
 
1602
1932
  def isOnefileMode():
1603
1933
  """:returns: bool derived from ``--onefile``"""
1604
- return options.is_onefile
1934
+ if shallCreatePythonPgoInput():
1935
+ return False
1936
+
1937
+ return bool(options.is_onefile)
1605
1938
 
1606
1939
 
1607
1940
  def isAcceleratedMode():
@@ -1616,13 +1949,16 @@ def isOnefileTempDirMode():
1616
1949
  Using cached onefile execution when the spec doesn't contain
1617
1950
  volatile things.
1618
1951
  """
1952
+ if shallCreatePythonPgoInput():
1953
+ return False
1954
+
1619
1955
  spec = getOnefileTempDirSpec()
1620
1956
 
1621
1957
  for candidate in (
1622
- "%PID",
1623
- "%TIME%",
1624
- "%PROGRAM%",
1625
- "%PROGRAM_BASE%",
1958
+ "{PID}",
1959
+ "{TIME}",
1960
+ "{PROGRAM}",
1961
+ "{PROGRAM_BASE}",
1626
1962
  ):
1627
1963
  if candidate in spec:
1628
1964
  return True
@@ -1630,8 +1966,11 @@ def isOnefileTempDirMode():
1630
1966
  return False
1631
1967
 
1632
1968
 
1633
- def isPgoMode():
1634
- """:returns: bool derived from ``--pgo``"""
1969
+ def isCPgoMode():
1970
+ """:returns: bool derived from ``--pgo-c``"""
1971
+ if shallCreatePythonPgoInput():
1972
+ return False
1973
+
1635
1974
  return options.is_c_pgo
1636
1975
 
1637
1976
 
@@ -1645,7 +1984,7 @@ def getPythonPgoInput():
1645
1984
  return options.python_pgo_input
1646
1985
 
1647
1986
 
1648
- def shallCreatePgoInput():
1987
+ def shallCreatePythonPgoInput():
1649
1988
  return isPythonPgoMode() and getPythonPgoInput() is None
1650
1989
 
1651
1990
 
@@ -1659,9 +1998,7 @@ def getPgoExecutable():
1659
1998
 
1660
1999
  if options.pgo_executable and os.path.exists(options.pgo_executable):
1661
2000
  if not os.path.isabs(options.pgo_executable):
1662
- options.pgo_executable = os.path.normcase(
1663
- os.path.join(".", options.pgo_executable)
1664
- )
2001
+ options.pgo_executable = os.path.join(".", options.pgo_executable)
1665
2002
 
1666
2003
  return options.pgo_executable
1667
2004
 
@@ -1674,11 +2011,10 @@ def getPythonPgoUnseenModulePolicy():
1674
2011
  def getOnefileTempDirSpec():
1675
2012
  """*str* = ``--onefile-tempdir-spec``"""
1676
2013
  result = (
1677
- options.onefile_tempdir_spec or "%TEMP%" + os.path.sep + "onefile_%PID%_%TIME%"
2014
+ options.onefile_tempdir_spec or "{TEMP}" + os.path.sep + "onefile_{PID}_{TIME}"
1678
2015
  )
1679
2016
 
1680
- # This changes the '/' to '\' on Windows at least.
1681
- return os.path.normpath(result)
2017
+ return result
1682
2018
 
1683
2019
 
1684
2020
  def getOnefileChildGraceTime():
@@ -1695,10 +2031,31 @@ def shallNotCompressOnefile():
1695
2031
  return options.onefile_no_compression
1696
2032
 
1697
2033
 
1698
- def getIconPaths():
1699
- """*list of str*, values of ``--windows-icon-from-ico`` and ``--linux-onefile-icon``"""
2034
+ def shallOnefileAsArchive():
2035
+ """*bool* = ``--onefile-as-archive``"""
2036
+ return options.onefile_as_archive
2037
+
2038
+
2039
+ def _checkIconPaths(icon_paths):
2040
+ for icon_path in icon_paths:
2041
+ if not os.path.exists(icon_path):
2042
+ Tracing.options_logger.sysexit(
2043
+ "Error, icon path '%s' does not exist." % icon_path
2044
+ )
2045
+
2046
+ checkIconUsage(logger=Tracing.options_logger, icon_path=icon_path)
1700
2047
 
1701
- result = options.icon_path
2048
+ return icon_paths
2049
+
2050
+
2051
+ def getWindowsIconPaths():
2052
+ """*list of str*, values of ``--windows-icon-from-ico``"""
2053
+ return _checkIconPaths(options.windows_icon_path)
2054
+
2055
+
2056
+ def getLinuxIconPaths():
2057
+ """*list of str*, values of ``--linux-icon``"""
2058
+ result = options.linux_icon_path
1702
2059
 
1703
2060
  # Check if Linux icon requirement is met.
1704
2061
  if isLinux() and not result and isOnefileMode():
@@ -1714,7 +2071,12 @@ def getIconPaths():
1714
2071
  result.append(icon)
1715
2072
  break
1716
2073
 
1717
- return result
2074
+ return _checkIconPaths(result)
2075
+
2076
+
2077
+ def getMacOSIconPaths():
2078
+ """*list of str*, values of ``--macos-app-icon``"""
2079
+ return _checkIconPaths(options.macos_icon_path)
1718
2080
 
1719
2081
 
1720
2082
  def getWindowsIconExecutablePath():
@@ -1732,6 +2094,28 @@ def shallAskForWindowsUIAccessRights():
1732
2094
  return options.windows_uac_uiaccess
1733
2095
 
1734
2096
 
2097
+ def getLegalCopyright():
2098
+ """*str* name of the product to use derived from ``--copyright``"""
2099
+ return options.legal_copyright
2100
+
2101
+
2102
+ def getLegalTrademarks():
2103
+ """*str* name of the product to use derived from ``--trademarks``"""
2104
+ return options.legal_trademarks
2105
+
2106
+
2107
+ def getLegalInformation():
2108
+ result = options.legal_copyright
2109
+
2110
+ if options.legal_trademarks:
2111
+ if result is not None:
2112
+ result += "\nTrademark information:" + options.legal_trademarks
2113
+ else:
2114
+ result = options.legal_trademarks
2115
+
2116
+ return result
2117
+
2118
+
1735
2119
  def isWindowsServiceMode():
1736
2120
  """*bool*, value of ``--windows-service``"""
1737
2121
  return options.windows_service
@@ -1800,27 +2184,47 @@ def _parseVersionNumber(value):
1800
2184
 
1801
2185
 
1802
2186
  def getProductVersion():
2187
+ """:returns: str, derived from ``--product-version``"""
2188
+ return options.product_version
2189
+
2190
+
2191
+ def getProductVersionTuple():
1803
2192
  """:returns: tuple of 4 ints or None, derived from ``--product-version``"""
1804
2193
  return _parseVersionNumber(options.product_version)
1805
2194
 
1806
2195
 
1807
2196
  def getFileVersion():
2197
+ """:returns str, derived from ``--file-version``"""
2198
+ return options.file_version
2199
+
2200
+
2201
+ def getFileVersionTuple():
1808
2202
  """:returns tuple of 4 ints or None, derived from ``--file-version``"""
1809
2203
  return _parseVersionNumber(options.file_version)
1810
2204
 
1811
2205
 
2206
+ def getProductFileVersion():
2207
+ if options.product_version:
2208
+ if options.file_version:
2209
+ return "%s-%s" % (options.product_version, options.file_version)
2210
+ else:
2211
+ return options.product_version
2212
+ else:
2213
+ return options.file_version
2214
+
2215
+
1812
2216
  def getWindowsSplashScreen():
1813
2217
  """:returns: bool derived from ``--onefile-windows-splash-screen-image``"""
1814
2218
  return options.splash_screen_image
1815
2219
 
1816
2220
 
1817
2221
  def getCompanyName():
1818
- """*str* name of the company to use"""
2222
+ """*str* name of the company to use derived from ``--company-name``"""
1819
2223
  return options.company_name
1820
2224
 
1821
2225
 
1822
2226
  def getProductName():
1823
- """*str* name of the product to use"""
2227
+ """*str* name of the product to use derived from ``--product-name``"""
1824
2228
  return options.product_name
1825
2229
 
1826
2230
 
@@ -1836,6 +2240,9 @@ def getMacOSTargetArch():
1836
2240
 
1837
2241
  def shallCreateAppBundle():
1838
2242
  """*bool* shall create an application bundle, derived from ``--macos-create-app-bundle`` value"""
2243
+ if shallCreatePythonPgoInput():
2244
+ return False
2245
+
1839
2246
  return options.macos_create_bundle and isMacOS()
1840
2247
 
1841
2248
 
@@ -1931,6 +2338,8 @@ def _getPythonFlags():
1931
2338
  _python_flags.add("package_mode")
1932
2339
  elif part in ("-I", "isolated"):
1933
2340
  _python_flags.add("isolated")
2341
+ elif part in ("-B", "dontwritebytecode"):
2342
+ _python_flags.add("dontwritebytecode")
1934
2343
  else:
1935
2344
  Tracing.options_logger.sysexit(
1936
2345
  "Unsupported python flag '%s'." % part
@@ -1987,8 +2396,14 @@ def hasPythonFlagNoRandomization():
1987
2396
  return "no_randomization" in _getPythonFlags()
1988
2397
 
1989
2398
 
2399
+ def hasPythonFlagNoBytecodeRuntimeCache():
2400
+ """*bool* = "dontwritebytecode", "-u" in python flags given"""
2401
+
2402
+ return "dontwritebytecode" in _getPythonFlags()
2403
+
2404
+
1990
2405
  def hasPythonFlagUnbuffered():
1991
- """*bool* = "package_mode", "-m" in python flags given"""
2406
+ """*bool* = "unbuffered", "-u" in python flags given"""
1992
2407
 
1993
2408
  return "unbuffered" in _getPythonFlags()
1994
2409
 
@@ -2106,27 +2521,28 @@ def shallUseProgressBar():
2106
2521
 
2107
2522
  def getForcedStdoutPath():
2108
2523
  """*str* force program stdout output into that filename"""
2109
- result = options.force_stdout_spec
2110
-
2111
- if result is not None:
2112
- result = os.path.normpath(result)
2524
+ if shallCreatePythonPgoInput():
2525
+ return False
2113
2526
 
2114
- return result
2527
+ return options.force_stdout_spec
2115
2528
 
2116
2529
 
2117
2530
  def getForcedStderrPath():
2118
2531
  """*str* force program stderr output into that filename"""
2119
- result = options.force_stderr_spec
2120
-
2121
- if result is not None:
2122
- result = os.path.normpath(result)
2532
+ if shallCreatePythonPgoInput():
2533
+ return False
2123
2534
 
2124
- return result
2535
+ return options.force_stderr_spec
2125
2536
 
2126
2537
 
2127
- def shallShowSourceModifications():
2538
+ def shallShowSourceModifications(module_name):
2128
2539
  """*bool* display plugin source changes derived from --show-source-changes"""
2129
- return options is not None and options.show_source_changes
2540
+ if options is None:
2541
+ return False
2542
+
2543
+ result, _reason = module_name.matchesToShellPatterns(options.show_source_changes)
2544
+
2545
+ return result
2130
2546
 
2131
2547
 
2132
2548
  def isLowMemory():
@@ -2208,3 +2624,63 @@ def shallDisplayWarningMnemonic(mnemonic):
2208
2624
 
2209
2625
  def shallShowExecutedCommands():
2210
2626
  return isExperimental("show-commands")
2627
+
2628
+
2629
+ def getTargetPythonDescription():
2630
+ """:returns: tuple(python_version,OS/arch) string derived from ``--target``"""
2631
+ if options.target_spec is not None:
2632
+ # TODO: Only one we are working on right now.
2633
+ assert options.target_spec == "wasi"
2634
+
2635
+ return python_version, "wasi"
2636
+
2637
+ return None
2638
+
2639
+
2640
+ def getFcfProtectionMode():
2641
+ """:returns: string derived from ``--fcf-protection``"""
2642
+ return options.cf_protection
2643
+
2644
+
2645
+ def getModuleParameter(module_name, parameter_name):
2646
+ """:returns: string derived from ``--module-parameter``"""
2647
+
2648
+ module_name_prefix = module_name.getTopLevelPackageName().asString()
2649
+
2650
+ if parameter_name.startswith(module_name_prefix + "-"):
2651
+ option_name = parameter_name
2652
+ else:
2653
+ option_name = module_name_prefix + "-" + parameter_name
2654
+
2655
+ for module_option in options.module_parameters:
2656
+ module_option_name, module_option_value = module_option.split("=", 1)
2657
+
2658
+ if option_name == module_option_name:
2659
+ return module_option_value
2660
+
2661
+ return None
2662
+
2663
+
2664
+ def getForcedRuntimeEnvironmentVariableValues():
2665
+ """:returns: iterable (string, string) derived from ``----force-runtime-environment-variable``"""
2666
+
2667
+ for forced_runtime_env_variables_spec in options.forced_runtime_env_variables:
2668
+ name, value = forced_runtime_env_variables_spec.split("=", 1)
2669
+
2670
+ yield (name, value)
2671
+
2672
+
2673
+ # Part of "Nuitka", an optimizing Python compiler that is compatible and
2674
+ # integrates with CPython, but also works on its own.
2675
+ #
2676
+ # Licensed under the Apache License, Version 2.0 (the "License");
2677
+ # you may not use this file except in compliance with the License.
2678
+ # You may obtain a copy of the License at
2679
+ #
2680
+ # http://www.apache.org/licenses/LICENSE-2.0
2681
+ #
2682
+ # Unless required by applicable law or agreed to in writing, software
2683
+ # distributed under the License is distributed on an "AS IS" BASIS,
2684
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2685
+ # See the License for the specific language governing permissions and
2686
+ # limitations under the License.