Nuitka-winsvc 1.8.6__cp312-cp312-win_amd64.whl → 1.9.3__cp312-cp312-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 (214) hide show
  1. {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/RECORD +212 -203
  3. {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/WHEEL +1 -1
  4. nuitka/BytecodeCaching.py +4 -1
  5. nuitka/HardImportRegistry.py +348 -0
  6. nuitka/MainControl.py +45 -25
  7. nuitka/OptionParsing.py +31 -20
  8. nuitka/Options.py +47 -16
  9. nuitka/Progress.py +32 -2
  10. nuitka/PythonFlavors.py +1 -1
  11. nuitka/PythonVersions.py +61 -0
  12. nuitka/Tracing.py +25 -12
  13. nuitka/TreeXML.py +5 -5
  14. nuitka/Variables.py +15 -24
  15. nuitka/Version.py +16 -6
  16. nuitka/__main__.py +15 -0
  17. nuitka/__past__.py +15 -17
  18. nuitka/build/Backend.scons +44 -35
  19. nuitka/build/CCompilerVersion.scons +10 -9
  20. nuitka/build/Onefile.scons +11 -26
  21. nuitka/build/SconsCaching.py +2 -0
  22. nuitka/build/SconsCompilerSettings.py +72 -22
  23. nuitka/build/SconsHacks.py +1 -0
  24. nuitka/build/SconsInterface.py +5 -0
  25. nuitka/build/SconsSpawn.py +16 -3
  26. nuitka/build/SconsUtils.py +11 -12
  27. nuitka/build/include/nuitka/checksum_tools.h +0 -4
  28. nuitka/build/include/nuitka/compiled_asyncgen.h +1 -1
  29. nuitka/build/include/nuitka/compiled_coroutine.h +1 -1
  30. nuitka/build/include/nuitka/compiled_frame.h +7 -4
  31. nuitka/build/include/nuitka/compiled_function.h +13 -3
  32. nuitka/build/include/nuitka/compiled_generator.h +1 -1
  33. nuitka/build/include/nuitka/constants.h +2 -0
  34. nuitka/build/include/nuitka/environment_variables.h +45 -0
  35. nuitka/build/include/nuitka/exceptions.h +32 -4
  36. nuitka/build/include/nuitka/filesystem_paths.h +6 -1
  37. nuitka/build/include/nuitka/freelists.h +11 -1
  38. nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
  39. nuitka/build/include/nuitka/helper/import_hard.h +3 -0
  40. nuitka/build/include/nuitka/helpers.h +2 -0
  41. nuitka/build/include/nuitka/importing.h +3 -0
  42. nuitka/build/include/nuitka/prelude.h +17 -6
  43. nuitka/build/include/nuitka/unfreezing.h +1 -1
  44. nuitka/build/inline_copy/bin/scons.py +14 -0
  45. nuitka/build/inline_copy/tqdm/tqdm/__init__.py +2 -2
  46. nuitka/build/inline_copy/tqdm/tqdm/utils.py +14 -8
  47. nuitka/build/inline_copy/zlib/LICENSE +22 -0
  48. nuitka/build/inline_copy/zlib/crc32.c +1049 -0
  49. nuitka/build/inline_copy/zlib/crc32.h +9446 -0
  50. nuitka/build/inline_copy/zlib/zconf.h +551 -0
  51. nuitka/build/inline_copy/zlib/zlib.h +1938 -0
  52. nuitka/build/inline_copy/zlib/zutil.h +275 -0
  53. nuitka/build/static_src/CompiledAsyncgenType.c +41 -41
  54. nuitka/build/static_src/CompiledCodeHelpers.c +14 -7
  55. nuitka/build/static_src/CompiledCoroutineType.c +60 -51
  56. nuitka/build/static_src/CompiledFrameType.c +12 -12
  57. nuitka/build/static_src/CompiledFunctionType.c +149 -28
  58. nuitka/build/static_src/CompiledGeneratorType.c +64 -65
  59. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +1 -1
  60. nuitka/build/static_src/CompiledMethodType.c +5 -3
  61. nuitka/build/static_src/HelperEnvironmentVariables.c +120 -0
  62. nuitka/build/static_src/HelpersAttributes.c +1 -1
  63. nuitka/build/static_src/HelpersBuiltin.c +1 -1
  64. nuitka/build/static_src/HelpersChecksumTools.c +19 -4
  65. nuitka/build/static_src/HelpersComparisonEq.c +4 -4
  66. nuitka/build/static_src/HelpersComparisonNe.c +4 -4
  67. nuitka/build/static_src/HelpersConstantsBlob.c +40 -23
  68. nuitka/build/static_src/HelpersDictionaries.c +3 -1
  69. nuitka/build/static_src/HelpersDictionariesGenerated.c +9 -9
  70. nuitka/build/static_src/HelpersFilesystemPaths.c +12 -2
  71. nuitka/build/static_src/HelpersImport.c +29 -1
  72. nuitka/build/static_src/HelpersImportHard.c +19 -0
  73. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +5 -4
  74. nuitka/build/static_src/HelpersPythonPgo.c +5 -5
  75. nuitka/build/static_src/HelpersSafeStrings.c +2 -1
  76. nuitka/build/static_src/HelpersStrings.c +12 -10
  77. nuitka/build/static_src/HelpersTypes.c +1 -1
  78. nuitka/build/static_src/InspectPatcher.c +3 -2
  79. nuitka/build/static_src/MainProgram.c +182 -214
  80. nuitka/build/static_src/MetaPathBasedLoader.c +36 -23
  81. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +4 -2
  82. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +38 -2
  83. nuitka/build/static_src/OnefileBootstrap.c +124 -93
  84. nuitka/code_generation/CodeGeneration.py +4 -2
  85. nuitka/code_generation/CodeObjectCodes.py +5 -1
  86. nuitka/code_generation/ConstantCodes.py +4 -0
  87. nuitka/code_generation/Contexts.py +111 -3
  88. nuitka/code_generation/DictCodes.py +5 -5
  89. nuitka/code_generation/FunctionCodes.py +4 -2
  90. nuitka/code_generation/GlobalConstants.py +10 -0
  91. nuitka/code_generation/ImportCodes.py +69 -33
  92. nuitka/code_generation/ModuleCodes.py +4 -1
  93. nuitka/code_generation/Namify.py +6 -5
  94. nuitka/code_generation/YieldCodes.py +3 -3
  95. nuitka/code_generation/templates/CodeTemplatesModules.py +61 -95
  96. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +3 -3
  97. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +2 -2
  98. nuitka/distutils/DistutilCommands.py +3 -0
  99. nuitka/finalizations/FinalizeMarkups.py +1 -1
  100. nuitka/freezer/DependsExe.py +2 -1
  101. nuitka/freezer/DllDependenciesPosix.py +11 -1
  102. nuitka/freezer/IncludedEntryPoints.py +54 -16
  103. nuitka/freezer/Onefile.py +7 -3
  104. nuitka/freezer/Standalone.py +39 -17
  105. nuitka/importing/Importing.py +195 -62
  106. nuitka/importing/PreloadedPackages.py +2 -1
  107. nuitka/importing/Recursion.py +98 -27
  108. nuitka/importing/StandardLibrary.py +7 -4
  109. nuitka/nodes/BuiltinOpenNodes.py +28 -1
  110. nuitka/nodes/BuiltinRangeNodes.py +2 -2
  111. nuitka/nodes/BuiltinSumNodes.py +1 -1
  112. nuitka/nodes/ChildrenHavingMixins.py +326 -2
  113. nuitka/nodes/HardImportNodesGenerated.py +141 -38
  114. nuitka/nodes/ImportHardNodes.py +0 -8
  115. nuitka/nodes/ImportNodes.py +267 -361
  116. nuitka/nodes/IterationHandles.py +36 -17
  117. nuitka/nodes/LocalsScopes.py +3 -1
  118. nuitka/nodes/NodeBases.py +8 -14
  119. nuitka/nodes/OperatorNodes.py +9 -9
  120. nuitka/nodes/OutlineNodes.py +3 -3
  121. nuitka/nodes/PackageMetadataNodes.py +19 -9
  122. nuitka/nodes/SliceNodes.py +1 -1
  123. nuitka/nodes/VariableAssignNodes.py +25 -15
  124. nuitka/nodes/VariableRefNodes.py +7 -7
  125. nuitka/nodes/YieldNodes.py +2 -2
  126. nuitka/nodes/shapes/BuiltinTypeShapes.py +81 -6
  127. nuitka/nodes/shapes/ShapeMixins.py +21 -0
  128. nuitka/nodes/shapes/StandardShapes.py +9 -3
  129. nuitka/optimizations/OptimizeBuiltinCalls.py +1 -1
  130. nuitka/optimizations/TraceCollections.py +75 -0
  131. nuitka/pgo/PGO.py +14 -6
  132. nuitka/plugins/PluginBase.py +83 -11
  133. nuitka/plugins/Plugins.py +78 -35
  134. nuitka/plugins/standard/AntiBloatPlugin.py +46 -1
  135. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +1 -1
  136. nuitka/plugins/standard/DelvewheelPlugin.py +2 -1
  137. nuitka/plugins/standard/DillPlugin.py +3 -99
  138. nuitka/plugins/standard/DllFilesPlugin.py +45 -0
  139. nuitka/plugins/standard/GiPlugin.py +23 -10
  140. nuitka/plugins/standard/GlfwPlugin.py +1 -0
  141. nuitka/plugins/standard/ImplicitImports.py +267 -15
  142. nuitka/plugins/standard/KivyPlugin.py +1 -0
  143. nuitka/plugins/standard/MatplotlibPlugin.py +43 -25
  144. nuitka/plugins/standard/OptionsNannyPlugin.py +5 -6
  145. nuitka/plugins/standard/PkgResourcesPlugin.py +1 -1
  146. nuitka/plugins/standard/PmwPlugin.py +1 -1
  147. nuitka/plugins/standard/PySidePyQtPlugin.py +37 -20
  148. nuitka/plugins/standard/TkinterPlugin.py +44 -30
  149. nuitka/plugins/standard/TransformersPlugin.py +3 -1
  150. nuitka/plugins/standard/standard.nuitka-package.config.yml +522 -86
  151. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +8 -1
  152. nuitka/reports/CompilationReportReader.py +53 -0
  153. nuitka/reports/LicenseReport.rst.j2 +4 -4
  154. nuitka/reports/Reports.py +129 -47
  155. nuitka/specs/HardImportSpecs.py +6 -0
  156. nuitka/tools/data_composer/DataComposer.py +29 -17
  157. nuitka/tools/onefile_compressor/OnefileCompressor.py +173 -110
  158. nuitka/tools/podman/__main__.py +17 -2
  159. nuitka/tools/scanning/DisplayPackageDLLs.py +11 -2
  160. nuitka/tools/scanning/DisplayPackageData.py +1 -1
  161. nuitka/tools/specialize/CTypeDescriptions.py +36 -27
  162. nuitka/tools/specialize/SpecializeC.py +1 -1
  163. nuitka/tools/specialize/SpecializePython.py +16 -0
  164. nuitka/tools/testing/Common.py +3 -4
  165. nuitka/tools/testing/OutputComparison.py +23 -0
  166. nuitka/tools/testing/SearchModes.py +2 -2
  167. nuitka/tools/testing/compare_with_cpython/__main__.py +13 -4
  168. nuitka/tools/testing/measure_construct_performance/__main__.py +2 -5
  169. nuitka/tools/watch/__main__.py +194 -56
  170. nuitka/tree/Building.py +8 -2
  171. nuitka/tree/ComplexCallHelperFunctions.py +45 -15
  172. nuitka/tree/ReformulationAssignmentStatements.py +18 -12
  173. nuitka/tree/ReformulationCallExpressions.py +1 -1
  174. nuitka/tree/ReformulationClasses.py +11 -5
  175. nuitka/tree/ReformulationClasses3.py +30 -12
  176. nuitka/tree/ReformulationComparisonExpressions.py +4 -2
  177. nuitka/tree/ReformulationContractionExpressions.py +19 -11
  178. nuitka/tree/ReformulationDictionaryCreation.py +9 -3
  179. nuitka/tree/ReformulationExecStatements.py +6 -6
  180. nuitka/tree/ReformulationForLoopStatements.py +5 -5
  181. nuitka/tree/ReformulationFunctionStatements.py +6 -2
  182. nuitka/tree/ReformulationImportStatements.py +7 -2
  183. nuitka/tree/ReformulationLambdaExpressions.py +1 -1
  184. nuitka/tree/ReformulationMatchStatements.py +3 -1
  185. nuitka/tree/ReformulationNamespacePackages.py +7 -3
  186. nuitka/tree/ReformulationPrintStatements.py +1 -1
  187. nuitka/tree/ReformulationSequenceCreation.py +18 -6
  188. nuitka/tree/ReformulationWithStatements.py +8 -8
  189. nuitka/tree/ReformulationYieldExpressions.py +2 -2
  190. nuitka/tree/SourceHandling.py +27 -5
  191. nuitka/tree/VariableClosure.py +11 -1
  192. nuitka/utils/AppDirs.py +2 -2
  193. nuitka/utils/CStrings.py +39 -3
  194. nuitka/utils/CommandLineOptions.py +42 -1
  195. nuitka/utils/Distributions.py +305 -38
  196. nuitka/utils/Download.py +27 -8
  197. nuitka/utils/FileOperations.py +103 -20
  198. nuitka/utils/Hashing.py +2 -3
  199. nuitka/utils/Importing.py +60 -3
  200. nuitka/utils/InstalledPythons.py +31 -36
  201. nuitka/utils/Jinja2.py +11 -5
  202. nuitka/utils/ModuleNames.py +11 -3
  203. nuitka/utils/ReExecute.py +7 -0
  204. nuitka/utils/SharedLibraries.py +38 -14
  205. nuitka/utils/SlotMetaClasses.py +55 -0
  206. nuitka/utils/Utils.py +10 -0
  207. nuitka/utils/Yaml.py +9 -1
  208. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_gui.py +0 -9
  209. nuitka/build/inline_copy/tqdm/tqdm/gui.py +0 -191
  210. {Nuitka_winsvc-1.8.6.data → Nuitka_winsvc-1.9.3.data}/scripts/nuitka-run.bat +0 -0
  211. {Nuitka_winsvc-1.8.6.data → Nuitka_winsvc-1.9.3.data}/scripts/nuitka.bat +0 -0
  212. {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/LICENSE.txt +0 -0
  213. {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/entry_points.txt +0 -0
  214. {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/top_level.txt +0 -0
@@ -98,7 +98,7 @@ Should 'Pmw.Blt' not be included, Default is to include it.""",
98
98
  Should 'Pmw.Color' not be included, Default is to include it.""",
99
99
  )
100
100
 
101
- def onModuleSourceCode(self, module_name, source_code):
101
+ def onModuleSourceCode(self, module_name, source_filename, source_code):
102
102
  if module_name == "Pmw":
103
103
  pmw_path = self.locateModule(module_name=module_name)
104
104
 
@@ -39,18 +39,20 @@ from nuitka.plugins.Plugins import (
39
39
  )
40
40
  from nuitka.PythonFlavors import isAnacondaPython
41
41
  from nuitka.PythonVersions import python_version
42
+ from nuitka.utils.Distributions import (
43
+ getDistributionFromModuleName,
44
+ getDistributionInstallerName,
45
+ getDistributionName,
46
+ )
42
47
  from nuitka.utils.FileOperations import getFileList, listDir
43
48
  from nuitka.utils.ModuleNames import ModuleName
44
- from nuitka.utils.Utils import (
45
- getArchitecture,
46
- isDebianBasedLinux,
47
- isLinux,
48
- isMacOS,
49
- isWin32Windows,
50
- )
49
+ from nuitka.utils.Utils import getArchitecture, isMacOS, isWin32Windows
51
50
 
52
51
 
53
52
  class NuitkaPluginQtBindingsPluginBase(NuitkaPluginBase):
53
+ # We are a bit detail rich and caching a bunch,
54
+ # pylint: disable=too-many-instance-attributes
55
+
54
56
  # Automatically suppress detectors for any other toolkit
55
57
  plugin_gui_toolkit = True
56
58
 
@@ -60,6 +62,17 @@ class NuitkaPluginQtBindingsPluginBase(NuitkaPluginBase):
60
62
  warned_about = set()
61
63
 
62
64
  def __init__(self, include_qt_plugins, noinclude_qt_plugins, no_qt_translations):
65
+ self.distribution = getDistributionFromModuleName(self.binding_name)
66
+
67
+ if self.distribution is None:
68
+ self.sysexit(
69
+ "Error, failed to locate the %s installation." % self.binding_name
70
+ )
71
+
72
+ self.distribution_name = getDistributionName(self.distribution)
73
+
74
+ self.installer_name = getDistributionInstallerName(self.distribution_name)
75
+
63
76
  # Qt plugin directories found.
64
77
  self.qt_plugins_dirs = None
65
78
 
@@ -199,6 +212,8 @@ of files that you may not want to be included.""",
199
212
  return "."
200
213
 
201
214
  def _getSensiblePlugins(self):
215
+ # spell-checker: ignore imageformats,iconengines,mediaservice,printsupport
216
+ # spell-checker: ignore platformthemes,egldeviceintegrations,xcbglintegrations
202
217
  return OrderedSet(
203
218
  tuple(
204
219
  family
@@ -390,7 +405,8 @@ import %(binding_name)s.QtCore
390
405
  def _getQmlFileList(self, dlls):
391
406
  qml_plugin_dir = self._getQmlDirectory()
392
407
 
393
- # List all file types of the QML plugin folder that are data files and not DLLs.
408
+ # List all file types of the QML plugin folder that are data files and
409
+ # not DLLs, spell-checker: ignore qmlc,qmltypes,metainfo,qmldir
394
410
  datafile_suffixes = (
395
411
  ".qml",
396
412
  ".qmlc",
@@ -435,6 +451,7 @@ import %(binding_name)s.QtCore
435
451
  self.getQtPluginTargetPath(),
436
452
  filename_relative,
437
453
  ),
454
+ module_name=self.binding_package_name,
438
455
  package_name=self.binding_package_name,
439
456
  reason="qt plugin",
440
457
  )
@@ -864,6 +881,7 @@ Prefix = .
864
881
  dest_path=os.path.normpath(
865
882
  os.path.join(self._getWebEngineTargetDir(), filename_relative)
866
883
  ),
884
+ module_name=full_name,
867
885
  package_name=full_name,
868
886
  reason="needed by '%s'" % full_name.asString(),
869
887
  )
@@ -877,17 +895,6 @@ Prefix = .
877
895
 
878
896
  self.web_engine_done_binaries = True # prevent multiple copies
879
897
 
880
- def decideAllowOutsideDependencies(self, module_name):
881
- if isLinux() and module_name.hasNamespace(self.binding_name):
882
- if isDebianBasedLinux():
883
- module_filename = self.locateModule(self.binding_name)
884
-
885
- return "dist-packages" in module_filename.split("/")
886
- else:
887
- return False
888
-
889
- return None
890
-
891
898
  def getQtPluginTargetPath(self):
892
899
  if self.binding_name == "PyQt6":
893
900
  return os.path.join(self.binding_name, "Qt6", "plugins")
@@ -935,10 +942,13 @@ Prefix = .
935
942
  count = 0
936
943
  for filename in qt_bin_files:
937
944
  basename = os.path.basename(filename).lower()
945
+ # spell-checker: ignore libeay32,ssleay32
946
+
938
947
  if basename in ("libeay32.dll", "ssleay32.dll"):
939
948
  yield self.makeDllEntryPoint(
940
949
  source_path=filename,
941
950
  dest_path=basename,
951
+ module_name=full_name,
942
952
  package_name=full_name,
943
953
  reason="needed by '%s'" % full_name.asString(),
944
954
  )
@@ -963,6 +973,7 @@ Prefix = .
963
973
  qml_target_dir,
964
974
  filename_relative,
965
975
  ),
976
+ module_name=full_name,
966
977
  package_name=full_name,
967
978
  reason="Qt QML plugin DLL",
968
979
  )
@@ -980,6 +991,7 @@ Prefix = .
980
991
  yield self.makeDllEntryPoint(
981
992
  source_path=filename,
982
993
  dest_path=basename,
994
+ module_name=full_name,
983
995
  package_name=full_name,
984
996
  reason="needed by OpenGL for '%s'"
985
997
  % full_name.asString(),
@@ -1008,6 +1020,7 @@ Prefix = .
1008
1020
  )
1009
1021
 
1010
1022
  # Manually loaded DLLs by Qt5.
1023
+ # spell-checker: ignore libcrypto
1011
1024
  for dll_basename in ("libssl-1_1", "libcrypto-1_1"):
1012
1025
  dll_filename = dll_basename + arch_suffix + ".dll"
1013
1026
 
@@ -1018,6 +1031,7 @@ Prefix = .
1018
1031
  yield self.makeDllEntryPoint(
1019
1032
  source_path=candidate,
1020
1033
  dest_path=dll_filename,
1034
+ module_name=full_name,
1021
1035
  package_name=full_name,
1022
1036
  reason="needed by '%s'" % full_name.asString(),
1023
1037
  )
@@ -1030,6 +1044,7 @@ Prefix = .
1030
1044
  yield self.makeDllEntryPoint(
1031
1045
  source_path=dll_path,
1032
1046
  dest_path=os.path.basename(dll_path),
1047
+ module_name=full_name,
1033
1048
  package_name=full_name,
1034
1049
  reason="needed by '%s'" % full_name.asString(),
1035
1050
  )
@@ -1039,6 +1054,7 @@ Prefix = .
1039
1054
  yield self.makeDllEntryPoint(
1040
1055
  source_path=dll_path,
1041
1056
  dest_path=os.path.basename(dll_path),
1057
+ module_name=full_name,
1042
1058
  package_name=full_name,
1043
1059
  reason="needed by '%s'" % full_name.asString(),
1044
1060
  )
@@ -1116,8 +1132,9 @@ behavior with the uncompiled code."""
1116
1132
  module_set=module_set, plugin_binding_name=self.binding_name
1117
1133
  )
1118
1134
 
1119
- def onModuleSourceCode(self, module_name, source_code):
1135
+ def onModuleSourceCode(self, module_name, source_filename, source_code):
1120
1136
  """Third party packages that make binding selections."""
1137
+ # spell-checker: ignore pyqtgraph
1121
1138
  if module_name.hasNamespace("pyqtgraph"):
1122
1139
  # TODO: Add a mechanism to force all variable references of a name to something
1123
1140
  # during tree building, that would cover all uses in a nicer way.
@@ -22,7 +22,7 @@ import sys
22
22
 
23
23
  from nuitka.Options import isStandaloneMode, shallCreateAppBundle
24
24
  from nuitka.plugins.PluginBase import NuitkaPluginBase
25
- from nuitka.PythonVersions import getSystemPrefixPath
25
+ from nuitka.PythonVersions import getSystemPrefixPath, getTkInterVersion
26
26
  from nuitka.utils.FileOperations import listDllFilesFromDirectory, relpath
27
27
  from nuitka.utils.Utils import isMacOS, isWin32Windows
28
28
 
@@ -68,7 +68,18 @@ class NuitkaPluginTkinter(NuitkaPluginBase):
68
68
  self.tcl_library_dir = tcl_library_dir
69
69
  self.tk_library_dir = tk_library_dir
70
70
 
71
- self.files_copied = False # ensure one-time action
71
+ # ensure one-time action, we deal with two names for the execution, yet we
72
+ # only want to do it once.
73
+ self.files_copied = False
74
+
75
+ self.tk_inter_version = getTkInterVersion()
76
+
77
+ if self.tk_inter_version is None:
78
+ self.sysexit("Error, it seems tk-inter is not installed.")
79
+
80
+ # Only ever saw these 2 in use.
81
+ assert self.tk_inter_version in ("8.5", "8.6"), self.tk_inter_version
82
+
72
83
  return None
73
84
 
74
85
  @classmethod
@@ -153,46 +164,44 @@ The Tcl library dir. See comments for Tk library dir.""",
153
164
  tags="tcl",
154
165
  )
155
166
 
156
- @staticmethod
157
- def _getTclCandidatePaths():
167
+ def _getTclCandidatePaths(self):
158
168
  # Check typical locations of the dirs
159
169
  yield os.environ.get("TCL_LIBRARY")
160
170
 
171
+ # Inside the Python install, esp. on Windows.
161
172
  for sys_prefix_path in (sys.prefix, getSystemPrefixPath()):
162
- yield os.path.join(sys_prefix_path, "tcl", "tcl8.5")
163
- yield os.path.join(sys_prefix_path, "tcl", "tcl8.6")
164
- yield os.path.join(sys_prefix_path, "lib", "tcl8.5")
165
- yield os.path.join(sys_prefix_path, "lib", "tcl8.6")
173
+ yield os.path.join(sys_prefix_path, "tcl", "tcl%s" % self.tk_inter_version)
174
+ yield os.path.join(sys_prefix_path, "lib", "tcl%s" % self.tk_inter_version)
175
+
166
176
  # Newer Anaconda.
167
- yield os.path.join(sys_prefix_path, "Library", "lib", "tcl8.6")
177
+ yield os.path.join(
178
+ sys_prefix_path, "Library", "lib", "tcl%s" % self.tk_inter_version
179
+ )
168
180
 
181
+ # System installs on non-Windows
169
182
  if not isWin32Windows():
170
- yield "/usr/share/tcltk/tcl8.6"
171
- yield "/usr/share/tcltk/tcl8.5"
172
- yield "/usr/share/tcl8.6"
173
- yield "/usr/share/tcl8.5"
174
- yield "/usr/lib64/tcl/tcl8.5"
175
- yield "/usr/lib64/tcl/tcl8.6"
183
+ yield "/usr/share/tcltk/tcl%s" % self.tk_inter_version
184
+ yield "/usr/share/tcl%s" % self.tk_inter_version
185
+ yield "/usr/lib64/tcl/tcl%s" % self.tk_inter_version
186
+ yield "/usr/lib/tcl%s" % self.tk_inter_version
176
187
 
177
- @staticmethod
178
- def _getTkCandidatePaths():
188
+ def _getTkCandidatePaths(self):
179
189
  yield os.environ.get("TK_LIBRARY")
180
190
 
181
191
  for sys_prefix_path in (sys.prefix, getSystemPrefixPath()):
182
- yield os.path.join(sys_prefix_path, "tcl", "tk8.5")
183
- yield os.path.join(sys_prefix_path, "tcl", "tk8.6")
184
- yield os.path.join(sys_prefix_path, "lib", "tk8.5")
185
- yield os.path.join(sys_prefix_path, "lib", "tk8.6")
192
+ yield os.path.join(sys_prefix_path, "tcl", "tk%s" % self.tk_inter_version)
193
+ yield os.path.join(sys_prefix_path, "lib", "tk%s" % self.tk_inter_version)
194
+
186
195
  # Newer Anaconda.
187
- yield os.path.join(sys_prefix_path, "Library", "lib", "tk8.6")
196
+ yield os.path.join(
197
+ sys_prefix_path, "Library", "lib", "tk%s" % self.tk_inter_version
198
+ )
188
199
 
189
200
  if not isWin32Windows():
190
- yield "/usr/share/tcltk/tk8.6"
191
- yield "/usr/share/tcltk/tk8.5"
192
- yield "/usr/share/tk8.6"
193
- yield "/usr/share/tk8.5"
194
- yield "/usr/lib64/tcl/tk8.5"
195
- yield "/usr/lib64/tcl/tk8.6"
201
+ yield "/usr/share/tcltk/tk%s" % self.tk_inter_version
202
+ yield "/usr/share/tk%s" % self.tk_inter_version
203
+ yield "/usr/lib64/tcl/tk%s" % self.tk_inter_version
204
+ yield "/usr/lib/tk%s" % self.tk_inter_version
196
205
 
197
206
  def considerDataFiles(self, module):
198
207
  """Provide TCL libraries to the dist folder.
@@ -220,7 +229,9 @@ The Tcl library dir. See comments for Tk library dir.""",
220
229
  tcl_library_dir = self.tcl_library_dir
221
230
  if tcl_library_dir is None:
222
231
  for tcl_library_dir in self._getTclCandidatePaths():
223
- if tcl_library_dir is not None and os.path.exists(tcl_library_dir):
232
+ if tcl_library_dir is not None and os.path.exists(
233
+ os.path.join(tcl_library_dir, "init.tcl")
234
+ ):
224
235
  break
225
236
 
226
237
  if tcl_library_dir is None or not os.path.exists(tcl_library_dir):
@@ -233,7 +244,9 @@ that works, report a bug so it can be added to Nuitka."""
233
244
  tk_library_dir = self.tk_library_dir
234
245
  if tk_library_dir is None:
235
246
  for tk_library_dir in self._getTkCandidatePaths():
236
- if tk_library_dir is not None and os.path.exists(tk_library_dir):
247
+ if tk_library_dir is not None and os.path.exists(
248
+ os.path.join(tk_library_dir, "dialog.tcl")
249
+ ):
237
250
  break
238
251
 
239
252
  if tk_library_dir is None or not os.path.exists(tk_library_dir):
@@ -287,6 +300,7 @@ that works, report a bug."""
287
300
  yield self.makeDllEntryPoint(
288
301
  source_path=filename,
289
302
  dest_path=os.path.join("tkinterdnd2", dest_path),
303
+ module_name="tkinterdnd2",
290
304
  package_name="tkinterdnd2",
291
305
  reason="tkinterdnd2 package DLL",
292
306
  )
@@ -35,6 +35,7 @@ class NuitkaPluginTransformers(NuitkaPluginBase):
35
35
  # Found via grep -re "_import_structure = {"
36
36
  _import_structure_modules = (
37
37
  "transformers",
38
+ "transformers.integrations",
38
39
  "transformers.generation",
39
40
  "transformers.models.albert",
40
41
  "transformers.models.align",
@@ -245,7 +246,8 @@ class NuitkaPluginTransformers(NuitkaPluginBase):
245
246
  if full_name in self._import_structure_modules:
246
247
  for sub_module_name in self.queryRuntimeInformationSingle(
247
248
  setup_codes="import %s" % full_name.asString(),
248
- value="list(%s._import_structure.keys())" % full_name.asString(),
249
+ value="list(getattr(%(module_name)s, '_import_structure', {}).keys())"
250
+ % {"module_name": full_name.asString()},
249
251
  info_name="import_structure_for_%s"
250
252
  % full_name.asString().replace(".", "_"),
251
253
  ):