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
nuitka/Options.py CHANGED
@@ -44,6 +44,7 @@ from nuitka.PythonFlavors import (
44
44
  isPyenvPython,
45
45
  isTermuxPython,
46
46
  isUninstalledPython,
47
+ isUvPython,
47
48
  )
48
49
  from nuitka.PythonVersions import (
49
50
  getLaunchingSystemPrefixPath,
@@ -883,8 +884,16 @@ options instead."""
883
884
  )
884
885
 
885
886
  if options.static_libpython == "yes" and getSystemStaticLibPythonPath() is None:
887
+ usable, reason = _couldUseStaticLibPython()
888
+
886
889
  Tracing.options_logger.sysexit(
887
- "Error, static libpython is not found or not supported for this Python installation."
890
+ """\
891
+ Error, a static libpython is either not found or not supported for \
892
+ this Python (%s) installation: %s"""
893
+ % (
894
+ getPythonFlavorName(),
895
+ (reason if not usable else "unknown reason"),
896
+ )
888
897
  )
889
898
 
890
899
  if shallUseStaticLibPython() and getSystemStaticLibPythonPath() is None:
@@ -1674,85 +1683,102 @@ def shallOptimizeStringExec():
1674
1683
  _shall_use_static_lib_python = None
1675
1684
 
1676
1685
 
1677
- def _shallUseStaticLibPython():
1678
- # many cases and return driven, pylint: disable=too-many-branches,too-many-return-statements
1686
+ def _couldUseStaticLibPython():
1687
+ # many cases and return driven,
1688
+ # pylint: disable=too-many-branches,too-many-return-statements
1679
1689
 
1680
- if shallMakeModule():
1681
- return False, "not used in module mode"
1690
+ # Nuitka-Python is good to to static linking.
1691
+ if isNuitkaPython():
1692
+ return True, "Nuitka-Python is unexpectedly broken."
1682
1693
 
1683
- if options.static_libpython == "auto":
1684
- # Nuitka-Python is good to to static linking.
1685
- if isNuitkaPython():
1686
- return True, "Nuitka-Python is unexpectedly broken."
1694
+ if isHomebrewPython():
1695
+ return True, "Homebrew Python is unexpectedly broken."
1687
1696
 
1688
- if isHomebrewPython():
1689
- return True, "Homebrew Python is unexpectedly broken."
1697
+ # Debian packages with are usable if the OS is new enough
1698
+ from nuitka.utils.StaticLibraries import isDebianSuitableForStaticLinking
1690
1699
 
1691
- # Debian packages with are usable if the OS is new enough
1692
- from nuitka.utils.StaticLibraries import (
1693
- isDebianSuitableForStaticLinking,
1694
- )
1695
-
1696
- if (
1697
- isDebianBasedLinux()
1698
- and isDebianPackagePython()
1699
- and isDebianSuitableForStaticLinking()
1700
- and not shallUsePythonDebug()
1700
+ if (
1701
+ isDebianBasedLinux()
1702
+ and isDebianPackagePython()
1703
+ and isDebianSuitableForStaticLinking()
1704
+ and not shallUsePythonDebug()
1705
+ ):
1706
+ if python_version >= 0x3C0 and not os.path.exists(
1707
+ getInlineCopyFolder("python_hacl")
1701
1708
  ):
1702
- if python_version >= 0x3C0 and not os.path.exists(
1703
- getInlineCopyFolder("python_hacl")
1704
- ):
1705
- return (
1706
- False,
1707
- "Nuitka on Debian-Python needs inline copy of hacl not included.",
1708
- )
1709
-
1710
- return True, "Nuitka on Debian-Python needs package '%s' installed." % (
1711
- "python2-dev" if str is bytes else "python3-dev"
1709
+ return (
1710
+ False,
1711
+ "Nuitka on Debian-Python needs inline copy of hacl not included.",
1712
1712
  )
1713
1713
 
1714
- if isMSYS2MingwPython():
1715
- return True, "Nuitka on MSYS2 needs package 'python-devel' installed."
1716
-
1717
- # For Anaconda default to trying static lib python library, which
1718
- # normally is just not available or if it is even unusable.
1719
- if isAnacondaPython():
1720
- if isMacOS():
1721
- # TODO: Maybe some linker options can make it happen.
1722
- return (
1723
- False,
1724
- "Anaconda on macOS exports not all symbols when using it.",
1725
- )
1726
- elif not isWin32Windows():
1727
- return (
1728
- True,
1729
- """\
1730
- Nuitka on Anaconda needs package for static libpython installed. \
1731
- Execute 'conda install libpython-static'.""",
1732
- )
1714
+ return True, "Nuitka on Debian-Python needs package '%s' installed." % (
1715
+ "python2-dev" if str is bytes else "python3-dev"
1716
+ )
1733
1717
 
1734
- if isPyenvPython():
1735
- return True, "Nuitka on pyenv should not use '--enable-shared'."
1718
+ if isMSYS2MingwPython():
1719
+ return True, "Nuitka on MSYS2 needs package 'python-devel' installed."
1736
1720
 
1737
- if isManyLinuxPython():
1721
+ # For Anaconda default to trying static lib python library, which
1722
+ # normally is just not available or if it is even unusable.
1723
+ if isAnacondaPython():
1724
+ if isMacOS():
1725
+ # TODO: Maybe some linker options can make it happen.
1726
+ return (
1727
+ False,
1728
+ "Anaconda on macOS exports not all symbols when using it.",
1729
+ )
1730
+ elif not isWin32Windows():
1738
1731
  return (
1739
1732
  True,
1740
1733
  """\
1734
+ Nuitka on Anaconda needs package for static libpython installed. \
1735
+ Execute 'conda install libpython-static'.""",
1736
+ )
1737
+
1738
+ if isUvPython():
1739
+ return (
1740
+ False,
1741
+ """\
1742
+ Static link library of UV-Python is currently using dependent libraries \
1743
+ such as tcl that are not included, but would be needed. Please help them \
1744
+ improve it for best performance of the result.""",
1745
+ )
1746
+
1747
+ if isPyenvPython():
1748
+ return True, "Nuitka on pyenv should not use '--enable-shared'."
1749
+
1750
+ if isManyLinuxPython():
1751
+ return (
1752
+ True,
1753
+ """\
1741
1754
  Nuitka on 'manylinux' has no shared libraries. Use container with \
1742
1755
  the command 'RUN cd /opt/_internal && tar xf static-libs-for-embedding-only.tar.xz' \
1743
1756
  added to provide the static link library.""",
1744
- )
1757
+ )
1758
+
1759
+ if isMacOS() and isCPythonOfficialPackage():
1760
+ return True, None
1761
+
1762
+ if isArchPackagePython():
1763
+ return True, None
1764
+
1765
+ # If not dynamic link library is available, the static link library will
1766
+ # have to do it.
1767
+ if isStaticallyLinkedPython():
1768
+ return True, None
1769
+
1770
+ return None, None
1771
+
1745
1772
 
1746
- if isMacOS() and isCPythonOfficialPackage():
1747
- return True, None
1773
+ def _shallUseStaticLibPython():
1774
+ if shallMakeModule():
1775
+ return False, "not used in module mode"
1748
1776
 
1749
- if isArchPackagePython():
1750
- return True, None
1777
+ if options.static_libpython == "auto":
1778
+ result = _couldUseStaticLibPython()
1751
1779
 
1752
- # If not dynamic link library is available, the static link library will
1753
- # have to do it.
1754
- if isStaticallyLinkedPython():
1755
- return True, None
1780
+ if result[0] is not None:
1781
+ return result
1756
1782
 
1757
1783
  return options.static_libpython == "yes", None
1758
1784
 
@@ -2116,6 +2142,8 @@ def shallOnefileAsArchive():
2116
2142
 
2117
2143
 
2118
2144
  def _checkIconPaths(icon_paths):
2145
+ icon_paths = tuple(icon_paths)
2146
+
2119
2147
  for icon_path in icon_paths:
2120
2148
  if not os.path.exists(icon_path):
2121
2149
  Tracing.options_logger.sysexit(
@@ -2155,10 +2183,8 @@ def getLinuxIconPaths():
2155
2183
 
2156
2184
  def getMacOSIconPaths():
2157
2185
  """*list of str*, values of ``--macos-app-icon``"""
2158
- return tuple(
2159
- _checkIconPaths(
2160
- icon_path for icon_path in options.macos_icon_path if icon_path != "none"
2161
- )
2186
+ return _checkIconPaths(
2187
+ icon_path for icon_path in options.macos_icon_path if icon_path != "none"
2162
2188
  )
2163
2189
 
2164
2190
 
nuitka/PythonFlavors.py CHANGED
@@ -143,6 +143,16 @@ def isRyePython():
143
143
  return False
144
144
 
145
145
 
146
+ def isUvPython():
147
+ if isWin32Windows():
148
+ return r"AppData\Roaming\uv" in getSystemPrefixPath()
149
+ else:
150
+ if getSystemPrefixPath().startswith(os.path.expanduser("~/.local/share/uv")):
151
+ return True
152
+
153
+ return False
154
+
155
+
146
156
  def isPyenvPython():
147
157
  if isWin32Windows():
148
158
  return False
@@ -183,6 +193,9 @@ def isUninstalledPython():
183
193
  if isSelfCompiledPythonUninstalled():
184
194
  return True
185
195
 
196
+ if isUvPython():
197
+ return True
198
+
186
199
  if isStaticallyLinkedPython():
187
200
  return False
188
201
 
@@ -376,6 +389,8 @@ def getPythonFlavorName():
376
389
  return "Homebrew Python"
377
390
  elif isRyePython():
378
391
  return "Rye Python"
392
+ elif isUvPython():
393
+ return "UV-Python"
379
394
  elif isApplePython():
380
395
  return "Apple Python"
381
396
  elif isPyenvPython():
nuitka/Version.py CHANGED
@@ -20,7 +20,7 @@
20
20
  """
21
21
 
22
22
  version_string = """\
23
- Nuitka V2.6
23
+ Nuitka V2.6.5
24
24
  Copyright (C) 2025 Kay Hayen."""
25
25
 
26
26
 
@@ -684,10 +684,9 @@ def setupCCompiler(env, lto_mode, pgo_mode, job_count, onefile_compile):
684
684
  env.Append(CCFLAGS=[target_flag])
685
685
  env.Append(LINKFLAGS=[target_flag])
686
686
 
687
- # The 32 bits MinGW does not default for API level properly, so help it.
688
- if env.mingw_mode:
689
- # Windows XP
690
- env.Append(CPPDEFINES=["_WIN32_WINNT=0x0501"])
687
+ # The MinGW64 and ClangCL do not default for API level properly, so
688
+ # help it.
689
+ env.Append(CPPDEFINES=["_WIN32_WINNT=0x0601"])
691
690
 
692
691
  # Unicode entry points for programs.
693
692
  if env.mingw_mode:
@@ -307,7 +307,7 @@ import subprocess
307
307
 
308
308
  exit_code = subprocess.call(
309
309
  %(scons_command)r,
310
- env={%(env)s}
310
+ env={%(env)s},
311
311
  shell=False
312
312
  )"""
313
313
  % {
@@ -339,7 +339,7 @@ cd "${0%/*}"
339
339
  contents="""\
340
340
  %(script_prelude)s
341
341
 
342
- '%(scons_python)s' '%(scons_debug_script_name)s'
342
+ "%(scons_python)s" "%(scons_debug_script_name)s"
343
343
  """
344
344
  % {
345
345
  "script_prelude": script_prelude,
@@ -147,7 +147,7 @@ NUITKA_MAY_BE_UNUSED static inline bool isFrameUnusable(struct Nuitka_FrameObjec
147
147
  // Still in use
148
148
  Py_REFCNT(frame_object) > 1 ||
149
149
  #if PYTHON_VERSION < 0x300
150
- // Last used by another thread (TODO: Could just set it when re-using)
150
+ // Last used by another thread (TODO: Could just set it when reusing)
151
151
  frame_object->m_frame.f_tstate != PyThreadState_GET() ||
152
152
  #endif
153
153
  // Not currently linked.
@@ -648,7 +648,7 @@ NUITKA_MAY_BE_UNUSED static bool _CHECK_AND_CLEAR_EXCEPTION_OCCURRED(PyThreadSta
648
648
 
649
649
  Equivalent to if(PyErr_ExceptionMatches(PyExc_StopIteration) PyErr_Clear();
650
650
 
651
- If error is raised by built-in function next() and an iterators __next__()
651
+ If error is raised by built-in function next() and an iterator's __next__()
652
652
  method to signal that there are no further items produced by the iterator then
653
653
  it resets the TSTATE to NULL and returns True else return False
654
654
 
@@ -9,7 +9,7 @@
9
9
  #endif
10
10
 
11
11
  // Helpers for type aliases, type variables, and generic base classes.
12
- extern PyObject *MAKE_TYPE_ALIAS(PyObject *name, PyObject *type_params, PyObject *compute_value);
12
+ extern PyObject *MAKE_TYPE_ALIAS(PyObject *name, PyObject *type_params, PyObject *value, PyObject *module_name);
13
13
  extern PyObject *MAKE_TYPE_VAR(PyThreadState *tstate, PyObject *name);
14
14
  extern PyObject *MAKE_TYPE_GENERIC(PyThreadState *tstate, PyObject *params);
15
15
 
@@ -0,0 +1,41 @@
1
+ from __future__ import absolute_import
2
+ import sys
3
+ from . import ws2_32
4
+ from . import oleaut32
5
+
6
+ '''
7
+ A small module for keeping a database of ordinal to symbol
8
+ mappings for DLLs which frequently get linked without symbolic
9
+ infoz.
10
+ '''
11
+
12
+ ords = {
13
+ b'ws2_32.dll': ws2_32.ord_names,
14
+ b'wsock32.dll': ws2_32.ord_names,
15
+ b'oleaut32.dll': oleaut32.ord_names,
16
+ }
17
+
18
+ PY3 = sys.version_info > (3,)
19
+
20
+ if PY3:
21
+ def formatOrdString(ord_val):
22
+ return 'ord{}'.format(ord_val).encode()
23
+ else:
24
+ def formatOrdString(ord_val):
25
+ return b'ord%d' % ord_val
26
+
27
+
28
+ def ordLookup(libname, ord_val, make_name=False):
29
+ '''
30
+ Lookup a name for the given ordinal if it's in our
31
+ database.
32
+ '''
33
+ names = ords.get(libname.lower())
34
+ if names is None:
35
+ if make_name is True:
36
+ return formatOrdString(ord_val)
37
+ return None
38
+ name = names.get(ord_val)
39
+ if name is None:
40
+ return formatOrdString(ord_val)
41
+ return name