Nuitka-winsvc 2.1.5__cp311-cp311-win_amd64.whl → 2.2.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 (234) hide show
  1. {Nuitka_winsvc-2.1.5.dist-info → Nuitka_winsvc-2.2.1.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.1.5.dist-info → Nuitka_winsvc-2.2.1.dist-info}/RECORD +234 -225
  3. nuitka/Errors.py +4 -0
  4. nuitka/HardImportRegistry.py +18 -1
  5. nuitka/MainControl.py +27 -30
  6. nuitka/OptionParsing.py +32 -30
  7. nuitka/Options.py +26 -13
  8. nuitka/OutputDirectories.py +7 -4
  9. nuitka/PostProcessing.py +9 -7
  10. nuitka/Progress.py +3 -3
  11. nuitka/PythonVersions.py +2 -2
  12. nuitka/TreeXML.py +1 -1
  13. nuitka/Version.py +1 -1
  14. nuitka/build/Backend.scons +2 -1
  15. nuitka/build/DataComposerInterface.py +1 -0
  16. nuitka/build/Onefile.scons +2 -1
  17. nuitka/build/SconsCaching.py +64 -46
  18. nuitka/build/SconsCompilerSettings.py +19 -6
  19. nuitka/build/SconsHacks.py +0 -1
  20. nuitka/build/SconsInterface.py +84 -5
  21. nuitka/build/SconsProgress.py +0 -1
  22. nuitka/build/SconsUtils.py +9 -5
  23. nuitka/build/include/nuitka/allocator.h +8 -3
  24. nuitka/build/include/nuitka/compiled_cell.h +8 -0
  25. nuitka/build/include/nuitka/constants.h +2 -0
  26. nuitka/build/include/nuitka/exceptions.h +554 -179
  27. nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
  28. nuitka/build/include/nuitka/helper/import_hard.h +3 -0
  29. nuitka/build/include/nuitka/helper/ints.h +15 -2
  30. nuitka/build/include/nuitka/helper/lists.h +4 -1
  31. nuitka/build/include/nuitka/helper/raising.h +12 -0
  32. nuitka/build/include/nuitka/helper/tuples.h +5 -1
  33. nuitka/build/include/nuitka/helpers.h +5 -0
  34. nuitka/build/include/nuitka/importing.h +3 -4
  35. nuitka/build/include/nuitka/jit_sources.h +25 -0
  36. nuitka/build/include/nuitka/prelude.h +38 -11
  37. nuitka/build/include/nuitka/printing.h +3 -0
  38. nuitka/build/include/nuitka/threading.h +2 -6
  39. nuitka/build/include/nuitka/type_aliases.h +27 -0
  40. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
  41. nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -4
  42. nuitka/build/static_src/CompiledAsyncgenType.c +99 -114
  43. nuitka/build/static_src/CompiledCodeHelpers.c +24 -14
  44. nuitka/build/static_src/CompiledCoroutineType.c +96 -114
  45. nuitka/build/static_src/CompiledFrameType.c +14 -11
  46. nuitka/build/static_src/CompiledFunctionType.c +34 -7
  47. nuitka/build/static_src/CompiledGeneratorType.c +248 -142
  48. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +60 -70
  49. nuitka/build/static_src/CompiledMethodType.c +8 -7
  50. nuitka/build/static_src/HelpersAttributes.c +2 -19
  51. nuitka/build/static_src/HelpersBuiltin.c +2 -1
  52. nuitka/build/static_src/HelpersComparisonEq.c +32 -18
  53. nuitka/build/static_src/HelpersComparisonGe.c +50 -36
  54. nuitka/build/static_src/HelpersComparisonGt.c +50 -36
  55. nuitka/build/static_src/HelpersComparisonLe.c +50 -36
  56. nuitka/build/static_src/HelpersComparisonLt.c +50 -36
  57. nuitka/build/static_src/HelpersComparisonNe.c +32 -18
  58. nuitka/build/static_src/HelpersDeepcopy.c +6 -8
  59. nuitka/build/static_src/HelpersDictionaries.c +8 -3
  60. nuitka/build/static_src/HelpersExceptions.c +36 -22
  61. nuitka/build/static_src/HelpersFiles.c +9 -0
  62. nuitka/build/static_src/HelpersFilesystemPaths.c +7 -7
  63. nuitka/build/static_src/HelpersImportHard.c +15 -0
  64. nuitka/build/static_src/HelpersJitSources.c +46 -0
  65. nuitka/build/static_src/HelpersLists.c +40 -0
  66. nuitka/build/static_src/HelpersOperationBinaryAdd.c +66 -66
  67. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +80 -33
  68. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +16 -13
  69. nuitka/build/static_src/HelpersOperationBinarySub.c +39 -39
  70. nuitka/build/static_src/HelpersOperationInplaceAdd.c +54 -54
  71. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -1
  72. nuitka/build/static_src/HelpersOperationInplaceSub.c +50 -50
  73. nuitka/build/static_src/HelpersProfiling.c +3 -4
  74. nuitka/build/static_src/HelpersRaising.c +62 -1
  75. nuitka/build/static_src/HelpersStrings.c +203 -8
  76. nuitka/build/static_src/HelpersTypes.c +42 -0
  77. nuitka/build/static_src/MainProgram.c +1 -1
  78. nuitka/build/static_src/MetaPathBasedLoader.c +2 -1
  79. nuitka/build/static_src/OnefileBootstrap.c +3 -3
  80. nuitka/code_generation/BinaryOperationHelperDefinitions.py +5 -3
  81. nuitka/code_generation/BuiltinCodes.py +1 -0
  82. nuitka/code_generation/CodeGeneration.py +11 -0
  83. nuitka/code_generation/CodeHelpers.py +5 -3
  84. nuitka/code_generation/CodeObjectCodes.py +10 -6
  85. nuitka/code_generation/ComparisonCodes.py +19 -3
  86. nuitka/code_generation/ConstantCodes.py +5 -0
  87. nuitka/code_generation/Contexts.py +22 -6
  88. nuitka/code_generation/Emission.py +1 -0
  89. nuitka/code_generation/ErrorCodes.py +8 -16
  90. nuitka/code_generation/EvalCodes.py +5 -3
  91. nuitka/code_generation/ExceptionCodes.py +8 -1
  92. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +1 -0
  93. nuitka/code_generation/FrameCodes.py +5 -3
  94. nuitka/code_generation/FunctionCodes.py +0 -1
  95. nuitka/code_generation/GeneratorCodes.py +3 -3
  96. nuitka/code_generation/GlobalConstants.py +1 -2
  97. nuitka/code_generation/ImportCodes.py +2 -0
  98. nuitka/code_generation/JitCodes.py +44 -0
  99. nuitka/code_generation/ListCodes.py +11 -17
  100. nuitka/code_generation/MatchCodes.py +0 -1
  101. nuitka/code_generation/ModuleCodes.py +2 -1
  102. nuitka/code_generation/Namify.py +0 -1
  103. nuitka/code_generation/NetworkxCodes.py +51 -0
  104. nuitka/code_generation/OperationCodes.py +8 -6
  105. nuitka/code_generation/PackageResourceCodes.py +7 -5
  106. nuitka/code_generation/TensorflowCodes.py +54 -0
  107. nuitka/code_generation/TypeAliasCodes.py +71 -0
  108. nuitka/code_generation/VariableCodes.py +7 -5
  109. nuitka/code_generation/VariableDeclarations.py +1 -0
  110. nuitka/code_generation/c_types/CTypeCLongs.py +0 -1
  111. nuitka/code_generation/c_types/CTypeNuitkaInts.py +0 -1
  112. nuitka/code_generation/c_types/CTypeVoids.py +1 -0
  113. nuitka/code_generation/templates/CodeTemplatesConstants.py +15 -0
  114. nuitka/code_generation/templates/CodeTemplatesExceptions.py +1 -1
  115. nuitka/code_generation/templates/CodeTemplatesIterators.py +0 -1
  116. nuitka/code_generation/templates/CodeTemplatesLoader.py +0 -1
  117. nuitka/code_generation/templates/CodeTemplatesModules.py +4 -1
  118. nuitka/code_generation/templates/CodeTemplatesVariables.py +8 -8
  119. nuitka/code_generation/templates/TemplateDebugWrapper.py +0 -1
  120. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -0
  121. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +9 -7
  122. nuitka/containers/Namedtuples.py +0 -1
  123. nuitka/finalizations/Finalization.py +1 -0
  124. nuitka/finalizations/FinalizeMarkups.py +0 -1
  125. nuitka/freezer/DllDependenciesMacOS.py +60 -13
  126. nuitka/freezer/DllDependenciesPosix.py +0 -1
  127. nuitka/freezer/IncludedDataFiles.py +46 -15
  128. nuitka/freezer/IncludedEntryPoints.py +5 -3
  129. nuitka/freezer/Standalone.py +6 -1
  130. nuitka/importing/ImportCache.py +2 -2
  131. nuitka/importing/ImportResolving.py +80 -78
  132. nuitka/importing/Importing.py +34 -1
  133. nuitka/nodes/AttributeNodesGenerated.py +21 -6
  134. nuitka/nodes/BuiltinComplexNodes.py +1 -0
  135. nuitka/nodes/BuiltinFormatNodes.py +1 -0
  136. nuitka/nodes/BuiltinIteratorNodes.py +5 -3
  137. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +21 -6
  138. nuitka/nodes/BuiltinRefNodes.py +8 -1
  139. nuitka/nodes/BuiltinVarsNodes.py +0 -1
  140. nuitka/nodes/ChildrenHavingMixins.py +906 -186
  141. nuitka/nodes/CodeObjectSpecs.py +1 -1
  142. nuitka/nodes/ConstantRefNodes.py +38 -0
  143. nuitka/nodes/CtypesNodes.py +0 -1
  144. nuitka/nodes/DictionaryNodes.py +0 -1
  145. nuitka/nodes/ExceptionNodes.py +10 -0
  146. nuitka/nodes/ExpressionBases.py +15 -9
  147. nuitka/nodes/ExpressionBasesGenerated.py +32 -15
  148. nuitka/nodes/FunctionNodes.py +50 -5
  149. nuitka/nodes/HardImportNodesGenerated.py +245 -60
  150. nuitka/nodes/ImportHardNodes.py +27 -13
  151. nuitka/nodes/ImportNodes.py +90 -70
  152. nuitka/nodes/InjectCNodes.py +0 -1
  153. nuitka/nodes/ModuleNodes.py +10 -5
  154. nuitka/nodes/NetworkxNodes.py +45 -0
  155. nuitka/nodes/OperatorNodesUnary.py +1 -0
  156. nuitka/nodes/OsSysNodes.py +0 -1
  157. nuitka/nodes/PackageMetadataNodes.py +0 -1
  158. nuitka/nodes/PackageResourceNodes.py +10 -6
  159. nuitka/nodes/StatementBasesGenerated.py +107 -60
  160. nuitka/nodes/StringConcatenationNodes.py +1 -0
  161. nuitka/nodes/TensorflowNodes.py +38 -0
  162. nuitka/nodes/TypeNodes.py +21 -0
  163. nuitka/nodes/VariableRefNodes.py +1 -0
  164. nuitka/nodes/shapes/BuiltinTypeShapes.py +25 -15
  165. nuitka/optimizations/Optimization.py +7 -6
  166. nuitka/optimizations/OptimizeBuiltinCalls.py +11 -9
  167. nuitka/optimizations/Tags.py +0 -1
  168. nuitka/optimizations/TraceCollections.py +6 -55
  169. nuitka/optimizations/ValueTraces.py +49 -1
  170. nuitka/plugins/PluginBase.py +26 -4
  171. nuitka/plugins/Plugins.py +49 -12
  172. nuitka/plugins/standard/AntiBloatPlugin.py +12 -2
  173. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +0 -1
  174. nuitka/plugins/standard/DataFilesPlugin.py +2 -6
  175. nuitka/plugins/standard/DillPlugin.py +3 -3
  176. nuitka/plugins/standard/DllFilesPlugin.py +29 -23
  177. nuitka/plugins/standard/GiPlugin.py +1 -0
  178. nuitka/plugins/standard/ImplicitImports.py +9 -7
  179. nuitka/plugins/standard/MatplotlibPlugin.py +1 -0
  180. nuitka/plugins/standard/OptionsNannyPlugin.py +3 -7
  181. nuitka/plugins/standard/PkgResourcesPlugin.py +0 -1
  182. nuitka/plugins/standard/PmwPlugin.py +10 -9
  183. nuitka/plugins/standard/PySidePyQtPlugin.py +0 -28
  184. nuitka/plugins/standard/TensorflowPlugin.py +1 -0
  185. nuitka/plugins/standard/TorchPlugin.py +1 -0
  186. nuitka/plugins/standard/TrioPlugin.py +1 -0
  187. nuitka/plugins/standard/standard.nuitka-package.config.yml +242 -54
  188. nuitka/reports/CompilationReportReader.py +0 -1
  189. nuitka/reports/Reports.py +49 -5
  190. nuitka/specs/BuiltinParameterSpecs.py +10 -2
  191. nuitka/specs/BuiltinStrOperationSpecs.py +1 -1
  192. nuitka/specs/BuiltinTypeOperationSpecs.py +0 -1
  193. nuitka/specs/HardImportSpecs.py +34 -1
  194. nuitka/specs/ParameterSpecs.py +11 -9
  195. nuitka/tools/environments/Virtualenv.py +0 -1
  196. nuitka/tools/specialize/CTypeDescriptions.py +15 -11
  197. nuitka/tools/specialize/SpecializeC.py +11 -9
  198. nuitka/tools/specialize/SpecializePython.py +57 -30
  199. nuitka/tools/testing/Common.py +24 -7
  200. nuitka/tools/testing/OutputComparison.py +4 -0
  201. nuitka/tools/testing/Pythons.py +0 -1
  202. nuitka/tools/testing/compare_with_cpython/__main__.py +0 -4
  203. nuitka/tools/watch/GitHub.py +4 -1
  204. nuitka/tools/watch/__main__.py +22 -1
  205. nuitka/tree/Building.py +3 -0
  206. nuitka/tree/InternalModule.py +0 -1
  207. nuitka/tree/ReformulationAssertStatements.py +1 -0
  208. nuitka/tree/ReformulationAssignmentStatements.py +26 -3
  209. nuitka/tree/ReformulationClasses3.py +23 -26
  210. nuitka/tree/ReformulationContractionExpressions.py +5 -3
  211. nuitka/tree/ReformulationDictionaryCreation.py +6 -5
  212. nuitka/tree/ReformulationExecStatements.py +8 -6
  213. nuitka/tree/ReformulationFunctionStatements.py +10 -6
  214. nuitka/tree/SourceHandling.py +8 -0
  215. nuitka/tree/TreeHelpers.py +6 -3
  216. nuitka/utils/AppDirs.py +6 -2
  217. nuitka/utils/CStrings.py +1 -1
  218. nuitka/utils/CommandLineOptions.py +0 -1
  219. nuitka/utils/Distributions.py +3 -3
  220. nuitka/utils/Download.py +5 -1
  221. nuitka/utils/Execution.py +6 -3
  222. nuitka/utils/FileOperations.py +62 -35
  223. nuitka/utils/Importing.py +4 -4
  224. nuitka/utils/InstanceCounters.py +1 -0
  225. nuitka/utils/MacOSApp.py +1 -0
  226. nuitka/utils/Shebang.py +1 -0
  227. nuitka/utils/Utils.py +39 -1
  228. nuitka/utils/WindowsFileUsage.py +4 -3
  229. {Nuitka_winsvc-2.1.5.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka-run.bat +0 -0
  230. {Nuitka_winsvc-2.1.5.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka.bat +0 -0
  231. {Nuitka_winsvc-2.1.5.dist-info → Nuitka_winsvc-2.2.1.dist-info}/LICENSE.txt +0 -0
  232. {Nuitka_winsvc-2.1.5.dist-info → Nuitka_winsvc-2.2.1.dist-info}/WHEEL +0 -0
  233. {Nuitka_winsvc-2.1.5.dist-info → Nuitka_winsvc-2.2.1.dist-info}/entry_points.txt +0 -0
  234. {Nuitka_winsvc-2.1.5.dist-info → Nuitka_winsvc-2.2.1.dist-info}/top_level.txt +0 -0
@@ -2,18 +2,33 @@
2
2
 
3
3
 
4
4
  # We are not avoiding these in generated code at all
5
- # pylint: disable=I0021,too-many-lines
6
- # pylint: disable=I0021,line-too-long
7
- # pylint: disable=I0021,too-many-instance-attributes
8
- # 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
9
7
 
10
8
 
11
9
  """Children having statement bases
12
10
 
13
11
  WARNING, this code is GENERATED. Modify the template ChildrenHavingMixin.py.j2 instead!
14
12
 
15
- 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
16
- 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 buffering capitalize casefold
14
+ spell-checker: ignore center chars clear closefd copy count decode default delete dist
15
+ spell-checker: ignore distribution_name encode encoding end endswith errors exit_code
16
+ spell-checker: ignore expandtabs 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 file
19
+ spell-checker: ignore fillchar find format format_map formatmap fromkeys func get group
20
+ spell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha
21
+ spell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable
22
+ spell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys
23
+ spell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower
24
+ spell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener 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
17
32
  """
18
33
 
19
34
 
@@ -197,12 +212,16 @@ class StatementChildrenHavingConditionYesBranchOptionalStatementsOrNoneNoBranchO
197
212
 
198
213
  values = {
199
214
  "condition": self.subnode_condition.makeClone(),
200
- "yes_branch": self.subnode_yes_branch.makeClone()
201
- if self.subnode_yes_branch is not None
202
- else None,
203
- "no_branch": self.subnode_no_branch.makeClone()
204
- if self.subnode_no_branch is not None
205
- else None,
215
+ "yes_branch": (
216
+ self.subnode_yes_branch.makeClone()
217
+ if self.subnode_yes_branch is not None
218
+ else None
219
+ ),
220
+ "no_branch": (
221
+ self.subnode_no_branch.makeClone()
222
+ if self.subnode_no_branch is not None
223
+ else None
224
+ ),
206
225
  }
207
226
 
208
227
  values.update(self.getDetails())
@@ -291,9 +310,9 @@ class StatementChildHavingDestOptionalOperationMixin(StatementBase):
291
310
  """
292
311
 
293
312
  values = {
294
- "dest": self.subnode_dest.makeClone()
295
- if self.subnode_dest is not None
296
- else None,
313
+ "dest": (
314
+ self.subnode_dest.makeClone() if self.subnode_dest is not None else None
315
+ ),
297
316
  }
298
317
 
299
318
  values.update(self.getDetails())
@@ -408,9 +427,9 @@ class StatementChildrenHavingDestOptionalValueOperationMixin(StatementBase):
408
427
  """
409
428
 
410
429
  values = {
411
- "dest": self.subnode_dest.makeClone()
412
- if self.subnode_dest is not None
413
- else None,
430
+ "dest": (
431
+ self.subnode_dest.makeClone() if self.subnode_dest is not None else None
432
+ ),
414
433
  "value": self.subnode_value.makeClone(),
415
434
  }
416
435
 
@@ -789,15 +808,21 @@ class StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOp
789
808
 
790
809
  values = {
791
810
  "exception_type": self.subnode_exception_type.makeClone(),
792
- "exception_value": self.subnode_exception_value.makeClone()
793
- if self.subnode_exception_value is not None
794
- else None,
795
- "exception_trace": self.subnode_exception_trace.makeClone()
796
- if self.subnode_exception_trace is not None
797
- else None,
798
- "exception_cause": self.subnode_exception_cause.makeClone()
799
- if self.subnode_exception_cause is not None
800
- else None,
811
+ "exception_value": (
812
+ self.subnode_exception_value.makeClone()
813
+ if self.subnode_exception_value is not None
814
+ else None
815
+ ),
816
+ "exception_trace": (
817
+ self.subnode_exception_trace.makeClone()
818
+ if self.subnode_exception_trace is not None
819
+ else None
820
+ ),
821
+ "exception_cause": (
822
+ self.subnode_exception_cause.makeClone()
823
+ if self.subnode_exception_cause is not None
824
+ else None
825
+ ),
801
826
  }
802
827
 
803
828
  values.update(self.getDetails())
@@ -1107,12 +1132,16 @@ class StatementChildrenHavingExpressionLowerOptionalUpperOptionalMixin(Statement
1107
1132
 
1108
1133
  values = {
1109
1134
  "expression": self.subnode_expression.makeClone(),
1110
- "lower": self.subnode_lower.makeClone()
1111
- if self.subnode_lower is not None
1112
- else None,
1113
- "upper": self.subnode_upper.makeClone()
1114
- if self.subnode_upper is not None
1115
- else None,
1135
+ "lower": (
1136
+ self.subnode_lower.makeClone()
1137
+ if self.subnode_lower is not None
1138
+ else None
1139
+ ),
1140
+ "upper": (
1141
+ self.subnode_upper.makeClone()
1142
+ if self.subnode_upper is not None
1143
+ else None
1144
+ ),
1116
1145
  }
1117
1146
 
1118
1147
  values.update(self.getDetails())
@@ -1599,9 +1628,11 @@ class StatementChildHavingLoopBodyOptionalStatementsOrNonePostInitMixin(Statemen
1599
1628
  """
1600
1629
 
1601
1630
  values = {
1602
- "loop_body": self.subnode_loop_body.makeClone()
1603
- if self.subnode_loop_body is not None
1604
- else None,
1631
+ "loop_body": (
1632
+ self.subnode_loop_body.makeClone()
1633
+ if self.subnode_loop_body is not None
1634
+ else None
1635
+ ),
1605
1636
  }
1606
1637
 
1607
1638
  values.update(self.getDetails())
@@ -2452,12 +2483,16 @@ class StatementChildrenHavingSourceExpressionLowerOptionalUpperOptionalMixin(
2452
2483
  values = {
2453
2484
  "source": self.subnode_source.makeClone(),
2454
2485
  "expression": self.subnode_expression.makeClone(),
2455
- "lower": self.subnode_lower.makeClone()
2456
- if self.subnode_lower is not None
2457
- else None,
2458
- "upper": self.subnode_upper.makeClone()
2459
- if self.subnode_upper is not None
2460
- else None,
2486
+ "lower": (
2487
+ self.subnode_lower.makeClone()
2488
+ if self.subnode_lower is not None
2489
+ else None
2490
+ ),
2491
+ "upper": (
2492
+ self.subnode_upper.makeClone()
2493
+ if self.subnode_upper is not None
2494
+ else None
2495
+ ),
2461
2496
  }
2462
2497
 
2463
2498
  values.update(self.getDetails())
@@ -2719,12 +2754,16 @@ class StatementChildrenHavingSourceCodeGlobalsArgAutoNoneLocalsArgAutoNoneOperat
2719
2754
 
2720
2755
  values = {
2721
2756
  "source_code": self.subnode_source_code.makeClone(),
2722
- "globals_arg": self.subnode_globals_arg.makeClone()
2723
- if self.subnode_globals_arg is not None
2724
- else None,
2725
- "locals_arg": self.subnode_locals_arg.makeClone()
2726
- if self.subnode_locals_arg is not None
2727
- else None,
2757
+ "globals_arg": (
2758
+ self.subnode_globals_arg.makeClone()
2759
+ if self.subnode_globals_arg is not None
2760
+ else None
2761
+ ),
2762
+ "locals_arg": (
2763
+ self.subnode_locals_arg.makeClone()
2764
+ if self.subnode_locals_arg is not None
2765
+ else None
2766
+ ),
2728
2767
  }
2729
2768
 
2730
2769
  values.update(self.getDetails())
@@ -3171,18 +3210,26 @@ class StatementChildrenHavingTriedStatementsExceptHandlerOptionalStatementsOrNon
3171
3210
 
3172
3211
  values = {
3173
3212
  "tried": self.subnode_tried.makeClone(),
3174
- "except_handler": self.subnode_except_handler.makeClone()
3175
- if self.subnode_except_handler is not None
3176
- else None,
3177
- "break_handler": self.subnode_break_handler.makeClone()
3178
- if self.subnode_break_handler is not None
3179
- else None,
3180
- "continue_handler": self.subnode_continue_handler.makeClone()
3181
- if self.subnode_continue_handler is not None
3182
- else None,
3183
- "return_handler": self.subnode_return_handler.makeClone()
3184
- if self.subnode_return_handler is not None
3185
- else None,
3213
+ "except_handler": (
3214
+ self.subnode_except_handler.makeClone()
3215
+ if self.subnode_except_handler is not None
3216
+ else None
3217
+ ),
3218
+ "break_handler": (
3219
+ self.subnode_break_handler.makeClone()
3220
+ if self.subnode_break_handler is not None
3221
+ else None
3222
+ ),
3223
+ "continue_handler": (
3224
+ self.subnode_continue_handler.makeClone()
3225
+ if self.subnode_continue_handler is not None
3226
+ else None
3227
+ ),
3228
+ "return_handler": (
3229
+ self.subnode_return_handler.makeClone()
3230
+ if self.subnode_return_handler is not None
3231
+ else None
3232
+ ),
3186
3233
  }
3187
3234
 
3188
3235
  values.update(self.getDetails())
@@ -8,6 +8,7 @@ code alternative to actually looking up that method from the empty string
8
8
  object, so it got a dedicated node, also to perform optimizations specific
9
9
  to this.
10
10
  """
11
+
11
12
  from .ChildrenHavingMixins import ChildHavingValuesTupleMixin
12
13
  from .ConstantRefNodes import makeConstantRefNode
13
14
  from .ExpressionBases import ExpressionBase
@@ -0,0 +1,38 @@
1
+ # Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
3
+
4
+ """ Nodes that represent tensorflow functions
5
+
6
+ """
7
+
8
+ from nuitka.HardImportRegistry import addModuleDynamicHard
9
+
10
+ from .HardImportNodesGenerated import ExpressionTensorflowFunctionCallBase
11
+
12
+ addModuleDynamicHard(module_name="tensorflow")
13
+
14
+
15
+ class ExpressionTensorflowFunctionCall(ExpressionTensorflowFunctionCallBase):
16
+ kind = "EXPRESSION_TENSORFLOW_FUNCTION_CALL"
17
+
18
+ def replaceWithCompileTimeValue(self, trace_collection):
19
+ # TODO: The node generation should allow for this to not be necessary
20
+ trace_collection.onExceptionRaiseExit(BaseException)
21
+
22
+ return self, None, None
23
+
24
+
25
+ # Part of "Nuitka", an optimizing Python compiler that is compatible and
26
+ # integrates with CPython, but also works on its own.
27
+ #
28
+ # Licensed under the Apache License, Version 2.0 (the "License");
29
+ # you may not use this file except in compliance with the License.
30
+ # You may obtain a copy of the License at
31
+ #
32
+ # http://www.apache.org/licenses/LICENSE-2.0
33
+ #
34
+ # Unless required by applicable law or agreed to in writing, software
35
+ # distributed under the License is distributed on an "AS IS" BASIS,
36
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37
+ # See the License for the specific language governing permissions and
38
+ # limitations under the License.
nuitka/nodes/TypeNodes.py CHANGED
@@ -23,6 +23,7 @@ from .ChildrenHavingMixins import (
23
23
  ChildrenExpressionBuiltinSuper0Mixin,
24
24
  ChildrenExpressionBuiltinSuper1Mixin,
25
25
  ChildrenExpressionBuiltinSuper2Mixin,
26
+ ChildrenExpressionTypeAliasMixin,
26
27
  ChildrenHavingInstanceClassesMixin,
27
28
  )
28
29
  from .ExpressionBases import ExpressionBase, ExpressionBuiltinSingleArgBase
@@ -326,6 +327,26 @@ class ExpressionSubtypeCheck(
326
327
  return self, None, None
327
328
 
328
329
 
330
+ class ExpressionTypeAlias(ChildrenExpressionTypeAliasMixin, ExpressionBase):
331
+ kind = "EXPRESSION_TYPE_ALIAS"
332
+
333
+ named_children = ("type_params|tuple", "compute_value")
334
+
335
+ def __init__(self, type_params, compute_value, source_ref):
336
+ ChildrenExpressionTypeAliasMixin.__init__(
337
+ self, type_params=type_params, compute_value=compute_value
338
+ )
339
+
340
+ ExpressionBase.__init__(self, source_ref)
341
+
342
+ def computeExpression(self, trace_collection):
343
+ return self, None, None
344
+
345
+ @staticmethod
346
+ def mayRaiseExceptionOperation():
347
+ return False
348
+
349
+
329
350
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
330
351
  # integrates with CPython, but also works on its own.
331
352
  #
@@ -180,6 +180,7 @@ class ExpressionVariableRefBase(ExpressionBase):
180
180
  # Any code could be run, note that.
181
181
  trace_collection.onControlFlowEscape(in_node)
182
182
 
183
+ # TODO: Add "set" shape here as well.
183
184
  if self.variable_trace.hasShapeDictionaryExact():
184
185
  tags = "new_expression"
185
186
  message = """\
@@ -2240,9 +2240,11 @@ mod_shapes_bool.update(
2240
2240
  tshape_int_or_long: operation_result_zerodiv_intorlong,
2241
2241
  tshape_bool: operation_result_zerodiv_int,
2242
2242
  tshape_float: operation_result_zerodiv_float,
2243
- tshape_complex: operation_result_zerodiv_complex
2244
- if python_version < 0x300
2245
- else operation_result_unsupported_mod,
2243
+ tshape_complex: (
2244
+ operation_result_zerodiv_complex
2245
+ if python_version < 0x300
2246
+ else operation_result_unsupported_mod
2247
+ ),
2246
2248
  # Unsupported:
2247
2249
  tshape_str: operation_result_unsupported_mod,
2248
2250
  tshape_bytes: operation_result_unsupported_mod,
@@ -2577,9 +2579,11 @@ mod_shapes_int.update(
2577
2579
  tshape_int_or_long: operation_result_zerodiv_intorlong,
2578
2580
  tshape_bool: operation_result_zerodiv_int,
2579
2581
  tshape_float: operation_result_zerodiv_float,
2580
- tshape_complex: operation_result_zerodiv_complex
2581
- if python_version < 0x300
2582
- else operation_result_unsupported_mod,
2582
+ tshape_complex: (
2583
+ operation_result_zerodiv_complex
2584
+ if python_version < 0x300
2585
+ else operation_result_unsupported_mod
2586
+ ),
2583
2587
  # Unsupported:
2584
2588
  tshape_str: operation_result_unsupported_mod,
2585
2589
  tshape_bytes: operation_result_unsupported_mod,
@@ -2881,9 +2885,11 @@ mod_shapes_long.update(
2881
2885
  tshape_int_or_long: operation_result_zerodiv_long,
2882
2886
  tshape_bool: operation_result_zerodiv_long,
2883
2887
  tshape_float: operation_result_zerodiv_float,
2884
- tshape_complex: operation_result_zerodiv_complex
2885
- if python_version < 0x300
2886
- else operation_result_unsupported_mod,
2888
+ tshape_complex: (
2889
+ operation_result_zerodiv_complex
2890
+ if python_version < 0x300
2891
+ else operation_result_unsupported_mod
2892
+ ),
2887
2893
  # Unsupported:
2888
2894
  tshape_str: operation_result_unsupported_mod,
2889
2895
  tshape_bytes: operation_result_unsupported_mod,
@@ -3771,9 +3777,11 @@ add_shapes_str.update(
3771
3777
  # Sequence repeat is not allowed
3772
3778
  tshape_str: operation_result_str_noescape,
3773
3779
  tshape_bytes: operation_result_unsupported_add,
3774
- tshape_bytearray: operation_result_bytearray_noescape
3775
- if python_version < 0x300
3776
- else operation_result_unsupported_add,
3780
+ tshape_bytearray: (
3781
+ operation_result_bytearray_noescape
3782
+ if python_version < 0x300
3783
+ else operation_result_unsupported_add
3784
+ ),
3777
3785
  tshape_unicode: operation_result_unicode_noescape,
3778
3786
  tshape_tuple: operation_result_unsupported_add,
3779
3787
  tshape_list: operation_result_unsupported_add,
@@ -3961,9 +3969,11 @@ add_shapes_bytearray.update(
3961
3969
  tshape_bool: operation_result_unsupported_add,
3962
3970
  tshape_float: operation_result_unsupported_add,
3963
3971
  # Sequence repeat is not allowed
3964
- tshape_str: operation_result_bytearray_noescape
3965
- if python_version < 0x300
3966
- else operation_result_unsupported_add,
3972
+ tshape_str: (
3973
+ operation_result_bytearray_noescape
3974
+ if python_version < 0x300
3975
+ else operation_result_unsupported_add
3976
+ ),
3967
3977
  tshape_bytes: operation_result_bytearray_noescape,
3968
3978
  tshape_bytearray: operation_result_bytearray_noescape,
3969
3979
  tshape_unicode: operation_result_unsupported_add,
@@ -8,7 +8,6 @@ optimization is possible. Every successful optimization to anything might
8
8
  make others possible.
9
9
  """
10
10
 
11
-
12
11
  import inspect
13
12
 
14
13
  from nuitka import ModuleRegistry, Options, Variables
@@ -213,11 +212,13 @@ after that.""".format(
213
212
  reportMemoryUsage(
214
213
  "optimization/%d/%s" % (pass_count, current_module.getFullName()),
215
214
  (
216
- "Total memory usage before optimizing module '%s'"
217
- % current_module.getFullName()
218
- )
219
- if Options.isShowProgress() or Options.isShowMemory()
220
- else None,
215
+ (
216
+ "Total memory usage before optimizing module '%s'"
217
+ % current_module.getFullName()
218
+ )
219
+ if Options.isShowProgress() or Options.isShowMemory()
220
+ else None
221
+ ),
221
222
  )
222
223
 
223
224
 
@@ -1092,9 +1092,9 @@ def open_extractor(node):
1092
1092
 
1093
1093
  return BuiltinParameterSpecs.extractBuiltinArgs(
1094
1094
  node=node,
1095
- builtin_class=ExpressionBuiltinOpenP3
1096
- if str is not bytes
1097
- else ExpressionBuiltinOpenP2,
1095
+ builtin_class=(
1096
+ ExpressionBuiltinOpenP3 if str is not bytes else ExpressionBuiltinOpenP2
1097
+ ),
1098
1098
  builtin_spec=BuiltinParameterSpecs.builtin_open_spec,
1099
1099
  empty_special_class=makeOpen0,
1100
1100
  )
@@ -1132,9 +1132,9 @@ def super_extractor(node):
1132
1132
  ):
1133
1133
  return makeRaiseExceptionReplacementExpression(
1134
1134
  expression=node,
1135
- exception_type="SystemError"
1136
- if python_version < 0x331
1137
- else "RuntimeError",
1135
+ exception_type=(
1136
+ "SystemError" if python_version < 0x331 else "RuntimeError"
1137
+ ),
1138
1138
  exception_value="super(): __class__ cell not found",
1139
1139
  )
1140
1140
 
@@ -1172,9 +1172,11 @@ def super_extractor(node):
1172
1172
  if not object_arg.getVariable().isParameterVariable():
1173
1173
  return makeRaiseExceptionReplacementExpression(
1174
1174
  expression=node,
1175
- exception_type="SystemError"
1176
- if python_version < 0x300
1177
- else "RuntimeError",
1175
+ exception_type=(
1176
+ "SystemError"
1177
+ if python_version < 0x300
1178
+ else "RuntimeError"
1179
+ ),
1178
1180
  exception_value="super(): __class__ cell not found",
1179
1181
  )
1180
1182
 
@@ -9,7 +9,6 @@ tags to execute other steps.
9
9
 
10
10
  """
11
11
 
12
-
13
12
  allowed_tags = (
14
13
  # New code means new statements.
15
14
  # Could be an inlined exec statement.
@@ -17,8 +17,6 @@ from nuitka import Variables
17
17
  from nuitka.__past__ import iterItems # Python3 compatibility.
18
18
  from nuitka.containers.OrderedDicts import OrderedDict
19
19
  from nuitka.containers.OrderedSets import OrderedSet
20
- from nuitka.importing.Importing import locateModule, makeModuleUsageAttempt
21
- from nuitka.importing.Recursion import decideRecursion
22
20
  from nuitka.ModuleRegistry import addUsedModule
23
21
  from nuitka.nodes.NodeMakingHelpers import getComputationResult
24
22
  from nuitka.nodes.shapes.StandardShapes import tshape_uninitialized
@@ -949,6 +947,9 @@ class TraceCollectionBase(object):
949
947
  def onUsedFunction(self, function_body):
950
948
  return self.parent.onUsedFunction(function_body)
951
949
 
950
+ def onModuleUsageAttempts(self, module_usage_attempts):
951
+ self.parent.onModuleUsageAttempts(module_usage_attempts)
952
+
952
953
  def onModuleUsageAttempt(self, module_usage_attempt):
953
954
  self.parent.onModuleUsageAttempt(module_usage_attempt)
954
955
 
@@ -1133,60 +1134,10 @@ class TraceCollectionModule(CollectionStartPointMixin, TraceCollectionBase):
1133
1134
  def getModuleUsageAttempts(self):
1134
1135
  return self.module_usage_attempts
1135
1136
 
1136
- def onModuleUsageAttempt(self, module_usage_attempt):
1137
- if module_usage_attempt.finding != "not-found":
1138
- decision, _reason = decideRecursion(
1139
- using_module_name=self.owner.getFullName(),
1140
- module_name=module_usage_attempt.module_name,
1141
- module_filename=module_usage_attempt.filename,
1142
- module_kind=module_usage_attempt.module_kind,
1143
- )
1144
-
1145
- # When sub-package module import is rejected for whatever reason,
1146
- # still this implies an attempt of the parent, because nothing else
1147
- # will do it otherwise, it of course may also be rejected, but if it
1148
- # is not, otherwise it will be missing.
1149
- #
1150
- # A common case of this happening are extension modules in
1151
- # accelerated mode, for standalone this will of course be rare.
1152
- if decision is False:
1153
- parent_package_name = module_usage_attempt.module_name.getPackageName()
1154
-
1155
- if parent_package_name is not None:
1156
- (
1157
- package_module_name,
1158
- module_filename,
1159
- module_kind,
1160
- finding,
1161
- ) = locateModule(
1162
- module_name=parent_package_name,
1163
- parent_package=None,
1164
- level=0,
1165
- )
1166
-
1167
- # Should not be possible to happen.
1168
- assert finding != "not-found", package_module_name
1169
-
1170
- decision, _reason = decideRecursion(
1171
- using_module_name=self.owner.getFullName(),
1172
- module_name=package_module_name,
1173
- module_filename=module_filename,
1174
- module_kind=module_kind,
1175
- )
1176
-
1177
- if decision is True:
1178
- self.onModuleUsageAttempt(
1179
- makeModuleUsageAttempt(
1180
- module_name=package_module_name,
1181
- filename=module_filename,
1182
- finding=finding,
1183
- module_kind=module_kind,
1184
- level=0,
1185
- source_ref=module_usage_attempt.source_ref,
1186
- reason="parent import",
1187
- )
1188
- )
1137
+ def onModuleUsageAttempts(self, module_usage_attempts):
1138
+ self.module_usage_attempts.update(module_usage_attempts)
1189
1139
 
1140
+ def onModuleUsageAttempt(self, module_usage_attempt):
1190
1141
  self.module_usage_attempts.add(module_usage_attempt)
1191
1142
 
1192
1143
  def getUsedDistributions(self):
@@ -18,7 +18,15 @@ Values can be seen as:
18
18
  * LoopComplete (complete knowledge of loop types)
19
19
  """
20
20
 
21
- from nuitka.nodes.shapes.BuiltinTypeShapes import tshape_dict, tshape_tuple
21
+ from nuitka.nodes.shapes.BuiltinTypeShapes import (
22
+ tshape_bool,
23
+ tshape_bytes,
24
+ tshape_dict,
25
+ tshape_list,
26
+ tshape_str,
27
+ tshape_tuple,
28
+ tshape_unicode,
29
+ )
22
30
  from nuitka.nodes.shapes.ControlFlowDescriptions import (
23
31
  ControlFlowDescriptionElementBasedEscape,
24
32
  ControlFlowDescriptionFullEscape,
@@ -847,6 +855,46 @@ class ValueTraceLoopBase(ValueTraceMergeBase):
847
855
  self.recursion = False
848
856
  return True
849
857
 
858
+ def hasShapeListExact(self):
859
+ return self.type_shapes == _only_list_shape
860
+
861
+ def hasShapeDictionaryExact(self):
862
+ return self.type_shapes == _only_dict_shape
863
+
864
+ def hasShapeStrExact(self):
865
+ return self.type_shapes == _only_str_shape
866
+
867
+ def hasShapeUnicodeExact(self):
868
+ return self.type_shapes == _only_unicode_shape
869
+
870
+ if str is bytes:
871
+
872
+ def hasShapeStrOrUnicodeExact(self):
873
+ return (
874
+ self.hasShapeStrExact()
875
+ or self.hasShapeUnicodeExact()
876
+ or self.type_shapes == _str_plus_unicode_shape
877
+ )
878
+
879
+ else:
880
+
881
+ hasShapeStrOrUnicodeExact = hasShapeUnicodeExact
882
+
883
+ def hasShapeBytesExact(self):
884
+ return self.type_shapes == _only_bytes_shape
885
+
886
+ def hasShapeBoolExact(self):
887
+ return self.type_shapes == _only_bool_shape
888
+
889
+
890
+ _only_list_shape = frozenset((tshape_list,))
891
+ _only_dict_shape = frozenset((tshape_dict,))
892
+ _only_str_shape = frozenset((tshape_str,))
893
+ _only_unicode_shape = frozenset((tshape_unicode,))
894
+ _str_plus_unicode_shape = frozenset((tshape_unicode, tshape_str))
895
+ _only_bytes_shape = frozenset((tshape_bytes,))
896
+ _only_bool_shape = frozenset((tshape_bool,))
897
+
850
898
 
851
899
  class ValueTraceLoopComplete(ValueTraceLoopBase):
852
900
  __slots__ = ()