Nuitka-winsvc 2.6__cp311-cp311-win_amd64.whl → 2.6.5__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 (65) hide show
  1. {Nuitka_winsvc-2.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/RECORD +65 -61
  3. nuitka/BytecodeCaching.py +14 -3
  4. nuitka/ModuleRegistry.py +18 -3
  5. nuitka/Options.py +92 -66
  6. nuitka/PythonFlavors.py +15 -0
  7. nuitka/Version.py +1 -1
  8. nuitka/build/SconsCompilerSettings.py +3 -4
  9. nuitka/build/SconsInterface.py +2 -2
  10. nuitka/build/include/nuitka/compiled_frame.h +1 -1
  11. nuitka/build/include/nuitka/exceptions.h +1 -1
  12. nuitka/build/include/nuitka/type_aliases.h +1 -1
  13. nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
  14. nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
  15. nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
  16. nuitka/build/static_src/CompiledAsyncgenType.c +2 -11
  17. nuitka/build/static_src/CompiledCodeHelpers.c +4 -2
  18. nuitka/build/static_src/CompiledCoroutineType.c +5 -13
  19. nuitka/build/static_src/CompiledGeneratorType.c +0 -10
  20. nuitka/build/static_src/HelpersConsole.c +1 -1
  21. nuitka/build/static_src/HelpersTypes.c +4 -4
  22. nuitka/build/static_src/MainProgram.c +24 -0
  23. nuitka/build/static_src/MetaPathBasedLoader.c +17 -10
  24. nuitka/build/static_src/OnefileBootstrap.c +3 -1
  25. nuitka/code_generation/TypeAliasCodes.py +3 -2
  26. nuitka/freezer/DllDependenciesMacOS.py +7 -2
  27. nuitka/freezer/DllDependenciesPosix.py +22 -3
  28. nuitka/freezer/DllDependenciesWin32.py +1 -0
  29. nuitka/freezer/IncludedDataFiles.py +1 -1
  30. nuitka/freezer/IncludedEntryPoints.py +8 -0
  31. nuitka/freezer/Standalone.py +11 -2
  32. nuitka/importing/Importing.py +2 -1
  33. nuitka/nodes/ChildrenHavingMixins.py +13 -13
  34. nuitka/nodes/FunctionNodes.py +7 -0
  35. nuitka/nodes/ModuleNodes.py +21 -7
  36. nuitka/nodes/PackageMetadataNodes.py +3 -1
  37. nuitka/nodes/TypeNodes.py +3 -3
  38. nuitka/plugins/PluginBase.py +67 -13
  39. nuitka/plugins/Plugins.py +1 -1
  40. nuitka/plugins/standard/AntiBloatPlugin.py +136 -65
  41. nuitka/plugins/standard/ImplicitImports.py +3 -2
  42. nuitka/plugins/standard/PySidePyQtPlugin.py +13 -0
  43. nuitka/plugins/standard/standard.nuitka-package.config.yml +151 -53
  44. nuitka/reports/Reports.py +25 -2
  45. nuitka/tools/general/find_module/FindModuleCode.py +4 -1
  46. nuitka/tools/scanning/DisplayPackageDLLs.py +5 -6
  47. nuitka/tools/watch/__main__.py +7 -2
  48. nuitka/tree/Building.py +4 -6
  49. nuitka/tree/FutureSpecState.py +71 -0
  50. nuitka/tree/ReformulationAssignmentStatements.py +2 -2
  51. nuitka/tree/ReformulationDictionaryCreation.py +2 -2
  52. nuitka/tree/ReformulationFunctionStatements.py +1 -1
  53. nuitka/tree/ReformulationImportStatements.py +4 -51
  54. nuitka/tree/ReformulationMultidist.py +1 -1
  55. nuitka/tree/ReformulationNamespacePackages.py +27 -5
  56. nuitka/tree/SourceHandling.py +56 -17
  57. nuitka/utils/Distributions.py +26 -6
  58. nuitka/utils/FileOperations.py +18 -6
  59. nuitka/utils/StaticLibraries.py +4 -0
  60. {Nuitka_winsvc-2.6.data → Nuitka_winsvc-2.6.5.data}/scripts/nuitka-run.cmd +0 -0
  61. {Nuitka_winsvc-2.6.data → Nuitka_winsvc-2.6.5.data}/scripts/nuitka.cmd +0 -0
  62. {Nuitka_winsvc-2.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/LICENSE.txt +0 -0
  63. {Nuitka_winsvc-2.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/WHEEL +0 -0
  64. {Nuitka_winsvc-2.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/entry_points.txt +0 -0
  65. {Nuitka_winsvc-2.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/top_level.txt +0 -0
@@ -397,42 +397,69 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
397
397
 
398
398
  return dict(self.context_codes[context_code])
399
399
 
400
- def _onModuleSourceCode(self, module_name, anti_bloat_config, source_code):
401
- # Complex dealing with many cases, pylint: disable=too-many-branches
400
+ def _onModuleSourceCodeReplacement(
401
+ self,
402
+ config_module_name,
403
+ module_name,
404
+ source_code,
405
+ config_name,
406
+ extra_context,
407
+ replace_code,
408
+ replace_src,
409
+ ):
410
+ if replace_code:
411
+ replace_dst = self.evaluateExpression(
412
+ config_module_name=config_module_name,
413
+ module_name=module_name,
414
+ expression=replace_code,
415
+ config_name="module '%s' config '%s'"
416
+ % (config_module_name, config_name),
417
+ extra_context=extra_context,
418
+ single_value=True,
419
+ )
420
+ else:
421
+ replace_dst = ""
422
+
423
+ return source_code, source_code.replace(replace_src, replace_dst)
402
424
 
425
+ def _onModuleSourceCode(
426
+ self,
427
+ config_module_name,
428
+ module_name,
429
+ config_prefix,
430
+ anti_bloat_config,
431
+ source_code,
432
+ ):
433
+ # Complex dealing with many cases, pylint: disable=too-many-branches,too-many-locals
403
434
  description = anti_bloat_config.get("description", "description not given")
404
435
 
405
436
  # To allow detection if it did anything.
406
437
  change_count = 0
407
438
 
408
439
  for replace_src, replace_code in (
409
- anti_bloat_config.get("replacements") or {}
440
+ anti_bloat_config.get(config_prefix + "replacements") or {}
410
441
  ).items():
411
442
  # Avoid the eval, if the replace doesn't hit.
412
443
  if replace_src not in source_code:
413
444
  continue
414
445
 
415
- if replace_code:
416
- replace_dst = self.evaluateExpression(
417
- full_name=module_name,
418
- expression=replace_code,
419
- config_name="module '%s' config 'replacements'" % module_name,
420
- extra_context=self._getContextCode(
421
- module_name=module_name, anti_bloat_config=anti_bloat_config
422
- ),
423
- single_value=True,
424
- )
425
- else:
426
- replace_dst = ""
427
-
428
- old = source_code
429
- source_code = source_code.replace(replace_src, replace_dst)
446
+ old, source_code = self._onModuleSourceCodeReplacement(
447
+ config_module_name=config_module_name,
448
+ module_name=module_name,
449
+ source_code=source_code,
450
+ config_name=config_prefix + "replacements",
451
+ extra_context=self._getContextCode(
452
+ module_name=module_name, anti_bloat_config=anti_bloat_config
453
+ ),
454
+ replace_src=replace_src,
455
+ replace_code=replace_code,
456
+ )
430
457
 
431
458
  if old != source_code:
432
459
  change_count += 1
433
460
 
434
461
  for replace_src, replace_dst in (
435
- anti_bloat_config.get("replacements_plain") or {}
462
+ anti_bloat_config.get(config_prefix + "replacements_plain") or {}
436
463
  ).items():
437
464
  old = source_code
438
465
  source_code = source_code.replace(replace_src, replace_dst)
@@ -441,7 +468,7 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
441
468
  change_count += 1
442
469
 
443
470
  for replace_src, replace_dst in (
444
- anti_bloat_config.get("replacements_re") or {}
471
+ anti_bloat_config.get(config_prefix + "replacements_re") or {}
445
472
  ).items():
446
473
  old = source_code
447
474
  source_code = re.sub(replace_src, replace_dst, source_code, re.S)
@@ -451,31 +478,49 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
451
478
  elif isExperimental("display-anti-bloat-mismatches"):
452
479
  self.info("No match in %s no match %r" % (module_name, replace_src))
453
480
 
454
- append_code = anti_bloat_config.get("append_result", "")
455
- if type(append_code) in (tuple, list):
456
- append_code = "\n".join(append_code)
481
+ # These have no global variants.
482
+ if config_prefix == "":
483
+ append_code = anti_bloat_config.get("append_result", "")
484
+ if type(append_code) in (tuple, list):
485
+ append_code = "\n".join(append_code)
457
486
 
458
- if append_code:
459
- append_result = self.evaluateExpression(
460
- full_name=module_name,
461
- expression=append_code,
462
- config_name="module '%s' config 'append_code'" % module_name,
463
- extra_context=self._getContextCode(
464
- module_name=module_name, anti_bloat_config=anti_bloat_config
465
- ),
466
- single_value=True,
467
- )
487
+ if append_code:
488
+ append_result = self.evaluateExpression(
489
+ config_module_name=module_name,
490
+ module_name=module_name,
491
+ expression=append_code,
492
+ config_name="module '%s' config 'append_code'" % module_name,
493
+ extra_context=self._getContextCode(
494
+ module_name=module_name, anti_bloat_config=anti_bloat_config
495
+ ),
496
+ single_value=True,
497
+ )
468
498
 
469
- source_code += "\n" + append_result
470
- change_count += 1
499
+ source_code += "\n" + append_result
500
+ change_count += 1
501
+
502
+ append_plain = anti_bloat_config.get("append_plain", "")
503
+ if type(append_plain) in (tuple, list):
504
+ append_plain = "\n".join(append_plain)
471
505
 
472
- append_plain = anti_bloat_config.get("append_plain", "")
473
- if type(append_plain) in (tuple, list):
474
- append_plain = "\n".join(append_plain)
506
+ if append_plain:
507
+ source_code += "\n" + append_plain
508
+ change_count += 1
475
509
 
476
- if append_plain:
477
- source_code += "\n" + append_plain
478
- change_count += 1
510
+ module_code = anti_bloat_config.get("module_code", None)
511
+
512
+ if module_code is not None:
513
+ # Cannot be mixed.
514
+ assert not change_count
515
+
516
+ if self.show_changes:
517
+ self.info(
518
+ "Handling module '%s' with full replacement : %s."
519
+ % (module_name.asString(), description)
520
+ )
521
+
522
+ source_code = module_code
523
+ change_count = 1
479
524
 
480
525
  if change_count > 0 and self.show_changes:
481
526
  self.info(
@@ -483,31 +528,39 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
483
528
  % (module_name.asString(), change_count, description)
484
529
  )
485
530
 
486
- module_code = anti_bloat_config.get("module_code", None)
487
-
488
- if module_code is not None:
489
- assert not change_count
490
-
491
- if self.show_changes:
492
- self.info(
493
- "Handling module '%s' with full replacement : %s."
494
- % (module_name.asString(), description)
495
- )
496
-
497
- source_code = module_code
498
-
499
531
  return source_code
500
532
 
501
533
  def onModuleSourceCode(self, module_name, source_filename, source_code):
502
- for anti_bloat_config in self.config.get(module_name, section="anti-bloat"):
503
- if self.evaluateCondition(
504
- full_name=module_name, condition=anti_bloat_config.get("when", "True")
534
+ config_module_name = module_name
535
+ while True:
536
+ for anti_bloat_config in self.config.get(
537
+ config_module_name, section="anti-bloat"
505
538
  ):
506
- source_code = self._onModuleSourceCode(
507
- module_name=module_name,
508
- anti_bloat_config=anti_bloat_config,
509
- source_code=source_code,
510
- )
539
+ if self.evaluateCondition(
540
+ full_name=config_module_name,
541
+ condition=anti_bloat_config.get("when", "True"),
542
+ ):
543
+ if config_module_name == module_name:
544
+ source_code = self._onModuleSourceCode(
545
+ config_module_name=config_module_name,
546
+ module_name=module_name,
547
+ anti_bloat_config=anti_bloat_config,
548
+ config_prefix="",
549
+ source_code=source_code,
550
+ )
551
+
552
+ source_code = self._onModuleSourceCode(
553
+ config_module_name=config_module_name,
554
+ module_name=module_name,
555
+ anti_bloat_config=anti_bloat_config,
556
+ config_prefix="global_",
557
+ source_code=source_code,
558
+ )
559
+
560
+ config_module_name = config_module_name.getPackageName()
561
+
562
+ if not config_module_name:
563
+ break
511
564
 
512
565
  return source_code
513
566
 
@@ -526,7 +579,8 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
526
579
  return False
527
580
 
528
581
  replacement = self.evaluateExpression(
529
- full_name=module_name,
582
+ config_module_name=module_name,
583
+ module_name=module_name,
530
584
  expression=replace_code,
531
585
  config_name="module '%s' config 'change_function' of '%s'"
532
586
  % (module_name, function_name),
@@ -594,7 +648,8 @@ class %(class_name)s:
594
648
  return False
595
649
 
596
650
  replacement = self.evaluateExpression(
597
- full_name=module_name,
651
+ config_module_name=module_name,
652
+ module_name=module_name,
598
653
  expression=replace_code,
599
654
  config_name="module '%s' config 'change_class' of '%s'"
600
655
  % (module_name, class_name),
@@ -709,6 +764,22 @@ class %(class_name)s:
709
764
  ):
710
765
  self.no_follows[no_follow_pattern] = (config_of_module_name, description)
711
766
 
767
+ def _needsWarning(self, key):
768
+ if key in self.warnings_given:
769
+ return False
770
+
771
+ (
772
+ module_name,
773
+ using_module_name,
774
+ line_number,
775
+ ) = key
776
+
777
+ for parent_package in module_name.getParentPackageNames():
778
+ if (parent_package, using_module_name, line_number) in self.warnings_given:
779
+ return False
780
+
781
+ return True
782
+
712
783
  def onModuleRecursion(
713
784
  self,
714
785
  module_name,
@@ -776,7 +847,7 @@ class %(class_name)s:
776
847
  source_ref.getLineNumber(),
777
848
  )
778
849
 
779
- if key not in self.warnings_given:
850
+ if self._needsWarning(key):
780
851
  if handled_module_name == intended_module_name:
781
852
  handled_module_name_desc = "'%s'" % handled_module_name
782
853
  else:
@@ -87,7 +87,8 @@ class NuitkaPluginImplicitImports(NuitkaYamlPluginBase):
87
87
  def _resolveImplicitImportsConfig(self, full_name, dependency):
88
88
  if "(" in dependency:
89
89
  value = self.evaluateExpression(
90
- full_name=full_name,
90
+ config_module_name=full_name,
91
+ module_name=full_name,
91
92
  expression=dependency,
92
93
  config_name="depends value",
93
94
  extra_context=None,
@@ -418,7 +419,7 @@ __file__ = (__nuitka_binary_dir + '%ssite.py') if '__nuitka_binary_dir' in dict(
418
419
  # Special handling for huggingface that uses the source code variant
419
420
  # of lazy module. spell-checker: ignore huggingface
420
421
  if (
421
- "__getattr__, __dir__, __all__ = _attach(__name__, submodules=[], submod_attrs=_SUBMOD_ATTRS)"
422
+ "_attach(__name__, submodules=[], submod_attrs=_SUBMOD_ATTRS)"
422
423
  in source_code
423
424
  ):
424
425
  huggingface_hub_lazy_loader_info = self.queryRuntimeInformationSingle(
@@ -774,6 +774,11 @@ Prefix = .
774
774
  if self.binding_name in ("PySide6", "PyQt6"):
775
775
  used_frameworks += ["QtOpenGL", "QtDBus"]
776
776
 
777
+ # Newer PySide6 needs even more.
778
+ if self.binding_name == "PySide6" and self._getBindingVersion() >= (6, 8, 0):
779
+ used_frameworks.append("QtQmlMeta")
780
+ used_frameworks.append("QtQmlWorkerScript")
781
+
777
782
  for used_framework in used_frameworks:
778
783
  yield self.makeIncludedAppBundleFramework(
779
784
  source_path=os.path.join(self._getQtInformation().data_path, "lib"),
@@ -1433,6 +1438,14 @@ Support for PyQt6 is not perfect, e.g. Qt threading does not work, so prefer PyS
1433
1438
  )
1434
1439
 
1435
1440
 
1441
+ class NuitkaPluginDetectorPyQt6Plugins(NuitkaPluginBase):
1442
+ detector_for = NuitkaPluginPyQt6Plugins
1443
+
1444
+ def onModuleDiscovered(self, module):
1445
+ if module.getFullName() == NuitkaPluginPyQt6Plugins.binding_name + ".QtCore":
1446
+ self.warnUnusedPlugin("Standalone mode support and Qt plugins.")
1447
+
1448
+
1436
1449
  class NuitkaPluginNoQt(NuitkaPluginBase):
1437
1450
  """This is a plugins for suppression of all Qt binding plugins."""
1438
1451