Nuitka-winsvc 2.3.3__cp311-cp311-win_amd64.whl → 2.3.11__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 (63) hide show
  1. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/RECORD +63 -42
  3. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/WHEEL +1 -1
  4. nuitka/Options.py +1 -1
  5. nuitka/PythonFlavors.py +15 -0
  6. nuitka/Tracing.py +26 -23
  7. nuitka/Version.py +1 -1
  8. nuitka/build/SconsUtils.py +1 -1
  9. nuitka/build/include/nuitka/compiled_function.h +2 -0
  10. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  11. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  12. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  13. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  14. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  15. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  16. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  17. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  18. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  19. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  20. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  21. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  22. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  23. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  24. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  25. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  26. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  27. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  28. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  29. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  30. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  31. nuitka/build/static_src/CompiledCodeHelpers.c +2 -0
  32. nuitka/build/static_src/CompiledFrameType.c +2 -5
  33. nuitka/build/static_src/CompiledFunctionType.c +43 -4
  34. nuitka/build/static_src/HelpersAllocator.c +0 -2
  35. nuitka/build/static_src/HelpersBuiltin.c +2 -2
  36. nuitka/build/static_src/HelpersHeapStorage.c +4 -0
  37. nuitka/build/static_src/MainProgram.c +17 -0
  38. nuitka/build/static_src/MetaPathBasedLoader.c +77 -48
  39. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +29 -0
  40. nuitka/code_generation/templates/CodeTemplatesModules.py +1 -10
  41. nuitka/freezer/DllDependenciesCommon.py +28 -3
  42. nuitka/freezer/DllDependenciesMacOS.py +23 -2
  43. nuitka/freezer/DllDependenciesWin32.py +6 -1
  44. nuitka/importing/Importing.py +5 -1
  45. nuitka/nodes/FunctionNodes.py +4 -1
  46. nuitka/nodes/ModuleNodes.py +3 -4
  47. nuitka/nodes/NodeBases.py +10 -9
  48. nuitka/nodes/shapes/BuiltinTypeShapes.py +21 -1
  49. nuitka/plugins/PluginBase.py +11 -3
  50. nuitka/plugins/standard/KivyPlugin.py +10 -0
  51. nuitka/plugins/standard/standard.nuitka-package.config.yml +240 -25
  52. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +38 -2
  53. nuitka/tools/testing/Common.py +22 -2
  54. nuitka/tree/InternalModule.py +1 -1
  55. nuitka/tree/ReformulationFunctionStatements.py +1 -0
  56. nuitka/utils/Execution.py +8 -7
  57. nuitka/utils/FileOperations.py +38 -1
  58. nuitka/utils/SharedLibraries.py +38 -34
  59. {Nuitka_winsvc-2.3.3.data → Nuitka_winsvc-2.3.11.data}/scripts/nuitka-run.bat +0 -0
  60. {Nuitka_winsvc-2.3.3.data → Nuitka_winsvc-2.3.11.data}/scripts/nuitka.bat +0 -0
  61. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/LICENSE.txt +0 -0
  62. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/entry_points.txt +0 -0
  63. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/top_level.txt +0 -0
@@ -166,8 +166,26 @@ NUITKA_MAY_BE_UNUSED static PyObject *MAKE_RELATIVE_PATH_FROM_NAME(char const *n
166
166
  return result;
167
167
  }
168
168
 
169
- static PyObject *loadModuleFromCodeObject(PyObject *module, PyCodeObject *code_object, char const *name,
170
- bool is_package) {
169
+ static PyObject *_makeDunderPathObject(PyThreadState *tstate, PyObject *module_path_entry) {
170
+ CHECK_OBJECT(module_path_entry);
171
+
172
+ PyObject *path_list = MAKE_LIST_EMPTY(tstate, 1);
173
+ if (unlikely(path_list == NULL)) {
174
+ return NULL;
175
+ }
176
+
177
+ int res = PyList_SetItem(path_list, 0, module_path_entry);
178
+ if (unlikely(res != 0)) {
179
+ return NULL;
180
+ }
181
+ Py_INCREF(module_path_entry);
182
+
183
+ CHECK_OBJECT(path_list);
184
+ return path_list;
185
+ }
186
+
187
+ static PyObject *loadModuleFromCodeObject(PyThreadState *tstate, PyObject *module, PyCodeObject *code_object,
188
+ char const *name, bool is_package) {
171
189
  assert(code_object != NULL);
172
190
 
173
191
  {
@@ -200,20 +218,9 @@ static PyObject *loadModuleFromCodeObject(PyObject *module, PyCodeObject *code_o
200
218
 
201
219
  if (is_package) {
202
220
  /* Set __path__ properly, unlike frozen module importer does. */
203
- NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
204
-
205
- PyObject *path_list = MAKE_LIST_EMPTY(tstate, 1);
206
- if (unlikely(path_list == NULL)) {
207
- return NULL;
208
- }
221
+ PyObject *path_list = _makeDunderPathObject(tstate, module_path_entry);
209
222
 
210
- int res = PyList_SetItem(path_list, 0, module_path_entry);
211
- if (unlikely(res != 0)) {
212
- return NULL;
213
- }
214
- Py_INCREF(module_path_entry);
215
-
216
- res = PyObject_SetAttr(module, const_str_plain___path__, path_list);
223
+ int res = PyObject_SetAttr(module, const_str_plain___path__, path_list);
217
224
  if (unlikely(res != 0)) {
218
225
  return NULL;
219
226
  }
@@ -461,7 +468,8 @@ static bool scanModuleInPackagePath(PyThreadState *tstate, PyObject *module_name
461
468
  return result;
462
469
  }
463
470
 
464
- static PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full_name, const filename_char_t *filename);
471
+ static PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full_name, const filename_char_t *filename,
472
+ bool is_package);
465
473
 
466
474
  static PyObject *callIntoInstalledExtensionModule(PyThreadState *tstate, PyObject *module_name,
467
475
  PyObject *extension_module_filename) {
@@ -479,7 +487,9 @@ static PyObject *callIntoInstalledExtensionModule(PyThreadState *tstate, PyObjec
479
487
  char const *extension_module_filename_str = Nuitka_String_AsString(extension_module_filename);
480
488
  #endif
481
489
 
482
- return callIntoExtensionModule(tstate, Nuitka_String_AsString(module_name), extension_module_filename_str);
490
+ // TODO: The value of "is_package" is guessed, maybe infer from filename being
491
+ // a "__init__.so" and the like.
492
+ return callIntoExtensionModule(tstate, Nuitka_String_AsString(module_name), extension_module_filename_str, false);
483
493
  }
484
494
 
485
495
  #endif
@@ -675,8 +685,27 @@ static void _fillExtensionModuleDllEntryFunctionName(PyThreadState *tstate, char
675
685
  #endif
676
686
  }
677
687
 
678
- static PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full_name,
679
- const filename_char_t *filename) {
688
+ #ifdef _NUITKA_STANDALONE
689
+ // Append the the entry name from full path module name with dots,
690
+ // and translate these into directory separators.
691
+ static void _makeModuleCFilenameValue(filename_char_t *filename, size_t filename_size, char const *module_name_cstr,
692
+ PyObject *module_name) {
693
+ #ifdef _WIN32
694
+ appendWStringSafeW(filename, getBinaryDirectoryWideChars(true), filename_size);
695
+ appendCharSafeW(filename, SEP, filename_size);
696
+ appendModuleNameAsPathW(filename, module_name, filename_size);
697
+ appendStringSafeW(filename, ".pyd", filename_size);
698
+ #else
699
+ appendStringSafe(filename, getBinaryDirectoryHostEncoded(true), filename_size);
700
+ appendCharSafe(filename, SEP, filename_size);
701
+ appendModuleNameAsPath(filename, module_name_cstr, filename_size);
702
+ appendStringSafe(filename, ".so", filename_size);
703
+ #endif
704
+ }
705
+ #endif
706
+
707
+ static PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full_name, const filename_char_t *filename,
708
+ bool is_package) {
680
709
  // Determine the package name and basename of the module to load.
681
710
  char const *dot = strrchr(full_name, '.');
682
711
  char const *name;
@@ -836,7 +865,10 @@ static PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full
836
865
 
837
866
  PyObject *full_name_obj = Nuitka_String_FromString(full_name);
838
867
 
839
- PyObject *spec_value = createModuleSpec(tstate, full_name_obj, NULL, false);
868
+ PyObject *origin = Nuitka_String_FromFilename(filename);
869
+
870
+ PyObject *spec_value = createModuleSpec(tstate, full_name_obj, origin, is_package);
871
+ CHECK_OBJECT(spec_value);
840
872
 
841
873
  module = PyModule_FromDefAndSpec(def, spec_value);
842
874
 
@@ -848,16 +880,25 @@ static PyObject *callIntoExtensionModule(PyThreadState *tstate, char const *full
848
880
  return NULL;
849
881
  }
850
882
 
851
- setModuleFileValue(tstate, module, filename);
852
- PyObject_SetAttrString((PyObject *)spec_value, "origin",
853
- LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__));
854
883
  SET_ATTRIBUTE(tstate, module, const_str_plain___spec__, spec_value);
855
884
 
885
+ setModuleFileValue(tstate, module, filename);
886
+
887
+ /* Set __path__ properly, unlike frozen module importer does. */
888
+ PyObject *path_list = _makeDunderPathObject(tstate, origin);
889
+
890
+ int res = PyObject_SetAttr(module, const_str_plain___path__, path_list);
891
+ if (unlikely(res != 0)) {
892
+ return NULL;
893
+ }
894
+
895
+ Py_DECREF(path_list);
896
+
856
897
  Nuitka_SetModule(full_name_obj, module);
857
898
  Py_DECREF(full_name_obj);
858
899
 
859
900
  SET_ATTRIBUTE(tstate, spec_value, const_str_plain__initializing, Py_True);
860
- int res = PyModule_ExecDef(module, def);
901
+ res = PyModule_ExecDef(module, def);
861
902
  SET_ATTRIBUTE(tstate, spec_value, const_str_plain__initializing, Py_False);
862
903
 
863
904
  Py_DECREF(spec_value);
@@ -1011,35 +1052,22 @@ static PyObject *loadModule(PyThreadState *tstate, PyObject *module, PyObject *m
1011
1052
  struct Nuitka_MetaPathBasedLoaderEntry const *entry) {
1012
1053
  #ifdef _NUITKA_STANDALONE
1013
1054
  if ((entry->flags & NUITKA_EXTENSION_MODULE_FLAG) != 0) {
1014
- // Append the the entry name from full path module name with dots,
1015
- // and translate these into directory separators.
1016
- #ifdef _WIN32
1017
- wchar_t filename[MAXPATHLEN + 1] = {0};
1018
-
1019
- appendWStringSafeW(filename, getBinaryDirectoryWideChars(true), sizeof(filename) / sizeof(wchar_t));
1020
- appendCharSafeW(filename, SEP, sizeof(filename) / sizeof(wchar_t));
1021
- appendModuleNameAsPathW(filename, module_name, sizeof(filename) / sizeof(wchar_t));
1022
- appendStringSafeW(filename, ".pyd", sizeof(filename) / sizeof(wchar_t));
1023
- #else
1024
- char filename[MAXPATHLEN + 1] = {0};
1025
-
1026
- appendStringSafe(filename, getBinaryDirectoryHostEncoded(true), sizeof(filename));
1027
- appendCharSafe(filename, SEP, sizeof(filename));
1028
- appendModuleNameAsPath(filename, entry->name, sizeof(filename));
1029
- appendStringSafe(filename, ".so", sizeof(filename));
1030
-
1031
- #endif
1055
+ filename_char_t filename[MAXPATHLEN + 1] = {0};
1056
+ _makeModuleCFilenameValue(filename, sizeof(filename) / sizeof(filename_char_t), entry->name, module_name);
1032
1057
 
1033
1058
  // Set "__spec__" and "__file__", some modules expect it early.
1034
1059
  setModuleFileValue(tstate, module, filename);
1060
+
1061
+ bool is_package = (entry->flags & NUITKA_PACKAGE_FLAG) != 0;
1062
+
1035
1063
  #if PYTHON_VERSION >= 0x350
1036
- PyObject *spec_value =
1037
- createModuleSpec(tstate, module_name, LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__), false);
1064
+ PyObject *spec_value = createModuleSpec(tstate, module_name,
1065
+ LOOKUP_ATTRIBUTE(tstate, module, const_str_plain___file__), is_package);
1038
1066
 
1039
1067
  SET_ATTRIBUTE(tstate, module, const_str_plain___spec__, spec_value);
1040
1068
  #endif
1041
1069
 
1042
- callIntoExtensionModule(tstate, entry->name, filename);
1070
+ callIntoExtensionModule(tstate, entry->name, filename, is_package);
1043
1071
  } else
1044
1072
  #endif
1045
1073
  if ((entry->flags & NUITKA_BYTECODE_FLAG) != 0) {
@@ -1055,7 +1083,8 @@ static PyObject *loadModule(PyThreadState *tstate, PyObject *module, PyObject *m
1055
1083
  abort();
1056
1084
  }
1057
1085
 
1058
- return loadModuleFromCodeObject(module, code_object, entry->name, (entry->flags & NUITKA_PACKAGE_FLAG) != 0);
1086
+ return loadModuleFromCodeObject(tstate, module, code_object, entry->name,
1087
+ (entry->flags & NUITKA_PACKAGE_FLAG) != 0);
1059
1088
  } else {
1060
1089
  assert((entry->flags & NUITKA_EXTENSION_MODULE_FLAG) == 0);
1061
1090
  assert(entry->python_initfunc);
@@ -1640,9 +1669,9 @@ static PyObject *_nuitka_loader_exec_module(PyObject *self, PyObject *args, PyOb
1640
1669
 
1641
1670
  if (extension_module_filename != NULL) {
1642
1671
  // Set filename attribute
1643
- res = SET_ATTRIBUTE(tstate, module, const_str_plain___file__, extension_module_filename);
1672
+ bool b_res = SET_ATTRIBUTE(tstate, module, const_str_plain___file__, extension_module_filename);
1644
1673
 
1645
- if (unlikely(res < 0)) {
1674
+ if (unlikely(b_res == false)) {
1646
1675
  // Might be refuted, which wouldn't be harmful.
1647
1676
  CLEAR_ERROR_OCCURRED(tstate);
1648
1677
  }
@@ -442,6 +442,33 @@ static PyObject *Nuitka_ResourceReaderFiles_absolute(struct Nuitka_ResourceReade
442
442
  return Nuitka_ResourceReaderFiles_New(tstate, files->m_loader_entry, abspath);
443
443
  }
444
444
 
445
+ static PyObject *Nuitka_ResourceReaderFiles_get_parent(struct Nuitka_ResourceReaderFilesObject *files) {
446
+ PyThreadState *tstate = PyThreadState_GET();
447
+
448
+ PyObject *path = _Nuitka_ResourceReaderFiles_GetPath(tstate, files);
449
+
450
+ PyObject *abspath = OS_PATH_ABSPATH(tstate, path);
451
+
452
+ if (unlikely(abspath == NULL)) {
453
+ return NULL;
454
+ }
455
+
456
+ PyObject *dirname = OS_PATH_DIRNAME(tstate, abspath);
457
+
458
+ if (unlikely(dirname == NULL)) {
459
+ return NULL;
460
+ }
461
+
462
+ return Nuitka_ResourceReaderFiles_New(tstate, files->m_loader_entry, dirname);
463
+ }
464
+
465
+ static int Nuitka_ResourceReaderFiles_set_parent(struct Nuitka_ResourceReaderFilesObject *files, PyObject *value) {
466
+ PyThreadState *tstate = PyThreadState_GET();
467
+
468
+ SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_AttributeError, "readonly attribute");
469
+ return -1;
470
+ }
471
+
445
472
  static PyMethodDef Nuitka_ResourceReaderFiles_methods[] = {
446
473
  {"iterdir", (PyCFunction)Nuitka_ResourceReaderFiles_iterdir, METH_NOARGS, NULL},
447
474
  {"read_bytes", (PyCFunction)Nuitka_ResourceReaderFiles_read_bytes, METH_NOARGS, NULL},
@@ -505,6 +532,8 @@ static PyObject *Nuitka_ResourceReaderFiles_tp_richcompare(struct Nuitka_Resourc
505
532
 
506
533
  static PyGetSetDef Nuitka_ResourceReaderFiles_getset[] = {
507
534
  {(char *)"name", (getter)Nuitka_ResourceReaderFiles_get_name, (setter)Nuitka_ResourceReaderFiles_set_name, NULL},
535
+ {(char *)"parent", (getter)Nuitka_ResourceReaderFiles_get_parent, (setter)Nuitka_ResourceReaderFiles_set_parent,
536
+ NULL},
508
537
  {NULL}};
509
538
 
510
539
  // Initialized during readying the type for nb_truediv
@@ -149,16 +149,7 @@ static PyObject *_reduce_compiled_function(PyObject *self, PyObject *args, PyObj
149
149
  return NULL;
150
150
  }
151
151
 
152
- PyObject *code_object_desc = MAKE_TUPLE_EMPTY(tstate, 6);
153
- PyTuple_SET_ITEM0(code_object_desc, 0, function->m_code_object->co_filename);
154
- PyTuple_SET_ITEM0(code_object_desc, 1, function->m_code_object->co_name);
155
- PyTuple_SET_ITEM(code_object_desc, 2, PyLong_FromLong(function->m_code_object->co_firstlineno));
156
- PyTuple_SET_ITEM0(code_object_desc, 3, function->m_code_object->co_varnames);
157
- PyTuple_SET_ITEM(code_object_desc, 4, PyLong_FromLong(function->m_code_object->co_argcount));
158
- PyTuple_SET_ITEM(code_object_desc, 5, PyLong_FromLong(function->m_code_object->co_flags));
159
-
160
- CHECK_OBJECT_DEEP(code_object_desc);
161
-
152
+ PyObject *code_object_desc = Nuitka_Function_ExtractCodeObjectDescription(tstate, function);
162
153
 
163
154
  PyObject *result = MAKE_TUPLE_EMPTY(tstate, 8);
164
155
  PyTuple_SET_ITEM(result, 0, PyLong_FromLong(offset));
@@ -8,6 +8,7 @@ import os
8
8
  from nuitka.containers.OrderedSets import OrderedSet
9
9
  from nuitka.importing.Importing import locateModule
10
10
  from nuitka.plugins.Plugins import Plugins
11
+ from nuitka.Tracing import inclusion_logger
11
12
  from nuitka.utils.FileOperations import getSubDirectoriesWithDlls
12
13
  from nuitka.utils.ModuleNames import ModuleName
13
14
 
@@ -22,7 +23,12 @@ def getLdLibraryPath(package_name, python_rpaths, original_dir):
22
23
  if python_rpaths:
23
24
  ld_library_path.update(python_rpaths)
24
25
 
25
- ld_library_path.update(getPackageSpecificDLLDirectories(package_name))
26
+ ld_library_path.update(
27
+ getPackageSpecificDLLDirectories(
28
+ package_name=package_name,
29
+ consider_plugins=True,
30
+ )
31
+ )
26
32
  if original_dir is not None:
27
33
  ld_library_path.add(original_dir)
28
34
 
@@ -31,7 +37,9 @@ def getLdLibraryPath(package_name, python_rpaths, original_dir):
31
37
  return _ld_library_cache[key]
32
38
 
33
39
 
34
- def getPackageSpecificDLLDirectories(package_name, consider_plugins=True):
40
+ def getPackageSpecificDLLDirectories(
41
+ package_name, consider_plugins, allow_not_found=False
42
+ ):
35
43
  scan_dirs = OrderedSet()
36
44
 
37
45
  if package_name is not None:
@@ -39,6 +47,17 @@ def getPackageSpecificDLLDirectories(package_name, consider_plugins=True):
39
47
  module_name=package_name, parent_package=None, level=0
40
48
  )[1]
41
49
 
50
+ if package_dir is None:
51
+ if allow_not_found:
52
+ return scan_dirs
53
+
54
+ inclusion_logger.sysexit(
55
+ """\
56
+ Error, failed to locate package '%s' while trying to look up DLL dependencies, \
57
+ that should not happen. Please report the issue."""
58
+ % package_name
59
+ )
60
+
42
61
  if os.path.isdir(package_dir):
43
62
  scan_dirs.add(package_dir)
44
63
  scan_dirs.update(getSubDirectoriesWithDlls(package_dir))
@@ -51,7 +70,13 @@ def getPackageSpecificDLLDirectories(package_name, consider_plugins=True):
51
70
 
52
71
  # TODO: Move this to plugins DLLs section.
53
72
  if package_name == "torchvision" and consider_plugins:
54
- scan_dirs.update(getPackageSpecificDLLDirectories(ModuleName("torch")))
73
+ scan_dirs.update(
74
+ getPackageSpecificDLLDirectories(
75
+ package_name=ModuleName("torch"),
76
+ consider_plugins=True,
77
+ allow_not_found=True,
78
+ )
79
+ )
55
80
 
56
81
  return scan_dirs
57
82
 
@@ -134,7 +134,7 @@ def _parseOtoolListingOutput(output):
134
134
  return paths
135
135
 
136
136
 
137
- def _getNonVersionedDllFilenames(filename):
137
+ def _getNonVersionedDllFilenames2(filename):
138
138
  yield filename
139
139
 
140
140
  if getArchitecture() == "arm64" and filename.endswith(".dylib"):
@@ -152,6 +152,25 @@ def _getNonVersionedDllFilenames(filename):
152
152
  yield match.group(1) + "_arm64.dylib"
153
153
 
154
154
 
155
+ def _getNonVersionedDllFilenames(dll_filename, package_name):
156
+ for filename in _getNonVersionedDllFilenames2(dll_filename):
157
+ yield filename
158
+
159
+ # Some build systems, internally prefix DLLs with package names, attempt
160
+ # those removed as well.
161
+ if package_name is not None:
162
+ package_prefix = package_name.asString() + "."
163
+
164
+ if os.path.basename(dll_filename).startswith(package_prefix):
165
+ dll_filename = os.path.join(
166
+ os.path.dirname(dll_filename),
167
+ os.path.basename(dll_filename)[len(package_prefix) :],
168
+ )
169
+
170
+ for filename in _getNonVersionedDllFilenames2(dll_filename):
171
+ yield filename
172
+
173
+
155
174
  def _resolveBinaryPathDLLsMacOS(
156
175
  original_dir, binary_filename, paths, package_specific_dirs, package_name
157
176
  ):
@@ -222,7 +241,9 @@ def _resolveBinaryPathDLLsMacOS(
222
241
  specific_suffix = so_suffixes[0]
223
242
  abi_suffix = so_suffixes[1]
224
243
 
225
- for resolved_path_candidate in _getNonVersionedDllFilenames(resolved_path):
244
+ for resolved_path_candidate in _getNonVersionedDllFilenames(
245
+ dll_filename=resolved_path, package_name=package_name
246
+ ):
226
247
  if os.path.exists(resolved_path_candidate):
227
248
  resolved_path = resolved_path_candidate
228
249
  break
@@ -103,7 +103,12 @@ def _getScanDirectories(package_name, original_dir):
103
103
  scan_dirs = [os.path.dirname(sys.executable), getSystemPrefixPath()]
104
104
 
105
105
  if package_name is not None:
106
- scan_dirs.extend(getPackageSpecificDLLDirectories(package_name))
106
+ scan_dirs.extend(
107
+ getPackageSpecificDLLDirectories(
108
+ package_name=package_name,
109
+ consider_plugins=False,
110
+ )
111
+ )
107
112
 
108
113
  if original_dir is not None:
109
114
  scan_dirs.append(original_dir)
@@ -599,7 +599,11 @@ def _findModuleInPath2(package_name, module_name, search_path):
599
599
  if (
600
600
  found_candidate.module_type == "C_EXTENSION"
601
601
  and isMacOS()
602
- and not hasUniversalOrMatchingMacOSArchitecture(found_candidate.full_path)
602
+ and not hasUniversalOrMatchingMacOSArchitecture(
603
+ getPackageDirFilename(found_candidate.full_path)
604
+ if os.path.isdir(found_candidate.full_path)
605
+ else found_candidate.full_path
606
+ )
603
607
  ):
604
608
  # Not usable for target architecture.
605
609
  raise ImportError
@@ -583,6 +583,7 @@ class ExpressionFunctionBody(
583
583
  parameters,
584
584
  flags,
585
585
  auto_release,
586
+ code_prefix,
586
587
  source_ref,
587
588
  ):
588
589
  ExpressionFunctionEntryPointBase.__init__(
@@ -590,7 +591,7 @@ class ExpressionFunctionBody(
590
591
  provider=provider,
591
592
  name=name,
592
593
  code_object=code_object,
593
- code_prefix="function",
594
+ code_prefix=code_prefix,
594
595
  flags=flags,
595
596
  auto_release=auto_release,
596
597
  source_ref=source_ref,
@@ -779,6 +780,7 @@ class ExpressionFunctionPureBody(ExpressionFunctionBody):
779
780
  parameters,
780
781
  flags,
781
782
  auto_release,
783
+ code_prefix,
782
784
  source_ref,
783
785
  ):
784
786
  ExpressionFunctionBody.__init__(
@@ -790,6 +792,7 @@ class ExpressionFunctionPureBody(ExpressionFunctionBody):
790
792
  parameters=parameters,
791
793
  flags=flags,
792
794
  auto_release=auto_release,
795
+ code_prefix=code_prefix,
793
796
  source_ref=source_ref,
794
797
  )
795
798
 
@@ -20,7 +20,7 @@ from nuitka.PythonVersions import python_version
20
20
  from nuitka.SourceCodeReferences import fromFilename
21
21
  from nuitka.tree.SourceHandling import parsePyIFile, readSourceCodeFromFilename
22
22
  from nuitka.utils.CStrings import encodePythonIdentifierToC
23
- from nuitka.utils.Importing import getSharedLibrarySuffix
23
+ from nuitka.utils.Importing import getPackageDirFilename
24
24
  from nuitka.utils.ModuleNames import ModuleName
25
25
 
26
26
  from .ChildrenHavingMixins import (
@@ -1008,9 +1008,8 @@ class PythonExtensionModule(PythonModuleBase):
1008
1008
  self.used_modules = None
1009
1009
 
1010
1010
  if os.path.isdir(module_filename):
1011
- module_filename = os.path.join(
1012
- module_filename, "__init__" + getSharedLibrarySuffix(preferred=False)
1013
- )
1011
+ module_filename = getPackageDirFilename(module_filename)
1012
+
1014
1013
  self.module_filename = module_filename
1015
1014
 
1016
1015
  def finalize(self):
nuitka/nodes/NodeBases.py CHANGED
@@ -495,17 +495,18 @@ class CodeNodeMixin(object):
495
495
  provider = self.getParentVariableProvider().getEntryPoint()
496
496
  parent_name = provider.getCodeName()
497
497
 
498
- uid = "_%d" % provider.getChildUID(self)
499
-
500
- assert isinstance(self, CodeNodeMixin)
501
-
502
- if self.name:
503
- name = uid + "_" + self.name.strip("<>")
498
+ if self.code_prefix == "helper_function":
499
+ name = self.name
504
500
  else:
505
- name = uid
501
+ uid = "_%d" % provider.getChildUID(self)
502
+
503
+ if self.name:
504
+ name = uid + "_" + self.name.strip("<>")
505
+ else:
506
+ name = uid
506
507
 
507
- if str is not bytes:
508
- name = name.encode("ascii", "c_identifier").decode()
508
+ if str is not bytes:
509
+ name = name.encode("ascii", "c_identifier").decode()
509
510
 
510
511
  self.code_name = "%s$$$%s_%s" % (parent_name, self.code_prefix, name)
511
512
 
@@ -26,6 +26,7 @@ from .ControlFlowDescriptions import (
26
26
  ControlFlowDescriptionElementBasedEscape,
27
27
  ControlFlowDescriptionFloorDivUnsupported,
28
28
  ControlFlowDescriptionFormatError,
29
+ ControlFlowDescriptionFullEscape,
29
30
  ControlFlowDescriptionLshiftUnsupported,
30
31
  ControlFlowDescriptionMatmultUnsupported,
31
32
  ControlFlowDescriptionModUnsupported,
@@ -1729,7 +1730,9 @@ class ShapeTypeXrangeIterator(ShapeIteratorMixin, ShapeNotNumberMixin, ShapeBase
1729
1730
  tshape_xrange_iterator = ShapeTypeXrangeIterator()
1730
1731
 
1731
1732
 
1732
- class ShapeTypeType(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
1733
+ class ShapeTypeTypeBase(ShapeNotNumberMixin, ShapeBase):
1734
+ # Base classes can be abstract, pylint: disable=abstract-method
1735
+
1733
1736
  __slots__ = ()
1734
1737
 
1735
1738
  typical_value = int
@@ -1756,6 +1759,23 @@ class ShapeTypeType(ShapeNotContainerMixin, ShapeNotNumberMixin, ShapeBase):
1756
1759
  return hasattr(int, attribute_name)
1757
1760
 
1758
1761
 
1762
+ if python_version < 0x390:
1763
+
1764
+ class ShapeTypeType(ShapeNotContainerMixin, ShapeTypeTypeBase):
1765
+ __slots__ = ()
1766
+
1767
+ else:
1768
+
1769
+ class ShapeTypeType(ShapeTypeTypeBase):
1770
+ __slots__ = ()
1771
+
1772
+ @staticmethod
1773
+ def getOperationUnaryReprEscape():
1774
+ # We can't really say it's element based, since it may not be iterable
1775
+ # still.
1776
+ return ControlFlowDescriptionFullEscape
1777
+
1778
+
1759
1779
  tshape_type = ShapeTypeType()
1760
1780
 
1761
1781
 
@@ -52,7 +52,11 @@ from nuitka.Options import (
52
52
  shallMakeModule,
53
53
  shallShowExecutedCommands,
54
54
  )
55
- from nuitka.PythonFlavors import isAnacondaPython, isDebianPackagePython
55
+ from nuitka.PythonFlavors import (
56
+ isAnacondaPython,
57
+ isDebianPackagePython,
58
+ isNuitkaPython,
59
+ )
56
60
  from nuitka.PythonVersions import (
57
61
  getTestExecutionPythonVersions,
58
62
  python_version,
@@ -131,6 +135,7 @@ def _getEvaluationContext():
131
135
  "anaconda": isAnacondaPython(),
132
136
  "is_conda_package": isDistributionCondaPackage,
133
137
  "debian_python": isDebianPackagePython(),
138
+ "nuitka_python": isNuitkaPython(),
134
139
  "standalone": isStandaloneMode(),
135
140
  "module_mode": shallMakeModule(),
136
141
  "deployment": isDeploymentMode(),
@@ -195,8 +200,11 @@ def _getEvaluationContext():
195
200
  _context_dict["before_python3"] = python_version < 0x300
196
201
  _context_dict["python3_or_higher"] = python_version >= 0x300
197
202
 
198
- _context_dict["extension_std_suffix"] = getSharedLibrarySuffix(preferred=True)
199
- _context_dict["extension_suffix"] = getSharedLibrarySuffix(preferred=False)
203
+ if not isNuitkaPython():
204
+ _context_dict["extension_std_suffix"] = getSharedLibrarySuffix(
205
+ preferred=True
206
+ )
207
+ _context_dict["extension_suffix"] = getSharedLibrarySuffix(preferred=False)
200
208
 
201
209
  return _context_dict
202
210
 
@@ -6,6 +6,7 @@
6
6
 
7
7
  from nuitka.Options import isStandaloneMode
8
8
  from nuitka.plugins.PluginBase import NuitkaPluginBase
9
+ from nuitka.utils.Utils import isMacOS, isWin32Windows
9
10
 
10
11
 
11
12
  class NuitkaPluginKivy(NuitkaPluginBase):
@@ -88,10 +89,19 @@ except ImportError:
88
89
  yield "kivy.graphics.cgl_backend"
89
90
  elif full_name == "kivy.graphics.cgl_backend":
90
91
  yield "kivy.graphics.cgl_backend.cgl_glew"
92
+ yield "kivy.graphics.cgl_backend.cgl_sdl2"
91
93
  elif full_name == "kivy.graphics.cgl_backend.cgl_glew":
92
94
  yield "kivy.graphics.cgl_backend.cgl_gl"
93
95
  elif full_name == "kivymd.app":
94
96
  yield self.locateModules("kivymd.uix")
97
+ elif full_name == "kivy.core.clipboard":
98
+ if isWin32Windows():
99
+ yield "kivy.core.clipboard.clipboard_winctypes"
100
+ if isMacOS():
101
+ if self.locateModule("pyobjus"):
102
+ yield "kivy.core.clipboard.clipboard_nspaste"
103
+ else:
104
+ yield "kivy.core.clipboard.clipboard_sdl2"
95
105
 
96
106
  def getExtraDlls(self, module):
97
107
  """Copy extra shared libraries or data for this installation.