Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__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 (304) hide show
  1. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
  2. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
  3. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
  4. nuitka/Builtins.py +31 -0
  5. nuitka/HardImportRegistry.py +8 -0
  6. nuitka/MainControl.py +9 -4
  7. nuitka/OptionParsing.py +108 -54
  8. nuitka/Options.py +69 -13
  9. nuitka/OutputDirectories.py +7 -2
  10. nuitka/PostProcessing.py +69 -38
  11. nuitka/Progress.py +16 -1
  12. nuitka/PythonVersions.py +2 -1
  13. nuitka/Serialization.py +4 -2
  14. nuitka/Tracing.py +69 -1
  15. nuitka/Version.py +2 -2
  16. nuitka/build/Backend.scons +45 -5
  17. nuitka/build/CCompilerVersion.scons +6 -0
  18. nuitka/build/Onefile.scons +6 -0
  19. nuitka/build/SconsCaching.py +4 -0
  20. nuitka/build/SconsCompilerSettings.py +14 -3
  21. nuitka/build/SconsInterface.py +3 -0
  22. nuitka/build/SconsUtils.py +5 -0
  23. nuitka/build/include/nuitka/allocator.h +124 -1
  24. nuitka/build/include/nuitka/calling.h +6 -6
  25. nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
  26. nuitka/build/include/nuitka/compiled_frame.h +2 -1
  27. nuitka/build/include/nuitka/constants.h +8 -0
  28. nuitka/build/include/nuitka/debug_settings.h +60 -0
  29. nuitka/build/include/nuitka/exceptions.h +264 -121
  30. nuitka/build/include/nuitka/helper/attributes.h +0 -4
  31. nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
  32. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  33. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  34. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  35. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  36. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  37. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  38. nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
  39. nuitka/build/include/nuitka/helper/ints.h +86 -37
  40. nuitka/build/include/nuitka/helper/iterators.h +82 -34
  41. nuitka/build/include/nuitka/helper/operations.h +3 -0
  42. nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
  43. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  44. nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
  45. nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
  46. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
  47. nuitka/build/include/nuitka/helper/raising.h +47 -28
  48. nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
  49. nuitka/build/include/nuitka/helper/tuples.h +12 -0
  50. nuitka/build/include/nuitka/helpers.h +12 -2
  51. nuitka/build/include/nuitka/prelude.h +36 -25
  52. nuitka/build/include/nuitka/printing.h +9 -7
  53. nuitka/build/include/nuitka/threading.h +15 -1
  54. nuitka/build/include/nuitka/type_aliases.h +3 -0
  55. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  56. nuitka/build/inline_copy/stubgen/six.py +998 -0
  57. nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
  58. nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
  59. nuitka/build/static_src/CompiledCellType.c +6 -4
  60. nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
  61. nuitka/build/static_src/CompiledCoroutineType.c +41 -31
  62. nuitka/build/static_src/CompiledFrameType.c +110 -79
  63. nuitka/build/static_src/CompiledFunctionType.c +173 -151
  64. nuitka/build/static_src/CompiledGeneratorType.c +51 -49
  65. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
  66. nuitka/build/static_src/CompiledMethodType.c +6 -12
  67. nuitka/build/static_src/HelpersAllocator.c +266 -28
  68. nuitka/build/static_src/HelpersAttributes.c +0 -21
  69. nuitka/build/static_src/HelpersBuiltin.c +23 -14
  70. nuitka/build/static_src/HelpersCalling.c +7 -7
  71. nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
  72. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  73. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  74. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  75. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  76. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  77. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  78. nuitka/build/static_src/HelpersComparisonEq.c +18 -4
  79. nuitka/build/static_src/HelpersComparisonGe.c +18 -4
  80. nuitka/build/static_src/HelpersComparisonGt.c +18 -4
  81. nuitka/build/static_src/HelpersComparisonLe.c +18 -4
  82. nuitka/build/static_src/HelpersComparisonLt.c +18 -4
  83. nuitka/build/static_src/HelpersComparisonNe.c +18 -4
  84. nuitka/build/static_src/HelpersConsole.c +34 -8
  85. nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
  86. nuitka/build/static_src/HelpersDeepcopy.c +1 -0
  87. nuitka/build/static_src/HelpersDictionaries.c +195 -36
  88. nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
  89. nuitka/build/static_src/HelpersExceptions.c +24 -50
  90. nuitka/build/static_src/HelpersFiles.c +79 -5
  91. nuitka/build/static_src/HelpersImport.c +13 -9
  92. nuitka/build/static_src/HelpersImportHard.c +23 -46
  93. nuitka/build/static_src/HelpersLists.c +98 -9
  94. nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
  95. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
  96. nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
  97. nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
  98. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
  99. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
  100. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  101. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
  102. nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
  103. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
  104. nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
  105. nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
  106. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
  107. nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
  108. nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
  109. nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
  110. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
  111. nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
  112. nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
  113. nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
  114. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
  115. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
  116. nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
  117. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
  118. nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
  119. nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
  120. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
  121. nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
  122. nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
  123. nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
  124. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
  125. nuitka/build/static_src/HelpersProfiling.c +1 -1
  126. nuitka/build/static_src/HelpersRaising.c +255 -310
  127. nuitka/build/static_src/HelpersStrings.c +1 -1
  128. nuitka/build/static_src/HelpersTuples.c +2 -2
  129. nuitka/build/static_src/HelpersTypes.c +98 -2
  130. nuitka/build/static_src/MainProgram.c +132 -28
  131. nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
  132. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
  133. nuitka/build/static_src/OnefileBootstrap.c +6 -1
  134. nuitka/code_generation/AsyncgenCodes.py +2 -6
  135. nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
  136. nuitka/code_generation/BuiltinCodes.py +9 -1
  137. nuitka/code_generation/CallCodes.py +16 -16
  138. nuitka/code_generation/CodeGeneration.py +14 -2
  139. nuitka/code_generation/CodeHelperSelection.py +1 -1
  140. nuitka/code_generation/CodeHelpers.py +4 -1
  141. nuitka/code_generation/CodeObjectCodes.py +2 -2
  142. nuitka/code_generation/ComparisonCodes.py +13 -2
  143. nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
  144. nuitka/code_generation/Contexts.py +28 -16
  145. nuitka/code_generation/CoroutineCodes.py +2 -6
  146. nuitka/code_generation/DictCodes.py +3 -3
  147. nuitka/code_generation/ErrorCodes.py +34 -50
  148. nuitka/code_generation/ExceptionCodes.py +165 -96
  149. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
  150. nuitka/code_generation/FrameCodes.py +4 -11
  151. nuitka/code_generation/FunctionCodes.py +2 -6
  152. nuitka/code_generation/GeneratorCodes.py +2 -6
  153. nuitka/code_generation/GlobalConstants.py +8 -2
  154. nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
  155. nuitka/code_generation/IteratorCodes.py +67 -54
  156. nuitka/code_generation/LineNumberCodes.py +1 -3
  157. nuitka/code_generation/ModuleCodes.py +28 -4
  158. nuitka/code_generation/OperationCodes.py +51 -20
  159. nuitka/code_generation/PackageResourceCodes.py +37 -0
  160. nuitka/code_generation/RaisingCodes.py +164 -90
  161. nuitka/code_generation/Reports.py +13 -5
  162. nuitka/code_generation/ReturnCodes.py +2 -16
  163. nuitka/code_generation/TryCodes.py +12 -24
  164. nuitka/code_generation/TypeAliasCodes.py +48 -0
  165. nuitka/code_generation/VariableCodes.py +99 -40
  166. nuitka/code_generation/VariableDeclarations.py +8 -8
  167. nuitka/code_generation/YieldCodes.py +1 -1
  168. nuitka/code_generation/c_types/CTypeBases.py +10 -2
  169. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
  170. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
  171. nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
  172. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
  173. nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
  174. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
  175. nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
  176. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
  177. nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
  178. nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
  179. nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
  180. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
  181. nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
  182. nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
  183. nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
  184. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
  185. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
  186. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
  187. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
  188. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
  189. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  190. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
  191. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  192. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
  193. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
  194. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
  195. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
  196. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
  197. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
  198. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
  199. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
  200. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
  201. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
  202. nuitka/containers/Namedtuples.py +6 -0
  203. nuitka/containers/OrderedSets.py +105 -5
  204. nuitka/distutils/Build.py +14 -0
  205. nuitka/distutils/DistutilCommands.py +50 -10
  206. nuitka/finalizations/Finalization.py +3 -3
  207. nuitka/finalizations/FinalizeMarkups.py +10 -14
  208. nuitka/freezer/DependsExe.py +5 -2
  209. nuitka/freezer/DllDependenciesMacOS.py +18 -1
  210. nuitka/freezer/DllDependenciesWin32.py +26 -12
  211. nuitka/freezer/ImportDetection.py +6 -0
  212. nuitka/freezer/IncludedDataFiles.py +37 -6
  213. nuitka/freezer/Onefile.py +1 -0
  214. nuitka/freezer/Standalone.py +72 -18
  215. nuitka/importing/Importing.py +33 -6
  216. nuitka/importing/Recursion.py +5 -2
  217. nuitka/importing/StandardLibrary.py +57 -59
  218. nuitka/nodes/AsyncgenNodes.py +3 -6
  219. nuitka/nodes/BuiltinIteratorNodes.py +2 -2
  220. nuitka/nodes/BuiltinRefNodes.py +14 -30
  221. nuitka/nodes/ChildrenHavingMixins.py +439 -46
  222. nuitka/nodes/ConditionalNodes.py +3 -2
  223. nuitka/nodes/CoroutineNodes.py +3 -6
  224. nuitka/nodes/DictionaryNodes.py +1 -1
  225. nuitka/nodes/ExceptionNodes.py +102 -26
  226. nuitka/nodes/ExpressionBasesGenerated.py +288 -4
  227. nuitka/nodes/FrameNodes.py +22 -11
  228. nuitka/nodes/FunctionNodes.py +3 -3
  229. nuitka/nodes/GeneratorNodes.py +3 -6
  230. nuitka/nodes/HardImportNodesGenerated.py +182 -0
  231. nuitka/nodes/ImportNodes.py +2 -2
  232. nuitka/nodes/NodeBases.py +28 -1
  233. nuitka/nodes/NodeMakingHelpers.py +71 -50
  234. nuitka/nodes/OperatorNodesUnary.py +128 -3
  235. nuitka/nodes/OsSysNodes.py +37 -6
  236. nuitka/nodes/OutlineNodes.py +2 -2
  237. nuitka/nodes/StatementBasesGenerated.py +0 -2
  238. nuitka/nodes/StatementNodes.py +8 -7
  239. nuitka/nodes/SubscriptNodes.py +1 -1
  240. nuitka/nodes/TypeNodes.py +28 -1
  241. nuitka/nodes/VariableAssignNodes.py +2 -1
  242. nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
  243. nuitka/nodes/shapes/IteratorShapes.py +71 -0
  244. nuitka/nodes/shapes/ShapeMixins.py +18 -0
  245. nuitka/nodes/shapes/StandardShapes.py +47 -44
  246. nuitka/optimizations/BytecodeDemotion.py +2 -1
  247. nuitka/plugins/PluginBase.py +64 -22
  248. nuitka/plugins/Plugins.py +16 -3
  249. nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
  250. nuitka/plugins/standard/DllFilesPlugin.py +78 -2
  251. nuitka/plugins/standard/ImplicitImports.py +5 -15
  252. nuitka/plugins/standard/KivyPlugin.py +3 -12
  253. nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
  254. nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
  255. nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
  256. nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
  257. nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
  258. nuitka/plugins/standard/TkinterPlugin.py +23 -3
  259. nuitka/plugins/standard/TransformersPlugin.py +70 -275
  260. nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
  261. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
  262. nuitka/reports/CompilationReportReader.py +12 -0
  263. nuitka/reports/Reports.py +11 -0
  264. nuitka/specs/BuiltinParameterSpecs.py +5 -1
  265. nuitka/specs/HardImportSpecs.py +7 -0
  266. nuitka/specs/ParameterSpecs.py +4 -4
  267. nuitka/tools/environments/Virtualenv.py +13 -5
  268. nuitka/tools/general/dll_report/__main__.py +10 -1
  269. nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
  270. nuitka/tools/podman/__main__.py +4 -2
  271. nuitka/tools/specialize/CTypeDescriptions.py +158 -9
  272. nuitka/tools/specialize/SpecializeC.py +218 -56
  273. nuitka/tools/testing/Common.py +69 -62
  274. nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
  275. nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
  276. nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
  277. nuitka/tools/watch/AutoStage.py +1 -0
  278. nuitka/tree/Building.py +10 -37
  279. nuitka/tree/ComplexCallHelperFunctions.py +4 -0
  280. nuitka/tree/ReformulationAssertStatements.py +31 -14
  281. nuitka/tree/ReformulationAssignmentStatements.py +5 -1
  282. nuitka/tree/ReformulationClasses3.py +94 -19
  283. nuitka/tree/ReformulationDictionaryCreation.py +1 -0
  284. nuitka/tree/ReformulationFunctionStatements.py +1 -1
  285. nuitka/tree/ReformulationMatchStatements.py +3 -1
  286. nuitka/tree/ReformulationYieldExpressions.py +23 -5
  287. nuitka/utils/CommandLineOptions.py +27 -3
  288. nuitka/utils/Download.py +2 -2
  289. nuitka/utils/Execution.py +36 -31
  290. nuitka/utils/FileOperations.py +18 -39
  291. nuitka/utils/Hashing.py +5 -1
  292. nuitka/utils/Importing.py +2 -14
  293. nuitka/utils/InlineCopies.py +52 -0
  294. nuitka/utils/InstalledPythons.py +9 -4
  295. nuitka/utils/Json.py +2 -2
  296. nuitka/utils/PackageResources.py +44 -0
  297. nuitka/utils/SharedLibraries.py +24 -0
  298. nuitka/utils/Signing.py +9 -1
  299. nuitka/utils/Utils.py +1 -0
  300. {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
  301. {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
  302. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
  303. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
  304. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,115 @@
1
1
  """ This module is only an abstraction of OrderedSet which is not present in
2
2
  Python at all.
3
3
 
4
+ spell-checker: ignore orderedset,orderedsets
5
+
4
6
  """
5
7
 
6
- try:
7
- # spell-checker: ignore orderedset
8
- from orderedset import OrderedSet
9
- except ImportError:
8
+ import os
9
+ import subprocess
10
+ import sys
11
+
12
+ from nuitka.PythonVersions import python_version
13
+ from nuitka.utils.InlineCopies import getDownloadCopyFolder
14
+
15
+ recommended_orderedset_package_name, recommended_orderedset_module_name = (
16
+ ("ordered-set", "ordered_set")
17
+ if python_version >= 0x370
18
+ else ("orderedset", "orderedsets")
19
+ )
20
+
21
+
22
+ def _tryImportOrderedSet():
10
23
  try:
11
- from ordered_set import OrderedSet
24
+ from orderedset import OrderedSet as result
12
25
  except ImportError:
26
+ try:
27
+ from ordered_set import OrderedSet as result
28
+ except ImportError:
29
+ return None
30
+
31
+ return result
32
+
33
+
34
+ OrderedSet = _tryImportOrderedSet()
35
+
36
+
37
+ def _findDownloadSitePackagesDir(download_folder):
38
+ for root, dirnames, _filenames in os.walk(download_folder):
39
+ found_candidate = None
40
+ for candidate in ("site-packages", "dist-packages", "vendor-packages"):
41
+ if candidate in dirnames:
42
+ # Unclear which one to use.
43
+ if found_candidate is not None:
44
+ return
45
+
46
+ found_candidate = candidate
47
+
48
+ if found_candidate:
49
+ return os.path.join(root, found_candidate)
50
+
51
+
52
+ def tryDownloadPackageName(package_name, module_name, package_version):
53
+ download_folder = getDownloadCopyFolder()
54
+
55
+ site_packages_folder = _findDownloadSitePackagesDir(download_folder)
56
+
57
+ if site_packages_folder is not None:
58
+ candidate = os.path.join(site_packages_folder, module_name)
59
+
60
+ if os.path.exists(candidate):
61
+ return site_packages_folder
62
+
63
+ if os.getenv("NUITKA_ASSUME_YES_FOR_DOWNLOADS") in ("1", "true", "yes"):
64
+ if package_version is not None:
65
+ package_spec = "%s==%s" % (package_name, package_version)
66
+ else:
67
+ package_spec = package_name
68
+
69
+ exit_code = subprocess.call(
70
+ [
71
+ sys.executable,
72
+ "-m",
73
+ "pip",
74
+ "install",
75
+ "--root",
76
+ download_folder,
77
+ package_spec,
78
+ ],
79
+ shell=False,
80
+ )
81
+
82
+ if exit_code != 0:
83
+ return None
84
+
85
+ if site_packages_folder is None:
86
+ site_packages_folder = _findDownloadSitePackagesDir(download_folder)
87
+
88
+ if site_packages_folder is not None:
89
+ candidate = os.path.join(site_packages_folder, module_name)
90
+
91
+ if os.path.exists(candidate):
92
+ return site_packages_folder
93
+
94
+
95
+ def _tryDownloadOrderedSet():
96
+ return tryDownloadPackageName(
97
+ recommended_orderedset_package_name,
98
+ recommended_orderedset_module_name,
99
+ package_version=None,
100
+ )
101
+
102
+
103
+ if OrderedSet is None:
104
+ downloaded_pip = _tryDownloadOrderedSet()
105
+
106
+ try:
107
+ sys.path.insert(0, downloaded_pip)
108
+ OrderedSet = _tryImportOrderedSet()
109
+ finally:
110
+ del sys.path[0]
111
+
112
+ if OrderedSet is None:
13
113
  from .OrderedSetsFallback import OrderedSet
14
114
 
15
115
 
nuitka/distutils/Build.py CHANGED
@@ -23,6 +23,20 @@ class NuitkaBuildMetaBackend(setuptools.build_meta._BuildMetaBackend):
23
23
  def build_wheel(
24
24
  self, wheel_directory, config_settings=None, metadata_directory=None
25
25
  ):
26
+ # Allow falling back to setuptools when the `build_with_nuitka` configuration setting is set to true.
27
+ if config_settings:
28
+ build_with_nuitka = config_settings.pop("build_with_nuitka", "true").lower()
29
+
30
+ if build_with_nuitka not in ("true", "false"):
31
+ raise ValueError(
32
+ "When passing the 'build_with_nuitka' setting, it must either be 'true' or 'false'."
33
+ )
34
+
35
+ if build_with_nuitka == "false":
36
+ return super().build_wheel(
37
+ wheel_directory, config_settings, metadata_directory
38
+ )
39
+
26
40
  os.environ["NUITKA_TOML_FILE"] = os.path.join(os.getcwd(), "pyproject.toml")
27
41
 
28
42
  with suppress_known_deprecation():
@@ -21,6 +21,10 @@ from nuitka.importing.Importing import (
21
21
  locateModule,
22
22
  )
23
23
  from nuitka.PythonVersions import python_version
24
+ from nuitka.reports.CompilationReportReader import (
25
+ getEmbeddedDataFilenames,
26
+ parseCompilationReport,
27
+ )
24
28
  from nuitka.Tracing import wheel_logger
25
29
  from nuitka.utils.Execution import check_call
26
30
  from nuitka.utils.FileOperations import deleteFile, getFileList, renameFile
@@ -31,6 +35,7 @@ def setupNuitkaDistutilsCommands(dist, keyword, value):
31
35
  # If the user project setup.py includes the key "build_with_nuitka=True" all
32
36
  # build operations (build, bdist_wheel, install etc) will run via Nuitka.
33
37
  # pylint: disable=unused-argument
38
+ # spell-checker: ignore cmdclass
34
39
 
35
40
  if not value:
36
41
  return
@@ -213,6 +218,9 @@ class build(distutils.command.build.build):
213
218
 
214
219
  @staticmethod
215
220
  def _parseOptionsEntry(option, value):
221
+ if option == "build_with_nuitka":
222
+ return
223
+
216
224
  option = "--" + option.lstrip("-")
217
225
 
218
226
  if type(value) is tuple and len(value) == 2 and value[0] == "setup.py":
@@ -231,7 +239,8 @@ class build(distutils.command.build.build):
231
239
  yield "%s=%s" % (option, value)
232
240
 
233
241
  def _build(self, build_lib):
234
- # High complexity, pylint: disable=too-many-branches,too-many-locals
242
+ # High complexity,
243
+ # pylint: disable=too-many-branches,too-many-locals,too-many-statements
235
244
 
236
245
  old_dir = os.getcwd()
237
246
 
@@ -249,6 +258,8 @@ class build(distutils.command.build.build):
249
258
  # Search in the build directory preferably.
250
259
  addMainScriptDirectory(main_package_dir)
251
260
 
261
+ embedded_data_files = set()
262
+
252
263
  for is_package, module_name in self._findBuildTasks():
253
264
  # Nuitka wants the main package by filename, probably we should stop
254
265
  # needing that.
@@ -276,7 +287,12 @@ class build(distutils.command.build.build):
276
287
  "--enable-plugin=pylint-warnings",
277
288
  "--output-dir=%s" % output_dir,
278
289
  "--nofollow-import-to=*.tests",
290
+ "--nowarn-mnemonic=compiled-package-hidden-by-package",
279
291
  "--remove-output",
292
+ # Note: For when we are debugging module mode of Nuitka, not for general use.
293
+ # "--debug",
294
+ # "--trace",
295
+ # "--python-flag=-v"
280
296
  ]
281
297
 
282
298
  if package_name is not None:
@@ -319,12 +335,25 @@ class build(distutils.command.build.build):
319
335
  ):
320
336
  command.extend(self._parseOptionsEntry(option, value))
321
337
 
338
+ report_filename = None
339
+
322
340
  # Process any extra options from setuptools
323
341
  if "nuitka" in self.distribution.command_options:
324
342
  for option, value in self.distribution.command_options[
325
343
  "nuitka"
326
344
  ].items():
327
- command.extend(self._parseOptionsEntry(option, value))
345
+ for option in self._parseOptionsEntry(option, value):
346
+ command.append(option)
347
+
348
+ if option.startswith("--report="):
349
+ report_filename = option.split("=", 1)[1]
350
+
351
+ if report_filename is None:
352
+ command.append("--report=compilation-report.xml")
353
+ report_filename = "compilation-report.xml"
354
+ delete_report = True
355
+ else:
356
+ delete_report = False
328
357
 
329
358
  command.append(main_filename)
330
359
 
@@ -337,17 +366,26 @@ class build(distutils.command.build.build):
337
366
  "Finished compilation of '%s'." % module_name.asString(), style="green"
338
367
  )
339
368
 
340
- self.build_lib = build_lib
369
+ report = parseCompilationReport(report_filename)
341
370
 
342
- os.chdir(old_dir)
371
+ embedded_data_files.update(getEmbeddedDataFilenames(report))
372
+
373
+ if delete_report:
374
+ os.unlink(report_filename)
375
+
376
+ self.build_lib = build_lib
343
377
 
344
378
  # Remove Python code from build folder, that's our job now.
345
- for root, _, filenames in os.walk(build_lib):
346
- for filename in filenames:
347
- fullpath = os.path.join(root, filename)
379
+ for filename in getFileList(
380
+ build_lib, only_suffixes=(".py", ".pyw", ".pyc", ".pyo")
381
+ ):
382
+ os.unlink(filename)
348
383
 
349
- if fullpath.lower().endswith((".py", ".pyw", ".pyc", ".pyo")):
350
- os.unlink(fullpath)
384
+ # Remove data files from build folder, that's our job now too
385
+ for filename in embedded_data_files:
386
+ os.unlink(filename)
387
+
388
+ os.chdir(old_dir)
351
389
 
352
390
 
353
391
  # Required by distutils, used as command name, pylint: disable=invalid-name
@@ -355,7 +393,8 @@ class install(distutils.command.install.install):
355
393
  # pylint: disable=attribute-defined-outside-init
356
394
  def finalize_options(self):
357
395
  distutils.command.install.install.finalize_options(self)
358
- # Ensure the purelib folder is not used
396
+ # Ensure the "purelib" folder is not used
397
+ # spell-checker: ignore purelib,platlib
359
398
  self.install_lib = self.install_platlib
360
399
 
361
400
 
@@ -376,6 +415,7 @@ class bdist_nuitka(wheel.bdist_wheel.bdist_wheel):
376
415
  # Force module to use correct platform in name
377
416
  self.root_is_pure = False
378
417
 
418
+ # virtual method name, spell-checker: ignore wheelfile
379
419
  def write_wheelfile(self, wheelfile_base, generator=None):
380
420
  if generator is None:
381
421
  from nuitka.Version import getNuitkaVersion
@@ -14,9 +14,9 @@ from nuitka.tree import Operations
14
14
  from .FinalizeMarkups import FinalizeMarkups
15
15
 
16
16
 
17
- def prepareCodeGeneration(tree):
18
- visitor = FinalizeMarkups()
19
- Operations.visitTree(tree, visitor)
17
+ def prepareCodeGeneration(module):
18
+ visitor = FinalizeMarkups(module)
19
+ Operations.visitTree(module, visitor)
20
20
 
21
21
 
22
22
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
@@ -23,6 +23,9 @@ from nuitka.tree.Operations import VisitorNoopMixin
23
23
 
24
24
 
25
25
  class FinalizeMarkups(VisitorNoopMixin):
26
+ def __init__(self, module):
27
+ self.module = module
28
+
26
29
  def onEnterNode(self, node):
27
30
  try:
28
31
  self._onEnterNode(node)
@@ -37,26 +40,17 @@ class FinalizeMarkups(VisitorNoopMixin):
37
40
  # This has many different things it deals with, so there need to be a
38
41
  # lot of branches and statements, pylint: disable=too-many-branches
39
42
 
40
- # Also all self specific things have been done on the outside,
41
- # pylint: disable=no-self-use
42
43
  if node.isStatementReturn() or node.isStatementGeneratorReturn():
43
- search = node
44
-
45
- in_tried_block = False
46
-
47
44
  # Search up to the containing function, and check for a try/finally
48
45
  # containing the "return" statement.
49
- search = search.getParentReturnConsumer()
46
+ search = node.getParentReturnConsumer()
50
47
 
51
48
  if (
52
49
  search.isExpressionGeneratorObjectBody()
53
50
  or search.isExpressionCoroutineObjectBody()
54
51
  or search.isExpressionAsyncgenObjectBody()
55
52
  ):
56
- if in_tried_block:
57
- search.markAsNeedsGeneratorReturnHandling(2)
58
- else:
59
- search.markAsNeedsGeneratorReturnHandling(1)
53
+ search.markAsNeedsGeneratorReturnHandling()
60
54
 
61
55
  if node.isExpressionFunctionCreation():
62
56
  if (
@@ -72,11 +66,10 @@ class FinalizeMarkups(VisitorNoopMixin):
72
66
  function_body = node.getFunctionBody()
73
67
  parent_module = function_body.getParentModule()
74
68
 
75
- node_module = node.getParentModule()
76
- if node_module is not parent_module:
69
+ if self.module is not parent_module:
77
70
  function_body.markAsCrossModuleUsed()
78
71
 
79
- node_module.addCrossUsedFunction(function_body)
72
+ self.module.addCrossUsedFunction(function_body)
80
73
 
81
74
  if node.isStatementAssignmentVariable():
82
75
  target_var = node.getVariable()
@@ -93,6 +86,9 @@ class FinalizeMarkups(VisitorNoopMixin):
93
86
  # TODO: This might be bad.
94
87
  assign_source.removeMarkAsInplaceSuspect()
95
88
 
89
+ if target_var.isModuleVariable():
90
+ pass
91
+
96
92
  if python_version < 0x300 and node.isStatementPublishException():
97
93
  node.getParentStatementsFrame().markAsFrameExceptionPreserving()
98
94
 
@@ -3,12 +3,13 @@
3
3
 
4
4
  """ Interface to depends.exe on Windows.
5
5
 
6
- We use depends.exe to investigate needed DLLs of Python DLLs.
6
+ We use "depends.exe" to investigate needed DLLs of Python DLLs.
7
7
 
8
8
  """
9
9
 
10
10
  import os
11
11
 
12
+ # pylint: disable=I0021,import-error,redefined-builtin
12
13
  from nuitka.__past__ import WindowsError
13
14
  from nuitka.containers.OrderedSets import OrderedSet
14
15
  from nuitka.Options import assumeYesForDownloads
@@ -19,6 +20,7 @@ from nuitka.utils.FileOperations import (
19
20
  deleteFile,
20
21
  getExternalUsePath,
21
22
  getFileContentByLine,
23
+ getNormalizedPath,
22
24
  getWindowsLongPathName,
23
25
  isFilenameBelowPath,
24
26
  isFilesystemEncodable,
@@ -66,6 +68,7 @@ def _attemptToFindNotFoundDLL(dll_filename):
66
68
  if dll_filename in currently_loaded_dlls:
67
69
  return currently_loaded_dlls[dll_filename]
68
70
 
71
+ # Lets try the Windows system, spell-checker: ignore systemroot
69
72
  dll_filename = os.path.join(
70
73
  os.environ["SYSTEMROOT"],
71
74
  "SysWOW64" if getArchitecture() == "x86_64" else "System32",
@@ -159,7 +162,7 @@ def _parseDependsExeOutput2(lines):
159
162
 
160
163
  assert os.path.isfile(dll_filename), (dll_filename, line)
161
164
 
162
- result.add(os.path.normcase(os.path.abspath(dll_filename)))
165
+ result.add(getNormalizedPath(os.path.normcase(dll_filename)))
163
166
 
164
167
  return result
165
168
 
@@ -57,7 +57,12 @@ def _detectPythonRpaths():
57
57
 
58
58
 
59
59
  def detectBinaryPathDLLsMacOS(
60
- original_dir, binary_filename, package_name, keep_unresolved, recursive
60
+ original_dir,
61
+ binary_filename,
62
+ package_name,
63
+ keep_unresolved,
64
+ recursive,
65
+ recursive_dlls=None,
61
66
  ):
62
67
  assert os.path.exists(binary_filename), binary_filename
63
68
 
@@ -91,13 +96,25 @@ def detectBinaryPathDLLsMacOS(
91
96
  if recursive:
92
97
  merged_result = OrderedDict(resolved_result)
93
98
 
99
+ # For recursive DLL detection, cycle may exist, so we keep track of what
100
+ # was seen so far.
101
+ if recursive_dlls is None:
102
+ recursive_dlls = set([binary_filename])
103
+ else:
104
+ recursive_dlls = set(recursive_dlls)
105
+ recursive_dlls.add(binary_filename)
106
+
94
107
  for sub_dll_filename in resolved_result:
108
+ if sub_dll_filename in recursive_dlls:
109
+ continue
110
+
95
111
  _, sub_result = detectBinaryPathDLLsMacOS(
96
112
  original_dir=os.path.dirname(sub_dll_filename),
97
113
  binary_filename=sub_dll_filename,
98
114
  package_name=package_name,
99
115
  keep_unresolved=True,
100
116
  recursive=True,
117
+ recursive_dlls=recursive_dlls,
101
118
  )
102
119
 
103
120
  merged_result.update(sub_result)
@@ -43,6 +43,7 @@ def detectBinaryPathDLLsWin32(
43
43
  original_dir,
44
44
  binary_filename,
45
45
  package_name,
46
+ use_path,
46
47
  use_cache,
47
48
  update_cache,
48
49
  ):
@@ -55,6 +56,7 @@ def detectBinaryPathDLLsWin32(
55
56
  original_dir=original_dir,
56
57
  binary_filename=binary_filename,
57
58
  package_name=package_name,
59
+ use_path=use_path,
58
60
  )
59
61
 
60
62
  if use_cache:
@@ -79,7 +81,9 @@ def detectBinaryPathDLLsWin32(
79
81
  if isShowProgress():
80
82
  inclusion_logger.info("Analyzing dependencies of '%s'." % binary_filename)
81
83
 
82
- scan_dirs = _getScanDirectories(package_name, original_dir)
84
+ scan_dirs = _getScanDirectories(
85
+ package_name=package_name, original_dir=original_dir, use_path=use_path
86
+ )
83
87
 
84
88
  result = detectDLLsWithDependencyWalker(
85
89
  binary_filename=binary_filename, source_dir=source_dir, scan_dirs=scan_dirs
@@ -91,7 +95,7 @@ def detectBinaryPathDLLsWin32(
91
95
  return result
92
96
 
93
97
 
94
- def _getScanDirectories(package_name, original_dir):
98
+ def _getScanDirectories(package_name, original_dir, use_path):
95
99
  # TODO: Move PyWin32 specific stuff to yaml dll section
96
100
  # pylint: disable=too-many-branches
97
101
 
@@ -120,18 +124,23 @@ def _getScanDirectories(package_name, original_dir):
120
124
  if py_win32_dir is not None:
121
125
  scan_dirs.append(py_win32_dir)
122
126
 
123
- for path_dir in os.environ["PATH"].split(";"):
124
- if not os.path.isdir(path_dir):
125
- continue
127
+ if use_path:
128
+ for path_dir in os.environ["PATH"].split(";"):
129
+ if not os.path.isdir(path_dir):
130
+ continue
126
131
 
127
- if areSamePaths(path_dir, os.path.join(os.environ["SYSTEMROOT"])):
128
- continue
129
- if areSamePaths(path_dir, os.path.join(os.environ["SYSTEMROOT"], "System32")):
130
- continue
131
- if areSamePaths(path_dir, os.path.join(os.environ["SYSTEMROOT"], "SysWOW64")):
132
- continue
132
+ if areSamePaths(path_dir, os.path.join(os.environ["SYSTEMROOT"])):
133
+ continue
134
+ if areSamePaths(
135
+ path_dir, os.path.join(os.environ["SYSTEMROOT"], "System32")
136
+ ):
137
+ continue
138
+ if areSamePaths(
139
+ path_dir, os.path.join(os.environ["SYSTEMROOT"], "SysWOW64")
140
+ ):
141
+ continue
133
142
 
134
- scan_dirs.append(path_dir)
143
+ scan_dirs.append(path_dir)
135
144
 
136
145
  result = []
137
146
 
@@ -161,6 +170,7 @@ def _getCacheFilename(
161
170
  original_dir,
162
171
  binary_filename,
163
172
  package_name,
173
+ use_path,
164
174
  ):
165
175
  original_filename = os.path.join(original_dir, os.path.basename(binary_filename))
166
176
  original_filename = os.path.normcase(original_filename)
@@ -192,6 +202,10 @@ def _getCacheFilename(
192
202
  # Take Nuitka version into account as well, ought to catch code changes.
193
203
  hash_value.updateFromValues(version_string)
194
204
 
205
+ # Using PATH or not, should also be considered different.
206
+ if use_path:
207
+ hash_value.updateFromValues(os.getenv("PATH"))
208
+
195
209
  cache_dir = os.path.join(getCacheDir("library_dependencies"), dependency_tool)
196
210
  makePath(cache_dir)
197
211
 
@@ -137,6 +137,12 @@ print("\\n".join(sorted(
137
137
  "_collections_abc.py",
138
138
  "_collections_abc.pyc",
139
139
  ):
140
+ # Note: This was only useful for 3.13.0, and 3.13.1 already
141
+ # didn't need it anymore. So precise version check for a major
142
+ # version is correct here.
143
+ if python_version == 0x3D0:
144
+ detections.append((module_name, 2, "sourcefile", filename))
145
+
140
146
  module_name = ModuleName("_collections_abc")
141
147
 
142
148
  if filename.endswith(".py"):
@@ -19,6 +19,7 @@ from nuitka.Options import (
19
19
  getShallIncludeDataFiles,
20
20
  getShallIncludeExternallyDataFilePatterns,
21
21
  getShallIncludePackageData,
22
+ getShallIncludeRawDirs,
22
23
  getShallNotIncludeDataFilePatterns,
23
24
  isAcceleratedMode,
24
25
  isOnefileMode,
@@ -26,7 +27,7 @@ from nuitka.Options import (
26
27
  shallMakeModule,
27
28
  )
28
29
  from nuitka.OutputDirectories import getStandaloneDirectoryPath
29
- from nuitka.Tracing import general, options_logger
30
+ from nuitka.Tracing import general, inclusion_logger, options_logger
30
31
  from nuitka.utils.FileOperations import (
31
32
  areSamePaths,
32
33
  containsPathElements,
@@ -167,11 +168,12 @@ def makeIncludedDataFile(source_path, dest_path, reason, tracer, tags):
167
168
  # In accelerated mode, data files can be everywhere, but they cannot
168
169
  # change place.
169
170
  if isAcceleratedMode():
170
- if "package_data" not in tags and not areSamePaths(source_path, dest_path):
171
- tracer.sysexit(
172
- "Error, cannot change paths for data files in accelerated mode from '%s' to '%s'."
173
- % (source_path, dest_path)
174
- )
171
+ if "copy" in tags:
172
+ if "package_data" not in tags and not areSamePaths(source_path, dest_path):
173
+ tracer.sysexit(
174
+ "Error, cannot change paths for data files in accelerated mode from '%s' to '%s'."
175
+ % (source_path, dest_path)
176
+ )
175
177
  else:
176
178
  inside = True
177
179
  if not isRelativePath(dest_path):
@@ -334,6 +336,15 @@ def addIncludedDataFile(included_datafile):
334
336
  ):
335
337
  included_datafile.tags.add("external")
336
338
 
339
+ dest_path = getOutputPath(included_datafile.dest_path)
340
+
341
+ if areSamePaths(dest_path, included_datafile.source_path):
342
+ inclusion_logger.sysexit(
343
+ """\
344
+ Error, when asking to copy files external data, you cannot output to\
345
+ same directory and need to use '--output-dir' option."""
346
+ )
347
+
337
348
  _included_data_files.append(included_datafile)
338
349
 
339
350
 
@@ -342,6 +353,8 @@ def getIncludedDataFiles():
342
353
 
343
354
 
344
355
  def _addIncludedDataFilesFromFileOptions():
356
+ # Many different option variants, pylint: disable=too-many-branches
357
+
345
358
  for pattern, source_path, dest_path, arg in getShallIncludeDataFiles():
346
359
  filenames = resolveShellPatternToFilenames(pattern)
347
360
 
@@ -393,6 +406,24 @@ def _addIncludedDataFilesFromFileOptions():
393
406
  if count == 0:
394
407
  options_logger.warning("No data files in directory '%s.'" % source_path)
395
408
 
409
+ for source_path, dest_path in getShallIncludeRawDirs():
410
+ count = 0
411
+
412
+ for included_datafile in makeIncludedDataDirectory(
413
+ source_path=source_path,
414
+ dest_path=os.path.normpath(dest_path),
415
+ reason="specified raw dir '%s' on command line" % source_path,
416
+ tracer=options_logger,
417
+ tags="user",
418
+ raw=True,
419
+ ):
420
+ yield included_datafile
421
+
422
+ count += 1
423
+
424
+ if count == 0:
425
+ options_logger.warning("No files in raw directory '%s.'" % source_path)
426
+
396
427
 
397
428
  def addIncludedDataFilesFromFileOptions():
398
429
  """Early data files, from user options that work with file system."""
nuitka/freezer/Onefile.py CHANGED
@@ -244,6 +244,7 @@ def packDistFolderToOnefileBootstrap(onefile_output_filename, dist_dir):
244
244
 
245
245
  if isMacOS():
246
246
  addMacOSCodeSignature(filenames=[onefile_output_filename])
247
+ assert payload_used_in_build
247
248
 
248
249
  if not payload_used_in_build:
249
250
  runOnefileCompressor(