Nuitka-winsvc 2.3__cp311-cp311-win_amd64.whl → 2.3.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.

Potentially problematic release.


This version of Nuitka-winsvc might be problematic. Click here for more details.

Files changed (30) hide show
  1. {Nuitka_winsvc-2.3.dist-info → Nuitka_winsvc-2.3.3.dist-info}/METADATA +2 -1
  2. {Nuitka_winsvc-2.3.dist-info → Nuitka_winsvc-2.3.3.dist-info}/RECORD +30 -30
  3. nuitka/Options.py +4 -3
  4. nuitka/PythonFlavors.py +6 -1
  5. nuitka/Version.py +1 -1
  6. nuitka/build/Backend.scons +11 -30
  7. nuitka/build/SconsCompilerSettings.py +7 -1
  8. nuitka/build/SconsInterface.py +6 -2
  9. nuitka/build/include/nuitka/prelude.h +14 -3
  10. nuitka/build/static_src/CompiledCodeHelpers.c +4 -0
  11. nuitka/build/static_src/HelpersCallingGenerated.c +819 -0
  12. nuitka/code_generation/templates/CodeTemplatesModules.py +3 -1
  13. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +51 -0
  14. nuitka/freezer/IncludedEntryPoints.py +16 -0
  15. nuitka/freezer/Standalone.py +35 -20
  16. nuitka/plugins/standard/ImplicitImports.py +3 -0
  17. nuitka/plugins/standard/standard.nuitka-package.config.yml +17 -2
  18. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +5 -0
  19. nuitka/tools/testing/run_nuitka_tests/__main__.py +37 -0
  20. nuitka/tree/ReformulationMatchStatements.py +12 -11
  21. nuitka/tree/SourceHandling.py +4 -0
  22. nuitka/utils/FileOperations.py +1 -1
  23. nuitka/utils/ReExecute.py +5 -0
  24. nuitka/utils/SharedLibraries.py +9 -1
  25. {Nuitka_winsvc-2.3.data → Nuitka_winsvc-2.3.3.data}/scripts/nuitka-run.bat +0 -0
  26. {Nuitka_winsvc-2.3.data → Nuitka_winsvc-2.3.3.data}/scripts/nuitka.bat +0 -0
  27. {Nuitka_winsvc-2.3.dist-info → Nuitka_winsvc-2.3.3.dist-info}/LICENSE.txt +0 -0
  28. {Nuitka_winsvc-2.3.dist-info → Nuitka_winsvc-2.3.3.dist-info}/WHEEL +0 -0
  29. {Nuitka_winsvc-2.3.dist-info → Nuitka_winsvc-2.3.3.dist-info}/entry_points.txt +0 -0
  30. {Nuitka_winsvc-2.3.dist-info → Nuitka_winsvc-2.3.3.dist-info}/top_level.txt +0 -0
@@ -619,7 +619,9 @@ static int %(module_dll_entry_point)s_slot(PyObject *module) {
619
619
 
620
620
  NUITKA_MODULE_INIT_FUNCTION (%(module_dll_entry_point)s)(void) {
621
621
  if (_Py_PackageContext != NULL) {
622
- module_full_name = _Py_PackageContext;
622
+ if (strcmp(module_full_name, _Py_PackageContext) != 0) {
623
+ module_full_name = strdup(_Py_PackageContext);
624
+ }
623
625
  }
624
626
 
625
627
  #if PYTHON_VERSION < 0x300
@@ -156,6 +156,56 @@ PyObject *CALL_FUNCTION_WITH_ARGS{{args_count}}(PyThreadState *tstate, PyObject
156
156
  }
157
157
  #if !defined(_NUITKA_EXPERIMENTAL_DISABLE_CFUNCTION_CALL_OPT)
158
158
  } else if (PyCFunction_CheckExact(called)) {
159
+ #if PYTHON_VERSION >= 0x380
160
+ #ifdef _NUITKA_FULL_COMPAT
161
+ if (unlikely(Py_EnterRecursiveCall((char *)" while calling a Python object"))) {
162
+ return NULL;
163
+ }
164
+ #endif
165
+
166
+ int flags = PyCFunction_GET_FLAGS(called);
167
+
168
+ PyObject *result;
169
+
170
+ if (!(flags & METH_VARARGS)) {
171
+ vectorcallfunc func = *((vectorcallfunc *)(((char *)called) + Py_TYPE(called)->tp_vectorcall_offset));
172
+
173
+ assert(func != NULL);
174
+ {% if args_count == 0 %}
175
+ result = func(called, NULL, 0, NULL);
176
+ {% else %}
177
+ result = func(called, args, {{args_count}}, NULL);
178
+ {% endif %}
179
+
180
+ CHECK_OBJECT_X(result);
181
+ } else {
182
+ PyCFunction method = PyCFunction_GET_FUNCTION(called);
183
+ PyObject *self = PyCFunction_GET_SELF(called);
184
+
185
+ {% if not has_tuple_arg and args_count != 0 %}
186
+ PyObject *pos_args = MAKE_TUPLE(tstate, args, {{args_count}});
187
+ {% elif not has_tuple_arg %}
188
+ PyObject *pos_args = const_tuple_empty;
189
+ {% endif %}
190
+
191
+ if (flags & METH_KEYWORDS) {
192
+ result = (*(PyCFunctionWithKeywords)(void(*)(void))method)(self, pos_args, NULL);
193
+ } else {
194
+ result = (*method)(self, pos_args);
195
+ }
196
+
197
+ {% if not has_tuple_arg and args_count != 0 %}
198
+ Py_DECREF(pos_args);
199
+ {% endif %}
200
+ }
201
+
202
+ #ifdef _NUITKA_FULL_COMPAT
203
+ Py_LeaveRecursiveCall();
204
+ #endif
205
+ CHECK_OBJECT_X(result);
206
+
207
+ return Nuitka_CheckFunctionResult(tstate, called, result);
208
+ #else
159
209
  // Try to be fast about wrapping the arguments.
160
210
  int flags = PyCFunction_GET_FLAGS(called) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
161
211
 
@@ -294,6 +344,7 @@ PyObject *CALL_FUNCTION_WITH_ARGS{{args_count}}(PyThreadState *tstate, PyObject
294
344
  return Nuitka_CheckFunctionResult(tstate, called, result);
295
345
  }
296
346
  #endif
347
+ #endif
297
348
  #if PYTHON_VERSION < 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_UNCOMPILED_FUNCTION_CALL_OPT)
298
349
  } else if (PyFunction_Check(called)) {
299
350
  #if PYTHON_VERSION < 0x3b0
@@ -229,6 +229,13 @@ def addIncludedEntryPoint(entry_point):
229
229
  if areSamePaths(
230
230
  entry_point.source_path, standalone_entry_point.source_path
231
231
  ):
232
+ if (
233
+ standalone_entry_point.kind == "extension"
234
+ and entry_point.kind == "dll"
235
+ ):
236
+ entry_point = _makeIgnoredEntryPoint(entry_point)
237
+ break
238
+
232
239
  return
233
240
 
234
241
  if isShowInclusion():
@@ -325,6 +332,15 @@ def addExtensionModuleEntryPoint(module):
325
332
  )
326
333
 
327
334
 
335
+ def getIncludedExtensionModule(source_path):
336
+ for standalone_entry_point in standalone_entry_points:
337
+ if standalone_entry_point.kind == "extension":
338
+ if areSamePaths(source_path, standalone_entry_point.source_path):
339
+ return standalone_entry_point
340
+
341
+ return None
342
+
343
+
328
344
  def getStandaloneEntryPoints():
329
345
  return tuple(standalone_entry_points)
330
346
 
@@ -49,7 +49,11 @@ from .DllDependenciesMacOS import (
49
49
  )
50
50
  from .DllDependenciesPosix import detectBinaryPathDLLsPosix
51
51
  from .DllDependenciesWin32 import detectBinaryPathDLLsWin32
52
- from .IncludedEntryPoints import addIncludedEntryPoint, makeDllEntryPoint
52
+ from .IncludedEntryPoints import (
53
+ addIncludedEntryPoint,
54
+ getIncludedExtensionModule,
55
+ makeDllEntryPoint,
56
+ )
53
57
 
54
58
 
55
59
  def checkFreezingModuleSet():
@@ -241,7 +245,7 @@ def _reduceToPythonPath(used_dlls):
241
245
  def _detectUsedDLLs(standalone_entry_point, source_dir):
242
246
  binary_filename = standalone_entry_point.source_path
243
247
  try:
244
- used_dlls = _detectBinaryDLLs(
248
+ used_dll_paths = _detectBinaryDLLs(
245
249
  is_main_executable=standalone_entry_point.kind == "executable",
246
250
  source_dir=source_dir,
247
251
  original_filename=standalone_entry_point.source_path,
@@ -258,7 +262,7 @@ def _detectUsedDLLs(standalone_entry_point, source_dir):
258
262
  # Plugins generally decide if they allow dependencies from the outside
259
263
  # based on the package name.
260
264
 
261
- if standalone_entry_point.module_name is not None and used_dlls:
265
+ if standalone_entry_point.module_name is not None and used_dll_paths:
262
266
  module_name, module_filename, _kind, finding = locateModule(
263
267
  standalone_entry_point.module_name, parent_package=None, level=0
264
268
  )
@@ -277,35 +281,46 @@ def _detectUsedDLLs(standalone_entry_point, source_dir):
277
281
  )
278
282
 
279
283
  if allow_outside_dependencies is False:
280
- used_dlls = _reduceToPythonPath(used_dlls)
284
+ used_dll_paths = _reduceToPythonPath(used_dll_paths)
281
285
 
282
286
  # Allow plugins can prevent inclusion, this may discard things from used_dlls.
283
287
  removed_dlls = Plugins.removeDllDependencies(
284
- dll_filename=binary_filename, dll_filenames=used_dlls
288
+ dll_filename=binary_filename, dll_filenames=used_dll_paths
285
289
  )
286
- used_dlls = tuple(OrderedSet(used_dlls) - OrderedSet(removed_dlls))
287
-
288
- for used_dll in used_dlls:
289
- dest_path = os.path.basename(used_dll)
290
-
291
- # TODO: If used by a DLL from the same folder, put it there,
292
- # otherwise top level, but for now this is limited to a few cases
293
- # where required that way (openvino) or known to be good only (av),
294
- # because it broke other things. spell-checker: ignore openvino
295
- if standalone_entry_point.package_name in (
296
- "openvino",
297
- "av",
298
- ) and areInSamePaths(standalone_entry_point.source_path, used_dll):
290
+ used_dll_paths = tuple(OrderedSet(used_dll_paths) - OrderedSet(removed_dlls))
291
+
292
+ for used_dll_path in used_dll_paths:
293
+ extension_standalone_entry_point = getIncludedExtensionModule(used_dll_path)
294
+ if extension_standalone_entry_point is not None:
295
+ # Sometimes an extension module is used like a DLL, make sure to
296
+ # remove it as a DLL then, there is no value in keeping those. Need
297
+ # to keep it's destination path from that extension module then.
298
+ dest_path = extension_standalone_entry_point.dest_path
299
+ elif (
300
+ standalone_entry_point.package_name is not None
301
+ and standalone_entry_point.package_name.hasOneOfNamespaces(
302
+ "openvino",
303
+ "av",
304
+ )
305
+ and areInSamePaths(standalone_entry_point.source_path, used_dll_path)
306
+ ):
307
+ # TODO: If used by a DLL from the same folder, put it there,
308
+ # otherwise top level, but for now this is limited to a few cases
309
+ # where required that way (openvino) or known to be good only (av),
310
+ # because it broke other things. spell-checker: ignore openvino
311
+
299
312
  dest_path = os.path.normpath(
300
313
  os.path.join(
301
314
  os.path.dirname(standalone_entry_point.dest_path),
302
- dest_path,
315
+ os.path.basename(used_dll_path),
303
316
  )
304
317
  )
318
+ else:
319
+ dest_path = os.path.basename(used_dll_path)
305
320
 
306
321
  dll_entry_point = makeDllEntryPoint(
307
322
  logger=inclusion_logger,
308
- source_path=used_dll,
323
+ source_path=used_dll_path,
309
324
  dest_path=dest_path,
310
325
  module_name=standalone_entry_point.module_name,
311
326
  package_name=standalone_entry_point.package_name,
@@ -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.
@@ -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:
@@ -1822,6 +1824,13 @@
1822
1824
  replacements_plain:
1823
1825
  'from keras.testing_infra.test_utils import layer_test': ''
1824
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
+
1825
1834
  - module-name: 'keras.src.utils.vis_utils' # checksum: 7d07a2d1
1826
1835
  anti-bloat:
1827
1836
  - description: 'remove IPython reference'
@@ -3388,7 +3397,7 @@
3388
3397
  'display': 'un-callable'
3389
3398
  when: 'not use_ipython'
3390
3399
 
3391
- - module-name: 'pkg_resources' # checksum: 9cc15580
3400
+ - module-name: 'pkg_resources' # checksum: d0674fc2
3392
3401
  anti-bloat:
3393
3402
  - description: 'avoid using plistlib dependency on non-macOS'
3394
3403
  replacements_plain:
@@ -3398,6 +3407,12 @@
3398
3407
  replacements_plain:
3399
3408
  'def load(self, require=True,': 'def load(self, require=False,'
3400
3409
  'if not require or args or kwargs:': 'if False:'
3410
+ - description: 'disable deprecation warnings'
3411
+ replacements_plain:
3412
+ 'warnings.warn(': 'if False: warnings.warn('
3413
+ implicit-imports:
3414
+ - depends:
3415
+ - 'pkg_resources.extern'
3401
3416
 
3402
3417
  - module-name: 'pkg_resources._vendor.appdirs' # checksum: 9d4faeee
3403
3418
  anti-bloat:
@@ -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:
@@ -241,6 +241,16 @@ The standard CPython3.11 test suite. Execute this for all corner cases to be
241
241
  covered. With Python 2.x these are not run. Default is %default.""",
242
242
  )
243
243
 
244
+ parser.add_option(
245
+ "--skip-cpython312-tests",
246
+ action="store_false",
247
+ dest="cpython312",
248
+ default=True,
249
+ help="""\
250
+ The standard CPython3.12 test suite. Execute this for all corner cases to be
251
+ covered. With Python 2.x these are not run. Default is %default.""",
252
+ )
253
+
244
254
  parser.add_option(
245
255
  "--skip-other-cpython-tests",
246
256
  action="store_true",
@@ -370,6 +380,15 @@ Do not use Python3.10 even if available on the system. Default is %default.""",
370
380
  Do not use Python3.11 even if available on the system. Default is %default.""",
371
381
  )
372
382
 
383
+ parser.add_option(
384
+ "--no-python3.12",
385
+ action="store_true",
386
+ dest="no312",
387
+ default=False,
388
+ help="""\
389
+ Do not use Python3.12 even if available on the system. Default is %default.""",
390
+ )
391
+
373
392
  parser.add_option(
374
393
  "--coverage",
375
394
  action="store_true",
@@ -436,6 +455,8 @@ Enforce the use of MinGW64 on Windows. Defaults to off.""",
436
455
  options.no310 = True
437
456
  if sys.version_info[0:2] != (3, 11):
438
457
  options.no311 = True
458
+ if sys.version_info[0:2] != (3, 12):
459
+ options.no312 = True
439
460
 
440
461
  if options.cpython_no_other:
441
462
  if sys.version_info[0:2] != (2, 6):
@@ -460,6 +481,8 @@ Enforce the use of MinGW64 on Windows. Defaults to off.""",
460
481
  options.cpython310 = False
461
482
  if sys.version_info[0:2] != (3, 11):
462
483
  options.cpython311 = False
484
+ if sys.version_info[0:2] != (3, 12):
485
+ options.cpython312 = False
463
486
 
464
487
  if options.cpython_none:
465
488
  options.cpython26 = False
@@ -473,6 +496,7 @@ Enforce the use of MinGW64 on Windows. Defaults to off.""",
473
496
  options.cpython39 = False
474
497
  options.cpython310 = False
475
498
  options.cpython311 = False
499
+ options.cpython312 = False
476
500
 
477
501
  if options.coverage and os.path.exists(".coverage"):
478
502
  os.unlink(".coverage")
@@ -580,6 +604,8 @@ def main():
580
604
  return False
581
605
  if command == "python3.11" and options.no311:
582
606
  return False
607
+ if command == "python3.12" and options.no312:
608
+ return False
583
609
 
584
610
  # Shortcuts for python versions, also needed for Windows as it won't have
585
611
  # the version number in the Python binaries at all.
@@ -911,6 +937,17 @@ def main():
911
937
  else:
912
938
  my_print("The CPython3.11 tests are not present, not run.")
913
939
 
940
+ # Running the Python 3.12 test suite only with CPython3.x.
941
+ if not use_python.startswith("python2"):
942
+ if options.cpython312:
943
+ if os.path.exists("./tests/CPython312/run_all.py"):
944
+ with withExtendedExtraOptions(
945
+ *getExtraFlags(where, "312tests", flags)
946
+ ):
947
+ executeSubTest("./tests/CPython312/run_all.py search")
948
+ else:
949
+ my_print("The CPython3.12 tests are not present, not run.")
950
+
914
951
  if not any(
915
952
  checkExecutableCommand("python%s" % python_version)
916
953
  for python_version in getTestExecutionPythonVersions()
@@ -161,17 +161,18 @@ def _buildMatchSequence(provider, pattern, make_against, source_ref):
161
161
  # Could special case ">=1" or "==0" with truth checks potentially, but that
162
162
  # is for generic optimization to recognize, we don't know much about the
163
163
  # matched value at this point yet.
164
- conditions.append(
165
- makeComparisonExpression(
166
- left=ExpressionBuiltinLen(
167
- value=make_against(),
164
+ if min_length > 0 or exact:
165
+ conditions.append(
166
+ makeComparisonExpression(
167
+ left=ExpressionBuiltinLen(
168
+ value=make_against(),
169
+ source_ref=source_ref,
170
+ ),
171
+ right=makeConstantRefNode(constant=min_length, source_ref=source_ref),
172
+ comparator="Eq" if exact else "GtE",
168
173
  source_ref=source_ref,
169
- ),
170
- right=makeConstantRefNode(constant=min_length, source_ref=source_ref),
171
- comparator="Eq" if exact else "GtE",
172
- source_ref=source_ref,
174
+ )
173
175
  )
174
- )
175
176
 
176
177
  star_pos = None
177
178
 
@@ -195,8 +196,8 @@ def _buildMatchSequence(provider, pattern, make_against, source_ref):
195
196
  assert "!" not in variable_name, variable_name
196
197
 
197
198
  # Last one
198
- if star_pos == len(pattern.patterns):
199
- slice_value = slice(count)
199
+ if star_pos == len(pattern.patterns) - 1:
200
+ slice_value = slice(star_pos, None)
200
201
  else:
201
202
  slice_value = slice(count, -(len(pattern.patterns) - (count + 1)))
202
203
 
@@ -266,6 +266,10 @@ def checkPythonVersionFromCode(source_code):
266
266
  result = 0x3B0 > python_version >= 0x3A0
267
267
  elif basename == "python3.11":
268
268
  result = 0x3C0 > python_version >= 0x3B0
269
+ elif basename == "python3.12":
270
+ result = 0x3D0 > python_version >= 0x3C0
271
+ elif basename == "python3.13":
272
+ result = 0x3E0 > python_version >= 0x3D0
269
273
  else:
270
274
  result = None
271
275
 
@@ -731,7 +731,7 @@ def removeDirectory(path, ignore_errors):
731
731
 
732
732
  def onError(func, path, exc_info):
733
733
  # Record what happened what happened, pylint: disable=unused-argument
734
- last_error.append(func, path)
734
+ last_error.append((func, path))
735
735
 
736
736
  with withFileLock("removing directory %s" % path):
737
737
  if os.path.exists(path):
nuitka/utils/ReExecute.py CHANGED
@@ -12,6 +12,8 @@ spell-checker: ignore execl, Popen
12
12
  import os
13
13
  import sys
14
14
 
15
+ from nuitka.Options import shallExecuteImmediately
16
+
15
17
 
16
18
  def callExecProcess(args, uac):
17
19
  """Do exec in a portable way preserving exit code.
@@ -83,6 +85,9 @@ def reExecuteNuitka(pgo_filename):
83
85
  else:
84
86
  os.environ["NUITKA_SYS_PREFIX"] = sys.prefix
85
87
 
88
+ if shallExecuteImmediately():
89
+ args.append("--run")
90
+
86
91
  # Same arguments as before.
87
92
  args += sys.argv[1:]
88
93
 
@@ -661,7 +661,15 @@ def copyDllFile(source_path, dist_dir, dest_path, executable):
661
661
  # Path must be normalized for this to be correct, but entry points enforced that.
662
662
  count = dest_path.count(os.path.sep)
663
663
 
664
- rpath = os.path.join("$ORIGIN", *([".."] * count))
664
+ # TODO: This ought to depend on actual presence of used DLLs with middle
665
+ # paths and not just do it, but maybe there is not much harm in it.
666
+ if count > 0:
667
+ rpath = ":".join(
668
+ os.path.join("$ORIGIN", *([".."] * c)) for c in range(count, 0, -1)
669
+ )
670
+ else:
671
+ rpath = "$ORIGIN"
672
+
665
673
  setSharedLibraryRPATH(target_filename, rpath)
666
674
 
667
675
  if isWin32Windows() and isUnstripped():