Nuitka-winsvc 1.6.6__cp310-cp310-win_amd64.whl → 1.7.5__cp310-cp310-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 (84) hide show
  1. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/RECORD +84 -81
  3. nuitka/Builtins.py +7 -1
  4. nuitka/MainControl.py +4 -0
  5. nuitka/OptionParsing.py +5 -3
  6. nuitka/Options.py +17 -2
  7. nuitka/Serialization.py +28 -5
  8. nuitka/Version.py +2 -2
  9. nuitka/build/Backend.scons +16 -3
  10. nuitka/build/CCompilerVersion.scons +1 -1
  11. nuitka/build/DataComposerInterface.py +15 -9
  12. nuitka/build/Onefile.scons +1 -1
  13. nuitka/build/SconsCompilerSettings.py +1 -0
  14. nuitka/build/SconsProgress.py +11 -2
  15. nuitka/build/SconsSpawn.py +15 -15
  16. nuitka/build/include/nuitka/builtins.h +2 -0
  17. nuitka/build/include/nuitka/filesystem_paths.h +4 -0
  18. nuitka/build/include/nuitka/helper/attributes.h +3 -0
  19. nuitka/build/include/nuitka/helper/import_hard.h +6 -0
  20. nuitka/build/include/nuitka/helpers.h +1 -1
  21. nuitka/build/include/nuitka/safe_string_ops.h +10 -3
  22. nuitka/build/static_src/CompiledCodeHelpers.c +0 -200
  23. nuitka/build/static_src/HelpersAttributes.c +185 -8
  24. nuitka/build/static_src/HelpersFilesystemPaths.c +528 -7
  25. nuitka/build/static_src/HelpersImportHard.c +38 -0
  26. nuitka/build/static_src/HelpersSafeStrings.c +6 -278
  27. nuitka/build/static_src/MainProgram.c +273 -73
  28. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +6 -0
  29. nuitka/build/static_src/OnefileBootstrap.c +19 -36
  30. nuitka/build/static_src/OnefileSplashScreen.cpp +1 -0
  31. nuitka/code_generation/AttributeCodes.py +42 -23
  32. nuitka/code_generation/CodeGeneration.py +4 -0
  33. nuitka/code_generation/FunctionCodes.py +18 -3
  34. nuitka/code_generation/GlobalConstants.py +8 -1
  35. nuitka/code_generation/PackageResourceCodes.py +40 -0
  36. nuitka/code_generation/templates/CodeTemplatesModules.py +1 -7
  37. nuitka/freezer/DllDependenciesMacOS.py +18 -1
  38. nuitka/freezer/IncludedDataFiles.py +6 -10
  39. nuitka/importing/ImportResolving.py +6 -0
  40. nuitka/importing/Recursion.py +24 -68
  41. nuitka/nodes/AttributeNodes.py +72 -19
  42. nuitka/nodes/ChildrenHavingMixins.py +203 -234
  43. nuitka/nodes/ExpressionBasesGenerated.py +136 -0
  44. nuitka/nodes/HardImportNodesGenerated.py +94 -0
  45. nuitka/nodes/ImportHardNodes.py +3 -3
  46. nuitka/nodes/ImportNodes.py +14 -4
  47. nuitka/nodes/ModuleNodes.py +4 -2
  48. nuitka/nodes/PackageMetadataNodes.py +12 -10
  49. nuitka/nodes/PackageResourceNodes.py +115 -0
  50. nuitka/nodes/TypeNodes.py +5 -1
  51. nuitka/plugins/PluginBase.py +32 -8
  52. nuitka/plugins/Plugins.py +44 -7
  53. nuitka/plugins/standard/AntiBloatPlugin.py +166 -72
  54. nuitka/plugins/standard/DataFilesPlugin.py +10 -0
  55. nuitka/plugins/standard/DllFilesPlugin.py +1 -2
  56. nuitka/plugins/standard/MatplotlibPlugin.py +24 -22
  57. nuitka/plugins/standard/MultiprocessingPlugin.py +5 -12
  58. nuitka/plugins/standard/OptionsNannyPlugin.py +2 -2
  59. nuitka/plugins/standard/PySidePyQtPlugin.py +18 -6
  60. nuitka/plugins/standard/PywebViewPlugin.py +4 -2
  61. nuitka/plugins/standard/TkinterPlugin.py +3 -0
  62. nuitka/plugins/standard/TransformersPlugin.py +11 -1
  63. nuitka/plugins/standard/TrioPlugin.py +6 -66
  64. nuitka/plugins/standard/standard.nuitka-package.config.yml +367 -21
  65. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +16 -4
  66. nuitka/specs/HardImportSpecs.py +6 -0
  67. nuitka/tools/data_composer/DataComposer.py +25 -27
  68. nuitka/tools/general/find_module/FindModuleCode.py +5 -2
  69. nuitka/tools/podman/Podman.py +53 -0
  70. nuitka/tools/podman/__init__.py +18 -0
  71. nuitka/tools/podman/__main__.py +255 -0
  72. nuitka/tools/specialize/SpecializePython.py +37 -3
  73. nuitka/tools/testing/RuntimeTracing.py +4 -0
  74. nuitka/tree/Building.py +1 -1
  75. nuitka/tree/ReformulationFunctionStatements.py +137 -10
  76. nuitka/utils/Execution.py +11 -1
  77. nuitka/utils/ModuleNames.py +1 -1
  78. nuitka/utils/SharedLibraries.py +7 -7
  79. {Nuitka_winsvc-1.6.6.data → Nuitka_winsvc-1.7.5.data}/scripts/nuitka-run.bat +0 -0
  80. {Nuitka_winsvc-1.6.6.data → Nuitka_winsvc-1.7.5.data}/scripts/nuitka.bat +0 -0
  81. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/LICENSE.txt +0 -0
  82. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/WHEEL +0 -0
  83. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/entry_points.txt +0 -0
  84. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/top_level.txt +0 -0
@@ -20,10 +20,15 @@ import os
20
20
 
21
21
  from nuitka.Options import isStandaloneMode
22
22
  from nuitka.plugins.PluginBase import NuitkaPluginBase
23
- from nuitka.plugins.Plugins import getActiveQtPlugin, hasActivePlugin
23
+ from nuitka.plugins.Plugins import (
24
+ getActiveQtPluginBindingName,
25
+ hasActivePlugin,
26
+ )
24
27
  from nuitka.utils.FileOperations import getFileContentByLine
28
+ from nuitka.utils.Jinja2 import renderTemplateFromString
25
29
 
26
- # spellchecker: ignore matplotlib, scipy, scikit, matplotlibrc, matplotlibdata, mpl_toolkits, tkagg
30
+ # spellchecker: ignore matplotlib, scipy, scikit, matplotlibrc, matplotlibdata
31
+ # spellchecker: ignore mpl_toolkits, tkagg, MPLBACKEND
27
32
 
28
33
 
29
34
  class NuitkaPluginMatplotlib(NuitkaPluginBase):
@@ -80,7 +85,7 @@ from inspect import getsource
80
85
  ("matplotlib_version", "__version__"),
81
86
  (
82
87
  "needs_matplotlibdata_env",
83
- "'MATPLOTLIBDATA' in getsource(get_data_path)",
88
+ "'MATPLOTLIBDATA' in getsource(get_data_path) or 'MATPLOTLIBRC' in getsource(get_data_path)",
84
89
  ),
85
90
  ),
86
91
  )
@@ -133,12 +138,14 @@ from inspect import getsource
133
138
  new_lines.append("backend: %s" % matplotlib_info.backend)
134
139
 
135
140
  yield self.makeIncludedGeneratedDataFile(
136
- data=new_lines,
141
+ data="\n".join(new_lines),
137
142
  dest_path=os.path.join("matplotlib", "mpl-data", "matplotlibrc"),
138
143
  reason="updated matplotlib config file with backend to use",
139
144
  )
140
145
 
141
- def onModuleEncounter(self, module_name, module_filename, module_kind):
146
+ def onModuleEncounter(
147
+ self, using_module_name, module_name, module_filename, module_kind
148
+ ):
142
149
  if module_name.hasNamespace("mpl_toolkits"):
143
150
  return True, "Needed by matplotlib"
144
151
 
@@ -153,20 +160,6 @@ from inspect import getsource
153
160
  ):
154
161
  return True, "Needed for tkinter matplotlib backend"
155
162
 
156
- if getActiveQtPlugin() is not None:
157
- # Note, their code tries everything behind that name, the qt5 is
158
- # misleading therefore, PySide will work there too.
159
- if module_name in (
160
- "matplotlib.backends.backend_qt5",
161
- "matplotlib.backends.backend_qt5.py",
162
- "matplotlib.backends.backend_qt5cairo.py",
163
- "matplotlib.backend.backend_qt5.py",
164
- ):
165
- return True, "Needed for Qt matplotlib backend"
166
-
167
- if module_name == "matplotlib.backends.backend_agg":
168
- return True, "Needed as standard matplotlib backend"
169
-
170
163
  def createPreModuleLoadCode(self, module):
171
164
  """Method called when a module is being imported.
172
165
 
@@ -186,11 +179,20 @@ from inspect import getsource
186
179
  module.getFullName() == "matplotlib"
187
180
  and self._getMatplotlibInfo().needs_matplotlibdata_env
188
181
  ):
189
- code = r"""
182
+ code = renderTemplateFromString(
183
+ r"""
190
184
  import os
191
185
  os.environ["MATPLOTLIBDATA"] = os.path.join(__nuitka_binary_dir, "matplotlib", "mpl-data")
192
- """
186
+ os.environ["MATPLOTLIBRC"] = os.path.join(__nuitka_binary_dir, "matplotlib", "mpl-data", "matplotlibrc")
187
+ os.environ["MPLBACKEND"] = {{matplotlib_info.backend}}
188
+ {% if qt_binding_name %}
189
+ os.environ["QT_API"] = "{{qt_binding_name}}"
190
+ {% endif %}
191
+ """,
192
+ matplotlib_info=self._getMatplotlibInfo(),
193
+ qt_binding_name=getActiveQtPluginBindingName(),
194
+ )
193
195
  return (
194
196
  code,
195
- "Setting 'MATPLOTLIBDATA' environment variable for matplotlib to find package data.",
197
+ "Setting environment variables for 'matplotlib' to find package configuration.",
196
198
  )
@@ -153,10 +153,12 @@ __import__("multiprocessing.forking").forking.freeze_support()"""
153
153
  module_name,
154
154
  source_code,
155
155
  root_module.getCompileTimeFilename(),
156
- "Autoenable multiprocessing freeze support",
156
+ "Auto enable multiprocessing freeze support",
157
157
  )
158
158
 
159
- def onModuleEncounter(self, module_name, module_filename, module_kind):
159
+ def onModuleEncounter(
160
+ self, using_module_name, module_name, module_filename, module_kind
161
+ ):
160
162
  # Enforce recursion in to multiprocessing for accelerated mode, which
161
163
  # would normally avoid this.
162
164
  if module_name.hasNamespace("multiprocessing"):
@@ -166,18 +168,9 @@ __import__("multiprocessing.forking").forking.freeze_support()"""
166
168
  if module_name.hasNamespace("multiprocessing"):
167
169
  return "bytecode"
168
170
 
169
- # TODO: Make this demotable too.
171
+ # TODO: Make this demoted too.
170
172
  # or module_name in( "multiprocessing-preLoad", "multiprocessing-postLoad"):
171
173
 
172
- def onFrozenModuleSourceCode(self, module_name, is_package, source_code):
173
- if module_name == "multiprocessing.resource_tracker":
174
- source_code = source_code.replace(
175
- "args += ['-c', cmd % r]",
176
- "args += ['--multiprocessing-resource-tracker', str(r)]",
177
- )
178
-
179
- return source_code
180
-
181
174
  @staticmethod
182
175
  def getPreprocessorSymbols():
183
176
  if getModuleInclusionInfoByName("__parents_main__"):
@@ -58,9 +58,9 @@ class NuitkaPluginOptionsNanny(NuitkaPluginBase):
58
58
  if support_info == "ignore":
59
59
  return
60
60
 
61
- message = "Using module (%s %s) with no support: %s" % (
61
+ message = "Using module ('%s' version %s) with no full support: %s" % (
62
62
  full_name.asString(),
63
- self.getPackageVersion(full_name),
63
+ ".".join(str(d) for d in self.getPackageVersion(full_name)),
64
64
  description,
65
65
  )
66
66
 
@@ -61,7 +61,12 @@ class NuitkaPluginQtBindingsPluginBase(NuitkaPluginBase):
61
61
  warned_about = set()
62
62
 
63
63
  def __init__(self, qt_plugins, no_qt_translations):
64
- self.qt_plugins = OrderedSet(x.strip().lower() for x in qt_plugins.split(","))
64
+ if not qt_plugins:
65
+ qt_plugins = ["sensible"]
66
+
67
+ qt_plugins = sum([value.split(",") for value in qt_plugins], [])
68
+
69
+ self.qt_plugins = OrderedSet(x.strip().lower() for x in qt_plugins)
65
70
  self.no_qt_translations = no_qt_translations
66
71
 
67
72
  self.web_engine_done_binaries = False
@@ -92,9 +97,9 @@ class NuitkaPluginQtBindingsPluginBase(NuitkaPluginBase):
92
97
  def addPluginCommandLineOptions(cls, group):
93
98
  group.add_option(
94
99
  "--include-qt-plugins",
95
- action="store",
100
+ action="append",
96
101
  dest="qt_plugins",
97
- default="sensible",
102
+ default=[],
98
103
  help="""\
99
104
  Which Qt plugins to include. These can be big with dependencies, so
100
105
  by default only the sensible ones are included, but you can also put
@@ -1052,7 +1057,9 @@ Prefix = .
1052
1057
  if os.path.basename(sub_dll_filename).startswith(badword):
1053
1058
  yield sub_dll_filename
1054
1059
 
1055
- def onModuleEncounter(self, module_name, module_filename, module_kind):
1060
+ def onModuleEncounter(
1061
+ self, using_module_name, module_name, module_filename, module_kind
1062
+ ):
1056
1063
  top_package_name = module_name.getTopLevelPackageName()
1057
1064
 
1058
1065
  if isStandaloneMode():
@@ -1213,12 +1220,15 @@ The standard PySide2 is not supported before CPython <3.6. For full support: htt
1213
1220
  self, qt_plugins=qt_plugins, no_qt_translations=no_qt_translations
1214
1221
  )
1215
1222
 
1216
- def onModuleEncounter(self, module_name, module_filename, module_kind):
1223
+ def onModuleEncounter(
1224
+ self, using_module_name, module_name, module_filename, module_kind
1225
+ ):
1217
1226
  if module_name == self.binding_name and self._getNuitkaPatchLevel() < 1:
1218
1227
  return True, "Need to monkey patch PySide2 for abstract methods."
1219
1228
 
1220
1229
  return NuitkaPluginQtBindingsPluginBase.onModuleEncounter(
1221
1230
  self,
1231
+ using_module_name=using_module_name,
1222
1232
  module_name=module_name,
1223
1233
  module_filename=module_filename,
1224
1234
  module_kind=module_kind,
@@ -1405,7 +1415,9 @@ class NuitkaPluginNoQt(NuitkaPluginBase):
1405
1415
 
1406
1416
  warned_about = set()
1407
1417
 
1408
- def onModuleEncounter(self, module_name, module_filename, module_kind):
1418
+ def onModuleEncounter(
1419
+ self, using_module_name, module_name, module_filename, module_kind
1420
+ ):
1409
1421
  top_package_name = module_name.getTopLevelPackageName()
1410
1422
 
1411
1423
  if isStandaloneMode():
@@ -45,7 +45,9 @@ class NuitkaPluginPywebview(NuitkaPluginBase):
45
45
  """
46
46
  return isStandaloneMode()
47
47
 
48
- def onModuleEncounter(self, module_name, module_filename, module_kind):
48
+ def onModuleEncounter(
49
+ self, using_module_name, module_name, module_filename, module_kind
50
+ ):
49
51
  # Make sure webview platforms are included as needed.
50
52
  if module_name.isBelowNamespace("webview.platforms"):
51
53
  if isWin32Windows():
@@ -63,7 +65,7 @@ class NuitkaPluginPywebview(NuitkaPluginBase):
63
65
  elif getActiveQtPlugin() is not None:
64
66
  result = module_name = "webview.platforms.qt"
65
67
  reason = (
66
- "Platforms package of webview used due to '%s'."
68
+ "Platforms package of webview used due to '%s' plugin being active."
67
69
  % getActiveQtPlugin()
68
70
  )
69
71
  else:
@@ -61,6 +61,9 @@ class NuitkaPluginTkinter(NuitkaPluginBase):
61
61
  # Automatically suppress detectors for any other toolkit
62
62
  plugin_gui_toolkit = True
63
63
 
64
+ # Only used in control tags
65
+ binding_name = "tkinter"
66
+
64
67
  def __init__(self, tcl_library_dir, tk_library_dir):
65
68
  self.tcl_library_dir = tcl_library_dir
66
69
  self.tk_library_dir = tk_library_dir
@@ -249,4 +249,14 @@ class NuitkaPluginTransformers(NuitkaPluginBase):
249
249
  info_name="import_structure_for_%s"
250
250
  % full_name.asString().replace(".", "_"),
251
251
  ):
252
- yield full_name.getChildNamed(sub_module_name)
252
+ sub_module_name = full_name.getChildNamed(sub_module_name)
253
+
254
+ if (
255
+ sub_module_name == "transformers.testing_utils"
256
+ and not self.evaluateCondition(
257
+ full_name="transformers", condition="use_pytest"
258
+ )
259
+ ):
260
+ continue
261
+
262
+ yield sub_module_name
@@ -15,75 +15,15 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- """Trio plugin module."""
19
-
18
+ """ Deprecated trio plugin.
19
+ """
20
20
  from nuitka.plugins.PluginBase import NuitkaPluginBase
21
21
 
22
- _trio_patches = {
23
- "trio._core._ki": (
24
- """\
25
- enable_ki_protection = _ki_protection_decorator(True) # type: Callable[[F], F]
26
- enable_ki_protection.__name__ = "enable_ki_protection"
27
-
28
- disable_ki_protection = _ki_protection_decorator(False) # type: Callable[[F], F]
29
- disable_ki_protection.__name__ = "disable_ki_protection"
30
- """,
31
- """\
32
- def enable_ki_protection(fn):
33
- return fn
34
-
35
- def disable_ki_protection(fn):
36
- return fn
37
- """,
38
- ),
39
- "trio._core._run": (
40
- "coro.cr_frame.f_locals.setdefault(LOCALS_KEY_KI_PROTECTION_ENABLED, system_task)",
41
- "# coro.cr_frame.f_locals.setdefault(LOCALS_KEY_KI_PROTECTION_ENABLED, system_task)",
42
- ),
43
- }
44
-
45
22
 
46
23
  class NuitkaPluginTrio(NuitkaPluginBase):
47
- """Plugin for compatibility with Trio.
48
-
49
- The only incompatibility in Trio is the way it handles KeyboardInterrupt exceptions (ctrl+C):
50
-
51
- https://github.com/Nuitka/Nuitka/issues/561
52
- https://github.com/python-trio/trio/issues/1752
53
-
54
- It does this to ensure that Trio's internal data structures stay consistent and that the
55
- `finally` blocks in suspended coroutines are all run:
56
-
57
- https://vorpus.org/blog/control-c-handling-in-python-and-trio/
58
-
59
- So, be warned, when this plugin is enabled, your Trio code may not behave as expected when the
60
- user hits CTRL+C. One option to cope with this is to run your Trio code in a separate thread,
61
- listen for it in the main thread (with a try/except block), then notify the Trio thread to
62
- shutdown (e.g. with `trio_token.run_sync_soon(cancel_scope.cancel())`).
63
-
64
- """
65
-
66
24
  plugin_name = "trio"
67
- plugin_desc = "Required for 'trio' package."
68
-
69
- # TODO: Change this to Yaml configuration.
70
-
71
- def __init__(self):
72
- self.shown_warning = False
73
-
74
- def onModuleSourceCode(self, module_name, source_code):
75
- if module_name not in _trio_patches:
76
- return
77
-
78
- if not self.shown_warning:
79
- self.info("Disabling careful handling of KeyboardInterrupt in Trio")
80
- self.shown_warning = True
81
-
82
- code_before, code_after = _trio_patches[module_name]
83
-
84
- if code_before not in source_code:
85
- self.sysexit(
86
- "Could not find code to patch in " + module_name + ":\n" + code_before
87
- )
25
+ plugin_desc = "Deprecated, was once required by the 'trio' package"
88
26
 
89
- return source_code.replace(code_before, code_after)
27
+ @classmethod
28
+ def isDeprecated(cls):
29
+ return True