Nuitka-winsvc 2.1.6__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 (232) hide show
  1. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/RECORD +232 -223
  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 +8 -4
  23. nuitka/build/include/nuitka/allocator.h +8 -3
  24. nuitka/build/include/nuitka/compiled_cell.h +8 -0
  25. nuitka/build/include/nuitka/exceptions.h +554 -179
  26. nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
  27. nuitka/build/include/nuitka/helper/import_hard.h +3 -0
  28. nuitka/build/include/nuitka/helper/ints.h +15 -2
  29. nuitka/build/include/nuitka/helper/lists.h +4 -1
  30. nuitka/build/include/nuitka/helper/raising.h +12 -0
  31. nuitka/build/include/nuitka/helper/tuples.h +5 -1
  32. nuitka/build/include/nuitka/helpers.h +4 -0
  33. nuitka/build/include/nuitka/importing.h +3 -4
  34. nuitka/build/include/nuitka/jit_sources.h +25 -0
  35. nuitka/build/include/nuitka/prelude.h +38 -11
  36. nuitka/build/include/nuitka/printing.h +3 -0
  37. nuitka/build/include/nuitka/threading.h +2 -6
  38. nuitka/build/include/nuitka/type_aliases.h +27 -0
  39. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
  40. nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -4
  41. nuitka/build/static_src/CompiledAsyncgenType.c +99 -114
  42. nuitka/build/static_src/CompiledCodeHelpers.c +24 -14
  43. nuitka/build/static_src/CompiledCoroutineType.c +96 -114
  44. nuitka/build/static_src/CompiledFrameType.c +14 -11
  45. nuitka/build/static_src/CompiledFunctionType.c +34 -7
  46. nuitka/build/static_src/CompiledGeneratorType.c +248 -142
  47. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +60 -70
  48. nuitka/build/static_src/CompiledMethodType.c +8 -7
  49. nuitka/build/static_src/HelpersAttributes.c +2 -19
  50. nuitka/build/static_src/HelpersBuiltin.c +2 -1
  51. nuitka/build/static_src/HelpersComparisonEq.c +32 -18
  52. nuitka/build/static_src/HelpersComparisonGe.c +50 -36
  53. nuitka/build/static_src/HelpersComparisonGt.c +50 -36
  54. nuitka/build/static_src/HelpersComparisonLe.c +50 -36
  55. nuitka/build/static_src/HelpersComparisonLt.c +50 -36
  56. nuitka/build/static_src/HelpersComparisonNe.c +32 -18
  57. nuitka/build/static_src/HelpersDeepcopy.c +6 -8
  58. nuitka/build/static_src/HelpersDictionaries.c +8 -3
  59. nuitka/build/static_src/HelpersExceptions.c +36 -22
  60. nuitka/build/static_src/HelpersFilesystemPaths.c +7 -7
  61. nuitka/build/static_src/HelpersImportHard.c +15 -0
  62. nuitka/build/static_src/HelpersJitSources.c +46 -0
  63. nuitka/build/static_src/HelpersLists.c +40 -0
  64. nuitka/build/static_src/HelpersOperationBinaryAdd.c +66 -66
  65. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +80 -33
  66. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +16 -13
  67. nuitka/build/static_src/HelpersOperationBinarySub.c +39 -39
  68. nuitka/build/static_src/HelpersOperationInplaceAdd.c +54 -54
  69. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -1
  70. nuitka/build/static_src/HelpersOperationInplaceSub.c +50 -50
  71. nuitka/build/static_src/HelpersProfiling.c +3 -4
  72. nuitka/build/static_src/HelpersRaising.c +62 -1
  73. nuitka/build/static_src/HelpersStrings.c +203 -8
  74. nuitka/build/static_src/HelpersTypes.c +42 -0
  75. nuitka/build/static_src/MainProgram.c +1 -1
  76. nuitka/build/static_src/MetaPathBasedLoader.c +2 -1
  77. nuitka/build/static_src/OnefileBootstrap.c +3 -3
  78. nuitka/code_generation/BinaryOperationHelperDefinitions.py +5 -3
  79. nuitka/code_generation/BuiltinCodes.py +1 -0
  80. nuitka/code_generation/CodeGeneration.py +11 -0
  81. nuitka/code_generation/CodeHelpers.py +5 -3
  82. nuitka/code_generation/CodeObjectCodes.py +10 -6
  83. nuitka/code_generation/ComparisonCodes.py +19 -3
  84. nuitka/code_generation/ConstantCodes.py +5 -0
  85. nuitka/code_generation/Contexts.py +22 -6
  86. nuitka/code_generation/Emission.py +1 -0
  87. nuitka/code_generation/ErrorCodes.py +8 -16
  88. nuitka/code_generation/EvalCodes.py +5 -3
  89. nuitka/code_generation/ExceptionCodes.py +8 -1
  90. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +1 -0
  91. nuitka/code_generation/FrameCodes.py +5 -3
  92. nuitka/code_generation/FunctionCodes.py +0 -1
  93. nuitka/code_generation/GeneratorCodes.py +3 -3
  94. nuitka/code_generation/GlobalConstants.py +0 -2
  95. nuitka/code_generation/ImportCodes.py +2 -0
  96. nuitka/code_generation/JitCodes.py +44 -0
  97. nuitka/code_generation/ListCodes.py +11 -17
  98. nuitka/code_generation/MatchCodes.py +0 -1
  99. nuitka/code_generation/ModuleCodes.py +2 -1
  100. nuitka/code_generation/Namify.py +0 -1
  101. nuitka/code_generation/NetworkxCodes.py +51 -0
  102. nuitka/code_generation/OperationCodes.py +8 -6
  103. nuitka/code_generation/PackageResourceCodes.py +7 -5
  104. nuitka/code_generation/TensorflowCodes.py +54 -0
  105. nuitka/code_generation/TypeAliasCodes.py +71 -0
  106. nuitka/code_generation/VariableCodes.py +7 -5
  107. nuitka/code_generation/VariableDeclarations.py +1 -0
  108. nuitka/code_generation/c_types/CTypeCLongs.py +0 -1
  109. nuitka/code_generation/c_types/CTypeNuitkaInts.py +0 -1
  110. nuitka/code_generation/c_types/CTypeVoids.py +1 -0
  111. nuitka/code_generation/templates/CodeTemplatesConstants.py +14 -0
  112. nuitka/code_generation/templates/CodeTemplatesExceptions.py +1 -1
  113. nuitka/code_generation/templates/CodeTemplatesIterators.py +0 -1
  114. nuitka/code_generation/templates/CodeTemplatesLoader.py +0 -1
  115. nuitka/code_generation/templates/CodeTemplatesModules.py +4 -1
  116. nuitka/code_generation/templates/CodeTemplatesVariables.py +8 -8
  117. nuitka/code_generation/templates/TemplateDebugWrapper.py +0 -1
  118. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -0
  119. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +9 -7
  120. nuitka/containers/Namedtuples.py +0 -1
  121. nuitka/finalizations/Finalization.py +1 -0
  122. nuitka/finalizations/FinalizeMarkups.py +0 -1
  123. nuitka/freezer/DllDependenciesMacOS.py +60 -13
  124. nuitka/freezer/DllDependenciesPosix.py +0 -1
  125. nuitka/freezer/IncludedDataFiles.py +46 -15
  126. nuitka/freezer/IncludedEntryPoints.py +5 -3
  127. nuitka/freezer/Standalone.py +6 -1
  128. nuitka/importing/ImportCache.py +2 -2
  129. nuitka/importing/ImportResolving.py +80 -78
  130. nuitka/importing/Importing.py +34 -1
  131. nuitka/nodes/AttributeNodesGenerated.py +21 -6
  132. nuitka/nodes/BuiltinComplexNodes.py +1 -0
  133. nuitka/nodes/BuiltinFormatNodes.py +1 -0
  134. nuitka/nodes/BuiltinIteratorNodes.py +5 -3
  135. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +21 -6
  136. nuitka/nodes/BuiltinRefNodes.py +8 -1
  137. nuitka/nodes/BuiltinVarsNodes.py +0 -1
  138. nuitka/nodes/ChildrenHavingMixins.py +906 -186
  139. nuitka/nodes/CodeObjectSpecs.py +1 -1
  140. nuitka/nodes/ConstantRefNodes.py +38 -0
  141. nuitka/nodes/CtypesNodes.py +0 -1
  142. nuitka/nodes/DictionaryNodes.py +0 -1
  143. nuitka/nodes/ExceptionNodes.py +10 -0
  144. nuitka/nodes/ExpressionBases.py +15 -9
  145. nuitka/nodes/ExpressionBasesGenerated.py +32 -15
  146. nuitka/nodes/FunctionNodes.py +50 -5
  147. nuitka/nodes/HardImportNodesGenerated.py +245 -60
  148. nuitka/nodes/ImportHardNodes.py +27 -13
  149. nuitka/nodes/ImportNodes.py +90 -70
  150. nuitka/nodes/InjectCNodes.py +0 -1
  151. nuitka/nodes/ModuleNodes.py +10 -5
  152. nuitka/nodes/NetworkxNodes.py +45 -0
  153. nuitka/nodes/OperatorNodesUnary.py +1 -0
  154. nuitka/nodes/OsSysNodes.py +0 -1
  155. nuitka/nodes/PackageMetadataNodes.py +0 -1
  156. nuitka/nodes/PackageResourceNodes.py +10 -6
  157. nuitka/nodes/StatementBasesGenerated.py +107 -60
  158. nuitka/nodes/StringConcatenationNodes.py +1 -0
  159. nuitka/nodes/TensorflowNodes.py +38 -0
  160. nuitka/nodes/TypeNodes.py +21 -0
  161. nuitka/nodes/VariableRefNodes.py +1 -0
  162. nuitka/nodes/shapes/BuiltinTypeShapes.py +25 -15
  163. nuitka/optimizations/Optimization.py +7 -6
  164. nuitka/optimizations/OptimizeBuiltinCalls.py +11 -9
  165. nuitka/optimizations/Tags.py +0 -1
  166. nuitka/optimizations/TraceCollections.py +6 -55
  167. nuitka/optimizations/ValueTraces.py +49 -1
  168. nuitka/plugins/PluginBase.py +26 -4
  169. nuitka/plugins/Plugins.py +49 -12
  170. nuitka/plugins/standard/AntiBloatPlugin.py +12 -2
  171. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +0 -1
  172. nuitka/plugins/standard/DataFilesPlugin.py +2 -6
  173. nuitka/plugins/standard/DillPlugin.py +3 -3
  174. nuitka/plugins/standard/DllFilesPlugin.py +29 -23
  175. nuitka/plugins/standard/GiPlugin.py +1 -0
  176. nuitka/plugins/standard/ImplicitImports.py +8 -7
  177. nuitka/plugins/standard/MatplotlibPlugin.py +1 -0
  178. nuitka/plugins/standard/OptionsNannyPlugin.py +3 -7
  179. nuitka/plugins/standard/PkgResourcesPlugin.py +0 -1
  180. nuitka/plugins/standard/PmwPlugin.py +10 -9
  181. nuitka/plugins/standard/PySidePyQtPlugin.py +0 -28
  182. nuitka/plugins/standard/TensorflowPlugin.py +1 -0
  183. nuitka/plugins/standard/TorchPlugin.py +1 -0
  184. nuitka/plugins/standard/TrioPlugin.py +1 -0
  185. nuitka/plugins/standard/standard.nuitka-package.config.yml +242 -34
  186. nuitka/reports/CompilationReportReader.py +0 -1
  187. nuitka/reports/Reports.py +49 -5
  188. nuitka/specs/BuiltinParameterSpecs.py +10 -2
  189. nuitka/specs/BuiltinStrOperationSpecs.py +1 -1
  190. nuitka/specs/BuiltinTypeOperationSpecs.py +0 -1
  191. nuitka/specs/HardImportSpecs.py +34 -1
  192. nuitka/specs/ParameterSpecs.py +11 -9
  193. nuitka/tools/environments/Virtualenv.py +0 -1
  194. nuitka/tools/specialize/CTypeDescriptions.py +15 -11
  195. nuitka/tools/specialize/SpecializeC.py +11 -9
  196. nuitka/tools/specialize/SpecializePython.py +57 -30
  197. nuitka/tools/testing/Common.py +24 -7
  198. nuitka/tools/testing/OutputComparison.py +4 -0
  199. nuitka/tools/testing/Pythons.py +0 -1
  200. nuitka/tools/testing/compare_with_cpython/__main__.py +0 -4
  201. nuitka/tools/watch/GitHub.py +4 -1
  202. nuitka/tools/watch/__main__.py +22 -1
  203. nuitka/tree/Building.py +3 -0
  204. nuitka/tree/InternalModule.py +0 -1
  205. nuitka/tree/ReformulationAssertStatements.py +1 -0
  206. nuitka/tree/ReformulationAssignmentStatements.py +26 -3
  207. nuitka/tree/ReformulationClasses3.py +23 -26
  208. nuitka/tree/ReformulationContractionExpressions.py +5 -3
  209. nuitka/tree/ReformulationDictionaryCreation.py +6 -5
  210. nuitka/tree/ReformulationExecStatements.py +8 -6
  211. nuitka/tree/ReformulationFunctionStatements.py +10 -6
  212. nuitka/tree/SourceHandling.py +8 -0
  213. nuitka/tree/TreeHelpers.py +6 -3
  214. nuitka/utils/AppDirs.py +6 -2
  215. nuitka/utils/CStrings.py +1 -1
  216. nuitka/utils/CommandLineOptions.py +0 -1
  217. nuitka/utils/Distributions.py +3 -3
  218. nuitka/utils/Download.py +5 -1
  219. nuitka/utils/Execution.py +6 -3
  220. nuitka/utils/FileOperations.py +61 -34
  221. nuitka/utils/Importing.py +4 -4
  222. nuitka/utils/InstanceCounters.py +1 -0
  223. nuitka/utils/MacOSApp.py +1 -0
  224. nuitka/utils/Shebang.py +1 -0
  225. nuitka/utils/Utils.py +39 -1
  226. nuitka/utils/WindowsFileUsage.py +4 -3
  227. {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka-run.bat +0 -0
  228. {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka.bat +0 -0
  229. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/LICENSE.txt +0 -0
  230. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/WHEEL +0 -0
  231. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/entry_points.txt +0 -0
  232. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/top_level.txt +0 -0
@@ -136,12 +136,12 @@ class ParameterSpec(object):
136
136
  "ps_normal_args": ",".join(self.normal_args),
137
137
  "ps_pos_only_args": self.pos_only_args,
138
138
  "ps_kw_only_args": ",".join(self.kw_only_args),
139
- "ps_list_star_arg": self.list_star_arg
140
- if self.list_star_arg is not None
141
- else "",
142
- "ps_dict_star_arg": self.dict_star_arg
143
- if self.dict_star_arg is not None
144
- else "",
139
+ "ps_list_star_arg": (
140
+ self.list_star_arg if self.list_star_arg is not None else ""
141
+ ),
142
+ "ps_dict_star_arg": (
143
+ self.dict_star_arg if self.dict_star_arg is not None else ""
144
+ ),
145
145
  "ps_default_count": self.default_count,
146
146
  "type_shape": self.type_shape,
147
147
  }
@@ -556,9 +556,11 @@ def matchCall(
556
556
  "%s expected %s%s, got %d"
557
557
  % (
558
558
  func_name,
559
- ("at least " if python_version < 0x300 else "")
560
- if num_defaults > 0
561
- else "exactly ",
559
+ (
560
+ ("at least " if python_version < 0x300 else "")
561
+ if num_defaults > 0
562
+ else "exactly "
563
+ ),
562
564
  "%d arguments" % num_required,
563
565
  num_total,
564
566
  )
@@ -5,7 +5,6 @@
5
5
 
6
6
  """
7
7
 
8
-
9
8
  import os
10
9
  import sys
11
10
  from contextlib import contextmanager
@@ -275,9 +275,11 @@ class TypeDescBase(getMetaClassBase("Type", require_slots=False)):
275
275
  if self is object_desc or other is object_desc:
276
276
  return "%s == %s" % (
277
277
  self.getTypeValueExpression(None) if self is not object_desc else type1,
278
- other.getTypeValueExpression(None)
279
- if other is not object_desc
280
- else type2,
278
+ (
279
+ other.getTypeValueExpression(None)
280
+ if other is not object_desc
281
+ else type2
282
+ ),
281
283
  )
282
284
  elif self is other:
283
285
  return "1"
@@ -288,9 +290,11 @@ class TypeDescBase(getMetaClassBase("Type", require_slots=False)):
288
290
  if self is object_desc or other is object_desc:
289
291
  return "%s != %s" % (
290
292
  self.getTypeValueExpression(None) if self is not object_desc else type1,
291
- other.getTypeValueExpression(None)
292
- if other is not object_desc
293
- else type2,
293
+ (
294
+ other.getTypeValueExpression(None)
295
+ if other is not object_desc
296
+ else type2
297
+ ),
294
298
  )
295
299
  elif self is other:
296
300
  return "0"
@@ -1372,23 +1376,23 @@ class LongDesc(ConcreteNonSequenceTypeBase):
1372
1376
 
1373
1377
  @staticmethod
1374
1378
  def getLongValueSizeExpression(operand):
1375
- return "Py_SIZE(%s_long_object)" % operand
1379
+ return "Nuitka_LongGetSignedDigitSize(%s_long_object)" % operand
1376
1380
 
1377
1381
  @staticmethod
1378
1382
  def getLongValueIsNegativeTestExpression(operand):
1379
- return "Py_SIZE(%s_long_object) < 0" % operand
1383
+ return "Nuitka_LongIsNegative(%s_long_object)" % operand
1380
1384
 
1381
1385
  @staticmethod
1382
1386
  def getLongValueDigitCountExpression(operand):
1383
- return "Py_ABS(Py_SIZE(%s_long_object))" % operand
1387
+ return "Nuitka_LongGetDigitSize(%s_long_object)" % operand
1384
1388
 
1385
1389
  @staticmethod
1386
1390
  def getLongValueDigitExpression(operand, index):
1387
- return "%s_long_object->ob_digit[%s]" % (operand, index)
1391
+ return "Nuitka_LongGetDigitPointer(%s_long_object)[%s]" % (operand, index)
1388
1392
 
1389
1393
  @staticmethod
1390
1394
  def getLongValueDigitsPointerExpression(operand):
1391
- return "%s_long_object->ob_digit" % operand
1395
+ return "Nuitka_LongGetDigitPointer(%s_long_object)" % operand
1392
1396
 
1393
1397
  @staticmethod
1394
1398
  def getLongValueMediumValueExpression(operand):
@@ -360,9 +360,9 @@ def makeHelperOperations(
360
360
  op_code=op_code,
361
361
  operator=operator,
362
362
  nb_slot=_getNbSlotFromOperand(operator, op_code),
363
- nb_inplace_slot=_getNbInplaceSlotFromOperand(operator, op_code)
364
- if inplace
365
- else None,
363
+ nb_inplace_slot=(
364
+ _getNbInplaceSlotFromOperand(operator, op_code) if inplace else None
365
+ ),
366
366
  sq_slot=sq_slot,
367
367
  sq_inplace_slot=sq_inplace_slot,
368
368
  object_desc=object_desc,
@@ -1232,15 +1232,17 @@ def makeHelperBuiltinTypeMethods():
1232
1232
  builtin_type=type_desc,
1233
1233
  builtin_arg_name=type_desc.type_name,
1234
1234
  method_name=method_name,
1235
- api_suffix=str(arg_count + 1)
1236
- if len(arg_counts) > 1
1237
- else "",
1235
+ api_suffix=(
1236
+ str(arg_count + 1) if len(arg_counts) > 1 else ""
1237
+ ),
1238
1238
  arg_names=variant_args,
1239
1239
  arg_types=[object_desc] * len(variant_args),
1240
1240
  formatArgumentDeclaration=formatArgumentDeclaration,
1241
- extra_check=_getCheckForShape(result_shape)
1242
- if result_shape is not None
1243
- else None,
1241
+ extra_check=(
1242
+ _getCheckForShape(result_shape)
1243
+ if result_shape is not None
1244
+ else None
1245
+ ),
1244
1246
  zip=zip,
1245
1247
  len=len,
1246
1248
  name=template.name,
@@ -12,15 +12,18 @@ nuitka.Options.is_full_compat = False
12
12
 
13
13
  # isort:start
14
14
 
15
+ import textwrap
15
16
  from collections import namedtuple
16
17
 
17
18
  import nuitka.code_generation.BinaryOperationHelperDefinitions
18
19
  import nuitka.code_generation.CodeGeneration
19
20
  import nuitka.code_generation.ComparisonCodes
20
21
  import nuitka.code_generation.Namify
22
+ import nuitka.nodes.NetworkxNodes
21
23
  import nuitka.nodes.PackageMetadataNodes
22
24
  import nuitka.nodes.PackageResourceNodes
23
25
  import nuitka.nodes.SideEffectNodes
26
+ import nuitka.nodes.TensorflowNodes
24
27
  import nuitka.specs.BuiltinBytesOperationSpecs
25
28
  import nuitka.specs.BuiltinDictOperationSpecs
26
29
  import nuitka.specs.BuiltinListOperationSpecs
@@ -248,20 +251,35 @@ lambda source_ref: wrapExpressionWithNodeSideEffects(
248
251
 
249
252
 
250
253
  def emitGenerationWarning(emit, doc_string, template_name):
251
- attribute_code_names = set(attribute_information.keys())
252
- attribute_code_names = set(
254
+ generate_names = set()
255
+
256
+ generate_names.update(attribute_information.keys())
257
+ generate_names.update(
253
258
  attribute_name.replace("_", "") for attribute_name in attribute_information
254
259
  )
255
260
 
256
- attribute_arg_names = set(sum(attribute_shape_args.values(), ()))
261
+ generate_names.update(sum(attribute_shape_args.values(), ()))
262
+
263
+ for spec_descriptions in getSpecVersions(nuitka.specs.HardImportSpecs):
264
+ spec = spec_descriptions[0][2]
265
+ generate_names.update(spec.getArgumentNames())
266
+
267
+ ignores = textwrap.fill(
268
+ " ".join(sorted(generate_names)),
269
+ width=90,
270
+ initial_indent="spell-checker: ignore ",
271
+ subsequent_indent="spell-checker: ignore ",
272
+ break_on_hyphens=False,
273
+ break_long_words=False,
274
+ expand_tabs=False,
275
+ replace_whitespace=False,
276
+ )
257
277
 
258
278
  emit(
259
279
  """
260
280
  # We are not avoiding these in generated code at all
261
- # pylint: disable=I0021,too-many-lines
262
- # pylint: disable=I0021,line-too-long
263
- # pylint: disable=I0021,too-many-instance-attributes
264
- # pylint: disable=I0021,too-many-return-statements
281
+ # pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines
282
+ # pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements
265
283
  """
266
284
  )
267
285
 
@@ -271,17 +289,11 @@ def emitGenerationWarning(emit, doc_string, template_name):
271
289
 
272
290
  WARNING, this code is GENERATED. Modify the template %s instead!
273
291
 
274
- spell-checker: ignore %s
275
- spell-checker: ignore %s
292
+ %s
276
293
  """
277
294
 
278
295
  '''
279
- % (
280
- doc_string,
281
- template_name,
282
- " ".join(sorted(attribute_code_names)),
283
- " ".join(sorted(attribute_arg_names)),
284
- )
296
+ % (doc_string, template_name, ignores)
285
297
  )
286
298
 
287
299
 
@@ -450,6 +462,8 @@ def makeCodeCased(value):
450
462
 
451
463
 
452
464
  def getCallModuleName(module_name, function_name):
465
+ # return driven, pylint: disable=too-many-return-statements
466
+
453
467
  if module_name in ("pkg_resources", "importlib.metadata", "importlib_metadata"):
454
468
  if function_name in ("resource_stream", "resource_string"):
455
469
  return "PackageResourceNodes"
@@ -465,6 +479,12 @@ def getCallModuleName(module_name, function_name):
465
479
  if function_name == "open":
466
480
  return "BuiltinOpenNodes"
467
481
 
482
+ if module_name == "tensorflow":
483
+ return "TensorflowNodes"
484
+
485
+ if module_name.startswith("networkx"):
486
+ return "NetworkxNodes"
487
+
468
488
  assert False, (module_name, function_name)
469
489
 
470
490
 
@@ -616,14 +636,14 @@ def _parseNamedChildrenSpec(named_children):
616
636
  named_children_checkers[named_child] = "convertNoneConstantToNone"
617
637
  elif named_child_property == "auto_none_empty_str":
618
638
  named_children_types[named_child] = "optional"
619
- named_children_checkers[
620
- named_child
621
- ] = "convertEmptyStrConstantToNone"
639
+ named_children_checkers[named_child] = (
640
+ "convertEmptyStrConstantToNone"
641
+ )
622
642
  elif named_child_property == "statements_or_none":
623
643
  named_children_types[named_child] = "optional"
624
- named_children_checkers[
625
- named_child
626
- ] = "checkStatementsSequenceOrNone"
644
+ named_children_checkers[named_child] = (
645
+ "checkStatementsSequenceOrNone"
646
+ )
627
647
  elif named_child_property == "statements":
628
648
  named_children_checkers[named_child] = "checkStatementsSequence"
629
649
  elif named_child_property == "optional":
@@ -712,15 +732,15 @@ def addFromNodes():
712
732
  _addFromNode(node_class)
713
733
 
714
734
  # Fake factories:
715
- node_factory_translations[
716
- "ExpressionImportlibMetadataMetadataCall"
717
- ] = "makeExpressionImportlibMetadataMetadataCall"
718
- node_factory_translations[
719
- "ExpressionImportlibMetadataBackportMetadataCall"
720
- ] = "makeExpressionImportlibMetadataBackportMetadataCall"
721
- node_factory_translations[
722
- "ExpressionBuiltinsOpenCall"
723
- ] = "makeExpressionBuiltinsOpenCall"
735
+ node_factory_translations["ExpressionImportlibMetadataMetadataCall"] = (
736
+ "makeExpressionImportlibMetadataMetadataCall"
737
+ )
738
+ node_factory_translations["ExpressionImportlibMetadataBackportMetadataCall"] = (
739
+ "makeExpressionImportlibMetadataBackportMetadataCall"
740
+ )
741
+ node_factory_translations["ExpressionBuiltinsOpenCall"] = (
742
+ "makeExpressionBuiltinsOpenCall"
743
+ )
724
744
  node_factory_translations["ExpressionSysExitCall"] = "makeExpressionSysExitCall"
725
745
 
726
746
 
@@ -1024,9 +1044,16 @@ hard_import_node_classes = {}
1024
1044
  assert optional_name not in named_children_types
1025
1045
  named_children_types[optional_name] = "optional"
1026
1046
 
1047
+ if spec.getStarListArgumentName():
1048
+ named_children_types[spec.getStarListArgumentName()] = "tuple"
1049
+
1027
1050
  if spec.getStarDictArgumentName():
1028
1051
  named_children_types[spec.getStarDictArgumentName()] = "tuple"
1029
1052
 
1053
+ for kw_only_name in spec.getKwOnlyParameterNames():
1054
+ assert kw_only_name not in named_children_types
1055
+ named_children_types[kw_only_name] = "optional"
1056
+
1030
1057
  if parameter_names:
1031
1058
  mixin_name = addChildrenMixin(
1032
1059
  True,
@@ -309,6 +309,10 @@ def decideFilenameVersionSkip(filename):
309
309
  if filename.endswith("_37.py") and _python_version >= (3, 8):
310
310
  return False
311
311
 
312
+ # Skip tests that require Python 3.11 at maximum.
313
+ if filename.endswith("_311.py") and _python_version >= (3, 8):
314
+ return False
315
+
312
316
  # Skip tests that require Python 3.2 at least.
313
317
  if filename.endswith("32.py") and _python_version < (3, 2):
314
318
  return False
@@ -349,6 +353,10 @@ def decideFilenameVersionSkip(filename):
349
353
  if filename.endswith("311.py") and _python_version < (3, 11):
350
354
  return False
351
355
 
356
+ # Skip tests that require Python 3.12 at least.
357
+ if filename.endswith("312.py") and _python_version < (3, 12):
358
+ return False
359
+
352
360
  return True
353
361
 
354
362
 
@@ -702,7 +710,7 @@ def checkReferenceCount(checked_function, max_rounds=20, explain=False):
702
710
  my_print("extra:", m1[key], key)
703
711
  elif m1[key] != m2[key]:
704
712
  my_print("*" * 80)
705
- my_print(m1[key], "->", m2[key], key)
713
+ my_print(m1[key], "->", m2[key], repr(key))
706
714
  else:
707
715
  pass
708
716
 
@@ -805,9 +813,9 @@ Defaults to off.""",
805
813
  assert False
806
814
  elif mode == "coverage":
807
815
  return SearchModeCoverage(
808
- start_at=options.pattern.replace("/", os.path.sep)
809
- if options.pattern
810
- else None
816
+ start_at=(
817
+ options.pattern.replace("/", os.path.sep) if options.pattern else None
818
+ )
811
819
  )
812
820
  else:
813
821
  test_logger.sysexit("Error, using unknown search mode %r" % mode)
@@ -825,7 +833,7 @@ def executeReferenceChecked(
825
833
  ):
826
834
  gc.disable()
827
835
 
828
- extract_number = lambda name: int(name.replace(prefix, ""))
836
+ extract_number = lambda name: int(name.replace(prefix, "") or "0")
829
837
 
830
838
  # Find the function names.
831
839
  matching_names = tuple(
@@ -941,7 +949,8 @@ def withExtendedExtraOptions(*args):
941
949
 
942
950
  def indentedCode(codes, count):
943
951
  """Indent code, used for generating test codes."""
944
- return "\n".join(" " * count + line if line else "" for line in codes)
952
+ indent = " " * count
953
+ return "\n".join(indent + line if line else "" for line in codes)
945
954
 
946
955
 
947
956
  def convertToPython(doctests, line_filter=None):
@@ -1601,7 +1610,14 @@ def checkLoadedFileAccesses(loaded_filenames, current_dir):
1601
1610
  # Loading from home directories is OK too.
1602
1611
  if any(
1603
1612
  isFilenameSameAsOrBelowPath(path, loaded_filename)
1604
- for path in ("/home", "/data", "/root", "/Users", "/Library/Preferences")
1613
+ for path in (
1614
+ "/home",
1615
+ "/data",
1616
+ "/root",
1617
+ "/Users",
1618
+ "/Library/Preferences",
1619
+ "/agent", # Azure
1620
+ )
1605
1621
  ):
1606
1622
  continue
1607
1623
 
@@ -1768,6 +1784,7 @@ def checkLoadedFileAccesses(loaded_filenames, current_dir):
1768
1784
  "/AppleInternal",
1769
1785
  "/System/Volumes/Preboot",
1770
1786
  "/usr/lib/system/",
1787
+ "/usr/libexec/swift",
1771
1788
  ):
1772
1789
  if isFilenameSameAsOrBelowPath(ignored_dir, loaded_filename):
1773
1790
  ignore = False
@@ -64,6 +64,8 @@ syntax_error_caret_re = re.compile(r"^\s*~*\^*~*$")
64
64
 
65
65
  timing_re = re.compile(r"in [0-9]+.[0-9][0-9](s| seconds)")
66
66
 
67
+ did_you_mean_re = re.compile(r"\. Did you mean: '.*?'\?")
68
+
67
69
 
68
70
  def makeDiffable(output, ignore_warnings, syntax_errors):
69
71
  # Of course many cases to deal with,
@@ -177,6 +179,8 @@ def makeDiffable(output, ignore_warnings, syntax_errors):
177
179
 
178
180
  line = tempfile_re.sub(r"/tmp/tmpxxxxxxx", line)
179
181
 
182
+ line = did_you_mean_re.sub("", line)
183
+
180
184
  # This is a bug potentially, occurs only for CPython when re-directed,
181
185
  # we are going to ignore the issue as Nuitka is fine.
182
186
  if (
@@ -3,7 +3,6 @@
3
3
 
4
4
  """ Test tool to run a program with various Pythons. """
5
5
 
6
-
7
6
  from nuitka.PythonVersions import getSupportedPythonVersions
8
7
  from nuitka.utils.Execution import check_output
9
8
  from nuitka.utils.InstalledPythons import findPythons
@@ -220,7 +220,6 @@ def main():
220
220
  coverage_mode = hasArg("coverage")
221
221
  two_step_execution = hasArg("two_step_execution")
222
222
  binary_python_path = hasArg("binary_python_path")
223
- keep_python_path = hasArg("keep_python_path")
224
223
  trace_command = (
225
224
  hasArg("trace_command") or os.getenv("NUITKA_TRACE_COMMANDS", "0") != "0"
226
225
  )
@@ -477,9 +476,6 @@ Taking coverage of '{filename}' using '{python}' with flags {args} ...""".format
477
476
  if binary_python_path:
478
477
  addToPythonPath(os.path.dirname(os.path.abspath(filename)))
479
478
 
480
- if (keep_python_path or binary_python_path) and not coverage_mode:
481
- extra_options.append("--execute-with-pythonpath")
482
-
483
479
  if report:
484
480
  extra_options.append("--report=%s" % report)
485
481
  deleteFile(report, must_exist=False)
@@ -17,7 +17,10 @@ from nuitka.utils.Execution import callProcess, check_call
17
17
 
18
18
  def checkInNuitkaWatch():
19
19
  remote_url = getRemoteURL("origin")
20
- assert remote_url == "git@github.com:Nuitka/Nuitka-Watch.git", remote_url
20
+ assert remote_url in (
21
+ "git@github.com:Nuitka/Nuitka-Watch.git",
22
+ "https://github.com/Nuitka/Nuitka-Watch",
23
+ ), remote_url
21
24
  branch_name = getCurrentBranchName()
22
25
  assert branch_name == "main", branch_name
23
26
  assert os.path.exists(".git")
@@ -467,9 +467,12 @@ def _updateCase(
467
467
  def updateCase(case_dir, case_data, dry_run, no_pipenv_update, nuitka_update_mode):
468
468
  case_name = case_data["case"]
469
469
 
470
+ watch_logger.info("Consider '%s' ... " % case_name)
471
+
470
472
  # Wrong OS maybe.
471
473
  os_name = selectOS(case_data["os"])
472
474
  if os_name is None:
475
+ watch_logger.info(" ... not on this OS")
473
476
  return
474
477
 
475
478
  nuitka_min_version = case_data.get("nuitka")
@@ -478,6 +481,20 @@ def updateCase(case_dir, case_data, dry_run, no_pipenv_update, nuitka_update_mod
478
481
  if nuitka_min_version is not None and _compareNuitkaVersions(
479
482
  nuitka_version, nuitka_min_version, consider_rc=False
480
483
  ):
484
+ watch_logger.info(" ... not for this Nuitka version")
485
+ return
486
+
487
+ selected_pythons = tuple(
488
+ selectPythons(
489
+ # TODO: Enable Anaconda support through options/detection.
490
+ anaconda="Anaconda" in os_name,
491
+ msys2_mingw64="MSYS2" in os_name,
492
+ python_version_req=case_data.get("python_version_req"),
493
+ )
494
+ )
495
+
496
+ if not selected_pythons:
497
+ watch_logger.info(" ... no suitable Python installations")
481
498
  return
482
499
 
483
500
  # For all relevant Pythons applicable to this case.
@@ -590,8 +607,12 @@ PR to create. Default not making a PR.""",
590
607
 
591
608
  assert len(positional_args) <= 1, positional_args
592
609
 
593
- if positional_args and os.path.isdir(positional_args[0]):
610
+ if positional_args:
594
611
  base_dir = positional_args[0]
612
+
613
+ if not os.path.isdir(base_dir):
614
+ watch_logger.sysexit("Error, '%s' is not a directory" % base_dir)
615
+
595
616
  else:
596
617
  base_dir = os.getcwd()
597
618
 
nuitka/tree/Building.py CHANGED
@@ -34,6 +34,7 @@ special attribute lookups for "__enter__" and "__exit__", calls of them,
34
34
  catching and passing in exceptions raised.
35
35
 
36
36
  """
37
+
37
38
  import marshal
38
39
  import os
39
40
 
@@ -139,6 +140,7 @@ from .ReformulationAssignmentStatements import (
139
140
  buildDeleteNode,
140
141
  buildInplaceAssignNode,
141
142
  buildNamedExprNode,
143
+ buildTypeAliasNode,
142
144
  )
143
145
  from .ReformulationBooleanExpressions import buildBoolOpNode
144
146
  from .ReformulationCallExpressions import buildCallNode
@@ -762,6 +764,7 @@ setBuildingDispatchers(
762
764
  "NamedExpr": buildNamedExprNode,
763
765
  "Slice": buildSliceNode,
764
766
  "Match": buildMatchNode,
767
+ "TypeAlias": buildTypeAliasNode,
765
768
  },
766
769
  path_args2={
767
770
  "Constant": buildNamedConstantNode, # Python3.8
@@ -11,7 +11,6 @@ TODO: Clarify by renaming that the top module is now used, and these are
11
11
  merely helpers to do it.
12
12
  """
13
13
 
14
-
15
14
  from nuitka.ModuleRegistry import getRootTopModule
16
15
  from nuitka.nodes.FunctionNodes import (
17
16
  ExpressionFunctionPureBody,
@@ -7,6 +7,7 @@ Consult the Developer Manual for information. TODO: Add ability to sync
7
7
  source code comments with Developer Manual sections.
8
8
 
9
9
  """
10
+
10
11
  from nuitka.nodes.BuiltinRefNodes import ExpressionBuiltinExceptionRef
11
12
  from nuitka.nodes.ConditionalNodes import makeStatementConditional
12
13
  from nuitka.nodes.ContainerMakingNodes import makeExpressionMakeTuple
@@ -53,6 +53,7 @@ from nuitka.nodes.SubscriptNodes import (
53
53
  StatementAssignmentSubscript,
54
54
  StatementDelSubscript,
55
55
  )
56
+ from nuitka.nodes.TypeNodes import ExpressionTypeAlias
56
57
  from nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable
57
58
  from nuitka.nodes.VariableDelNodes import makeStatementDelVariable
58
59
  from nuitka.nodes.VariableNameNodes import (
@@ -76,6 +77,7 @@ from .SyntaxErrors import raiseSyntaxError
76
77
  from .TreeHelpers import (
77
78
  buildAnnotationNode,
78
79
  buildNode,
80
+ buildNodeTuple,
79
81
  getKind,
80
82
  makeStatementsSequence,
81
83
  makeStatementsSequenceFromStatement,
@@ -214,9 +216,11 @@ def buildAssignmentStatementsFromDecoded(provider, kind, detail, source, source_
214
216
  if element[0] == "Starred":
215
217
  if starred_index is not None:
216
218
  raiseSyntaxError(
217
- "two starred expressions in assignment"
218
- if python_version < 0x390
219
- else "multiple starred expressions in assignment",
219
+ (
220
+ "two starred expressions in assignment"
221
+ if python_version < 0x390
222
+ else "multiple starred expressions in assignment"
223
+ ),
220
224
  source_ref.atColumnNumber(0),
221
225
  )
222
226
 
@@ -1247,6 +1251,25 @@ def buildNamedExprNode(provider, node, source_ref):
1247
1251
  return outline_body
1248
1252
 
1249
1253
 
1254
+ def buildTypeAliasNode(provider, node, source_ref):
1255
+ """Python3.12 or higher, type alias statements."""
1256
+
1257
+ assert not node.type_params, node.type_params
1258
+ type_alias_node = ExpressionTypeAlias(
1259
+ type_params=buildNodeTuple(provider, node.type_params, source_ref),
1260
+ compute_value=buildNode(provider, node.value, source_ref),
1261
+ source_ref=source_ref,
1262
+ )
1263
+
1264
+ # TODO: A specialized assignment statement might be in order
1265
+ return StatementAssignmentVariableName(
1266
+ provider=provider,
1267
+ variable_name=mangleName(node.name.id, provider),
1268
+ source=type_alias_node,
1269
+ source_ref=source_ref,
1270
+ )
1271
+
1272
+
1250
1273
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
1251
1274
  # integrates with CPython, but also works on its own.
1252
1275
  #