Nuitka-winsvc 2.1.6__cp311-cp311-win_amd64.whl → 2.2.2__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.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.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 +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 +23 -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 +42 -28
  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 +9 -4
  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/DllDependenciesWin32.py +2 -1
  126. nuitka/freezer/IncludedDataFiles.py +46 -15
  127. nuitka/freezer/IncludedEntryPoints.py +5 -3
  128. nuitka/freezer/Standalone.py +6 -1
  129. nuitka/importing/ImportCache.py +2 -2
  130. nuitka/importing/ImportResolving.py +80 -78
  131. nuitka/importing/Importing.py +34 -1
  132. nuitka/nodes/AttributeNodesGenerated.py +21 -6
  133. nuitka/nodes/BuiltinComplexNodes.py +1 -0
  134. nuitka/nodes/BuiltinFormatNodes.py +1 -0
  135. nuitka/nodes/BuiltinIteratorNodes.py +5 -3
  136. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +21 -6
  137. nuitka/nodes/BuiltinRefNodes.py +8 -1
  138. nuitka/nodes/BuiltinVarsNodes.py +0 -1
  139. nuitka/nodes/ChildrenHavingMixins.py +906 -186
  140. nuitka/nodes/CodeObjectSpecs.py +1 -1
  141. nuitka/nodes/ConditionalNodes.py +2 -6
  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 +92 -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 +8 -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 +249 -34
  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 +61 -34
  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.6.data → Nuitka_winsvc-2.2.2.data}/scripts/nuitka-run.bat +0 -0
  230. {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.2.data}/scripts/nuitka.bat +0 -0
  231. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/LICENSE.txt +0 -0
  232. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/WHEEL +0 -0
  233. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/entry_points.txt +0 -0
  234. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/top_level.txt +0 -0
nuitka/Errors.py CHANGED
@@ -69,6 +69,10 @@ class NuitkaForbiddenDLLEncounter(Exception):
69
69
  """This DLL is not allowed to be included."""
70
70
 
71
71
 
72
+ class NuitkaSyntaxError(Exception):
73
+ """The code cannot be read due to SyntaxError"""
74
+
75
+
72
76
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
73
77
  # integrates with CPython, but also works on its own.
74
78
  #
@@ -63,6 +63,10 @@ hard_modules_non_stdlib = set(
63
63
  "pkg_resources",
64
64
  "importlib_metadata",
65
65
  "importlib_resources",
66
+ "tensorflow",
67
+ # TODO: Disabled for now, keyword only arguments and star list argument
68
+ # are having ordering issues for call matching and code generation.
69
+ # "networkx.utils.decorators",
66
70
  )
67
71
  )
68
72
 
@@ -109,7 +113,15 @@ def isHardModule(module_name):
109
113
 
110
114
 
111
115
  # These modules can cause issues if imported during compile time.
112
- hard_modules_trust_with_side_effects = set(["site"])
116
+ hard_modules_trust_with_side_effects = set(
117
+ [
118
+ "site",
119
+ "tensorflow",
120
+ # TODO: Disabled for now, keyword only arguments and star list argument are
121
+ # having ordering issues for call matching and code generation.
122
+ # "networkx.utils.decorators"
123
+ ]
124
+ )
113
125
  if not isWin32Windows():
114
126
  # Crashing on anything but Windows.
115
127
  hard_modules_trust_with_side_effects.add("ctypes.wintypes")
@@ -264,6 +276,10 @@ hard_modules_trust = {
264
276
  "ctypes.wintypes": {},
265
277
  "ctypes.macholib": {},
266
278
  "builtins": module_builtins_trust,
279
+ "tensorflow": {"function": trust_node},
280
+ # TODO: Disabled for now, keyword only arguments and star list argument are
281
+ # having ordering issues for call matching and code generation.
282
+ # "networkx.utils.decorators": {"argmap": trust_node},
267
283
  }
268
284
 
269
285
 
@@ -329,6 +345,7 @@ def addModuleDynamicHard(module_name):
329
345
  hard_modules.add(module_name)
330
346
  hard_modules_dynamic.add(module_name)
331
347
  hard_modules_non_stdlib.add(module_name)
348
+ hard_modules_trust_with_side_effects.add(module_name)
332
349
 
333
350
  if module_name not in hard_modules_trust:
334
351
  hard_modules_trust[module_name] = {}
nuitka/MainControl.py CHANGED
@@ -279,7 +279,7 @@ def dumpTreeXML():
279
279
  filename = Options.getXMLDumpOutputFilename()
280
280
 
281
281
  if filename is not None:
282
- with openTextFile(filename, "w") as output_file:
282
+ with openTextFile(filename, "wb") as output_file:
283
283
  # XML output only.
284
284
  for module in ModuleRegistry.getDoneModules():
285
285
  dumpTreeXMLToFile(tree=module.asXml(), output_file=output_file)
@@ -759,12 +759,7 @@ def runSconsBackend():
759
759
  return result
760
760
 
761
761
 
762
- def callExecPython(args, clean_path, add_path):
763
- old_python_path = os.getenv("PYTHONPATH")
764
-
765
- if clean_path and old_python_path is not None:
766
- os.environ["PYTHONPATH"] = ""
767
-
762
+ def callExecPython(args, add_path):
768
763
  if add_path:
769
764
  if "PYTHONPATH" in os.environ:
770
765
  os.environ["PYTHONPATH"] += ":" + Options.getOutputDir()
@@ -777,17 +772,17 @@ def callExecPython(args, clean_path, add_path):
777
772
  callExecProcess(args)
778
773
 
779
774
 
780
- def executeMain(binary_filename, clean_path):
775
+ def _executeMain(binary_filename):
781
776
  # Wrap in debugger, unless the CMD file contains that call already.
782
777
  if Options.shallRunInDebugger() and not Options.shallCreateCmdFileForExecution():
783
778
  args = wrapCommandForDebuggerForExec(binary_filename)
784
779
  else:
785
780
  args = (binary_filename, binary_filename)
786
781
 
787
- callExecPython(clean_path=clean_path, add_path=False, args=args)
782
+ callExecPython(add_path=False, args=args)
788
783
 
789
784
 
790
- def executeModule(tree, clean_path):
785
+ def _executeModule(tree):
791
786
  """Execute the extension module just created."""
792
787
 
793
788
  if python_version < 0x340:
@@ -829,7 +824,7 @@ import sys; sys.path.insert(0, %(output_dir)r)
829
824
  else:
830
825
  args = (sys.executable, "python", "-c", python_command)
831
826
 
832
- callExecPython(clean_path=clean_path, add_path=True, args=args)
827
+ callExecPython(add_path=True, args=args)
833
828
 
834
829
 
835
830
  def compileTree():
@@ -842,9 +837,11 @@ def compileTree():
842
837
 
843
838
  reportMemoryUsage(
844
839
  "before_c_code_generation",
845
- "Total memory usage before generating C code:"
846
- if Options.isShowProgress() or Options.isShowMemory()
847
- else None,
840
+ (
841
+ "Total memory usage before generating C code:"
842
+ if Options.isShowProgress() or Options.isShowMemory()
843
+ else None
844
+ ),
848
845
  )
849
846
 
850
847
  # Now build the target language code for the whole tree.
@@ -870,9 +867,11 @@ def compileTree():
870
867
 
871
868
  reportMemoryUsage(
872
869
  "before_running_scons",
873
- "Total memory usage before running scons"
874
- if Options.isShowProgress() or Options.isShowMemory()
875
- else None,
870
+ (
871
+ "Total memory usage before running scons"
872
+ if Options.isShowProgress() or Options.isShowMemory()
873
+ else None
874
+ ),
876
875
  )
877
876
 
878
877
  if Options.isShowMemory():
@@ -953,9 +952,11 @@ def _main():
953
952
 
954
953
  reportMemoryUsage(
955
954
  "after_launch",
956
- "Total memory usage before processing:"
957
- if Options.isShowProgress() or Options.isShowMemory()
958
- else None,
955
+ (
956
+ "Total memory usage before processing:"
957
+ if Options.isShowProgress() or Options.isShowMemory()
958
+ else None
959
+ ),
959
960
  )
960
961
 
961
962
  # Initialize the importing layer from options, main filenames, debugging
@@ -1004,8 +1005,6 @@ def _main():
1004
1005
 
1005
1006
  executePostProcessing()
1006
1007
 
1007
- copyDataFiles()
1008
-
1009
1008
  if Options.isStandaloneMode():
1010
1009
  binary_filename = scons_options["result_exe"]
1011
1010
 
@@ -1026,6 +1025,10 @@ def _main():
1026
1025
  standalone_entry_points=getStandaloneEntryPoints(),
1027
1026
  )
1028
1027
 
1028
+ copyDataFiles(standalone_entry_points=getStandaloneEntryPoints())
1029
+
1030
+ if Options.isStandaloneMode():
1031
+
1029
1032
  Plugins.onStandaloneDistributionFinished(dist_dir)
1030
1033
 
1031
1034
  if Options.isOnefileMode():
@@ -1105,15 +1108,9 @@ not use compiled code while it exists."""
1105
1108
  general.info("Launching '%s'." % run_filename)
1106
1109
 
1107
1110
  if Options.shallMakeModule():
1108
- executeModule(
1109
- tree=main_module,
1110
- clean_path=Options.shallClearPythonPathEnvironment(),
1111
- )
1111
+ _executeModule(tree=main_module)
1112
1112
  else:
1113
- executeMain(
1114
- binary_filename=run_filename,
1115
- clean_path=Options.shallClearPythonPathEnvironment(),
1116
- )
1113
+ _executeMain(run_filename)
1117
1114
  else:
1118
1115
  if run_filename != final_filename:
1119
1116
  general.info(
nuitka/OptionParsing.py CHANGED
@@ -577,18 +577,6 @@ Execute inside a debugger, e.g. "gdb" or "lldb" to automatically get a stack tra
577
577
  Defaults to off.""",
578
578
  )
579
579
 
580
- execute_group.add_option(
581
- "--execute-with-pythonpath",
582
- action="store_true",
583
- dest="keep_pythonpath",
584
- default=False,
585
- help="""\
586
- When immediately executing the created binary or module using '--run',
587
- don't reset 'PYTHONPATH' environment. When all modules are successfully
588
- included, you ought to not need PYTHONPATH anymore, and definitely not
589
- for standalone mode.""",
590
- )
591
-
592
580
  del execute_group
593
581
 
594
582
 
@@ -738,7 +726,19 @@ Keep deployment mode, but disable selectively parts of it. Errors from
738
726
  deployment mode will output these identifiers. Default empty.""",
739
727
  )
740
728
 
741
- del deployment_group
729
+ environment_group = parser.add_option_group("Environment control")
730
+
731
+ environment_group.add_option(
732
+ "--force-runtime-environment-variable",
733
+ action="append",
734
+ dest="forced_runtime_env_variables",
735
+ metavar="VARIABLE_SPEC",
736
+ default=[],
737
+ help="""\
738
+ Force an environment variables to a given value. Default empty.""",
739
+ )
740
+
741
+ del environment_group
742
742
 
743
743
  debug_group = parser.add_option_group("Debug features")
744
744
 
@@ -1709,6 +1709,7 @@ plugin_group.add_option(
1709
1709
  dest="plugins_disabled",
1710
1710
  metavar="PLUGIN_NAME",
1711
1711
  default=[],
1712
+ github_action=False,
1712
1713
  help="""\
1713
1714
  Disabled plugins. Must be plug-in names. Use '--plugin-list' to query the
1714
1715
  full list and exit. Most standard plugins are not a good idea to disable.
@@ -1716,16 +1717,12 @@ Default empty.""",
1716
1717
  )
1717
1718
 
1718
1719
  plugin_group.add_option(
1719
- "--plugin-no-detection",
1720
- action="store_false",
1721
- dest="detect_missing_plugins",
1722
- default=True,
1723
- help="""\
1724
- Plugins can detect if they might be used, and the you can disable the warning
1725
- via "--disable-plugin=plugin-that-warned", or you can use this option to disable
1726
- the mechanism entirely, which also speeds up compilation slightly of course as
1727
- this detection code is run in vain once you are certain of which plugins to
1728
- use. Defaults to off.""",
1720
+ "--user-plugin",
1721
+ action="append",
1722
+ dest="user_plugins",
1723
+ metavar="PATH",
1724
+ default=[],
1725
+ help="The file name of user plugin. Can be given multiple times. Default empty.",
1729
1726
  )
1730
1727
 
1731
1728
  plugin_group.add_option(
@@ -1734,17 +1731,22 @@ plugin_group.add_option(
1734
1731
  dest="plugin_list",
1735
1732
  default=False,
1736
1733
  require_compiling=False,
1734
+ github_action=False,
1737
1735
  help="""\
1738
1736
  Show list of all available plugins and exit. Defaults to off.""",
1739
1737
  )
1740
1738
 
1741
1739
  plugin_group.add_option(
1742
- "--user-plugin",
1743
- action="append",
1744
- dest="user_plugins",
1745
- metavar="PATH",
1746
- default=[],
1747
- help="The file name of user plugin. Can be given multiple times. Default empty.",
1740
+ "--plugin-no-detection",
1741
+ action="store_false",
1742
+ dest="detect_missing_plugins",
1743
+ default=True,
1744
+ help="""\
1745
+ Plugins can detect if they might be used, and the you can disable the warning
1746
+ via "--disable-plugin=plugin-that-warned", or you can use this option to disable
1747
+ the mechanism entirely, which also speeds up compilation slightly of course as
1748
+ this detection code is run in vain once you are certain of which plugins to
1749
+ use. Defaults to off.""",
1748
1750
  )
1749
1751
 
1750
1752
  plugin_group.add_option(
@@ -1759,12 +1761,12 @@ to provide extra decisions. Format is currently
1759
1761
  Default empty.""",
1760
1762
  )
1761
1763
 
1762
-
1763
1764
  plugin_group.add_option(
1764
1765
  "--show-source-changes",
1765
1766
  action="append",
1766
1767
  dest="show_source_changes",
1767
1768
  default=[],
1769
+ github_action=False,
1768
1770
  help="""\
1769
1771
  Show source changes to original Python file content before compilation. Mostly
1770
1772
  intended for developing plugins and Nuitka package configuration. Use e.g.
nuitka/Options.py CHANGED
@@ -61,6 +61,7 @@ from nuitka.utils.Utils import (
61
61
  getArchitecture,
62
62
  getCPUCoreCount,
63
63
  getLinuxDistribution,
64
+ getMacOSRelease,
64
65
  getOS,
65
66
  getWindowsRelease,
66
67
  hasOnefileSupportedOS,
@@ -159,7 +160,7 @@ def checkPathSpec(value, arg_name, allow_disable):
159
160
  % (arg_name, value)
160
161
  )
161
162
 
162
- if "{VERSION}" in value and not (getFileVersion() or getProductVersion()):
163
+ if "{VERSION}" in value and not (getFileVersionTuple() or getProductVersionTuple()):
163
164
  Tracing.options_logger.sysexit(
164
165
  "Using value '{VERSION}' in '%s=%s' value without being specified."
165
166
  % (arg_name, value)
@@ -291,6 +292,9 @@ def _getVersionInformationValues():
291
292
  if isWin32OrPosixWindows():
292
293
  yield "WindowsRelease: %s" % getWindowsRelease()
293
294
 
295
+ if isMacOS():
296
+ yield "macOSRelease: %s" % getMacOSRelease()
297
+
294
298
 
295
299
  def printVersionInformation():
296
300
  print("\n".join(_getVersionInformationValues()))
@@ -630,7 +634,7 @@ it before using it: '%s' (from --output-filename='%s')."""
630
634
  )
631
635
 
632
636
  try:
633
- file_version = getFileVersion()
637
+ file_version = getFileVersionTuple()
634
638
  # Catch all the things, don't want any interface, pylint: disable=broad-except
635
639
  except Exception:
636
640
  Tracing.options_logger.sysexit(
@@ -638,7 +642,7 @@ it before using it: '%s' (from --output-filename='%s')."""
638
642
  )
639
643
 
640
644
  try:
641
- product_version = getProductVersion()
645
+ product_version = getProductVersionTuple()
642
646
  # Catch all the things, don't want any interface, pylint: disable=broad-except
643
647
  except Exception:
644
648
  Tracing.options_logger.sysexit(
@@ -1087,11 +1091,6 @@ but errors may happen."""
1087
1091
  "The '--debugger' option has no effect outside of '--debug' without '--run' option."
1088
1092
  )
1089
1093
 
1090
- if not shallClearPythonPathEnvironment():
1091
- Tracing.options_logger.warning(
1092
- "The '--execute-with-pythonpath' option has no effect without '--run' option."
1093
- )
1094
-
1095
1094
  # Check if the fallback is used, except for Python2 on Windows, where we cannot
1096
1095
  # have it.
1097
1096
  if hasattr(OrderedSet, "is_fallback") and not (
@@ -1454,11 +1453,6 @@ def shallOptimizeStringExec():
1454
1453
  return False
1455
1454
 
1456
1455
 
1457
- def shallClearPythonPathEnvironment():
1458
- """*bool* = **not** ``--execute-with-pythonpath``"""
1459
- return not options.keep_pythonpath
1460
-
1461
-
1462
1456
  _shall_use_static_lib_python = None
1463
1457
 
1464
1458
 
@@ -1999,11 +1993,21 @@ def _parseVersionNumber(value):
1999
1993
 
2000
1994
 
2001
1995
  def getProductVersion():
1996
+ """:returns: str, derived from ``--product-version``"""
1997
+ return options.product_version
1998
+
1999
+
2000
+ def getProductVersionTuple():
2002
2001
  """:returns: tuple of 4 ints or None, derived from ``--product-version``"""
2003
2002
  return _parseVersionNumber(options.product_version)
2004
2003
 
2005
2004
 
2006
2005
  def getFileVersion():
2006
+ """:returns str, derived from ``--file-version``"""
2007
+ return options.file_version
2008
+
2009
+
2010
+ def getFileVersionTuple():
2007
2011
  """:returns tuple of 4 ints or None, derived from ``--file-version``"""
2008
2012
  return _parseVersionNumber(options.file_version)
2009
2013
 
@@ -2432,6 +2436,15 @@ def getModuleParameter(module_name, parameter_name):
2432
2436
  return None
2433
2437
 
2434
2438
 
2439
+ def getForcedRuntimeEnvironmentVariableValues():
2440
+ """:returns: iterable (string, string) derived from ``----force-runtime-environment-variable``"""
2441
+
2442
+ for forced_runtime_env_variables_spec in options.forced_runtime_env_variables:
2443
+ name, value = forced_runtime_env_variables_spec.split("=", 1)
2444
+
2445
+ yield (name, value)
2446
+
2447
+
2435
2448
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
2436
2449
  # integrates with CPython, but also works on its own.
2437
2450
  #
@@ -14,7 +14,7 @@ import os
14
14
 
15
15
  from nuitka import Options
16
16
  from nuitka.utils.FileOperations import (
17
- hasFilenameExtension,
17
+ addFilenameExtension,
18
18
  makePath,
19
19
  putTextFileContents,
20
20
  )
@@ -126,10 +126,13 @@ def getResultFullpath(onefile):
126
126
  elif output_filename is not None:
127
127
  result = output_filename
128
128
  elif not isWin32OrPosixWindows() and not Options.shallCreateAppBundle():
129
- result += ".bin"
129
+ result = addFilenameExtension(result, ".bin")
130
130
 
131
- if isWin32OrPosixWindows() and not hasFilenameExtension(result, ".exe"):
132
- result += ".exe"
131
+ if isWin32OrPosixWindows():
132
+ result = addFilenameExtension(result, ".exe")
133
+
134
+ if not isWin32OrPosixWindows() and Options.isOnefileMode() and not onefile:
135
+ result = addFilenameExtension(result, ".bin")
133
136
 
134
137
  return result
135
138
 
nuitka/PostProcessing.py CHANGED
@@ -227,13 +227,13 @@ def executePostProcessingResources(manifest, onefile):
227
227
 
228
228
  if (
229
229
  Options.getWindowsVersionInfoStrings()
230
- or Options.getProductVersion()
231
- or Options.getFileVersion()
230
+ or Options.getProductVersionTuple()
231
+ or Options.getFileVersionTuple()
232
232
  ):
233
233
  addVersionInfoResource(
234
234
  string_values=Options.getWindowsVersionInfoStrings(),
235
- product_version=Options.getProductVersion(),
236
- file_version=Options.getFileVersion(),
235
+ product_version=Options.getProductVersionTuple(),
236
+ file_version=Options.getFileVersionTuple(),
237
237
  file_date=(0, 0),
238
238
  is_exe=not Options.shallMakeModule(),
239
239
  result_filename=result_filename,
@@ -379,9 +379,11 @@ set PYTHONHOME=%(python_home)s
379
379
  set NUITKA_PYTHONPATH=%(python_path)s
380
380
  %(debugger_call)s"%%~dp0%(exe_filename)s" %%*
381
381
  """ % {
382
- "debugger_call": (" ".join(wrapCommandForDebuggerForExec()) + " ")
383
- if Options.shallRunInDebugger()
384
- else "",
382
+ "debugger_call": (
383
+ (" ".join(wrapCommandForDebuggerForExec()) + " ")
384
+ if Options.shallRunInDebugger()
385
+ else ""
386
+ ),
385
387
  "dll_directory": dll_directory,
386
388
  "python_home": sys.prefix,
387
389
  "python_path": ";".join(sys.path),
nuitka/Progress.py CHANGED
@@ -41,9 +41,9 @@ class NuitkaProgressBar(object):
41
41
  self.tqdm = tqdm(
42
42
  iterable=iterable,
43
43
  initial=self.progress,
44
- total=max(self.total, self.min_total)
45
- if self.min_total is not None
46
- else None,
44
+ total=(
45
+ max(self.total, self.min_total) if self.min_total is not None else None
46
+ ),
47
47
  unit=unit,
48
48
  disable=None,
49
49
  leave=False,
nuitka/PythonVersions.py CHANGED
@@ -36,13 +36,13 @@ def getSupportedPythonVersions():
36
36
 
37
37
  def getNotYetSupportedPythonVersions():
38
38
  """Versions known to not work at all (yet)."""
39
- return ("3.12",)
39
+ return ("3.13",)
40
40
 
41
41
 
42
42
  def getPartiallySupportedPythonVersions():
43
43
  """Partially supported Python versions for Nuitka."""
44
44
 
45
- return ()
45
+ return ("3.12",)
46
46
 
47
47
 
48
48
  def getZstandardSupportingVersions():
nuitka/TreeXML.py CHANGED
@@ -117,7 +117,7 @@ def appendTreeElement(parent, *args, **kwargs):
117
117
  def dumpTreeXMLToFile(tree, output_file):
118
118
  """Write an XML node tree to a file."""
119
119
 
120
- value = toString(tree).rstrip()
120
+ value = toBytes(tree).rstrip()
121
121
  output_file.write(value)
122
122
 
123
123
 
nuitka/Version.py CHANGED
@@ -20,7 +20,7 @@
20
20
  """
21
21
 
22
22
  version_string = """\
23
- Nuitka V2.1.6
23
+ Nuitka V2.2.2
24
24
  Copyright (C) 2024 Kay Hayen."""
25
25
 
26
26
 
@@ -1044,12 +1044,13 @@ enableSpawnMonitoring(
1044
1044
  changeKeyboardInterruptToErrorExit()
1045
1045
 
1046
1046
  # Check if ccache is installed, and complain if it is not.
1047
- if env.gcc_mode and not disable_ccache:
1047
+ if env.gcc_mode:
1048
1048
  enableCcache(
1049
1049
  env=env,
1050
1050
  source_dir=source_dir,
1051
1051
  python_prefix=python_prefix_external,
1052
1052
  assume_yes_for_downloads=assume_yes_for_downloads,
1053
+ disable_ccache=disable_ccache,
1053
1054
  )
1054
1055
 
1055
1056
  if env.msvc_mode and not disable_ccache:
@@ -4,6 +4,7 @@
4
4
  """ Interface to data composer
5
5
 
6
6
  """
7
+
7
8
  import os
8
9
  import subprocess
9
10
  import sys
@@ -496,12 +496,13 @@ enableSpawnMonitoring(
496
496
  changeKeyboardInterruptToErrorExit()
497
497
 
498
498
  # Check if ccache is installed, and complain if it is not.
499
- if env.gcc_mode and not disable_ccache:
499
+ if env.gcc_mode:
500
500
  enableCcache(
501
501
  env=env,
502
502
  source_dir=source_dir,
503
503
  python_prefix=python_prefix_external,
504
504
  assume_yes_for_downloads=assume_yes_for_downloads,
505
+ disable_ccache=disable_ccache,
505
506
  )
506
507
 
507
508
  if env.msvc_mode and not disable_ccache: