Nuitka-winsvc 2.2.3__cp311-cp311-win_amd64.whl → 2.3.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 (201) hide show
  1. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/METADATA +2 -1
  2. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/RECORD +201 -200
  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 +106 -45
  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 +18 -6
  18. nuitka/build/SconsInterface.py +28 -8
  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 +49 -5
  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 +952 -133
  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 +16 -17
  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 +80 -54
  129. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +1 -1
  130. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +59 -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/IncludedEntryPoints.py +16 -0
  157. nuitka/freezer/Onefile.py +0 -1
  158. nuitka/freezer/Standalone.py +38 -21
  159. nuitka/importing/ImportCache.py +3 -2
  160. nuitka/importing/Importing.py +16 -3
  161. nuitka/importing/StandardLibrary.py +4 -0
  162. nuitka/nodes/ChildrenHavingMixins.py +2 -0
  163. nuitka/nodes/ExpressionBasesGenerated.py +4 -0
  164. nuitka/nodes/HardImportNodesGenerated.py +83 -0
  165. nuitka/nodes/ModuleNodes.py +10 -2
  166. nuitka/nodes/OsSysNodes.py +16 -0
  167. nuitka/nodes/SubscriptNodes.py +3 -3
  168. nuitka/plugins/PluginBase.py +2 -0
  169. nuitka/plugins/standard/DataFilesPlugin.py +22 -1
  170. nuitka/plugins/standard/DillPlugin/DillPlugin.c +3 -3
  171. nuitka/plugins/standard/ImplicitImports.py +3 -0
  172. nuitka/plugins/standard/OptionsNannyPlugin.py +9 -41
  173. nuitka/plugins/standard/PkgResourcesPlugin.py +8 -2
  174. nuitka/plugins/standard/PySidePyQtPlugin.py +3 -0
  175. nuitka/plugins/standard/standard.nuitka-package.config.yml +28 -13
  176. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +2 -2
  177. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +7 -2
  178. nuitka/specs/HardImportSpecs.py +3 -0
  179. nuitka/specs/ParameterSpecs.py +26 -15
  180. nuitka/tools/general/find_module/FindModuleCode.py +3 -2
  181. nuitka/tools/specialize/CTypeDescriptions.py +11 -9
  182. nuitka/tools/testing/Common.py +12 -5
  183. nuitka/tools/testing/SearchModes.py +5 -1
  184. nuitka/tools/testing/run_nuitka_tests/__main__.py +37 -0
  185. nuitka/tools/watch/GitHub.py +1 -7
  186. nuitka/tree/Building.py +9 -6
  187. nuitka/tree/ReformulationMatchStatements.py +51 -14
  188. nuitka/tree/TreeHelpers.py +8 -0
  189. nuitka/utils/CStrings.py +7 -0
  190. nuitka/utils/Execution.py +10 -1
  191. nuitka/utils/FileOperations.py +21 -13
  192. nuitka/utils/Importing.py +24 -0
  193. nuitka/utils/ReExecute.py +12 -3
  194. nuitka/utils/SharedLibraries.py +26 -1
  195. nuitka/utils/Yaml.py +9 -1
  196. {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.2.data}/scripts/nuitka-run.bat +0 -0
  197. {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.2.data}/scripts/nuitka.bat +0 -0
  198. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/LICENSE.txt +0 -0
  199. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/WHEEL +0 -0
  200. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/entry_points.txt +0 -0
  201. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/top_level.txt +0 -0
@@ -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
  }
@@ -653,6 +653,9 @@ According to Yaml 'overridden-environment-variables' configuration."""
653
653
  "asyncua.ua.object_ids", # Too large generated code
654
654
  "asyncua.ua.uaerrors._auto", # Too large generated code
655
655
  "asyncua.server.standard_address_space.standard_address_space_services", # Too large generated code
656
+ "opcua.ua.object_ids", # Too large generated code
657
+ "opcua.ua.uaerrors._auto", # Too large generated code
658
+ "opcua.server.server.standard_address_space",
656
659
  "azure.mgmt.network", # Too large generated code
657
660
  "azure.mgmt.compute", # Too large generated code
658
661
  "transformers.utils.dummy_pt_objects", # Not performance relevant.
@@ -11,9 +11,7 @@ console is disabled. This reads Yaml configuration.
11
11
  from nuitka.Options import (
12
12
  isOnefileMode,
13
13
  isStandaloneMode,
14
- mayDisableConsoleWindow,
15
14
  shallCreateAppBundle,
16
- shallDisableConsoleWindow,
17
15
  )
18
16
  from nuitka.plugins.PluginBase import NuitkaYamlPluginBase
19
17
  from nuitka.utils.Utils import isMacOS
@@ -72,37 +70,6 @@ class NuitkaPluginOptionsNanny(NuitkaYamlPluginBase):
72
70
  % full_name.asString()
73
71
  )
74
72
 
75
- def _checkConsoleMode(self, full_name, console):
76
- if console == "no":
77
- if shallDisableConsoleWindow() is not True:
78
- self.sysexit(
79
- "Error, when using '%s', you have to use '--disable-console' option."
80
- % full_name
81
- )
82
- elif console == "yes":
83
- pass
84
- elif console == "recommend":
85
- if shallDisableConsoleWindow() is None:
86
- if isMacOS():
87
- downside_message = """\
88
- Otherwise high resolution will not be available and a terminal window will open"""
89
- else:
90
- downside_message = """\
91
- Otherwise a terminal window will open"""
92
-
93
- self.info(
94
- """\
95
- Note, when using '%s', consider using '--disable-console' option. %s. However \
96
- for debugging, terminal output is the easiest way to see informative traceback \
97
- and error information, so delay this until your program is working and remove \
98
- once you find it non-working, and use '--enable-console' to make it explicit \
99
- and not see this message."""
100
- % (full_name, downside_message)
101
- )
102
-
103
- else:
104
- self.sysexitIllegalOptionValue(full_name, "console", console)
105
-
106
73
  def _checkMacOSBundleMode(self, full_name, macos_bundle):
107
74
  if macos_bundle == "yes":
108
75
  if isStandaloneMode() and not shallCreateAppBundle():
@@ -114,8 +81,15 @@ Error, package '%s' requires '--macos-create-app-bundle' to be used or else it c
114
81
  elif macos_bundle == "no":
115
82
  pass
116
83
  elif macos_bundle == "recommend":
117
- # TODO: Not really recommending with a message it yet.
118
- pass
84
+ self.info(
85
+ """\
86
+ Note, when using '%s', consider using '--macos-create-app-bundle' option. \
87
+ Otherwise high resolution will not be available and a terminal window will \
88
+ open. However for debugging, terminal output is the easiest way to see \
89
+ informative traceback and error information, so launch it from there if \
90
+ possible."""
91
+ % full_name
92
+ )
119
93
  else:
120
94
  self.sysexitIllegalOptionValue(full_name, "macos_bundle", macos_bundle)
121
95
 
@@ -151,12 +125,6 @@ Error, package '%s' requires '--onefile' to be used on top of '--macos-create-ap
151
125
  condition=condition,
152
126
  )
153
127
 
154
- if mayDisableConsoleWindow():
155
- self._checkConsoleMode(
156
- full_name=full_name,
157
- console=check.get("console", "yes"),
158
- )
159
-
160
128
  if isMacOS():
161
129
  self._checkMacOSBundleMode(
162
130
  full_name=full_name,
@@ -52,8 +52,14 @@ class NuitkaPluginResources(NuitkaPluginBase):
52
52
 
53
53
  for entry_point in dist.entry_points:
54
54
  if entry_point.group == group and entry_point.name == name:
55
- module_name = entry_point.module
56
- main_name = entry_point.attr
55
+ try:
56
+ module_name = entry_point.module
57
+ main_name = entry_point.attr
58
+ except AttributeError:
59
+ match = entry_point.pattern.match(entry_point.value)
60
+
61
+ module_name = match.group("module")
62
+ main_name = match.group("attr")
57
63
 
58
64
  break
59
65
 
@@ -1459,6 +1459,9 @@ it for full compatible behavior with the uncompiled code to debug it."""
1459
1459
 
1460
1460
  return (False, "Not included due to all Qt bindings disallowed.")
1461
1461
 
1462
+ def getEvaluationConditionControlTags(self):
1463
+ return {"use_noqt": True}
1464
+
1462
1465
 
1463
1466
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
1464
1467
  # integrates with CPython, but also works on its own.
@@ -446,10 +446,12 @@
446
446
  'is_triton_available()': 'False'
447
447
  when: 'not use_setuptools'
448
448
 
449
- - module-name: 'bokeh' # checksum: e1035750
449
+ - module-name: 'bokeh' # checksum: cd9c2e63
450
450
  data-files:
451
451
  dirs:
452
452
  - '_sri'
453
+ patterns:
454
+ - '_sri.json'
453
455
 
454
456
  - module-name: 'bokeh.core' # checksum: 3dbea61d
455
457
  data-files:
@@ -1273,6 +1275,12 @@
1273
1275
  macos_bundle: 'yes'
1274
1276
  when: 'macos'
1275
1277
 
1278
+ - module-name: 'freetype' # checksum: 5a9431c2
1279
+ dlls:
1280
+ - from_filenames:
1281
+ prefixes:
1282
+ - 'libfreetype'
1283
+
1276
1284
  - module-name: 'frozendict' # checksum: 85584475
1277
1285
  data-files:
1278
1286
  patterns:
@@ -1816,6 +1824,13 @@
1816
1824
  replacements_plain:
1817
1825
  'from keras.testing_infra.test_utils import layer_test': ''
1818
1826
 
1827
+ - module-name: 'keras.src' # checksum: 9760fd72
1828
+ anti-bloat:
1829
+ - description: 'remove unittest reference'
1830
+ replacements_plain:
1831
+ 'from keras.src.testing_infra import test_utils': 'test_utils = None'
1832
+ when: 'not use_unittest'
1833
+
1819
1834
  - module-name: 'keras.src.utils.vis_utils' # checksum: 7d07a2d1
1820
1835
  anti-bloat:
1821
1836
  - description: 'remove IPython reference'
@@ -3688,7 +3703,7 @@
3688
3703
  dirs:
3689
3704
  - '.'
3690
3705
 
3691
- - module-name: 'pygame' # checksum: 74ba6d7b
3706
+ - module-name: 'pygame' # checksum: 5fbb83cf
3692
3707
  data-files:
3693
3708
  patterns:
3694
3709
  - 'freesansbold.ttf'
@@ -3696,7 +3711,7 @@
3696
3711
  options:
3697
3712
  checks:
3698
3713
  - description: 'PyGame is a GUI framework'
3699
- console: 'recommend'
3714
+ macos_bundle: 'recommend'
3700
3715
 
3701
3716
  - module-name: 'pygame_menu' # checksum: 3f9f0b7d
3702
3717
  data-files:
@@ -3814,7 +3829,7 @@
3814
3829
  dirs:
3815
3830
  - 'proj_dir'
3816
3831
 
3817
- - module-name: 'PyQt5' # checksum: c7182cc5
3832
+ - module-name: 'PyQt5' # checksum: 8ca4bbdf
3818
3833
  data-files:
3819
3834
  empty_dirs:
3820
3835
  - 'Qt5'
@@ -3823,7 +3838,7 @@
3823
3838
  options:
3824
3839
  checks:
3825
3840
  - description: 'PyQt5 is a GUI framework'
3826
- console: 'recommend'
3841
+ macos_bundle: 'recommend'
3827
3842
  when: 'use_pyqt5'
3828
3843
  - description: 'PyQt5 cannot be used without bundle'
3829
3844
  macos_bundle: 'yes'
@@ -3836,11 +3851,11 @@
3836
3851
  - acceptable-missing-dlls:
3837
3852
  - 'libqpdf'
3838
3853
 
3839
- - module-name: 'PyQt6' # checksum: 884033ec
3854
+ - module-name: 'PyQt6' # checksum: 9ddfb6bb
3840
3855
  options:
3841
3856
  checks:
3842
3857
  - description: 'PyQt6 is a GUI framework'
3843
- console: 'recommend'
3858
+ macos_bundle: 'recommend'
3844
3859
  when: 'use_pyqt6'
3845
3860
  - description: 'PyQt6 on macOS is not supported, use PySide6 instead'
3846
3861
  support_info: 'error'
@@ -3990,7 +4005,7 @@
3990
4005
  prefixes:
3991
4006
  - 'libcvhf'
3992
4007
 
3993
- - module-name: 'PySide2' # checksum: 4e71be92
4008
+ - module-name: 'PySide2' # checksum: c07d1551
3994
4009
  implicit-imports:
3995
4010
  - post-import-code:
3996
4011
  - |
@@ -4009,7 +4024,7 @@
4009
4024
  options:
4010
4025
  checks:
4011
4026
  - description: 'PySide2 is a GUI framework'
4012
- console: 'recommend'
4027
+ macos_bundle: 'recommend'
4013
4028
  when: 'use_pyside2'
4014
4029
  - description: 'PySide2 cannot be signed unless onefile'
4015
4030
  macos_bundle_as_onefile: 'yes'
@@ -4018,7 +4033,7 @@
4018
4033
  - find-dlls-near-module:
4019
4034
  - 'shiboken2'
4020
4035
 
4021
- - module-name: 'PySide6' # checksum: 8852cddf
4036
+ - module-name: 'PySide6' # checksum: a87b6b1
4022
4037
  implicit-imports:
4023
4038
  - post-import-code:
4024
4039
  - |
@@ -4056,7 +4071,7 @@
4056
4071
  options:
4057
4072
  checks:
4058
4073
  - description: 'PySide6 is a GUI framework'
4059
- console: 'recommend'
4074
+ macos_bundle: 'recommend'
4060
4075
  when: 'use_pyside6'
4061
4076
 
4062
4077
  import-hacks:
@@ -7372,11 +7387,11 @@
7372
7387
  - depends:
7373
7388
  - '._noop'
7374
7389
 
7375
- - module-name: 'wx' # checksum: 154e95cb
7390
+ - module-name: 'wx' # checksum: 9a4d4164
7376
7391
  options:
7377
7392
  checks:
7378
7393
  - description: 'wx will crash in console mode during startup'
7379
- console: 'yes'
7394
+ macos_bundle: 'yes'
7380
7395
  when: 'macos'
7381
7396
  - description: 'wx requires program to be in bundle form'
7382
7397
  macos_bundle: 'yes'
@@ -59,10 +59,10 @@
59
59
  change_function:
60
60
  'test': "'(lambda: None)'"
61
61
 
62
- - module-name: 'Tkinter' # checksum: 16ff58dd
62
+ - module-name: 'Tkinter' # checksum: 6eaa6fb1
63
63
  options:
64
64
  checks:
65
- - console: 'recommend'
65
+ - macos_bundle: 'recommend'
66
66
  when: 'plugin("tk-inter")'
67
67
 
68
68
  - module-name: 'xml.sax.xmlreader' # checksum: 167cb032
@@ -9,6 +9,11 @@
9
9
  - depends:
10
10
  - 'asyncio'
11
11
 
12
+ - module-name: '_osx_support' # checksum: e893ad4b
13
+ anti-bloat:
14
+ - no-auto-follow:
15
+ 'distutils': 'ignore'
16
+
12
17
  - module-name: '_zoneinfo' # checksum: 8de2a2bd
13
18
  implicit-imports:
14
19
  - depends:
@@ -320,7 +325,7 @@
320
325
  change_function:
321
326
  '_test': "'(lambda: None)'"
322
327
 
323
- - module-name: 'tkinter' # checksum: cef6b613
328
+ - module-name: 'tkinter' # checksum: 481f7b98
324
329
  anti-bloat:
325
330
  - description: 'enhanced tk-inter in case of missing tcl'
326
331
  context:
@@ -338,7 +343,7 @@
338
343
  when: 'not deployment and not plugin("tk-inter")'
339
344
  options:
340
345
  checks:
341
- - console: 'recommend'
346
+ - macos_bundle: 'recommend'
342
347
  when: 'plugin("tk-inter")'
343
348
 
344
349
  - module-name: 'tokenize' # checksum: 6a44b57d
@@ -131,6 +131,9 @@ os_path_basename_spec = BuiltinParameterSpec(
131
131
  "os.path.basename", ("p",), default_count=0
132
132
  )
133
133
  os_path_dirname_spec = BuiltinParameterSpec("os.path.dirname", ("p",), default_count=0)
134
+ os_path_normpath_spec = BuiltinParameterSpec(
135
+ "os.path.normpath", ("path",), default_count=0
136
+ )
134
137
  os_path_abspath_spec = BuiltinParameterSpec(
135
138
  "os.path.abspath", ("path",), default_count=0
136
139
  )
@@ -391,24 +391,30 @@ def matchCall(
391
391
  try:
392
392
  arg_index = (args + kw_only_args).index(pair[0])
393
393
  except ValueError:
394
- if improved or python_version >= 0x370:
395
- message = "'%s' is an invalid keyword argument for %s()" % (
396
- pair[0],
397
- func_name,
398
- )
394
+ if python_version < 0x370 and not improved:
395
+ template = "'%(arg_name)s' is an invalid keyword argument for this function"
396
+ elif python_version < 0x3D0 and not improved:
397
+ template = "'%(arg_name)s' is an invalid keyword argument for %(func_name)s()"
399
398
  else:
400
- message = (
401
- "'%s' is an invalid keyword argument for this function"
402
- % pair[0]
403
- )
399
+ template = "%(func_name)s() got an unexpected keyword argument '%(arg_name)s'"
400
+
401
+ message = template % {
402
+ "arg_name": pair[0],
403
+ "func_name": func_name,
404
+ }
404
405
 
405
406
  raise TooManyArguments(TypeError(message))
406
407
 
407
408
  if arg_index < num_pos_only:
408
- message = "'%s' is an invalid keyword argument for %s()" % (
409
- pair[0],
410
- func_name,
411
- )
409
+ if python_version < 0x3D0:
410
+ template = "'%(arg_name)s' is an invalid keyword argument for %(func_name)s()"
411
+ else:
412
+ template = "%(func_name)s() got an unexpected keyword argument '%(arg_name)s'"
413
+
414
+ message = template % {
415
+ "arg_name": pair[0],
416
+ "func_name": func_name,
417
+ }
412
418
 
413
419
  raise TooManyArguments(TypeError(message))
414
420
 
@@ -446,9 +452,14 @@ def matchCall(
446
452
  )
447
453
  )
448
454
 
455
+ if python_version < 0x3D0:
456
+ template = "%s() takes at most %d %s (%d given)"
457
+ else:
458
+ template = "%s expected at most %d %s, got %d"
459
+
449
460
  raise TooManyArguments(
450
461
  TypeError(
451
- "%s() takes at most %d %s (%d given)"
462
+ template
452
463
  % (
453
464
  func_name,
454
465
  num_args,
@@ -507,7 +518,7 @@ def matchCall(
507
518
  elif pairs:
508
519
  unexpected = next(iter(dict(pairs)))
509
520
 
510
- if improved:
521
+ if improved or python_version >= 0x3D0:
511
522
  message = "%s() got an unexpected keyword argument '%s'" % (
512
523
  func_name,
513
524
  unexpected,
@@ -20,6 +20,7 @@ from nuitka.importing.Importing import (
20
20
  from nuitka.Tracing import tools_logger
21
21
  from nuitka.utils.Execution import callProcess, getExecutablePath
22
22
  from nuitka.utils.FileOperations import relpath
23
+ from nuitka.utils.Importing import getPackageDirFilename
23
24
  from nuitka.utils.Utils import isWin32Windows
24
25
 
25
26
 
@@ -76,9 +77,9 @@ def editModuleCode(module_search_desc):
76
77
  tools_logger.sysexit("Error, did not find '%s' module" % module_name)
77
78
  else:
78
79
  if os.path.isdir(module_filename):
79
- candidate = os.path.join(module_filename, ("__init__.py"))
80
+ candidate = getPackageDirFilename(module_filename)
80
81
 
81
- if os.path.isfile(candidate):
82
+ if candidate is not None:
82
83
  module_filename = candidate
83
84
 
84
85
  if os.path.isdir(module_filename):
@@ -670,8 +670,11 @@ return %(return_value)s;""" % {
670
670
  )
671
671
 
672
672
  @staticmethod
673
- def getTakeReferenceStatement(operand):
674
- return "Py_INCREF(%s);" % operand
673
+ def getTakeReferenceStatement(operand, immortal):
674
+ return "%s(%s);" % (
675
+ ("Py_INCREF_IMMORTAL" if immortal else "Py_INCREF"),
676
+ operand,
677
+ )
675
678
 
676
679
  @classmethod
677
680
  def hasReferenceCounting(cls):
@@ -764,10 +767,9 @@ return %(return_value)s;""" % {
764
767
  @classmethod
765
768
  def getAssignFromBoolExpressionCode(cls, result, operand, give_ref):
766
769
  if cls.type_name == "object":
767
- # TODO: Python3?
768
770
  code = "%s = BOOL_FROM(%s);" % (result, operand)
769
771
  if give_ref:
770
- code += "Py_INCREF(%s);" % result
772
+ code += "Py_INCREF_IMMORTAL(%s);" % result
771
773
 
772
774
  return code
773
775
  elif cls.type_name == "nbool":
@@ -903,7 +905,7 @@ Py_INCREF(%(result)s);""" % {
903
905
  def getAssignConversionCode(cls, result, left, value):
904
906
  def _getObjectObject():
905
907
  code = "%s = %s;" % (result, value)
906
- code += cls.getTakeReferenceStatement(result)
908
+ code += cls.getTakeReferenceStatement(result, immortal=False)
907
909
 
908
910
  return code
909
911
 
@@ -964,7 +966,7 @@ assert(%(type_name)s_CheckExact(%(operand)s));""" % {
964
966
  pass
965
967
 
966
968
  @staticmethod
967
- def getTakeReferenceStatement(operand):
969
+ def getTakeReferenceStatement(operand, immortal):
968
970
  return ""
969
971
 
970
972
 
@@ -1598,7 +1600,7 @@ class CBoolDesc(ConcreteCTypeBase):
1598
1600
  return "CHECK_IF_TRUE(%s) == 1" % operand
1599
1601
 
1600
1602
  @staticmethod
1601
- def getTakeReferenceStatement(operand):
1603
+ def getTakeReferenceStatement(operand, immortal):
1602
1604
  return ""
1603
1605
 
1604
1606
  @staticmethod
@@ -1644,7 +1646,7 @@ class NBoolDesc(ConcreteCTypeBase):
1644
1646
  return cls.getToValueFromBoolExpression("CHECK_IF_TRUE(%s)" % operand)
1645
1647
 
1646
1648
  @staticmethod
1647
- def getTakeReferenceStatement(operand):
1649
+ def getTakeReferenceStatement(operand, immortal):
1648
1650
  return ""
1649
1651
 
1650
1652
  @staticmethod
@@ -1695,7 +1697,7 @@ class NVoidDesc(ConcreteCTypeBase):
1695
1697
  return "NUITKA_VOID_OK"
1696
1698
 
1697
1699
  @staticmethod
1698
- def getTakeReferenceStatement(operand):
1700
+ def getTakeReferenceStatement(operand, immortal):
1699
1701
  return ""
1700
1702
 
1701
1703
  @staticmethod