Nuitka-winsvc 2.2.2__cp311-cp311-win_amd64.whl → 2.3__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.
Files changed (199) hide show
  1. {Nuitka_winsvc-2.2.2.dist-info → Nuitka_winsvc-2.3.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.2.2.dist-info → Nuitka_winsvc-2.3.dist-info}/RECORD +199 -198
  3. nuitka/Bytecodes.py +4 -2
  4. nuitka/HardImportRegistry.py +1 -0
  5. nuitka/MainControl.py +16 -10
  6. nuitka/ModuleRegistry.py +15 -0
  7. nuitka/OptionParsing.py +30 -8
  8. nuitka/Options.py +104 -44
  9. nuitka/PostProcessing.py +9 -8
  10. nuitka/PythonVersions.py +2 -1
  11. nuitka/Serialization.py +47 -30
  12. nuitka/Version.py +1 -1
  13. nuitka/build/Backend.scons +46 -19
  14. nuitka/build/CCompilerVersion.scons +3 -3
  15. nuitka/build/Onefile.scons +4 -4
  16. nuitka/build/SconsCaching.py +3 -2
  17. nuitka/build/SconsCompilerSettings.py +11 -5
  18. nuitka/build/SconsInterface.py +22 -6
  19. nuitka/build/SconsUtils.py +9 -1
  20. nuitka/build/include/nuitka/allocator.h +58 -2
  21. nuitka/build/include/nuitka/compiled_frame.h +48 -13
  22. nuitka/build/include/nuitka/compiled_function.h +4 -0
  23. nuitka/build/include/nuitka/constants.h +6 -0
  24. nuitka/build/include/nuitka/exception_groups.h +6 -6
  25. nuitka/build/include/nuitka/exceptions.h +3 -3
  26. nuitka/build/include/nuitka/freelists.h +11 -0
  27. nuitka/build/include/nuitka/helper/dictionaries.h +5 -4
  28. nuitka/build/include/nuitka/helper/lists.h +5 -5
  29. nuitka/build/include/nuitka/helper/lists_generated.h +12 -12
  30. nuitka/build/include/nuitka/helper/sequences.h +6 -0
  31. nuitka/build/include/nuitka/helper/slices.h +14 -8
  32. nuitka/build/include/nuitka/helper/subscripts.h +1 -184
  33. nuitka/build/include/nuitka/helper/tuples.h +42 -33
  34. nuitka/build/include/nuitka/importing.h +5 -0
  35. nuitka/build/include/nuitka/prelude.h +35 -2
  36. nuitka/build/include/nuitka/safe_string_ops.h +1 -0
  37. nuitka/build/include/nuitka/threading.h +13 -10
  38. nuitka/build/static_src/CompiledAsyncgenType.c +19 -8
  39. nuitka/build/static_src/CompiledCellType.c +1 -1
  40. nuitka/build/static_src/CompiledCodeHelpers.c +18 -16
  41. nuitka/build/static_src/CompiledCoroutineType.c +23 -19
  42. nuitka/build/static_src/CompiledFrameType.c +46 -34
  43. nuitka/build/static_src/CompiledFunctionType.c +55 -34
  44. nuitka/build/static_src/CompiledGeneratorType.c +21 -19
  45. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +127 -130
  46. nuitka/build/static_src/CompiledMethodType.c +15 -17
  47. nuitka/build/static_src/HelpersAllocator.c +71 -0
  48. nuitka/build/static_src/HelpersAttributes.c +1 -1
  49. nuitka/build/static_src/HelpersBuiltin.c +5 -5
  50. nuitka/build/static_src/HelpersBytes.c +2 -2
  51. nuitka/build/static_src/HelpersCalling.c +3 -0
  52. nuitka/build/static_src/HelpersCallingGenerated.c +131 -131
  53. nuitka/build/static_src/HelpersComparisonEq.c +329 -329
  54. nuitka/build/static_src/HelpersComparisonEqUtils.c +3 -1
  55. nuitka/build/static_src/HelpersComparisonGe.c +322 -322
  56. nuitka/build/static_src/HelpersComparisonGt.c +321 -321
  57. nuitka/build/static_src/HelpersComparisonLe.c +322 -322
  58. nuitka/build/static_src/HelpersComparisonLt.c +321 -321
  59. nuitka/build/static_src/HelpersComparisonNe.c +329 -329
  60. nuitka/build/static_src/HelpersConsole.c +96 -0
  61. nuitka/build/static_src/HelpersConstantsBlob.c +10 -6
  62. nuitka/build/static_src/HelpersDeepcopy.c +10 -8
  63. nuitka/build/static_src/HelpersDictionaries.c +17 -11
  64. nuitka/build/static_src/HelpersDictionariesGenerated.c +65 -29
  65. nuitka/build/static_src/HelpersExceptions.c +107 -9
  66. nuitka/build/static_src/HelpersFilesystemPaths.c +64 -4
  67. nuitka/build/static_src/HelpersFloats.c +20 -14
  68. nuitka/build/static_src/HelpersImport.c +1 -1
  69. nuitka/build/static_src/HelpersJitSources.c +1 -1
  70. nuitka/build/static_src/HelpersLists.c +29 -19
  71. nuitka/build/static_src/HelpersListsGenerated.c +24 -24
  72. nuitka/build/static_src/HelpersMatching.c +32 -5
  73. nuitka/build/static_src/HelpersOperationBinaryAdd.c +90 -63
  74. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +4 -4
  75. nuitka/build/static_src/HelpersOperationBinaryBitand.c +33 -33
  76. nuitka/build/static_src/HelpersOperationBinaryBitor.c +33 -33
  77. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +33 -33
  78. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +24 -24
  79. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +24 -24
  80. nuitka/build/static_src/HelpersOperationBinaryLshift.c +30 -30
  81. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +7 -7
  82. nuitka/build/static_src/HelpersOperationBinaryMod.c +90 -90
  83. nuitka/build/static_src/HelpersOperationBinaryMult.c +64 -58
  84. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +24 -24
  85. nuitka/build/static_src/HelpersOperationBinaryPow.c +27 -27
  86. nuitka/build/static_src/HelpersOperationBinaryRshift.c +30 -30
  87. nuitka/build/static_src/HelpersOperationBinarySub.c +24 -24
  88. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +24 -24
  89. nuitka/build/static_src/HelpersOperationInplaceAdd.c +67 -49
  90. nuitka/build/static_src/HelpersOperationInplaceBitand.c +25 -25
  91. nuitka/build/static_src/HelpersOperationInplaceBitor.c +25 -25
  92. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +25 -25
  93. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +28 -28
  94. nuitka/build/static_src/HelpersOperationInplaceLshift.c +18 -18
  95. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
  96. nuitka/build/static_src/HelpersOperationInplaceMod.c +70 -70
  97. nuitka/build/static_src/HelpersOperationInplaceMult.c +33 -33
  98. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +28 -28
  99. nuitka/build/static_src/HelpersOperationInplacePow.c +28 -28
  100. nuitka/build/static_src/HelpersOperationInplaceRshift.c +18 -18
  101. nuitka/build/static_src/HelpersOperationInplaceSub.c +28 -28
  102. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +28 -28
  103. nuitka/build/static_src/HelpersRaising.c +10 -3
  104. nuitka/build/static_src/HelpersSafeStrings.c +14 -4
  105. nuitka/build/static_src/HelpersSlices.c +12 -5
  106. nuitka/build/static_src/HelpersStrings.c +1 -1
  107. nuitka/build/static_src/HelpersTuples.c +20 -15
  108. nuitka/build/static_src/InspectPatcher.c +74 -6
  109. nuitka/build/static_src/MainProgram.c +90 -25
  110. nuitka/build/static_src/MetaPathBasedLoader.c +81 -45
  111. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +2 -2
  112. nuitka/build/static_src/OnefileBootstrap.c +17 -20
  113. nuitka/code_generation/CodeGeneration.py +5 -2
  114. nuitka/code_generation/ConstantCodes.py +2 -2
  115. nuitka/code_generation/DictCodes.py +2 -2
  116. nuitka/code_generation/GlobalConstants.py +5 -0
  117. nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
  118. nuitka/code_generation/ListCodes.py +2 -2
  119. nuitka/code_generation/LocalsDictCodes.py +1 -1
  120. nuitka/code_generation/ModuleCodes.py +19 -0
  121. nuitka/code_generation/PackageResourceCodes.py +14 -0
  122. nuitka/code_generation/SliceCodes.py +3 -3
  123. nuitka/code_generation/SubscriptCodes.py +5 -13
  124. nuitka/code_generation/TupleCodes.py +1 -1
  125. nuitka/code_generation/c_types/CTypePyObjectPointers.py +7 -7
  126. nuitka/code_generation/templates/CodeTemplatesConstants.py +7 -5
  127. nuitka/code_generation/templates/CodeTemplatesLoader.py +2 -0
  128. nuitka/code_generation/templates/CodeTemplatesModules.py +78 -54
  129. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +1 -1
  130. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +8 -8
  131. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +5 -5
  132. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +2 -2
  133. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +2 -2
  134. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +57 -21
  135. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -1
  136. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +5 -5
  137. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +18 -18
  138. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +11 -11
  139. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +3 -3
  140. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +3 -3
  141. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +7 -7
  142. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +3 -3
  143. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +11 -11
  144. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
  145. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +10 -10
  146. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
  147. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +3 -3
  148. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +4 -1
  149. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +4 -1
  150. nuitka/finalizations/FinalizeMarkups.py +0 -18
  151. nuitka/freezer/DependsExe.py +9 -4
  152. nuitka/freezer/DllDependenciesMacOS.py +1 -1
  153. nuitka/freezer/DllDependenciesWin32.py +1 -1
  154. nuitka/freezer/ImportDetection.py +1 -0
  155. nuitka/freezer/IncludedDataFiles.py +13 -4
  156. nuitka/freezer/Onefile.py +0 -1
  157. nuitka/freezer/Standalone.py +3 -1
  158. nuitka/importing/ImportCache.py +3 -2
  159. nuitka/importing/Importing.py +16 -3
  160. nuitka/importing/StandardLibrary.py +4 -0
  161. nuitka/nodes/ChildrenHavingMixins.py +2 -0
  162. nuitka/nodes/ExpressionBasesGenerated.py +4 -0
  163. nuitka/nodes/HardImportNodesGenerated.py +83 -0
  164. nuitka/nodes/ModuleNodes.py +10 -2
  165. nuitka/nodes/OsSysNodes.py +16 -0
  166. nuitka/nodes/SubscriptNodes.py +3 -3
  167. nuitka/plugins/PluginBase.py +2 -0
  168. nuitka/plugins/standard/DataFilesPlugin.py +22 -1
  169. nuitka/plugins/standard/DillPlugin/DillPlugin.c +3 -3
  170. nuitka/plugins/standard/OptionsNannyPlugin.py +9 -41
  171. nuitka/plugins/standard/PkgResourcesPlugin.py +8 -2
  172. nuitka/plugins/standard/PySidePyQtPlugin.py +4 -0
  173. nuitka/plugins/standard/standard.nuitka-package.config.yml +29 -13
  174. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +2 -2
  175. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +2 -2
  176. nuitka/specs/HardImportSpecs.py +3 -0
  177. nuitka/specs/ParameterSpecs.py +26 -15
  178. nuitka/tools/general/find_module/FindModuleCode.py +3 -2
  179. nuitka/tools/specialize/CTypeDescriptions.py +11 -9
  180. nuitka/tools/testing/Common.py +12 -5
  181. nuitka/tools/testing/SearchModes.py +5 -1
  182. nuitka/tools/watch/GitHub.py +1 -7
  183. nuitka/tree/Building.py +9 -6
  184. nuitka/tree/ReformulationMatchStatements.py +39 -3
  185. nuitka/tree/TreeHelpers.py +8 -0
  186. nuitka/utils/CStrings.py +7 -0
  187. nuitka/utils/Execution.py +10 -1
  188. nuitka/utils/FileOperations.py +21 -13
  189. nuitka/utils/Images.py +1 -1
  190. nuitka/utils/Importing.py +24 -0
  191. nuitka/utils/ReExecute.py +7 -3
  192. nuitka/utils/SharedLibraries.py +17 -0
  193. nuitka/utils/Yaml.py +9 -1
  194. {Nuitka_winsvc-2.2.2.data → Nuitka_winsvc-2.3.data}/scripts/nuitka-run.bat +0 -0
  195. {Nuitka_winsvc-2.2.2.data → Nuitka_winsvc-2.3.data}/scripts/nuitka.bat +0 -0
  196. {Nuitka_winsvc-2.2.2.dist-info → Nuitka_winsvc-2.3.dist-info}/LICENSE.txt +0 -0
  197. {Nuitka_winsvc-2.2.2.dist-info → Nuitka_winsvc-2.3.dist-info}/WHEEL +0 -0
  198. {Nuitka_winsvc-2.2.2.dist-info → Nuitka_winsvc-2.3.dist-info}/entry_points.txt +0 -0
  199. {Nuitka_winsvc-2.2.2.dist-info → Nuitka_winsvc-2.3.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  {# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file #}
2
2
 
3
- static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
3
+ static {{ target.getTypeDecl() }} COMPARE_{{op_code}}_{{target.getHelperCodeName()}}_{{left.getHelperCodeName()}}_{{right.getHelperCodeName()}}({{left.getVariableDecl("operand1")}}, {{right.getVariableDecl("operand2")}}) {
4
4
  {{left.getCheckValueCode("operand1")}}
5
5
  {{right.getCheckValueCode("operand2")}}
6
6
 
@@ -16,8 +16,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
16
16
  {% endif %}
17
17
 
18
18
  // Convert to target type.
19
- {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r")}};
20
- {{target.getTakeReferenceStatement("result")}}
19
+ {{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r")}};
20
+ {{ target.getTakeReferenceStatement("result", immortal=True) }}
21
21
  return result;
22
22
  }
23
23
 
@@ -60,8 +60,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
60
60
  }
61
61
  }
62
62
 
63
- {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r == " + ("true" if operand == "==" else "false"))}};
64
- {{target.getTakeReferenceStatement("result")}}
63
+ {{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r == " + ("true" if operand == "==" else "false"))}};
64
+ {{ target.getTakeReferenceStatement("result", immortal=True) }}
65
65
  return result;
66
66
  #else
67
67
  bool r;
@@ -77,8 +77,8 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
77
77
  r = (cmp == 0);
78
78
  }
79
79
 
80
- {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r == " + ("true" if operand == "==" else "false"))}};
81
- {{target.getTakeReferenceStatement("result")}}
80
+ {{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r == " + ("true" if operand == "==" else "false"))}};
81
+ {{ target.getTakeReferenceStatement("result", immortal=True) }}
82
82
  return result;
83
83
  #endif
84
84
  {% else %}
@@ -91,9 +91,9 @@ static {{target.getTypeDecl()}} COMPARE_{{op_code}}_{{target.getHelperCodeName()
91
91
  return r;
92
92
  {% else %}
93
93
  // Convert to target type if necessary
94
- {{target.getTypeDecl()}} result = {{target.getToValueFromBoolExpression("r == Py_True")}};
95
- Py_DECREF(r);
96
- {{target.getTakeReferenceStatement("result")}}
94
+ {{ target.getTypeDecl() }} result = {{target.getToValueFromBoolExpression("r == Py_True")}};
95
+ Py_DECREF_IMMORTAL(r);
96
+ {{ target.getTakeReferenceStatement("result", immortal=True) }}
97
97
  return result;
98
98
  {% endif %}
99
99
  {% endif %}
@@ -23,7 +23,7 @@
23
23
  {{ goto_exit(props, "exit_inplace_result_object", "x") }}
24
24
  }
25
25
 
26
- Py_DECREF(x);
26
+ Py_DECREF_IMMORTAL(x);
27
27
  }
28
28
  {% else %}
29
29
  // No inplace number slot {{ nb_inplace_slot }} available for this type.
@@ -171,7 +171,7 @@
171
171
  {{ goto_exit(props, exit_result_object, "x") }}
172
172
  }
173
173
 
174
- Py_DECREF(x);
174
+ Py_DECREF_IMMORTAL(x);
175
175
  slot2 = NULL;
176
176
  }
177
177
  }
@@ -183,7 +183,7 @@
183
183
  {{ goto_exit(props, exit_result_object, "x") }}
184
184
  }
185
185
 
186
- Py_DECREF(x);
186
+ Py_DECREF_IMMORTAL(x);
187
187
  }
188
188
  {% endif %}
189
189
 
@@ -195,7 +195,7 @@
195
195
  {{ goto_exit(props, exit_result_object, "x") }}
196
196
  }
197
197
 
198
- Py_DECREF(x);
198
+ Py_DECREF_IMMORTAL(x);
199
199
  }
200
200
  {% endif %}
201
201
 
@@ -9,7 +9,10 @@
9
9
  {# TODO: Could and should in-line and specialize this per slot too. #}
10
10
  {% if nb_slot == "nb_add" %}
11
11
  {% if left.type_name == "list" == right.type_name %}
12
- PyObject *x = LIST_CONCAT({{ operand1 }}, {{ operand2 }});
12
+ // TODO: Have this more globally passed in
13
+ PyThreadState *tstate = PyThreadState_GET();
14
+
15
+ PyObject *x = LIST_CONCAT(tstate, {{ operand1 }}, {{ operand2 }});
13
16
  {% else %}
14
17
  PyObject *x = {{ left.getSlotCallExpression("sq_concat", "PyList_Type.tp_as_sequence->sq_concat", operand1, operand2) }};
15
18
  {% endif %}
@@ -9,7 +9,10 @@
9
9
  {# TODO: Could and should in-line and specialize this per slot too. #}
10
10
  {% if nb_slot == "nb_add" %}
11
11
  {% if left.type_name == "tuple" == right.type_name %}
12
- PyObject *x = TUPLE_CONCAT({{ operand1 }}, {{ operand2 }});
12
+ // TODO: Have this more globally passed in
13
+ PyThreadState *tstate = PyThreadState_GET();
14
+
15
+ PyObject *x = TUPLE_CONCAT(tstate, {{ operand1 }}, {{ operand2 }});
13
16
  {% else %}
14
17
  PyObject *x = {{ left.getSlotCallExpression("sq_concat", "PyTuple_Type.tp_as_sequence->sq_concat", operand1, operand2) }};
15
18
  {% endif %}
@@ -18,17 +18,9 @@ are in another context.
18
18
  """
19
19
 
20
20
  from nuitka import Tracing
21
- from nuitka.__past__ import unicode
22
- from nuitka.containers.OrderedSets import OrderedSet
23
21
  from nuitka.PythonVersions import python_version
24
22
  from nuitka.tree.Operations import VisitorNoopMixin
25
23
 
26
- imported_names = OrderedSet()
27
-
28
-
29
- def getImportedNames():
30
- return imported_names
31
-
32
24
 
33
25
  class FinalizeMarkups(VisitorNoopMixin):
34
26
  def onEnterNode(self, node):
@@ -66,16 +58,6 @@ class FinalizeMarkups(VisitorNoopMixin):
66
58
  else:
67
59
  search.markAsNeedsGeneratorReturnHandling(1)
68
60
 
69
- if node.isExpressionBuiltinImport() and node.follow_attempted:
70
- module_name = node.subnode_name
71
-
72
- if module_name.isCompileTimeConstant():
73
- imported_module_name = module_name.getCompileTimeConstant()
74
-
75
- if type(imported_module_name) in (str, unicode):
76
- if imported_module_name:
77
- imported_names.add(imported_module_name)
78
-
79
61
  if node.isExpressionFunctionCreation():
80
62
  if (
81
63
  not node.getParent().isExpressionFunctionCall()
@@ -20,6 +20,7 @@ from nuitka.utils.FileOperations import (
20
20
  getFileContentByLine,
21
21
  getWindowsLongPathName,
22
22
  isFilenameBelowPath,
23
+ isFilesystemEncodable,
23
24
  putTextFileContents,
24
25
  withFileLock,
25
26
  )
@@ -160,10 +161,14 @@ def parseDependsExeOutput(filename):
160
161
 
161
162
 
162
163
  def detectDLLsWithDependencyWalker(binary_filename, source_dir, scan_dirs):
163
- dwp_filename = os.path.join(source_dir, os.path.basename(binary_filename) + ".dwp")
164
- output_filename = os.path.join(
165
- source_dir, os.path.basename(binary_filename) + ".depends"
166
- )
164
+ source_dir = getExternalUsePath(source_dir)
165
+ temp_base_name = os.path.basename(binary_filename)
166
+
167
+ if not isFilesystemEncodable(temp_base_name):
168
+ temp_base_name = "dependency_walker"
169
+
170
+ dwp_filename = os.path.join(source_dir, temp_base_name + ".dwp")
171
+ output_filename = os.path.join(source_dir, temp_base_name + ".depends")
167
172
 
168
173
  # User query should only happen once if at all.
169
174
  with withFileLock(
@@ -175,7 +175,7 @@ def _resolveBinaryPathDLLsMacOS(
175
175
  resolved_path = os.path.normpath(os.path.join(rpath, path[7:]))
176
176
  break
177
177
  else:
178
- # These have become virtual in later macOS.
178
+ # These have become virtual in later macOS, spell-checker: ignore libz
179
179
  if library_name in ("libc++.1.dylib", "libz.1.dylib"):
180
180
  continue
181
181
 
@@ -100,7 +100,7 @@ def _getScanDirectories(package_name, original_dir):
100
100
  if cache_key in _scan_dir_cache:
101
101
  return _scan_dir_cache[cache_key]
102
102
 
103
- scan_dirs = [getSystemPrefixPath()]
103
+ scan_dirs = [os.path.dirname(sys.executable), getSystemPrefixPath()]
104
104
 
105
105
  if package_name is not None:
106
106
  scan_dirs.extend(getPackageSpecificDLLDirectories(package_name))
@@ -210,6 +210,7 @@ def _detectEarlyImports():
210
210
  "base64_codec",
211
211
  "hex_codec",
212
212
  "rot_13",
213
+ "punycode",
213
214
  ):
214
215
  if non_locale_encoding in encoding_names:
215
216
  encoding_names.remove(non_locale_encoding)
@@ -227,13 +227,22 @@ def makeIncludedDataDirectory(
227
227
  ignore_suffixes=(),
228
228
  only_suffixes=(),
229
229
  normalize=True,
230
+ raw=False,
230
231
  ):
231
232
  assert isRelativePath(dest_path), dest_path
232
233
  assert os.path.isdir(source_path), source_path
233
234
 
234
- ignore_dirs = tuple(ignore_dirs) + default_ignored_dirs
235
- ignore_filenames = tuple(ignore_filenames) + default_ignored_filenames
236
- ignore_suffixes = tuple(ignore_suffixes) + default_ignored_suffixes
235
+ ignore_dirs = tuple(ignore_dirs)
236
+ if not raw:
237
+ ignore_dirs += default_ignored_dirs
238
+
239
+ ignore_filenames = tuple(ignore_filenames)
240
+ if not raw:
241
+ ignore_filenames += default_ignored_filenames
242
+
243
+ ignore_suffixes = tuple(ignore_suffixes)
244
+ if not raw:
245
+ ignore_suffixes += default_ignored_suffixes
237
246
 
238
247
  for filename in getFileList(
239
248
  source_path,
@@ -255,7 +264,7 @@ def makeIncludedDataDirectory(
255
264
  tags=tags,
256
265
  )
257
266
 
258
- included_datafile.tags.add("data-dir-contents")
267
+ included_datafile.tags.add("raw-dir-contents" if raw else "data-dir-contents")
259
268
 
260
269
  yield included_datafile
261
270
 
nuitka/freezer/Onefile.py CHANGED
@@ -61,7 +61,6 @@ def _runOnefileScons(onefile_compression, onefile_archive):
61
61
  Plugins.writeExtraCodeFiles(onefile=True)
62
62
 
63
63
  options = {
64
- "result_name": OutputDirectories.getResultBasePath(onefile=True),
65
64
  "result_exe": OutputDirectories.getResultFullpath(onefile=True),
66
65
  "source_dir": source_dir,
67
66
  "debug_mode": asBoolStr(Options.is_debug),
@@ -251,7 +251,9 @@ def _detectUsedDLLs(standalone_entry_point, source_dir):
251
251
  update_cache=not shallNotStoreDependsExeCachedResults(),
252
252
  )
253
253
  except NuitkaForbiddenDLLEncounter:
254
- inclusion_logger.info("Not including forbidden DLL '%s'." % binary_filename)
254
+ inclusion_logger.info(
255
+ "Not including due to forbidden DLL '%s'." % binary_filename
256
+ )
255
257
  else:
256
258
  # Plugins generally decide if they allow dependencies from the outside
257
259
  # based on the package name.
@@ -14,6 +14,7 @@ not start anew, but reuse what we already found out about it.
14
14
  import os
15
15
 
16
16
  from nuitka.plugins.Plugins import Plugins
17
+ from nuitka.utils.Importing import hasPackageDirFilename
17
18
 
18
19
  imported_modules = {}
19
20
  imported_by_name = {}
@@ -22,7 +23,7 @@ imported_by_name = {}
22
23
  def addImportedModule(imported_module):
23
24
  module_filename = os.path.abspath(imported_module.getFilename())
24
25
 
25
- if os.path.basename(module_filename) == "__init__.py":
26
+ if hasPackageDirFilename(module_filename):
26
27
  module_filename = os.path.dirname(module_filename)
27
28
 
28
29
  key = (module_filename, imported_module.getFullName())
@@ -55,7 +56,7 @@ def getImportedModuleByNameAndPath(full_name, module_filename):
55
56
  # For caching we use absolute paths only.
56
57
  module_filename = os.path.abspath(module_filename)
57
58
 
58
- if os.path.basename(module_filename) == "__init__.py":
59
+ if hasPackageDirFilename(module_filename):
59
60
  module_filename = os.path.dirname(module_filename)
60
61
 
61
62
  # KeyError is valid result.
@@ -41,6 +41,7 @@ from nuitka.utils.Hashing import getFileContentsHash
41
41
  from nuitka.utils.Importing import (
42
42
  builtin_module_names,
43
43
  getModuleFilenameSuffixes,
44
+ getPackageDirFilename,
44
45
  getSharedLibrarySuffixes,
45
46
  isBuiltinModuleName,
46
47
  )
@@ -228,6 +229,16 @@ def getModuleNameAndKindFromFilename(module_filename):
228
229
  )
229
230
 
230
231
  if os.path.isdir(module_filename):
232
+ package_filename = getPackageDirFilename(module_filename)
233
+
234
+ if package_filename is not None:
235
+ for suffix in getSharedLibrarySuffixes():
236
+ if package_filename.endswith(suffix):
237
+ return (
238
+ ModuleName(os.path.basename(module_filename)),
239
+ "extension",
240
+ )
241
+
231
242
  return ModuleName(os.path.basename(module_filename)), "py"
232
243
 
233
244
  return None, None
@@ -507,9 +518,6 @@ def _findModuleInPath2(package_name, module_name, search_path):
507
518
  found = False
508
519
 
509
520
  for suffix, module_type in getModuleFilenameSuffixes():
510
- if module_type == "C_EXTENSION":
511
- continue
512
-
513
521
  package_file_name = "__init__" + suffix
514
522
 
515
523
  file_path = os.path.join(package_directory, package_file_name)
@@ -1016,6 +1024,11 @@ _stdlib_module_raises = {
1016
1024
  "zlib": False,
1017
1025
  "_ssl": True,
1018
1026
  "_xxinterpchannels": False,
1027
+ # TODO: 3.13 clarify if this is actually true
1028
+ "_interpchannels": False,
1029
+ "_interpreters": False,
1030
+ "_interpqueues": False,
1031
+ "_sysconfig": False,
1019
1032
  }
1020
1033
 
1021
1034
 
@@ -18,6 +18,7 @@ from nuitka.PythonVersions import python_version
18
18
  from nuitka.utils.FileOperations import getFileContents, isFilenameBelowPath
19
19
  from nuitka.utils.ModuleNames import ModuleName
20
20
  from nuitka.utils.Utils import (
21
+ isMacOS,
21
22
  isNetBSD,
22
23
  isPosixWindows,
23
24
  isWin32OrPosixWindows,
@@ -175,6 +176,9 @@ def scanStandardLibraryPath(stdlib_dir):
175
176
  if "ensurepip" in dirs:
176
177
  dirs.remove("ensurepip")
177
178
 
179
+ if "_ios_support.py" in filenames and not isMacOS():
180
+ filenames.remove("_ios_support.py")
181
+
178
182
  # Ignore "lib-dynload" and "lib-tk" and alike.
179
183
  dirs[:] = [
180
184
  dirname
@@ -13853,6 +13853,7 @@ class ChildHavingPathMixin(object):
13853
13853
  # ExpressionOsPathExists
13854
13854
  # ExpressionOsPathIsdir
13855
13855
  # ExpressionOsPathIsfile
13856
+ # ExpressionOsPathNormpath
13856
13857
 
13857
13858
  def __init__(
13858
13859
  self,
@@ -13939,6 +13940,7 @@ ChildrenExpressionOsPathAbspathMixin = ChildHavingPathMixin
13939
13940
  ChildrenExpressionOsPathExistsMixin = ChildHavingPathMixin
13940
13941
  ChildrenExpressionOsPathIsdirMixin = ChildHavingPathMixin
13941
13942
  ChildrenExpressionOsPathIsfileMixin = ChildHavingPathMixin
13943
+ ChildrenExpressionOsPathNormpathMixin = ChildHavingPathMixin
13942
13944
 
13943
13945
 
13944
13946
  class ChildHavingPathOptionalMixin(object):
@@ -206,6 +206,7 @@ class ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin(Expressio
206
206
 
207
207
  # This is generated for use in
208
208
  # ExpressionBuiltinMakeExceptionImportError
209
+ # ExpressionBuiltinMakeExceptionModuleNotFoundError
209
210
 
210
211
  def __init__(self, args, name, path, source_ref):
211
212
  assert type(args) is tuple
@@ -390,6 +391,9 @@ class ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin(Expressio
390
391
  ExpressionBuiltinMakeExceptionImportErrorBase = (
391
392
  ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin
392
393
  )
394
+ ExpressionBuiltinMakeExceptionModuleNotFoundErrorBase = (
395
+ ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin
396
+ )
393
397
 
394
398
 
395
399
  class ChildrenHavingCallableArgSentinelFinalMixin(ExpressionBase):
@@ -63,6 +63,7 @@ from nuitka.specs.HardImportSpecs import (
63
63
  os_path_isabs_spec,
64
64
  os_path_isdir_spec,
65
65
  os_path_isfile_spec,
66
+ os_path_normpath_spec,
66
67
  os_uname_spec,
67
68
  pkg_resources_get_distribution_spec,
68
69
  pkg_resources_iter_entry_points_spec,
@@ -2489,6 +2490,88 @@ class ExpressionOsPathIsfileCallBase(ChildHavingPathMixin, ExpressionBase):
2489
2490
  return True
2490
2491
 
2491
2492
 
2493
+ class ExpressionOsPathNormpathRef(ExpressionImportModuleNameHardExistsSpecificBase):
2494
+ """Function reference os.path.normpath"""
2495
+
2496
+ kind = "EXPRESSION_OS_PATH_NORMPATH_REF"
2497
+
2498
+ def __init__(self, source_ref):
2499
+ ExpressionImportModuleNameHardExistsSpecificBase.__init__(
2500
+ self,
2501
+ module_name=os.path.__name__,
2502
+ import_name="normpath",
2503
+ module_guaranteed=True,
2504
+ source_ref=source_ref,
2505
+ )
2506
+
2507
+ def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
2508
+ # Anything may happen on call trace before this. On next pass, if
2509
+ # replaced, we might be better but not now.
2510
+ trace_collection.onExceptionRaiseExit(BaseException)
2511
+
2512
+ from .OsSysNodes import ExpressionOsPathNormpathCall
2513
+
2514
+ result = extractBuiltinArgs(
2515
+ node=call_node,
2516
+ builtin_class=ExpressionOsPathNormpathCall,
2517
+ builtin_spec=os_path_normpath_spec,
2518
+ )
2519
+
2520
+ return (
2521
+ result,
2522
+ "new_expression",
2523
+ "Call to 'os.path.normpath' recognized.",
2524
+ )
2525
+
2526
+
2527
+ hard_import_node_classes[ExpressionOsPathNormpathRef] = os_path_normpath_spec
2528
+
2529
+
2530
+ class ExpressionOsPathNormpathCallBase(ChildHavingPathMixin, ExpressionBase):
2531
+ """Base class for OsPathNormpathCall
2532
+
2533
+ Generated boiler plate code.
2534
+ """
2535
+
2536
+ named_children = ("path",)
2537
+
2538
+ __slots__ = ("attempted",)
2539
+
2540
+ spec = os_path_normpath_spec
2541
+
2542
+ def __init__(self, path, source_ref):
2543
+
2544
+ ChildHavingPathMixin.__init__(
2545
+ self,
2546
+ path=path,
2547
+ )
2548
+
2549
+ ExpressionBase.__init__(self, source_ref)
2550
+
2551
+ self.attempted = False
2552
+
2553
+ def computeExpression(self, trace_collection):
2554
+ if self.attempted or not os_path_normpath_spec.isCompileTimeComputable(
2555
+ (self.subnode_path,)
2556
+ ):
2557
+ trace_collection.onExceptionRaiseExit(BaseException)
2558
+
2559
+ return self, None, None
2560
+
2561
+ try:
2562
+ return self.replaceWithCompileTimeValue(trace_collection)
2563
+ finally:
2564
+ self.attempted = True
2565
+
2566
+ @abstractmethod
2567
+ def replaceWithCompileTimeValue(self, trace_collection):
2568
+ pass
2569
+
2570
+ @staticmethod
2571
+ def mayRaiseExceptionOperation():
2572
+ return True
2573
+
2574
+
2492
2575
  class ExpressionOsUnameRef(ExpressionImportModuleNameHardExistsSpecificBase):
2493
2576
  """Function reference os.uname"""
2494
2577
 
@@ -20,6 +20,7 @@ from nuitka.PythonVersions import python_version
20
20
  from nuitka.SourceCodeReferences import fromFilename
21
21
  from nuitka.tree.SourceHandling import parsePyIFile, readSourceCodeFromFilename
22
22
  from nuitka.utils.CStrings import encodePythonIdentifierToC
23
+ from nuitka.utils.Importing import getSharedLibrarySuffix
23
24
  from nuitka.utils.ModuleNames import ModuleName
24
25
 
25
26
  from .ChildrenHavingMixins import (
@@ -971,13 +972,14 @@ class PythonMainModule(CompiledPythonModule):
971
972
  class PythonExtensionModule(PythonModuleBase):
972
973
  kind = "PYTHON_EXTENSION_MODULE"
973
974
 
974
- __slots__ = ("used_modules", "technical")
975
+ __slots__ = ("used_modules", "module_filename", "technical")
975
976
 
976
977
  avoid_duplicates = set()
977
978
 
978
979
  def __init__(
979
980
  self,
980
981
  module_name,
982
+ module_filename,
981
983
  reason,
982
984
  technical,
983
985
  source_ref,
@@ -1005,11 +1007,17 @@ class PythonExtensionModule(PythonModuleBase):
1005
1007
 
1006
1008
  self.used_modules = None
1007
1009
 
1010
+ if os.path.isdir(module_filename):
1011
+ module_filename = os.path.join(
1012
+ module_filename, "__init__" + getSharedLibrarySuffix(preferred=False)
1013
+ )
1014
+ self.module_filename = module_filename
1015
+
1008
1016
  def finalize(self):
1009
1017
  del self.used_modules
1010
1018
 
1011
1019
  def getFilename(self):
1012
- return self.source_ref.getFilename()
1020
+ return self.module_filename
1013
1021
 
1014
1022
  @staticmethod
1015
1023
  def startTraversal():
@@ -112,6 +112,22 @@ class ExpressionOsPathAbspathCall(ExpressionOsPathAbspathCallBase):
112
112
  return self, None, None
113
113
 
114
114
 
115
+ class ExpressionOsPathNormpathCall(ExpressionOsPathAbspathCallBase):
116
+ kind = "EXPRESSION_OS_PATH_NORMPATH_CALL"
117
+
118
+ def replaceWithCompileTimeValue(self, trace_collection):
119
+ result = makeConstantRefNode(
120
+ constant=os.path.normpath(self.subnode_path.getCompileTimeConstant()),
121
+ source_ref=self.source_ref,
122
+ )
123
+
124
+ return (
125
+ result,
126
+ "new_expression",
127
+ "Compile time resolved 'os.path.normpath' call.",
128
+ )
129
+
130
+
115
131
  class ExpressionOsPathIsabsCall(ExpressionOsPathIsabsCallBase):
116
132
  kind = "EXPRESSION_OS_PATH_ISABS_CALL"
117
133
 
@@ -118,13 +118,13 @@ def hasSubscript(value, subscript):
118
118
  return True
119
119
 
120
120
 
121
- class ExpressionSubscriptCheck(
121
+ class ExpressionMatchSubscriptCheck(
122
122
  ExpressionBoolShapeExactMixin,
123
123
  SideEffectsFromChildrenMixin,
124
124
  ChildrenHavingExpressionSubscriptMixin,
125
125
  ExpressionBase,
126
126
  ):
127
- kind = "EXPRESSION_SUBSCRIPT_CHECK"
127
+ kind = "EXPRESSION_MATCH_SUBSCRIPT_CHECK"
128
128
 
129
129
  named_children = ("expression", "subscript")
130
130
 
@@ -153,7 +153,7 @@ class ExpressionSubscriptCheck(
153
153
  computation=lambda: hasSubscript(
154
154
  source.getCompileTimeConstant(), subscript.getCompileTimeConstant()
155
155
  ),
156
- description="Subscript check has been pre-computed.",
156
+ description="Subscript match check has been pre-computed.",
157
157
  )
158
158
 
159
159
  # If source has side effects, they must be evaluated.
@@ -895,6 +895,7 @@ Unwanted import of '%(unwanted)s' that %(problem)s '%(binding_name)s' encountere
895
895
  ignore_suffixes=(),
896
896
  only_suffixes=(),
897
897
  normalize=True,
898
+ raw=False,
898
899
  ):
899
900
  return makeIncludedDataDirectory(
900
901
  source_path=source_path,
@@ -907,6 +908,7 @@ Unwanted import of '%(unwanted)s' that %(problem)s '%(binding_name)s' encountere
907
908
  ignore_suffixes=ignore_suffixes,
908
909
  only_suffixes=only_suffixes,
909
910
  normalize=normalize,
911
+ raw=raw,
910
912
  )
911
913
 
912
914
  def makeIncludedEmptyDirectory(self, dest_path, reason, tags):
@@ -120,7 +120,7 @@ class NuitkaPluginDataFileCollector(NuitkaYamlPluginBase):
120
120
  if dirs is not None:
121
121
  if type(dirs) is not list or not dirs:
122
122
  self.sysexit(
123
- "Error, requiring list below 'empty_dirs_structure' entry for '%s' entry."
123
+ "Error, requiring list below 'dirs' entry for '%s' entry."
124
124
  % module_name
125
125
  )
126
126
 
@@ -136,6 +136,27 @@ class NuitkaPluginDataFileCollector(NuitkaYamlPluginBase):
136
136
  tags="config",
137
137
  )
138
138
 
139
+ raw_dirs = data_file_config.get("raw_dirs")
140
+ if raw_dirs is not None:
141
+ if type(raw_dirs) is not list or not raw_dirs:
142
+ self.sysexit(
143
+ "Error, requiring list below 'raw_dirs' entry for '%s' entry."
144
+ % module_name
145
+ )
146
+
147
+ for raw_dir in raw_dirs:
148
+ source_path = os.path.join(module_folder, raw_dir)
149
+
150
+ if os.path.isdir(source_path):
151
+ yield self.makeIncludedDataDirectory(
152
+ source_path=source_path,
153
+ dest_path=os.path.join(target_dir, raw_dir),
154
+ reason="package raw directory '%s' for %r"
155
+ % (raw_dir, module_name.asString()),
156
+ tags="config",
157
+ raw=True,
158
+ )
159
+
139
160
  include_pyi_file = data_file_config.get("include-pyi-file")
140
161
 
141
162
  if include_pyi_file == "yes":
@@ -11,12 +11,12 @@ void registerDillPluginTables(PyThreadState *tstate, char const *module_name, Py
11
11
  if (function_tables == NULL) {
12
12
  CLEAR_ERROR_OCCURRED(tstate);
13
13
 
14
- function_tables = MAKE_DICT_EMPTY();
14
+ function_tables = MAKE_DICT_EMPTY(tstate);
15
15
  PyObject_SetAttrString((PyObject *)builtin_module, "compiled_function_tables", function_tables);
16
16
  }
17
17
 
18
- PyObject *funcs =
19
- MAKE_TUPLE2_0(PyCFunction_New(reduce_compiled_function, NULL), PyCFunction_New(create_compiled_function, NULL));
18
+ PyObject *funcs = MAKE_TUPLE2_0(tstate, PyCFunction_New(reduce_compiled_function, NULL),
19
+ PyCFunction_New(create_compiled_function, NULL));
20
20
 
21
21
  PyDict_SetItemString(function_tables, module_name, funcs);
22
22
  }