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
@@ -1,33 +1,34 @@
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
  # We are not avoiding these in generated code at all
19
- # pylint: disable=I0021,too-many-lines
20
- # pylint: disable=I0021,line-too-long
21
- # pylint: disable=I0021,too-many-instance-attributes
22
- # pylint: disable=I0021,too-many-return-statements
5
+ # pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines
6
+ # pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements
23
7
 
24
8
 
25
9
  """Hard import nodes
26
10
 
27
11
  WARNING, this code is GENERATED. Modify the template HardImportReferenceNode.py.j2 instead!
28
12
 
29
- spell-checker: ignore append capitalize casefold center clear copy count decode encode endswith expandtabs extend find format formatmap fromkeys get haskey index insert isalnum isalpha isascii isdecimal isdigit isidentifier islower isnumeric isprintable isspace istitle isupper items iteritems iterkeys itervalues join keys ljust lower lstrip maketrans partition pop popitem prepare remove replace reverse rfind rindex rjust rpartition rsplit rstrip setdefault sort split splitlines startswith strip swapcase title translate update upper values viewitems viewkeys viewvalues zfill
30
- spell-checker: ignore args chars count default delete encoding end errors fillchar index item iterable keepends key kwargs maxsplit new old pairs prefix sep start stop sub suffix table tabsize value width
13
+ spell-checker: ignore __prepare__ append args autograph capitalize casefold center chars
14
+ spell-checker: ignore clear copy count decode default delete dist distribution_name encode
15
+ spell-checker: ignore encoding end endswith errors exit_code expandtabs
16
+ spell-checker: ignore experimental_attributes experimental_autograph_options
17
+ spell-checker: ignore experimental_compile experimental_follow_type_hints
18
+ spell-checker: ignore experimental_implements experimental_relax_shapes extend fillchar
19
+ spell-checker: ignore find format format_map formatmap fromkeys func get group handle
20
+ spell-checker: ignore has_key haskey index input_signature insert isalnum isalpha isascii
21
+ spell-checker: ignore isdecimal isdigit isidentifier islower isnumeric isprintable isspace
22
+ spell-checker: ignore istitle isupper item items iterable iteritems iterkeys itervalues
23
+ spell-checker: ignore jit_compile join keepends key keys kwargs ljust lower lstrip
24
+ spell-checker: ignore maketrans maxsplit mode name new old p package
25
+ spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
26
+ spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
27
+ spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
28
+ spell-checker: ignore sort split splitlines start startswith stop strip sub suffix
29
+ spell-checker: ignore swapcase table tabsize title translate update upper use_errno
30
+ spell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width
31
+ spell-checker: ignore winmode zfill
31
32
  """
32
33
  import os
33
34
  from abc import abstractmethod
@@ -54,12 +55,16 @@ from nuitka.specs.HardImportSpecs import (
54
55
  importlib_resources_read_binary_spec,
55
56
  importlib_resources_read_text_spec,
56
57
  os_listdir_spec,
58
+ os_lstat_spec,
57
59
  os_path_abspath_spec,
58
60
  os_path_basename_spec,
61
+ os_path_dirname_spec,
59
62
  os_path_exists_spec,
60
63
  os_path_isabs_spec,
61
64
  os_path_isdir_spec,
62
65
  os_path_isfile_spec,
66
+ os_path_normpath_spec,
67
+ os_stat_spec,
63
68
  os_uname_spec,
64
69
  pkg_resources_get_distribution_spec,
65
70
  pkg_resources_iter_entry_points_spec,
@@ -67,11 +72,14 @@ from nuitka.specs.HardImportSpecs import (
67
72
  pkg_resources_resource_stream_spec,
68
73
  pkg_resources_resource_string_spec,
69
74
  pkgutil_get_data_spec,
75
+ sys_exit_spec,
76
+ tensorflow_function_spec,
70
77
  )
71
78
 
72
79
  from .ChildrenHavingMixins import (
73
80
  ChildHavingDistMixin,
74
81
  ChildHavingDistributionNameMixin,
82
+ ChildHavingExitCodeOptionalMixin,
75
83
  ChildHavingPackageMixin,
76
84
  ChildHavingParamsTupleMixin,
77
85
  ChildHavingPathMixin,
@@ -79,12 +87,15 @@ from .ChildrenHavingMixins import (
79
87
  ChildHavingPMixin,
80
88
  ChildHavingRequirementsTupleMixin,
81
89
  ChildHavingSMixin,
90
+ ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin,
82
91
  ChildrenHavingGroupNameOptionalMixin,
83
- ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLasterrorOptionalMixin,
84
- ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLasterrorOptionalWinmodeOptionalMixin,
92
+ ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin,
93
+ ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin,
85
94
  ChildrenHavingPackageOrRequirementResourceNameMixin,
86
95
  ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin,
87
96
  ChildrenHavingPackageResourceMixin,
97
+ ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin,
98
+ ChildrenHavingPathOptionalDirFdOptionalMixin,
88
99
  )
89
100
  from .ExpressionBases import ExpressionBase
90
101
  from .ExpressionShapeMixins import (
@@ -152,7 +163,7 @@ hard_import_node_classes[ExpressionCtypesCdllRef] = ctypes_cdll_since_38_spec
152
163
 
153
164
 
154
165
  class ExpressionCtypesCdllSince38CallBase(
155
- ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLasterrorOptionalWinmodeOptionalMixin,
166
+ ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin,
156
167
  ExpressionBase,
157
168
  ):
158
169
  """Base class for CtypesCdllCall
@@ -167,7 +178,7 @@ class ExpressionCtypesCdllSince38CallBase(
167
178
  "mode|optional",
168
179
  "handle|optional",
169
180
  "use_errno|optional",
170
- "use_lasterror|optional",
181
+ "use_last_error|optional",
171
182
  "winmode|optional",
172
183
  )
173
184
 
@@ -176,22 +187,22 @@ class ExpressionCtypesCdllSince38CallBase(
176
187
  spec = ctypes_cdll_since_38_spec
177
188
 
178
189
  def __init__(
179
- self, name, mode, handle, use_errno, use_lasterror, winmode, source_ref
190
+ self, name, mode, handle, use_errno, use_last_error, winmode, source_ref
180
191
  ):
181
- ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLasterrorOptionalWinmodeOptionalMixin.__init__(
192
+
193
+ ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin.__init__(
182
194
  self,
183
195
  name=name,
184
196
  mode=mode,
185
197
  handle=handle,
186
198
  use_errno=use_errno,
187
- use_lasterror=use_lasterror,
199
+ use_last_error=use_last_error,
188
200
  winmode=winmode,
189
201
  )
190
202
 
191
203
  ExpressionBase.__init__(self, source_ref)
192
204
 
193
- # In module mode, we expect a changing environment, cannot optimize this
194
- self.attempted = shallMakeModule()
205
+ self.attempted = False
195
206
 
196
207
  def computeExpression(self, trace_collection):
197
208
  if self.attempted or not ctypes_cdll_since_38_spec.isCompileTimeComputable(
@@ -200,7 +211,7 @@ class ExpressionCtypesCdllSince38CallBase(
200
211
  self.subnode_mode,
201
212
  self.subnode_handle,
202
213
  self.subnode_use_errno,
203
- self.subnode_use_lasterror,
214
+ self.subnode_use_last_error,
204
215
  self.subnode_winmode,
205
216
  )
206
217
  ):
@@ -223,7 +234,7 @@ class ExpressionCtypesCdllSince38CallBase(
223
234
 
224
235
 
225
236
  class ExpressionCtypesCdllBefore38CallBase(
226
- ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLasterrorOptionalMixin,
237
+ ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin,
227
238
  ExpressionBase,
228
239
  ):
229
240
  """Base class for CtypesCdllCall
@@ -238,27 +249,27 @@ class ExpressionCtypesCdllBefore38CallBase(
238
249
  "mode|optional",
239
250
  "handle|optional",
240
251
  "use_errno|optional",
241
- "use_lasterror|optional",
252
+ "use_last_error|optional",
242
253
  )
243
254
 
244
255
  __slots__ = ("attempted",)
245
256
 
246
257
  spec = ctypes_cdll_before_38_spec
247
258
 
248
- def __init__(self, name, mode, handle, use_errno, use_lasterror, source_ref):
249
- ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLasterrorOptionalMixin.__init__(
259
+ def __init__(self, name, mode, handle, use_errno, use_last_error, source_ref):
260
+
261
+ ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin.__init__(
250
262
  self,
251
263
  name=name,
252
264
  mode=mode,
253
265
  handle=handle,
254
266
  use_errno=use_errno,
255
- use_lasterror=use_lasterror,
267
+ use_last_error=use_last_error,
256
268
  )
257
269
 
258
270
  ExpressionBase.__init__(self, source_ref)
259
271
 
260
- # In module mode, we expect a changing environment, cannot optimize this
261
- self.attempted = shallMakeModule()
272
+ self.attempted = False
262
273
 
263
274
  def computeExpression(self, trace_collection):
264
275
  if self.attempted or not ctypes_cdll_before_38_spec.isCompileTimeComputable(
@@ -267,7 +278,7 @@ class ExpressionCtypesCdllBefore38CallBase(
267
278
  self.subnode_mode,
268
279
  self.subnode_handle,
269
280
  self.subnode_use_errno,
270
- self.subnode_use_lasterror,
281
+ self.subnode_use_last_error,
271
282
  )
272
283
  ):
273
284
  trace_collection.onExceptionRaiseExit(BaseException)
@@ -326,9 +337,9 @@ class ExpressionImportlibMetadataBackportDistributionRef(
326
337
  )
327
338
 
328
339
 
329
- hard_import_node_classes[
330
- ExpressionImportlibMetadataBackportDistributionRef
331
- ] = importlib_metadata_backport_distribution_spec
340
+ hard_import_node_classes[ExpressionImportlibMetadataBackportDistributionRef] = (
341
+ importlib_metadata_backport_distribution_spec
342
+ )
332
343
 
333
344
 
334
345
  class ExpressionImportlibMetadataBackportDistributionCallBase(
@@ -346,6 +357,7 @@ class ExpressionImportlibMetadataBackportDistributionCallBase(
346
357
  spec = importlib_metadata_backport_distribution_spec
347
358
 
348
359
  def __init__(self, distribution_name, source_ref):
360
+
349
361
  ChildHavingDistributionNameMixin.__init__(
350
362
  self,
351
363
  distribution_name=distribution_name,
@@ -419,9 +431,9 @@ class ExpressionImportlibMetadataBackportEntryPointsRef(
419
431
  )
420
432
 
421
433
 
422
- hard_import_node_classes[
423
- ExpressionImportlibMetadataBackportEntryPointsRef
424
- ] = importlib_metadata_backport_entry_points_spec
434
+ hard_import_node_classes[ExpressionImportlibMetadataBackportEntryPointsRef] = (
435
+ importlib_metadata_backport_entry_points_spec
436
+ )
425
437
 
426
438
 
427
439
  class ExpressionImportlibMetadataBackportEntryPointsCallBase(
@@ -439,6 +451,7 @@ class ExpressionImportlibMetadataBackportEntryPointsCallBase(
439
451
  spec = importlib_metadata_backport_entry_points_spec
440
452
 
441
453
  def __init__(self, params, source_ref):
454
+
442
455
  ChildHavingParamsTupleMixin.__init__(
443
456
  self,
444
457
  params=params,
@@ -512,9 +525,9 @@ class ExpressionImportlibMetadataBackportMetadataRef(
512
525
  )
513
526
 
514
527
 
515
- hard_import_node_classes[
516
- ExpressionImportlibMetadataBackportMetadataRef
517
- ] = importlib_metadata_backport_metadata_spec
528
+ hard_import_node_classes[ExpressionImportlibMetadataBackportMetadataRef] = (
529
+ importlib_metadata_backport_metadata_spec
530
+ )
518
531
 
519
532
 
520
533
  class ExpressionImportlibMetadataBackportMetadataCallBase(
@@ -532,6 +545,7 @@ class ExpressionImportlibMetadataBackportMetadataCallBase(
532
545
  spec = importlib_metadata_backport_metadata_spec
533
546
 
534
547
  def __init__(self, distribution_name, source_ref):
548
+
535
549
  ChildHavingDistributionNameMixin.__init__(
536
550
  self,
537
551
  distribution_name=distribution_name,
@@ -605,9 +619,9 @@ class ExpressionImportlibMetadataBackportVersionRef(
605
619
  )
606
620
 
607
621
 
608
- hard_import_node_classes[
609
- ExpressionImportlibMetadataBackportVersionRef
610
- ] = importlib_metadata_backport_version_spec
622
+ hard_import_node_classes[ExpressionImportlibMetadataBackportVersionRef] = (
623
+ importlib_metadata_backport_version_spec
624
+ )
611
625
 
612
626
 
613
627
  class ExpressionImportlibMetadataBackportVersionCallBase(
@@ -625,6 +639,7 @@ class ExpressionImportlibMetadataBackportVersionCallBase(
625
639
  spec = importlib_metadata_backport_version_spec
626
640
 
627
641
  def __init__(self, distribution_name, source_ref):
642
+
628
643
  ChildHavingDistributionNameMixin.__init__(
629
644
  self,
630
645
  distribution_name=distribution_name,
@@ -698,9 +713,9 @@ class ExpressionImportlibMetadataDistributionRef(
698
713
  )
699
714
 
700
715
 
701
- hard_import_node_classes[
702
- ExpressionImportlibMetadataDistributionRef
703
- ] = importlib_metadata_distribution_spec
716
+ hard_import_node_classes[ExpressionImportlibMetadataDistributionRef] = (
717
+ importlib_metadata_distribution_spec
718
+ )
704
719
 
705
720
 
706
721
  class ExpressionImportlibMetadataDistributionCallBase(
@@ -718,6 +733,7 @@ class ExpressionImportlibMetadataDistributionCallBase(
718
733
  spec = importlib_metadata_distribution_spec
719
734
 
720
735
  def __init__(self, distribution_name, source_ref):
736
+
721
737
  ChildHavingDistributionNameMixin.__init__(
722
738
  self,
723
739
  distribution_name=distribution_name,
@@ -725,8 +741,7 @@ class ExpressionImportlibMetadataDistributionCallBase(
725
741
 
726
742
  ExpressionBase.__init__(self, source_ref)
727
743
 
728
- # In module mode, we expect a changing environment, cannot optimize this
729
- self.attempted = shallMakeModule()
744
+ self.attempted = False
730
745
 
731
746
  def computeExpression(self, trace_collection):
732
747
  if (
@@ -809,9 +824,9 @@ class ExpressionImportlibMetadataEntryPointsRef(
809
824
  )
810
825
 
811
826
 
812
- hard_import_node_classes[
813
- ExpressionImportlibMetadataEntryPointsRef
814
- ] = importlib_metadata_entry_points_since_310_spec
827
+ hard_import_node_classes[ExpressionImportlibMetadataEntryPointsRef] = (
828
+ importlib_metadata_entry_points_since_310_spec
829
+ )
815
830
 
816
831
 
817
832
  class ExpressionImportlibMetadataEntryPointsSince310CallBase(
@@ -831,6 +846,7 @@ class ExpressionImportlibMetadataEntryPointsSince310CallBase(
831
846
  spec = importlib_metadata_entry_points_since_310_spec
832
847
 
833
848
  def __init__(self, params, source_ref):
849
+
834
850
  ChildHavingParamsTupleMixin.__init__(
835
851
  self,
836
852
  params=params,
@@ -838,8 +854,7 @@ class ExpressionImportlibMetadataEntryPointsSince310CallBase(
838
854
 
839
855
  ExpressionBase.__init__(self, source_ref)
840
856
 
841
- # In module mode, we expect a changing environment, cannot optimize this
842
- self.attempted = shallMakeModule()
857
+ self.attempted = False
843
858
 
844
859
  def computeExpression(self, trace_collection):
845
860
  if (
@@ -881,10 +896,10 @@ class ExpressionImportlibMetadataEntryPointsBefore310CallBase(
881
896
  spec = importlib_metadata_entry_points_before_310_spec
882
897
 
883
898
  def __init__(self, source_ref):
899
+
884
900
  ExpressionBase.__init__(self, source_ref)
885
901
 
886
- # In module mode, we expect a changing environment, cannot optimize this
887
- self.attempted = shallMakeModule()
902
+ self.attempted = False
888
903
 
889
904
  def finalize(self):
890
905
  del self.parent
@@ -947,9 +962,9 @@ class ExpressionImportlibMetadataMetadataRef(
947
962
  )
948
963
 
949
964
 
950
- hard_import_node_classes[
951
- ExpressionImportlibMetadataMetadataRef
952
- ] = importlib_metadata_metadata_spec
965
+ hard_import_node_classes[ExpressionImportlibMetadataMetadataRef] = (
966
+ importlib_metadata_metadata_spec
967
+ )
953
968
 
954
969
 
955
970
  class ExpressionImportlibMetadataMetadataCallBase(
@@ -967,6 +982,7 @@ class ExpressionImportlibMetadataMetadataCallBase(
967
982
  spec = importlib_metadata_metadata_spec
968
983
 
969
984
  def __init__(self, distribution_name, source_ref):
985
+
970
986
  ChildHavingDistributionNameMixin.__init__(
971
987
  self,
972
988
  distribution_name=distribution_name,
@@ -974,8 +990,7 @@ class ExpressionImportlibMetadataMetadataCallBase(
974
990
 
975
991
  ExpressionBase.__init__(self, source_ref)
976
992
 
977
- # In module mode, we expect a changing environment, cannot optimize this
978
- self.attempted = shallMakeModule()
993
+ self.attempted = False
979
994
 
980
995
  def computeExpression(self, trace_collection):
981
996
  if (
@@ -1040,9 +1055,9 @@ class ExpressionImportlibMetadataVersionRef(
1040
1055
  )
1041
1056
 
1042
1057
 
1043
- hard_import_node_classes[
1044
- ExpressionImportlibMetadataVersionRef
1045
- ] = importlib_metadata_version_spec
1058
+ hard_import_node_classes[ExpressionImportlibMetadataVersionRef] = (
1059
+ importlib_metadata_version_spec
1060
+ )
1046
1061
 
1047
1062
 
1048
1063
  class ExpressionImportlibMetadataVersionCallBase(
@@ -1060,6 +1075,7 @@ class ExpressionImportlibMetadataVersionCallBase(
1060
1075
  spec = importlib_metadata_version_spec
1061
1076
 
1062
1077
  def __init__(self, distribution_name, source_ref):
1078
+
1063
1079
  ChildHavingDistributionNameMixin.__init__(
1064
1080
  self,
1065
1081
  distribution_name=distribution_name,
@@ -1067,8 +1083,7 @@ class ExpressionImportlibMetadataVersionCallBase(
1067
1083
 
1068
1084
  ExpressionBase.__init__(self, source_ref)
1069
1085
 
1070
- # In module mode, we expect a changing environment, cannot optimize this
1071
- self.attempted = shallMakeModule()
1086
+ self.attempted = False
1072
1087
 
1073
1088
  def computeExpression(self, trace_collection):
1074
1089
  if (
@@ -1133,9 +1148,9 @@ class ExpressionImportlibResourcesBackportFilesRef(
1133
1148
  )
1134
1149
 
1135
1150
 
1136
- hard_import_node_classes[
1137
- ExpressionImportlibResourcesBackportFilesRef
1138
- ] = importlib_resources_backport_files_spec
1151
+ hard_import_node_classes[ExpressionImportlibResourcesBackportFilesRef] = (
1152
+ importlib_resources_backport_files_spec
1153
+ )
1139
1154
 
1140
1155
 
1141
1156
  class ExpressionImportlibResourcesBackportFilesCallBase(
@@ -1153,6 +1168,7 @@ class ExpressionImportlibResourcesBackportFilesCallBase(
1153
1168
  spec = importlib_resources_backport_files_spec
1154
1169
 
1155
1170
  def __init__(self, package, source_ref):
1171
+
1156
1172
  ChildHavingPackageMixin.__init__(
1157
1173
  self,
1158
1174
  package=package,
@@ -1226,9 +1242,9 @@ class ExpressionImportlibResourcesBackportReadBinaryRef(
1226
1242
  )
1227
1243
 
1228
1244
 
1229
- hard_import_node_classes[
1230
- ExpressionImportlibResourcesBackportReadBinaryRef
1231
- ] = importlib_resources_backport_read_binary_spec
1245
+ hard_import_node_classes[ExpressionImportlibResourcesBackportReadBinaryRef] = (
1246
+ importlib_resources_backport_read_binary_spec
1247
+ )
1232
1248
 
1233
1249
 
1234
1250
  class ExpressionImportlibResourcesBackportReadBinaryCallBase(
@@ -1249,6 +1265,7 @@ class ExpressionImportlibResourcesBackportReadBinaryCallBase(
1249
1265
  spec = importlib_resources_backport_read_binary_spec
1250
1266
 
1251
1267
  def __init__(self, package, resource, source_ref):
1268
+
1252
1269
  ChildrenHavingPackageResourceMixin.__init__(
1253
1270
  self,
1254
1271
  package=package,
@@ -1326,9 +1343,9 @@ class ExpressionImportlibResourcesBackportReadTextRef(
1326
1343
  )
1327
1344
 
1328
1345
 
1329
- hard_import_node_classes[
1330
- ExpressionImportlibResourcesBackportReadTextRef
1331
- ] = importlib_resources_backport_read_text_spec
1346
+ hard_import_node_classes[ExpressionImportlibResourcesBackportReadTextRef] = (
1347
+ importlib_resources_backport_read_text_spec
1348
+ )
1332
1349
 
1333
1350
 
1334
1351
  class ExpressionImportlibResourcesBackportReadTextCallBase(
@@ -1353,6 +1370,7 @@ class ExpressionImportlibResourcesBackportReadTextCallBase(
1353
1370
  spec = importlib_resources_backport_read_text_spec
1354
1371
 
1355
1372
  def __init__(self, package, resource, encoding, errors, source_ref):
1373
+
1356
1374
  ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin.__init__(
1357
1375
  self,
1358
1376
  package=package,
@@ -1432,9 +1450,9 @@ class ExpressionImportlibResourcesFilesRef(
1432
1450
  )
1433
1451
 
1434
1452
 
1435
- hard_import_node_classes[
1436
- ExpressionImportlibResourcesFilesRef
1437
- ] = importlib_resources_files_spec
1453
+ hard_import_node_classes[ExpressionImportlibResourcesFilesRef] = (
1454
+ importlib_resources_files_spec
1455
+ )
1438
1456
 
1439
1457
 
1440
1458
  class ExpressionImportlibResourcesFilesCallBase(
@@ -1452,6 +1470,7 @@ class ExpressionImportlibResourcesFilesCallBase(
1452
1470
  spec = importlib_resources_files_spec
1453
1471
 
1454
1472
  def __init__(self, package, source_ref):
1473
+
1455
1474
  ChildHavingPackageMixin.__init__(
1456
1475
  self,
1457
1476
  package=package,
@@ -1459,8 +1478,7 @@ class ExpressionImportlibResourcesFilesCallBase(
1459
1478
 
1460
1479
  ExpressionBase.__init__(self, source_ref)
1461
1480
 
1462
- # In module mode, we expect a changing environment, cannot optimize this
1463
- self.attempted = shallMakeModule()
1481
+ self.attempted = False
1464
1482
 
1465
1483
  def computeExpression(self, trace_collection):
1466
1484
  if (
@@ -1525,9 +1543,9 @@ class ExpressionImportlibResourcesReadBinaryRef(
1525
1543
  )
1526
1544
 
1527
1545
 
1528
- hard_import_node_classes[
1529
- ExpressionImportlibResourcesReadBinaryRef
1530
- ] = importlib_resources_read_binary_spec
1546
+ hard_import_node_classes[ExpressionImportlibResourcesReadBinaryRef] = (
1547
+ importlib_resources_read_binary_spec
1548
+ )
1531
1549
 
1532
1550
 
1533
1551
  class ExpressionImportlibResourcesReadBinaryCallBase(
@@ -1548,6 +1566,7 @@ class ExpressionImportlibResourcesReadBinaryCallBase(
1548
1566
  spec = importlib_resources_read_binary_spec
1549
1567
 
1550
1568
  def __init__(self, package, resource, source_ref):
1569
+
1551
1570
  ChildrenHavingPackageResourceMixin.__init__(
1552
1571
  self,
1553
1572
  package=package,
@@ -1556,8 +1575,7 @@ class ExpressionImportlibResourcesReadBinaryCallBase(
1556
1575
 
1557
1576
  ExpressionBase.__init__(self, source_ref)
1558
1577
 
1559
- # In module mode, we expect a changing environment, cannot optimize this
1560
- self.attempted = shallMakeModule()
1578
+ self.attempted = False
1561
1579
 
1562
1580
  def computeExpression(self, trace_collection):
1563
1581
  if (
@@ -1625,9 +1643,9 @@ class ExpressionImportlibResourcesReadTextRef(
1625
1643
  )
1626
1644
 
1627
1645
 
1628
- hard_import_node_classes[
1629
- ExpressionImportlibResourcesReadTextRef
1630
- ] = importlib_resources_read_text_spec
1646
+ hard_import_node_classes[ExpressionImportlibResourcesReadTextRef] = (
1647
+ importlib_resources_read_text_spec
1648
+ )
1631
1649
 
1632
1650
 
1633
1651
  class ExpressionImportlibResourcesReadTextCallBase(
@@ -1652,6 +1670,7 @@ class ExpressionImportlibResourcesReadTextCallBase(
1652
1670
  spec = importlib_resources_read_text_spec
1653
1671
 
1654
1672
  def __init__(self, package, resource, encoding, errors, source_ref):
1673
+
1655
1674
  ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin.__init__(
1656
1675
  self,
1657
1676
  package=package,
@@ -1662,8 +1681,7 @@ class ExpressionImportlibResourcesReadTextCallBase(
1662
1681
 
1663
1682
  ExpressionBase.__init__(self, source_ref)
1664
1683
 
1665
- # In module mode, we expect a changing environment, cannot optimize this
1666
- self.attempted = shallMakeModule()
1684
+ self.attempted = False
1667
1685
 
1668
1686
  def computeExpression(self, trace_collection):
1669
1687
  if (
@@ -1745,6 +1763,7 @@ class ExpressionOsListdirCallBase(ChildHavingPathOptionalMixin, ExpressionBase):
1745
1763
  spec = os_listdir_spec
1746
1764
 
1747
1765
  def __init__(self, path, source_ref):
1766
+
1748
1767
  ChildHavingPathOptionalMixin.__init__(
1749
1768
  self,
1750
1769
  path=path,
@@ -1752,8 +1771,7 @@ class ExpressionOsListdirCallBase(ChildHavingPathOptionalMixin, ExpressionBase):
1752
1771
 
1753
1772
  ExpressionBase.__init__(self, source_ref)
1754
1773
 
1755
- # In module mode, we expect a changing environment, cannot optimize this
1756
- self.attempted = shallMakeModule()
1774
+ self.attempted = False
1757
1775
 
1758
1776
  def computeExpression(self, trace_collection):
1759
1777
  if self.attempted or not os_listdir_spec.isCompileTimeComputable(
@@ -1777,6 +1795,94 @@ class ExpressionOsListdirCallBase(ChildHavingPathOptionalMixin, ExpressionBase):
1777
1795
  return True
1778
1796
 
1779
1797
 
1798
+ class ExpressionOsLstatRef(ExpressionImportModuleNameHardExistsSpecificBase):
1799
+ """Function reference os.lstat"""
1800
+
1801
+ kind = "EXPRESSION_OS_LSTAT_REF"
1802
+
1803
+ def __init__(self, source_ref):
1804
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
1805
+ self,
1806
+ module_name="os",
1807
+ import_name="lstat",
1808
+ module_guaranteed=True,
1809
+ source_ref=source_ref,
1810
+ )
1811
+
1812
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
1813
+ # Anything may happen on call trace before this. On next pass, if
1814
+ # replaced, we might be better but not now.
1815
+ trace_collection.onExceptionRaiseExit(BaseException)
1816
+
1817
+ from .OsSysNodes import ExpressionOsLstatCall
1818
+
1819
+ result = extractBuiltinArgs(
1820
+ node=call_node,
1821
+ builtin_class=ExpressionOsLstatCall,
1822
+ builtin_spec=os_lstat_spec,
1823
+ )
1824
+
1825
+ return (
1826
+ result,
1827
+ "new_expression",
1828
+ "Call to 'os.lstat' recognized.",
1829
+ )
1830
+
1831
+
1832
+ hard_import_node_classes[ExpressionOsLstatRef] = os_lstat_spec
1833
+
1834
+
1835
+ class ExpressionOsLstatCallBase(
1836
+ ChildrenHavingPathOptionalDirFdOptionalMixin, ExpressionBase
1837
+ ):
1838
+ """Base class for OsLstatCall
1839
+
1840
+ Generated boiler plate code.
1841
+ """
1842
+
1843
+ named_children = (
1844
+ "path|optional",
1845
+ "dir_fd|optional",
1846
+ )
1847
+
1848
+ __slots__ = ("attempted",)
1849
+
1850
+ spec = os_lstat_spec
1851
+
1852
+ def __init__(self, path, dir_fd, source_ref):
1853
+
1854
+ ChildrenHavingPathOptionalDirFdOptionalMixin.__init__(
1855
+ self,
1856
+ path=path,
1857
+ dir_fd=dir_fd,
1858
+ )
1859
+
1860
+ ExpressionBase.__init__(self, source_ref)
1861
+
1862
+ self.attempted = False
1863
+
1864
+ def computeExpression(self, trace_collection):
1865
+ if self.attempted or not os_lstat_spec.isCompileTimeComputable(
1866
+ (self.subnode_path,)
1867
+ ):
1868
+ trace_collection.onExceptionRaiseExit(BaseException)
1869
+
1870
+ return self, None, None
1871
+
1872
+ try:
1873
+ return self.replaceWithCompileTimeValue(trace_collection)
1874
+ finally:
1875
+ self.attempted = True
1876
+
1877
+ @abstractmethod
1878
+ def replaceWithCompileTimeValue(self, trace_collection):
1879
+ pass
1880
+
1881
+ @staticmethod
1882
+ def mayRaiseExceptionOperation():
1883
+ return True
1884
+
1885
+
1780
1886
  class ExpressionOsPathAbspathRef(ExpressionImportModuleNameHardExistsSpecificBase):
1781
1887
  """Function reference os.path.abspath"""
1782
1888
 
@@ -1827,6 +1933,7 @@ class ExpressionOsPathAbspathCallBase(ChildHavingPathMixin, ExpressionBase):
1827
1933
  spec = os_path_abspath_spec
1828
1934
 
1829
1935
  def __init__(self, path, source_ref):
1936
+
1830
1937
  ChildHavingPathMixin.__init__(
1831
1938
  self,
1832
1939
  path=path,
@@ -1834,8 +1941,7 @@ class ExpressionOsPathAbspathCallBase(ChildHavingPathMixin, ExpressionBase):
1834
1941
 
1835
1942
  ExpressionBase.__init__(self, source_ref)
1836
1943
 
1837
- # In module mode, we expect a changing environment, cannot optimize this
1838
- self.attempted = shallMakeModule()
1944
+ self.attempted = False
1839
1945
 
1840
1946
  def computeExpression(self, trace_collection):
1841
1947
  if self.attempted or not os_path_abspath_spec.isCompileTimeComputable(
@@ -1909,6 +2015,7 @@ class ExpressionOsPathBasenameCallBase(ChildHavingPMixin, ExpressionBase):
1909
2015
  spec = os_path_basename_spec
1910
2016
 
1911
2017
  def __init__(self, p, source_ref):
2018
+
1912
2019
  ChildHavingPMixin.__init__(
1913
2020
  self,
1914
2021
  p=p,
@@ -1916,8 +2023,7 @@ class ExpressionOsPathBasenameCallBase(ChildHavingPMixin, ExpressionBase):
1916
2023
 
1917
2024
  ExpressionBase.__init__(self, source_ref)
1918
2025
 
1919
- # In module mode, we expect a changing environment, cannot optimize this
1920
- self.attempted = shallMakeModule()
2026
+ self.attempted = False
1921
2027
 
1922
2028
  def computeExpression(self, trace_collection):
1923
2029
  if self.attempted or not os_path_basename_spec.isCompileTimeComputable(
@@ -1941,6 +2047,88 @@ class ExpressionOsPathBasenameCallBase(ChildHavingPMixin, ExpressionBase):
1941
2047
  return True
1942
2048
 
1943
2049
 
2050
+ class ExpressionOsPathDirnameRef(ExpressionImportModuleNameHardExistsSpecificBase):
2051
+ """Function reference os.path.dirname"""
2052
+
2053
+ kind = "EXPRESSION_OS_PATH_DIRNAME_REF"
2054
+
2055
+ def __init__(self, source_ref):
2056
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
2057
+ self,
2058
+ module_name=os.path.__name__,
2059
+ import_name="dirname",
2060
+ module_guaranteed=True,
2061
+ source_ref=source_ref,
2062
+ )
2063
+
2064
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
2065
+ # Anything may happen on call trace before this. On next pass, if
2066
+ # replaced, we might be better but not now.
2067
+ trace_collection.onExceptionRaiseExit(BaseException)
2068
+
2069
+ from .OsSysNodes import ExpressionOsPathDirnameCall
2070
+
2071
+ result = extractBuiltinArgs(
2072
+ node=call_node,
2073
+ builtin_class=ExpressionOsPathDirnameCall,
2074
+ builtin_spec=os_path_dirname_spec,
2075
+ )
2076
+
2077
+ return (
2078
+ result,
2079
+ "new_expression",
2080
+ "Call to 'os.path.dirname' recognized.",
2081
+ )
2082
+
2083
+
2084
+ hard_import_node_classes[ExpressionOsPathDirnameRef] = os_path_dirname_spec
2085
+
2086
+
2087
+ class ExpressionOsPathDirnameCallBase(ChildHavingPMixin, ExpressionBase):
2088
+ """Base class for OsPathDirnameCall
2089
+
2090
+ Generated boiler plate code.
2091
+ """
2092
+
2093
+ named_children = ("p",)
2094
+
2095
+ __slots__ = ("attempted",)
2096
+
2097
+ spec = os_path_dirname_spec
2098
+
2099
+ def __init__(self, p, source_ref):
2100
+
2101
+ ChildHavingPMixin.__init__(
2102
+ self,
2103
+ p=p,
2104
+ )
2105
+
2106
+ ExpressionBase.__init__(self, source_ref)
2107
+
2108
+ self.attempted = False
2109
+
2110
+ def computeExpression(self, trace_collection):
2111
+ if self.attempted or not os_path_dirname_spec.isCompileTimeComputable(
2112
+ (self.subnode_p,)
2113
+ ):
2114
+ trace_collection.onExceptionRaiseExit(BaseException)
2115
+
2116
+ return self, None, None
2117
+
2118
+ try:
2119
+ return self.replaceWithCompileTimeValue(trace_collection)
2120
+ finally:
2121
+ self.attempted = True
2122
+
2123
+ @abstractmethod
2124
+ def replaceWithCompileTimeValue(self, trace_collection):
2125
+ pass
2126
+
2127
+ @staticmethod
2128
+ def mayRaiseExceptionOperation():
2129
+ return True
2130
+
2131
+
1944
2132
  class ExpressionOsPathExistsRef(ExpressionImportModuleNameHardExistsSpecificBase):
1945
2133
  """Function reference os.path.exists"""
1946
2134
 
@@ -1991,6 +2179,7 @@ class ExpressionOsPathExistsCallBase(ChildHavingPathMixin, ExpressionBase):
1991
2179
  spec = os_path_exists_spec
1992
2180
 
1993
2181
  def __init__(self, path, source_ref):
2182
+
1994
2183
  ChildHavingPathMixin.__init__(
1995
2184
  self,
1996
2185
  path=path,
@@ -1998,8 +2187,7 @@ class ExpressionOsPathExistsCallBase(ChildHavingPathMixin, ExpressionBase):
1998
2187
 
1999
2188
  ExpressionBase.__init__(self, source_ref)
2000
2189
 
2001
- # In module mode, we expect a changing environment, cannot optimize this
2002
- self.attempted = shallMakeModule()
2190
+ self.attempted = False
2003
2191
 
2004
2192
  def computeExpression(self, trace_collection):
2005
2193
  if self.attempted or not os_path_exists_spec.isCompileTimeComputable(
@@ -2075,6 +2263,7 @@ class ExpressionOsPathIsabsCallBase(
2075
2263
  spec = os_path_isabs_spec
2076
2264
 
2077
2265
  def __init__(self, s, source_ref):
2266
+
2078
2267
  ChildHavingSMixin.__init__(
2079
2268
  self,
2080
2269
  s=s,
@@ -2082,8 +2271,7 @@ class ExpressionOsPathIsabsCallBase(
2082
2271
 
2083
2272
  ExpressionBase.__init__(self, source_ref)
2084
2273
 
2085
- # In module mode, we expect a changing environment, cannot optimize this
2086
- self.attempted = shallMakeModule()
2274
+ self.attempted = False
2087
2275
 
2088
2276
  def computeExpression(self, trace_collection):
2089
2277
  if self.attempted or not os_path_isabs_spec.isCompileTimeComputable(
@@ -2157,6 +2345,7 @@ class ExpressionOsPathIsdirCallBase(ChildHavingPathMixin, ExpressionBase):
2157
2345
  spec = os_path_isdir_spec
2158
2346
 
2159
2347
  def __init__(self, path, source_ref):
2348
+
2160
2349
  ChildHavingPathMixin.__init__(
2161
2350
  self,
2162
2351
  path=path,
@@ -2164,8 +2353,7 @@ class ExpressionOsPathIsdirCallBase(ChildHavingPathMixin, ExpressionBase):
2164
2353
 
2165
2354
  ExpressionBase.__init__(self, source_ref)
2166
2355
 
2167
- # In module mode, we expect a changing environment, cannot optimize this
2168
- self.attempted = shallMakeModule()
2356
+ self.attempted = False
2169
2357
 
2170
2358
  def computeExpression(self, trace_collection):
2171
2359
  if self.attempted or not os_path_isdir_spec.isCompileTimeComputable(
@@ -2239,6 +2427,7 @@ class ExpressionOsPathIsfileCallBase(ChildHavingPathMixin, ExpressionBase):
2239
2427
  spec = os_path_isfile_spec
2240
2428
 
2241
2429
  def __init__(self, path, source_ref):
2430
+
2242
2431
  ChildHavingPathMixin.__init__(
2243
2432
  self,
2244
2433
  path=path,
@@ -2246,8 +2435,7 @@ class ExpressionOsPathIsfileCallBase(ChildHavingPathMixin, ExpressionBase):
2246
2435
 
2247
2436
  ExpressionBase.__init__(self, source_ref)
2248
2437
 
2249
- # In module mode, we expect a changing environment, cannot optimize this
2250
- self.attempted = shallMakeModule()
2438
+ self.attempted = False
2251
2439
 
2252
2440
  def computeExpression(self, trace_collection):
2253
2441
  if self.attempted or not os_path_isfile_spec.isCompileTimeComputable(
@@ -2271,16 +2459,16 @@ class ExpressionOsPathIsfileCallBase(ChildHavingPathMixin, ExpressionBase):
2271
2459
  return True
2272
2460
 
2273
2461
 
2274
- class ExpressionOsUnameRef(ExpressionImportModuleNameHardExistsSpecificBase):
2275
- """Function reference os.uname"""
2462
+ class ExpressionOsPathNormpathRef(ExpressionImportModuleNameHardExistsSpecificBase):
2463
+ """Function reference os.path.normpath"""
2276
2464
 
2277
- kind = "EXPRESSION_OS_UNAME_REF"
2465
+ kind = "EXPRESSION_OS_PATH_NORMPATH_REF"
2278
2466
 
2279
2467
  def __init__(self, source_ref):
2280
2468
  ExpressionImportModuleNameHardExistsSpecificBase.__init__(
2281
2469
  self,
2282
- module_name="os",
2283
- import_name="uname",
2470
+ module_name=os.path.__name__,
2471
+ import_name="normpath",
2284
2472
  module_guaranteed=True,
2285
2473
  source_ref=source_ref,
2286
2474
  )
@@ -2290,45 +2478,217 @@ class ExpressionOsUnameRef(ExpressionImportModuleNameHardExistsSpecificBase):
2290
2478
  # replaced, we might be better but not now.
2291
2479
  trace_collection.onExceptionRaiseExit(BaseException)
2292
2480
 
2293
- from .OsSysNodes import ExpressionOsUnameCall
2481
+ from .OsSysNodes import ExpressionOsPathNormpathCall
2294
2482
 
2295
2483
  result = extractBuiltinArgs(
2296
2484
  node=call_node,
2297
- builtin_class=ExpressionOsUnameCall,
2298
- builtin_spec=os_uname_spec,
2485
+ builtin_class=ExpressionOsPathNormpathCall,
2486
+ builtin_spec=os_path_normpath_spec,
2299
2487
  )
2300
2488
 
2301
2489
  return (
2302
2490
  result,
2303
2491
  "new_expression",
2304
- "Call to 'os.uname' recognized.",
2492
+ "Call to 'os.path.normpath' recognized.",
2305
2493
  )
2306
2494
 
2307
2495
 
2308
- hard_import_node_classes[ExpressionOsUnameRef] = os_uname_spec
2496
+ hard_import_node_classes[ExpressionOsPathNormpathRef] = os_path_normpath_spec
2309
2497
 
2310
2498
 
2311
- class ExpressionOsUnameCallBase(ExpressionBase):
2312
- """Base class for OsUnameCall
2499
+ class ExpressionOsPathNormpathCallBase(ChildHavingPathMixin, ExpressionBase):
2500
+ """Base class for OsPathNormpathCall
2313
2501
 
2314
2502
  Generated boiler plate code.
2315
2503
  """
2316
2504
 
2505
+ named_children = ("path",)
2506
+
2317
2507
  __slots__ = ("attempted",)
2318
2508
 
2319
- spec = os_uname_spec
2509
+ spec = os_path_normpath_spec
2320
2510
 
2321
- def __init__(self, source_ref):
2322
- ExpressionBase.__init__(self, source_ref)
2511
+ def __init__(self, path, source_ref):
2323
2512
 
2324
- # In module mode, we expect a changing environment, cannot optimize this
2325
- self.attempted = shallMakeModule()
2513
+ ChildHavingPathMixin.__init__(
2514
+ self,
2515
+ path=path,
2516
+ )
2326
2517
 
2327
- def finalize(self):
2328
- del self.parent
2518
+ ExpressionBase.__init__(self, source_ref)
2329
2519
 
2330
- def computeExpressionRaw(self, trace_collection):
2331
- if self.attempted:
2520
+ self.attempted = False
2521
+
2522
+ def computeExpression(self, trace_collection):
2523
+ if self.attempted or not os_path_normpath_spec.isCompileTimeComputable(
2524
+ (self.subnode_path,)
2525
+ ):
2526
+ trace_collection.onExceptionRaiseExit(BaseException)
2527
+
2528
+ return self, None, None
2529
+
2530
+ try:
2531
+ return self.replaceWithCompileTimeValue(trace_collection)
2532
+ finally:
2533
+ self.attempted = True
2534
+
2535
+ @abstractmethod
2536
+ def replaceWithCompileTimeValue(self, trace_collection):
2537
+ pass
2538
+
2539
+ @staticmethod
2540
+ def mayRaiseExceptionOperation():
2541
+ return True
2542
+
2543
+
2544
+ class ExpressionOsStatRef(ExpressionImportModuleNameHardExistsSpecificBase):
2545
+ """Function reference os.stat"""
2546
+
2547
+ kind = "EXPRESSION_OS_STAT_REF"
2548
+
2549
+ def __init__(self, source_ref):
2550
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
2551
+ self,
2552
+ module_name="os",
2553
+ import_name="stat",
2554
+ module_guaranteed=True,
2555
+ source_ref=source_ref,
2556
+ )
2557
+
2558
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
2559
+ # Anything may happen on call trace before this. On next pass, if
2560
+ # replaced, we might be better but not now.
2561
+ trace_collection.onExceptionRaiseExit(BaseException)
2562
+
2563
+ from .OsSysNodes import ExpressionOsStatCall
2564
+
2565
+ result = extractBuiltinArgs(
2566
+ node=call_node,
2567
+ builtin_class=ExpressionOsStatCall,
2568
+ builtin_spec=os_stat_spec,
2569
+ )
2570
+
2571
+ return (
2572
+ result,
2573
+ "new_expression",
2574
+ "Call to 'os.stat' recognized.",
2575
+ )
2576
+
2577
+
2578
+ hard_import_node_classes[ExpressionOsStatRef] = os_stat_spec
2579
+
2580
+
2581
+ class ExpressionOsStatCallBase(
2582
+ ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin, ExpressionBase
2583
+ ):
2584
+ """Base class for OsStatCall
2585
+
2586
+ Generated boiler plate code.
2587
+ """
2588
+
2589
+ named_children = (
2590
+ "path|optional",
2591
+ "dir_fd|optional",
2592
+ "follow_symlinks|optional",
2593
+ )
2594
+
2595
+ __slots__ = ("attempted",)
2596
+
2597
+ spec = os_stat_spec
2598
+
2599
+ def __init__(self, path, dir_fd, follow_symlinks, source_ref):
2600
+
2601
+ ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin.__init__(
2602
+ self,
2603
+ path=path,
2604
+ dir_fd=dir_fd,
2605
+ follow_symlinks=follow_symlinks,
2606
+ )
2607
+
2608
+ ExpressionBase.__init__(self, source_ref)
2609
+
2610
+ self.attempted = False
2611
+
2612
+ def computeExpression(self, trace_collection):
2613
+ if self.attempted or not os_stat_spec.isCompileTimeComputable(
2614
+ (self.subnode_path,)
2615
+ ):
2616
+ trace_collection.onExceptionRaiseExit(BaseException)
2617
+
2618
+ return self, None, None
2619
+
2620
+ try:
2621
+ return self.replaceWithCompileTimeValue(trace_collection)
2622
+ finally:
2623
+ self.attempted = True
2624
+
2625
+ @abstractmethod
2626
+ def replaceWithCompileTimeValue(self, trace_collection):
2627
+ pass
2628
+
2629
+ @staticmethod
2630
+ def mayRaiseExceptionOperation():
2631
+ return True
2632
+
2633
+
2634
+ class ExpressionOsUnameRef(ExpressionImportModuleNameHardExistsSpecificBase):
2635
+ """Function reference os.uname"""
2636
+
2637
+ kind = "EXPRESSION_OS_UNAME_REF"
2638
+
2639
+ def __init__(self, source_ref):
2640
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
2641
+ self,
2642
+ module_name="os",
2643
+ import_name="uname",
2644
+ module_guaranteed=True,
2645
+ source_ref=source_ref,
2646
+ )
2647
+
2648
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
2649
+ # Anything may happen on call trace before this. On next pass, if
2650
+ # replaced, we might be better but not now.
2651
+ trace_collection.onExceptionRaiseExit(BaseException)
2652
+
2653
+ from .OsSysNodes import ExpressionOsUnameCall
2654
+
2655
+ result = extractBuiltinArgs(
2656
+ node=call_node,
2657
+ builtin_class=ExpressionOsUnameCall,
2658
+ builtin_spec=os_uname_spec,
2659
+ )
2660
+
2661
+ return (
2662
+ result,
2663
+ "new_expression",
2664
+ "Call to 'os.uname' recognized.",
2665
+ )
2666
+
2667
+
2668
+ hard_import_node_classes[ExpressionOsUnameRef] = os_uname_spec
2669
+
2670
+
2671
+ class ExpressionOsUnameCallBase(ExpressionBase):
2672
+ """Base class for OsUnameCall
2673
+
2674
+ Generated boiler plate code.
2675
+ """
2676
+
2677
+ __slots__ = ("attempted",)
2678
+
2679
+ spec = os_uname_spec
2680
+
2681
+ def __init__(self, source_ref):
2682
+
2683
+ ExpressionBase.__init__(self, source_ref)
2684
+
2685
+ self.attempted = False
2686
+
2687
+ def finalize(self):
2688
+ del self.parent
2689
+
2690
+ def computeExpressionRaw(self, trace_collection):
2691
+ if self.attempted:
2332
2692
  trace_collection.onExceptionRaiseExit(BaseException)
2333
2693
 
2334
2694
  return self, None, None
@@ -2385,9 +2745,9 @@ class ExpressionPkgResourcesGetDistributionRef(
2385
2745
  )
2386
2746
 
2387
2747
 
2388
- hard_import_node_classes[
2389
- ExpressionPkgResourcesGetDistributionRef
2390
- ] = pkg_resources_get_distribution_spec
2748
+ hard_import_node_classes[ExpressionPkgResourcesGetDistributionRef] = (
2749
+ pkg_resources_get_distribution_spec
2750
+ )
2391
2751
 
2392
2752
 
2393
2753
  class ExpressionPkgResourcesGetDistributionCallBase(
@@ -2405,6 +2765,7 @@ class ExpressionPkgResourcesGetDistributionCallBase(
2405
2765
  spec = pkg_resources_get_distribution_spec
2406
2766
 
2407
2767
  def __init__(self, dist, source_ref):
2768
+
2408
2769
  ChildHavingDistMixin.__init__(
2409
2770
  self,
2410
2771
  dist=dist,
@@ -2478,9 +2839,9 @@ class ExpressionPkgResourcesIterEntryPointsRef(
2478
2839
  )
2479
2840
 
2480
2841
 
2481
- hard_import_node_classes[
2482
- ExpressionPkgResourcesIterEntryPointsRef
2483
- ] = pkg_resources_iter_entry_points_spec
2842
+ hard_import_node_classes[ExpressionPkgResourcesIterEntryPointsRef] = (
2843
+ pkg_resources_iter_entry_points_spec
2844
+ )
2484
2845
 
2485
2846
 
2486
2847
  class ExpressionPkgResourcesIterEntryPointsCallBase(
@@ -2501,6 +2862,7 @@ class ExpressionPkgResourcesIterEntryPointsCallBase(
2501
2862
  spec = pkg_resources_iter_entry_points_spec
2502
2863
 
2503
2864
  def __init__(self, group, name, source_ref):
2865
+
2504
2866
  ChildrenHavingGroupNameOptionalMixin.__init__(
2505
2867
  self,
2506
2868
  group=group,
@@ -2594,6 +2956,7 @@ class ExpressionPkgResourcesRequireCallBase(
2594
2956
  spec = pkg_resources_require_spec
2595
2957
 
2596
2958
  def __init__(self, requirements, source_ref):
2959
+
2597
2960
  ChildHavingRequirementsTupleMixin.__init__(
2598
2961
  self,
2599
2962
  requirements=requirements,
@@ -2664,9 +3027,9 @@ class ExpressionPkgResourcesResourceStreamRef(
2664
3027
  )
2665
3028
 
2666
3029
 
2667
- hard_import_node_classes[
2668
- ExpressionPkgResourcesResourceStreamRef
2669
- ] = pkg_resources_resource_stream_spec
3030
+ hard_import_node_classes[ExpressionPkgResourcesResourceStreamRef] = (
3031
+ pkg_resources_resource_stream_spec
3032
+ )
2670
3033
 
2671
3034
 
2672
3035
  class ExpressionPkgResourcesResourceStreamCallBase(
@@ -2687,6 +3050,7 @@ class ExpressionPkgResourcesResourceStreamCallBase(
2687
3050
  spec = pkg_resources_resource_stream_spec
2688
3051
 
2689
3052
  def __init__(self, package_or_requirement, resource_name, source_ref):
3053
+
2690
3054
  ChildrenHavingPackageOrRequirementResourceNameMixin.__init__(
2691
3055
  self,
2692
3056
  package_or_requirement=package_or_requirement,
@@ -2764,9 +3128,9 @@ class ExpressionPkgResourcesResourceStringRef(
2764
3128
  )
2765
3129
 
2766
3130
 
2767
- hard_import_node_classes[
2768
- ExpressionPkgResourcesResourceStringRef
2769
- ] = pkg_resources_resource_string_spec
3131
+ hard_import_node_classes[ExpressionPkgResourcesResourceStringRef] = (
3132
+ pkg_resources_resource_string_spec
3133
+ )
2770
3134
 
2771
3135
 
2772
3136
  class ExpressionPkgResourcesResourceStringCallBase(
@@ -2787,6 +3151,7 @@ class ExpressionPkgResourcesResourceStringCallBase(
2787
3151
  spec = pkg_resources_resource_string_spec
2788
3152
 
2789
3153
  def __init__(self, package_or_requirement, resource_name, source_ref):
3154
+
2790
3155
  ChildrenHavingPackageOrRequirementResourceNameMixin.__init__(
2791
3156
  self,
2792
3157
  package_or_requirement=package_or_requirement,
@@ -2881,6 +3246,7 @@ class ExpressionPkgutilGetDataCallBase(
2881
3246
  spec = pkgutil_get_data_spec
2882
3247
 
2883
3248
  def __init__(self, package, resource, source_ref):
3249
+
2884
3250
  ChildrenHavingPackageResourceMixin.__init__(
2885
3251
  self,
2886
3252
  package=package,
@@ -2889,8 +3255,7 @@ class ExpressionPkgutilGetDataCallBase(
2889
3255
 
2890
3256
  ExpressionBase.__init__(self, source_ref)
2891
3257
 
2892
- # In module mode, we expect a changing environment, cannot optimize this
2893
- self.attempted = shallMakeModule()
3258
+ self.attempted = False
2894
3259
 
2895
3260
  def computeExpression(self, trace_collection):
2896
3261
  if self.attempted or not pkgutil_get_data_spec.isCompileTimeComputable(
@@ -2915,3 +3280,236 @@ class ExpressionPkgutilGetDataCallBase(
2915
3280
  @staticmethod
2916
3281
  def mayRaiseExceptionOperation():
2917
3282
  return True
3283
+
3284
+
3285
+ class ExpressionSysExitRef(ExpressionImportModuleNameHardExistsSpecificBase):
3286
+ """Function reference sys.exit"""
3287
+
3288
+ kind = "EXPRESSION_SYS_EXIT_REF"
3289
+
3290
+ def __init__(self, source_ref):
3291
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
3292
+ self,
3293
+ module_name="sys",
3294
+ import_name="exit",
3295
+ module_guaranteed=True,
3296
+ source_ref=source_ref,
3297
+ )
3298
+
3299
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
3300
+ # Anything may happen on call trace before this. On next pass, if
3301
+ # replaced, we might be better but not now.
3302
+ trace_collection.onExceptionRaiseExit(BaseException)
3303
+
3304
+ from .OsSysNodes import makeExpressionSysExitCall
3305
+
3306
+ result = extractBuiltinArgs(
3307
+ node=call_node,
3308
+ builtin_class=makeExpressionSysExitCall,
3309
+ builtin_spec=sys_exit_spec,
3310
+ )
3311
+
3312
+ return (
3313
+ result,
3314
+ "new_expression",
3315
+ "Call to 'sys.exit' recognized.",
3316
+ )
3317
+
3318
+
3319
+ hard_import_node_classes[ExpressionSysExitRef] = sys_exit_spec
3320
+
3321
+
3322
+ class ExpressionSysExitCallBase(ChildHavingExitCodeOptionalMixin, ExpressionBase):
3323
+ """Base class for SysExitCall
3324
+
3325
+ Generated boiler plate code.
3326
+ """
3327
+
3328
+ named_children = ("exit_code|optional",)
3329
+
3330
+ __slots__ = ("attempted",)
3331
+
3332
+ spec = sys_exit_spec
3333
+
3334
+ def __init__(self, exit_code, source_ref):
3335
+
3336
+ ChildHavingExitCodeOptionalMixin.__init__(
3337
+ self,
3338
+ exit_code=exit_code,
3339
+ )
3340
+
3341
+ ExpressionBase.__init__(self, source_ref)
3342
+
3343
+ # In module mode, we expect a changing environment, cannot optimize this
3344
+ self.attempted = shallMakeModule()
3345
+
3346
+ def computeExpression(self, trace_collection):
3347
+ if self.attempted or not sys_exit_spec.isCompileTimeComputable(
3348
+ (self.subnode_exit_code,)
3349
+ ):
3350
+ trace_collection.onExceptionRaiseExit(BaseException)
3351
+
3352
+ return self, None, None
3353
+
3354
+ try:
3355
+ return self.replaceWithCompileTimeValue(trace_collection)
3356
+ finally:
3357
+ self.attempted = True
3358
+
3359
+ @abstractmethod
3360
+ def replaceWithCompileTimeValue(self, trace_collection):
3361
+ pass
3362
+
3363
+ @staticmethod
3364
+ def mayRaiseExceptionOperation():
3365
+ return True
3366
+
3367
+
3368
+ class ExpressionTensorflowFunctionRef(ExpressionImportModuleNameHardExistsSpecificBase):
3369
+ """Function reference tensorflow.function"""
3370
+
3371
+ kind = "EXPRESSION_TENSORFLOW_FUNCTION_REF"
3372
+
3373
+ def __init__(self, source_ref):
3374
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
3375
+ self,
3376
+ module_name="tensorflow",
3377
+ import_name="function",
3378
+ module_guaranteed=not shallMakeModule(),
3379
+ source_ref=source_ref,
3380
+ )
3381
+
3382
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
3383
+ # Anything may happen on call trace before this. On next pass, if
3384
+ # replaced, we might be better but not now.
3385
+ trace_collection.onExceptionRaiseExit(BaseException)
3386
+
3387
+ from .TensorflowNodes import ExpressionTensorflowFunctionCall
3388
+
3389
+ result = extractBuiltinArgs(
3390
+ node=call_node,
3391
+ builtin_class=ExpressionTensorflowFunctionCall,
3392
+ builtin_spec=tensorflow_function_spec,
3393
+ )
3394
+
3395
+ return (
3396
+ result,
3397
+ "new_expression",
3398
+ "Call to 'tensorflow.function' recognized.",
3399
+ )
3400
+
3401
+
3402
+ hard_import_node_classes[ExpressionTensorflowFunctionRef] = tensorflow_function_spec
3403
+
3404
+
3405
+ class ExpressionTensorflowFunctionCallBase(
3406
+ ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin,
3407
+ ExpressionBase,
3408
+ ):
3409
+ """Base class for TensorflowFunctionCall
3410
+
3411
+ Generated boiler plate code.
3412
+ """
3413
+
3414
+ named_children = (
3415
+ "func|optional",
3416
+ "input_signature|optional",
3417
+ "autograph|optional",
3418
+ "jit_compile|optional",
3419
+ "reduce_retracing|optional",
3420
+ "experimental_implements|optional",
3421
+ "experimental_autograph_options|optional",
3422
+ "experimental_attributes|optional",
3423
+ "experimental_relax_shapes|optional",
3424
+ "experimental_compile|optional",
3425
+ "experimental_follow_type_hints|optional",
3426
+ )
3427
+
3428
+ __slots__ = ("attempted",)
3429
+
3430
+ spec = tensorflow_function_spec
3431
+
3432
+ def __init__(
3433
+ self,
3434
+ func,
3435
+ input_signature,
3436
+ autograph,
3437
+ jit_compile,
3438
+ reduce_retracing,
3439
+ experimental_implements,
3440
+ experimental_autograph_options,
3441
+ experimental_attributes,
3442
+ experimental_relax_shapes,
3443
+ experimental_compile,
3444
+ experimental_follow_type_hints,
3445
+ source_ref,
3446
+ ):
3447
+
3448
+ ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin.__init__(
3449
+ self,
3450
+ func=func,
3451
+ input_signature=input_signature,
3452
+ autograph=autograph,
3453
+ jit_compile=jit_compile,
3454
+ reduce_retracing=reduce_retracing,
3455
+ experimental_implements=experimental_implements,
3456
+ experimental_autograph_options=experimental_autograph_options,
3457
+ experimental_attributes=experimental_attributes,
3458
+ experimental_relax_shapes=experimental_relax_shapes,
3459
+ experimental_compile=experimental_compile,
3460
+ experimental_follow_type_hints=experimental_follow_type_hints,
3461
+ )
3462
+
3463
+ ExpressionBase.__init__(self, source_ref)
3464
+
3465
+ # In module mode, we expect a changing environment, cannot optimize this
3466
+ self.attempted = shallMakeModule()
3467
+
3468
+ def computeExpression(self, trace_collection):
3469
+ if self.attempted or not tensorflow_function_spec.isCompileTimeComputable(
3470
+ (
3471
+ self.subnode_func,
3472
+ self.subnode_input_signature,
3473
+ self.subnode_autograph,
3474
+ self.subnode_jit_compile,
3475
+ self.subnode_reduce_retracing,
3476
+ self.subnode_experimental_implements,
3477
+ self.subnode_experimental_autograph_options,
3478
+ self.subnode_experimental_attributes,
3479
+ self.subnode_experimental_relax_shapes,
3480
+ self.subnode_experimental_compile,
3481
+ self.subnode_experimental_follow_type_hints,
3482
+ )
3483
+ ):
3484
+ trace_collection.onExceptionRaiseExit(BaseException)
3485
+
3486
+ return self, None, None
3487
+
3488
+ try:
3489
+ return self.replaceWithCompileTimeValue(trace_collection)
3490
+ finally:
3491
+ self.attempted = True
3492
+
3493
+ @abstractmethod
3494
+ def replaceWithCompileTimeValue(self, trace_collection):
3495
+ pass
3496
+
3497
+ @staticmethod
3498
+ def mayRaiseExceptionOperation():
3499
+ return True
3500
+
3501
+
3502
+ # Part of "Nuitka", an optimizing Python compiler that is compatible and
3503
+ # integrates with CPython, but also works on its own.
3504
+ #
3505
+ # Licensed under the Apache License, Version 2.0 (the "License");
3506
+ # you may not use this file except in compliance with the License.
3507
+ # You may obtain a copy of the License at
3508
+ #
3509
+ # http://www.apache.org/licenses/LICENSE-2.0
3510
+ #
3511
+ # Unless required by applicable law or agreed to in writing, software
3512
+ # distributed under the License is distributed on an "AS IS" BASIS,
3513
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3514
+ # See the License for the specific language governing permissions and
3515
+ # limitations under the License.