pytron-kit 0.3.12__py3-none-macosx_11_0_universal2.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 (419) hide show
  1. pytron/__init__.py +112 -0
  2. pytron/application.py +562 -0
  3. pytron/apputils/__init__.py +0 -0
  4. pytron/apputils/chrome_ipc.py +203 -0
  5. pytron/apputils/codegen.py +261 -0
  6. pytron/apputils/config.py +303 -0
  7. pytron/apputils/deadmansswitch.py +47 -0
  8. pytron/apputils/extras.py +76 -0
  9. pytron/apputils/native.py +148 -0
  10. pytron/apputils/shell.py +73 -0
  11. pytron/apputils/windows.py +286 -0
  12. pytron/cli.py +384 -0
  13. pytron/commands/__init__.py +0 -0
  14. pytron/commands/android.py +28 -0
  15. pytron/commands/build.py +26 -0
  16. pytron/commands/doctor.py +221 -0
  17. pytron/commands/engine.py +23 -0
  18. pytron/commands/frontend.py +60 -0
  19. pytron/commands/harvest.py +112 -0
  20. pytron/commands/helpers.py +239 -0
  21. pytron/commands/info.py +50 -0
  22. pytron/commands/init.py +521 -0
  23. pytron/commands/install.py +294 -0
  24. pytron/commands/login.py +130 -0
  25. pytron/commands/package.py +228 -0
  26. pytron/commands/plugin.py +442 -0
  27. pytron/commands/run.py +312 -0
  28. pytron/commands/scan.py +210 -0
  29. pytron/commands/show.py +23 -0
  30. pytron/commands/uninstall.py +150 -0
  31. pytron/commands/utils.py +42 -0
  32. pytron/commands/workflow.py +95 -0
  33. pytron/console.py +133 -0
  34. pytron/core.py +18 -0
  35. pytron/dependencies/WebView2Loader.dll +0 -0
  36. pytron/dependencies/__init__.py +1 -0
  37. pytron/dependencies/pytron_native.so +0 -0
  38. pytron/engines/chrome/adapter.py +445 -0
  39. pytron/engines/chrome/engine.py +576 -0
  40. pytron/engines/chrome/forge.py +147 -0
  41. pytron/engines/chrome/shell/package.json +8 -0
  42. pytron/engines/chrome/shell/preload.js +12 -0
  43. pytron/engines/chrome/shell/shell.js +534 -0
  44. pytron/exceptions.py +36 -0
  45. pytron/inspector.py +201 -0
  46. pytron/inspector_ui.py +512 -0
  47. pytron/installer/Installation.nsi +236 -0
  48. pytron/installer/header.bmp +0 -0
  49. pytron/installer/pytron.ico +0 -0
  50. pytron/installer/sidebar.bmp +0 -0
  51. pytron/llms.md +98 -0
  52. pytron/manifests/README.md +29 -0
  53. pytron/manifests/windows-utf8.manifest +44 -0
  54. pytron/menu.py +128 -0
  55. pytron/nsis-setup.exe +0 -0
  56. pytron/pack/__init__.py +0 -0
  57. pytron/pack/assets.py +131 -0
  58. pytron/pack/compilers.py +289 -0
  59. pytron/pack/crystal.py +297 -0
  60. pytron/pack/graph.py +377 -0
  61. pytron/pack/inference.py +157 -0
  62. pytron/pack/installers.py +402 -0
  63. pytron/pack/introspect.py +357 -0
  64. pytron/pack/metadata.py +213 -0
  65. pytron/pack/modules.py +618 -0
  66. pytron/pack/nuitka.py +108 -0
  67. pytron/pack/pipeline.py +107 -0
  68. pytron/pack/pyinstaller.py +176 -0
  69. pytron/pack/rust_engine.py +273 -0
  70. pytron/pack/secure.py +309 -0
  71. pytron/pack/secure_loader/bin/pytron_rust_bootloader +0 -0
  72. pytron/pack/secure_loader/icon.ico +0 -0
  73. pytron/pack/utils.py +110 -0
  74. pytron/pack/virtual_root.py +124 -0
  75. pytron/platforms/__init__.py +0 -0
  76. pytron/platforms/android/__init__.py +3 -0
  77. pytron/platforms/android/android.py +103 -0
  78. pytron/platforms/android/builder.py +736 -0
  79. pytron/platforms/android/ops/build.py +79 -0
  80. pytron/platforms/android/ops/init.py +63 -0
  81. pytron/platforms/android/ops/run.py +79 -0
  82. pytron/platforms/android/ops/sync.py +770 -0
  83. pytron/platforms/android/ops/utils.py +8 -0
  84. pytron/platforms/android/shell/README.md +30 -0
  85. pytron/platforms/android/shell/app/build.gradle +64 -0
  86. pytron/platforms/android/shell/app/src/main/AndroidManifest.xml +29 -0
  87. pytron/platforms/android/shell/app/src/main/assets/python/main.py +86 -0
  88. pytron/platforms/android/shell/app/src/main/assets/python/python314.zip +0 -0
  89. pytron/platforms/android/shell/app/src/main/cpp/CMakeLists.txt +25 -0
  90. pytron/platforms/android/shell/app/src/main/cpp/include/Python.h +155 -0
  91. pytron/platforms/android/shell/app/src/main/cpp/include/abstract.h +915 -0
  92. pytron/platforms/android/shell/app/src/main/cpp/include/audit.h +30 -0
  93. pytron/platforms/android/shell/app/src/main/cpp/include/bltinmodule.h +14 -0
  94. pytron/platforms/android/shell/app/src/main/cpp/include/boolobject.h +54 -0
  95. pytron/platforms/android/shell/app/src/main/cpp/include/bytearrayobject.h +44 -0
  96. pytron/platforms/android/shell/app/src/main/cpp/include/bytesobject.h +66 -0
  97. pytron/platforms/android/shell/app/src/main/cpp/include/ceval.h +145 -0
  98. pytron/platforms/android/shell/app/src/main/cpp/include/codecs.h +176 -0
  99. pytron/platforms/android/shell/app/src/main/cpp/include/compile.h +22 -0
  100. pytron/platforms/android/shell/app/src/main/cpp/include/complexobject.h +30 -0
  101. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/abstract.h +104 -0
  102. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/audit.h +8 -0
  103. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytearrayobject.h +38 -0
  104. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytesobject.h +42 -0
  105. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/cellobject.h +50 -0
  106. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/ceval.h +43 -0
  107. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/classobject.h +71 -0
  108. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/code.h +340 -0
  109. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/compile.h +50 -0
  110. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/complexobject.h +33 -0
  111. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/context.h +107 -0
  112. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/critical_section.h +154 -0
  113. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/descrobject.h +62 -0
  114. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/dictobject.h +105 -0
  115. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileobject.h +16 -0
  116. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileutils.h +16 -0
  117. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/floatobject.h +27 -0
  118. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/frameobject.h +35 -0
  119. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/funcobject.h +185 -0
  120. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/genobject.h +56 -0
  121. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/import.h +30 -0
  122. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/initconfig.h +334 -0
  123. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/listobject.h +53 -0
  124. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/lock.h +74 -0
  125. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longintrepr.h +184 -0
  126. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longobject.h +89 -0
  127. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/memoryobject.h +50 -0
  128. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/methodobject.h +66 -0
  129. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/modsupport.h +26 -0
  130. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/monitoring.h +269 -0
  131. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/object.h +493 -0
  132. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/objimpl.h +104 -0
  133. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/odictobject.h +43 -0
  134. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/picklebufobject.h +31 -0
  135. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pthread_stubs.h +105 -0
  136. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic.h +614 -0
  137. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_gcc.h +615 -0
  138. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_msc.h +1197 -0
  139. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_std.h +1112 -0
  140. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyctype.h +39 -0
  141. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pydebug.h +38 -0
  142. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyerrors.h +132 -0
  143. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyfpe.h +15 -0
  144. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyframe.h +45 -0
  145. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyhash.h +54 -0
  146. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pylifecycle.h +89 -0
  147. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pymem.h +84 -0
  148. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystate.h +275 -0
  149. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystats.h +194 -0
  150. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythonrun.h +96 -0
  151. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythread.h +43 -0
  152. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pytime.h +27 -0
  153. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/setobject.h +71 -0
  154. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/traceback.h +13 -0
  155. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tracemalloc.h +32 -0
  156. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tupleobject.h +40 -0
  157. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/unicodeobject.h +773 -0
  158. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/warnings.h +20 -0
  159. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/weakrefobject.h +66 -0
  160. pytron/platforms/android/shell/app/src/main/cpp/include/critical_section.h +16 -0
  161. pytron/platforms/android/shell/app/src/main/cpp/include/datetime.h +267 -0
  162. pytron/platforms/android/shell/app/src/main/cpp/include/descrobject.h +100 -0
  163. pytron/platforms/android/shell/app/src/main/cpp/include/dictobject.h +108 -0
  164. pytron/platforms/android/shell/app/src/main/cpp/include/dynamic_annotations.h +499 -0
  165. pytron/platforms/android/shell/app/src/main/cpp/include/enumobject.h +17 -0
  166. pytron/platforms/android/shell/app/src/main/cpp/include/errcode.h +45 -0
  167. pytron/platforms/android/shell/app/src/main/cpp/include/exports.h +105 -0
  168. pytron/platforms/android/shell/app/src/main/cpp/include/fileobject.h +41 -0
  169. pytron/platforms/android/shell/app/src/main/cpp/include/fileutils.h +62 -0
  170. pytron/platforms/android/shell/app/src/main/cpp/include/floatobject.h +54 -0
  171. pytron/platforms/android/shell/app/src/main/cpp/include/frameobject.h +20 -0
  172. pytron/platforms/android/shell/app/src/main/cpp/include/genericaliasobject.h +14 -0
  173. pytron/platforms/android/shell/app/src/main/cpp/include/import.h +103 -0
  174. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/atomic.h +392 -0
  175. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/internal.h +969 -0
  176. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/prim.h +329 -0
  177. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/track.h +147 -0
  178. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/types.h +721 -0
  179. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc.h +565 -0
  180. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_abstract.h +61 -0
  181. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_asdl.h +112 -0
  182. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast.h +945 -0
  183. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast_state.h +271 -0
  184. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_atexit.h +31 -0
  185. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_audit.h +35 -0
  186. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_backoff.h +133 -0
  187. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bitutils.h +186 -0
  188. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_blocks_output_buffer.h +321 -0
  189. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_brc.h +73 -0
  190. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytes_methods.h +82 -0
  191. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytesobject.h +149 -0
  192. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_c_array.h +39 -0
  193. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_call.h +206 -0
  194. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_capsule.h +17 -0
  195. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_cell.h +75 -0
  196. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval.h +390 -0
  197. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval_state.h +48 -0
  198. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_code.h +671 -0
  199. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_codecs.h +76 -0
  200. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_compile.h +230 -0
  201. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_complexobject.h +34 -0
  202. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_condvar.h +93 -0
  203. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_context.h +59 -0
  204. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_critical_section.h +237 -0
  205. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp.h +406 -0
  206. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp_data_registry.h +41 -0
  207. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_debug_offsets.h +379 -0
  208. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_descrobject.h +28 -0
  209. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict.h +410 -0
  210. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict_state.h +28 -0
  211. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dtoa.h +40 -0
  212. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_signal.h +30 -0
  213. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_trampoline.h +70 -0
  214. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_exceptions.h +40 -0
  215. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_faulthandler.h +100 -0
  216. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils.h +320 -0
  217. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils_windows.h +98 -0
  218. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_floatobject.h +49 -0
  219. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_flowgraph.h +47 -0
  220. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_format.h +27 -0
  221. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_frame.h +61 -0
  222. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist.h +111 -0
  223. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist_state.h +70 -0
  224. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_function.h +53 -0
  225. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gc.h +378 -0
  226. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_genobject.h +43 -0
  227. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_getopt.h +22 -0
  228. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gil.h +66 -0
  229. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects.h +34 -0
  230. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects_fini_generated.h +1592 -0
  231. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_strings.h +854 -0
  232. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hamt.h +113 -0
  233. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hashtable.h +150 -0
  234. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_import.h +141 -0
  235. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_importdl.h +139 -0
  236. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_index_pool.h +36 -0
  237. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_initconfig.h +197 -0
  238. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruction_sequence.h +83 -0
  239. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruments.h +127 -0
  240. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp.h +109 -0
  241. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp_structs.h +977 -0
  242. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe.h +401 -0
  243. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe_structs.h +95 -0
  244. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpolation.h +26 -0
  245. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_intrinsics.h +51 -0
  246. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_jit.h +29 -0
  247. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_list.h +81 -0
  248. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_llist.h +106 -0
  249. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_lock.h +236 -0
  250. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_long.h +319 -0
  251. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_magic_number.h +305 -0
  252. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_memoryobject.h +20 -0
  253. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_mimalloc.h +69 -0
  254. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_modsupport.h +99 -0
  255. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_moduleobject.h +62 -0
  256. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_namespace.h +21 -0
  257. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object.h +1029 -0
  258. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_alloc.h +71 -0
  259. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_deferred.h +32 -0
  260. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_stack.h +95 -0
  261. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_state.h +49 -0
  262. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc.h +702 -0
  263. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc_init.h +66 -0
  264. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_metadata.h +2117 -0
  265. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_utils.h +90 -0
  266. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_optimizer.h +318 -0
  267. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parking_lot.h +97 -0
  268. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parser.h +78 -0
  269. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pathconfig.h +26 -0
  270. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyarena.h +68 -0
  271. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyatomic_ft_wrappers.h +174 -0
  272. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pybuffer.h +21 -0
  273. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyerrors.h +213 -0
  274. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyhash.h +91 -0
  275. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pylifecycle.h +136 -0
  276. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymath.h +205 -0
  277. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem.h +145 -0
  278. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem_init.h +103 -0
  279. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystate.h +339 -0
  280. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystats.h +21 -0
  281. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythonrun.h +68 -0
  282. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythread.h +172 -0
  283. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_qsbr.h +172 -0
  284. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_range.h +21 -0
  285. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime.h +63 -0
  286. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init.h +239 -0
  287. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init_generated.h +1589 -0
  288. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_structs.h +310 -0
  289. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_semaphore.h +67 -0
  290. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_setobject.h +41 -0
  291. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_signal.h +108 -0
  292. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sliceobject.h +20 -0
  293. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stackref.h +791 -0
  294. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stats.h +97 -0
  295. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_strhex.h +39 -0
  296. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structs.h +88 -0
  297. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structseq.h +40 -0
  298. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_symtable.h +201 -0
  299. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sysmodule.h +32 -0
  300. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_template.h +26 -0
  301. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_time.h +334 -0
  302. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_token.h +110 -0
  303. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_traceback.h +111 -0
  304. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tracemalloc.h +164 -0
  305. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tstate.h +88 -0
  306. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tuple.h +75 -0
  307. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typedefs.h +18 -0
  308. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typeobject.h +155 -0
  309. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typevarobject.h +28 -0
  310. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ucnhash.h +36 -0
  311. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject.h +308 -0
  312. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject_generated.h +3132 -0
  313. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unionobject.h +26 -0
  314. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uniqueid.h +57 -0
  315. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_ids.h +335 -0
  316. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_metadata.h +1204 -0
  317. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_warnings.h +21 -0
  318. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_weakref.h +133 -0
  319. pytron/platforms/android/shell/app/src/main/cpp/include/intrcheck.h +23 -0
  320. pytron/platforms/android/shell/app/src/main/cpp/include/iterobject.h +24 -0
  321. pytron/platforms/android/shell/app/src/main/cpp/include/listobject.h +55 -0
  322. pytron/platforms/android/shell/app/src/main/cpp/include/lock.h +16 -0
  323. pytron/platforms/android/shell/app/src/main/cpp/include/longobject.h +178 -0
  324. pytron/platforms/android/shell/app/src/main/cpp/include/marshal.h +31 -0
  325. pytron/platforms/android/shell/app/src/main/cpp/include/memoryobject.h +34 -0
  326. pytron/platforms/android/shell/app/src/main/cpp/include/methodobject.h +146 -0
  327. pytron/platforms/android/shell/app/src/main/cpp/include/modsupport.h +146 -0
  328. pytron/platforms/android/shell/app/src/main/cpp/include/moduleobject.h +122 -0
  329. pytron/platforms/android/shell/app/src/main/cpp/include/monitoring.h +18 -0
  330. pytron/platforms/android/shell/app/src/main/cpp/include/object.h +828 -0
  331. pytron/platforms/android/shell/app/src/main/cpp/include/objimpl.h +211 -0
  332. pytron/platforms/android/shell/app/src/main/cpp/include/opcode.h +43 -0
  333. pytron/platforms/android/shell/app/src/main/cpp/include/opcode_ids.h +259 -0
  334. pytron/platforms/android/shell/app/src/main/cpp/include/osdefs.h +57 -0
  335. pytron/platforms/android/shell/app/src/main/cpp/include/osmodule.h +17 -0
  336. pytron/platforms/android/shell/app/src/main/cpp/include/patchlevel.h +49 -0
  337. pytron/platforms/android/shell/app/src/main/cpp/include/py_curses.h +117 -0
  338. pytron/platforms/android/shell/app/src/main/cpp/include/pyatomic.h +16 -0
  339. pytron/platforms/android/shell/app/src/main/cpp/include/pybuffer.h +145 -0
  340. pytron/platforms/android/shell/app/src/main/cpp/include/pycapsule.h +58 -0
  341. pytron/platforms/android/shell/app/src/main/cpp/include/pyconfig.h +2088 -0
  342. pytron/platforms/android/shell/app/src/main/cpp/include/pydtrace.h +59 -0
  343. pytron/platforms/android/shell/app/src/main/cpp/include/pyerrors.h +335 -0
  344. pytron/platforms/android/shell/app/src/main/cpp/include/pyexpat.h +62 -0
  345. pytron/platforms/android/shell/app/src/main/cpp/include/pyframe.h +26 -0
  346. pytron/platforms/android/shell/app/src/main/cpp/include/pyhash.h +59 -0
  347. pytron/platforms/android/shell/app/src/main/cpp/include/pylifecycle.h +80 -0
  348. pytron/platforms/android/shell/app/src/main/cpp/include/pymacconfig.h +91 -0
  349. pytron/platforms/android/shell/app/src/main/cpp/include/pymacro.h +243 -0
  350. pytron/platforms/android/shell/app/src/main/cpp/include/pymath.h +65 -0
  351. pytron/platforms/android/shell/app/src/main/cpp/include/pymem.h +110 -0
  352. pytron/platforms/android/shell/app/src/main/cpp/include/pyport.h +710 -0
  353. pytron/platforms/android/shell/app/src/main/cpp/include/pystate.h +132 -0
  354. pytron/platforms/android/shell/app/src/main/cpp/include/pystats.h +28 -0
  355. pytron/platforms/android/shell/app/src/main/cpp/include/pystrcmp.h +23 -0
  356. pytron/platforms/android/shell/app/src/main/cpp/include/pystrtod.h +37 -0
  357. pytron/platforms/android/shell/app/src/main/cpp/include/pythonrun.h +42 -0
  358. pytron/platforms/android/shell/app/src/main/cpp/include/pythread.h +131 -0
  359. pytron/platforms/android/shell/app/src/main/cpp/include/pytypedefs.h +30 -0
  360. pytron/platforms/android/shell/app/src/main/cpp/include/rangeobject.h +27 -0
  361. pytron/platforms/android/shell/app/src/main/cpp/include/refcount.h +555 -0
  362. pytron/platforms/android/shell/app/src/main/cpp/include/setobject.h +49 -0
  363. pytron/platforms/android/shell/app/src/main/cpp/include/sliceobject.h +69 -0
  364. pytron/platforms/android/shell/app/src/main/cpp/include/structmember.h +56 -0
  365. pytron/platforms/android/shell/app/src/main/cpp/include/structseq.h +46 -0
  366. pytron/platforms/android/shell/app/src/main/cpp/include/sysmodule.h +27 -0
  367. pytron/platforms/android/shell/app/src/main/cpp/include/traceback.h +26 -0
  368. pytron/platforms/android/shell/app/src/main/cpp/include/tupleobject.h +46 -0
  369. pytron/platforms/android/shell/app/src/main/cpp/include/typeslots.h +96 -0
  370. pytron/platforms/android/shell/app/src/main/cpp/include/unicodeobject.h +1029 -0
  371. pytron/platforms/android/shell/app/src/main/cpp/include/warnings.h +45 -0
  372. pytron/platforms/android/shell/app/src/main/cpp/include/weakrefobject.h +46 -0
  373. pytron/platforms/android/shell/app/src/main/cpp/pytron_bridge.cpp +224 -0
  374. pytron/platforms/android/shell/app/src/main/java/com/pytron/shell/MainActivity.kt +208 -0
  375. pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  376. pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  377. pytron/platforms/android/shell/build.gradle +11 -0
  378. pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.jar +0 -0
  379. pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.properties +5 -0
  380. pytron/platforms/android/shell/gradle.properties +2 -0
  381. pytron/platforms/android/shell/gradlew.bat +85 -0
  382. pytron/platforms/android/shell/settings.gradle +16 -0
  383. pytron/platforms/darwin.py +82 -0
  384. pytron/platforms/darwin_ops/libs.py +31 -0
  385. pytron/platforms/darwin_ops/system.py +182 -0
  386. pytron/platforms/darwin_ops/utils.py +85 -0
  387. pytron/platforms/darwin_ops/webview.py +5 -0
  388. pytron/platforms/darwin_ops/window.py +102 -0
  389. pytron/platforms/interface.py +152 -0
  390. pytron/platforms/linux.py +82 -0
  391. pytron/platforms/linux_ops/libs.py +49 -0
  392. pytron/platforms/linux_ops/system.py +316 -0
  393. pytron/platforms/linux_ops/utils.py +19 -0
  394. pytron/platforms/linux_ops/webview.py +5 -0
  395. pytron/platforms/linux_ops/window.py +115 -0
  396. pytron/platforms/windows.py +136 -0
  397. pytron/platforms/windows_ops/__init__.py +0 -0
  398. pytron/platforms/windows_ops/constants.py +126 -0
  399. pytron/platforms/windows_ops/system.py +518 -0
  400. pytron/platforms/windows_ops/utils.py +3 -0
  401. pytron/platforms/windows_ops/webview.py +5 -0
  402. pytron/platforms/windows_ops/window.py +361 -0
  403. pytron/plugin.py +467 -0
  404. pytron/rcedit-x64.exe +0 -0
  405. pytron/router.py +146 -0
  406. pytron/serializer.py +240 -0
  407. pytron/shortcuts.py +279 -0
  408. pytron/state.py +76 -0
  409. pytron/tray.py +399 -0
  410. pytron/updater.py +181 -0
  411. pytron/utf8_hook.py +112 -0
  412. pytron/utils.py +44 -0
  413. pytron/webview.py +722 -0
  414. pytron_kit-0.3.12.dist-info/METADATA +131 -0
  415. pytron_kit-0.3.12.dist-info/RECORD +419 -0
  416. pytron_kit-0.3.12.dist-info/WHEEL +5 -0
  417. pytron_kit-0.3.12.dist-info/entry_points.txt +2 -0
  418. pytron_kit-0.3.12.dist-info/licenses/LICENSE +201 -0
  419. pytron_kit-0.3.12.dist-info/top_level.txt +1 -0
@@ -0,0 +1,275 @@
1
+ #ifndef Py_CPYTHON_PYSTATE_H
2
+ # error "this header file must not be included directly"
3
+ #endif
4
+
5
+
6
+ /* private interpreter helpers */
7
+
8
+ PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *);
9
+ PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int);
10
+
11
+ /* State unique per thread */
12
+
13
+ /* Py_tracefunc return -1 when raising an exception, or 0 for success. */
14
+ typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *);
15
+
16
+ /* The following values are used for 'what' for tracefunc functions
17
+ *
18
+ * To add a new kind of trace event, also update "trace_init" in
19
+ * Python/sysmodule.c to define the Python level event name
20
+ */
21
+ #define PyTrace_CALL 0
22
+ #define PyTrace_EXCEPTION 1
23
+ #define PyTrace_LINE 2
24
+ #define PyTrace_RETURN 3
25
+ #define PyTrace_C_CALL 4
26
+ #define PyTrace_C_EXCEPTION 5
27
+ #define PyTrace_C_RETURN 6
28
+ #define PyTrace_OPCODE 7
29
+
30
+ /* Remote debugger support */
31
+ #define _Py_MAX_SCRIPT_PATH_SIZE 512
32
+ typedef struct {
33
+ int32_t debugger_pending_call;
34
+ char debugger_script_path[_Py_MAX_SCRIPT_PATH_SIZE];
35
+ } _PyRemoteDebuggerSupport;
36
+
37
+ typedef struct _err_stackitem {
38
+ /* This struct represents a single execution context where we might
39
+ * be currently handling an exception. It is a per-coroutine state
40
+ * (coroutine in the computer science sense, including the thread
41
+ * and generators).
42
+ *
43
+ * This is used as an entry on the exception stack, where each
44
+ * entry indicates if it is currently handling an exception.
45
+ * This ensures that the exception state is not impacted
46
+ * by "yields" from an except handler. The thread
47
+ * always has an entry (the bottom-most one).
48
+ */
49
+
50
+ /* The exception currently being handled in this context, if any. */
51
+ PyObject *exc_value;
52
+
53
+ struct _err_stackitem *previous_item;
54
+
55
+ } _PyErr_StackItem;
56
+
57
+ typedef struct _stack_chunk {
58
+ struct _stack_chunk *previous;
59
+ size_t size;
60
+ size_t top;
61
+ PyObject * data[1]; /* Variable sized */
62
+ } _PyStackChunk;
63
+
64
+ /* Minimum size of data stack chunk */
65
+ #define _PY_DATA_STACK_CHUNK_SIZE (16*1024)
66
+ struct _ts {
67
+ /* See Python/ceval.c for comments explaining most fields */
68
+
69
+ PyThreadState *prev;
70
+ PyThreadState *next;
71
+ PyInterpreterState *interp;
72
+
73
+ /* The global instrumentation version in high bits, plus flags indicating
74
+ when to break out of the interpreter loop in lower bits. See details in
75
+ pycore_ceval.h. */
76
+ uintptr_t eval_breaker;
77
+
78
+ struct {
79
+ /* Has been initialized to a safe state.
80
+
81
+ In order to be effective, this must be set to 0 during or right
82
+ after allocation. */
83
+ unsigned int initialized:1;
84
+
85
+ /* Has been bound to an OS thread. */
86
+ unsigned int bound:1;
87
+ /* Has been unbound from its OS thread. */
88
+ unsigned int unbound:1;
89
+ /* Has been bound aa current for the GILState API. */
90
+ unsigned int bound_gilstate:1;
91
+ /* Currently in use (maybe holds the GIL). */
92
+ unsigned int active:1;
93
+
94
+ /* various stages of finalization */
95
+ unsigned int finalizing:1;
96
+ unsigned int cleared:1;
97
+ unsigned int finalized:1;
98
+
99
+ /* padding to align to 4 bytes */
100
+ unsigned int :24;
101
+ } _status;
102
+ #ifdef Py_BUILD_CORE
103
+ # define _PyThreadState_WHENCE_NOTSET -1
104
+ # define _PyThreadState_WHENCE_UNKNOWN 0
105
+ # define _PyThreadState_WHENCE_INIT 1
106
+ # define _PyThreadState_WHENCE_FINI 2
107
+ # define _PyThreadState_WHENCE_THREADING 3
108
+ # define _PyThreadState_WHENCE_GILSTATE 4
109
+ # define _PyThreadState_WHENCE_EXEC 5
110
+ #endif
111
+
112
+ /* Currently holds the GIL. Must be its own field to avoid data races */
113
+ int holds_gil;
114
+
115
+ int _whence;
116
+
117
+ /* Thread state (_Py_THREAD_ATTACHED, _Py_THREAD_DETACHED, _Py_THREAD_SUSPENDED).
118
+ See Include/internal/pycore_pystate.h for more details. */
119
+ int state;
120
+
121
+ int py_recursion_remaining;
122
+ int py_recursion_limit;
123
+ int recursion_headroom; /* Allow 50 more calls to handle any errors. */
124
+
125
+ /* 'tracing' keeps track of the execution depth when tracing/profiling.
126
+ This is to prevent the actual trace/profile code from being recorded in
127
+ the trace/profile. */
128
+ int tracing;
129
+ int what_event; /* The event currently being monitored, if any. */
130
+
131
+ /* Pointer to currently executing frame. */
132
+ struct _PyInterpreterFrame *current_frame;
133
+
134
+ Py_tracefunc c_profilefunc;
135
+ Py_tracefunc c_tracefunc;
136
+ PyObject *c_profileobj;
137
+ PyObject *c_traceobj;
138
+
139
+ /* The exception currently being raised */
140
+ PyObject *current_exception;
141
+
142
+ /* Pointer to the top of the exception stack for the exceptions
143
+ * we may be currently handling. (See _PyErr_StackItem above.)
144
+ * This is never NULL. */
145
+ _PyErr_StackItem *exc_info;
146
+
147
+ PyObject *dict; /* Stores per-thread state */
148
+
149
+ int gilstate_counter;
150
+
151
+ PyObject *async_exc; /* Asynchronous exception to raise */
152
+ unsigned long thread_id; /* Thread id where this tstate was created */
153
+
154
+ /* Native thread id where this tstate was created. This will be 0 except on
155
+ * those platforms that have the notion of native thread id, for which the
156
+ * macro PY_HAVE_THREAD_NATIVE_ID is then defined.
157
+ */
158
+ unsigned long native_thread_id;
159
+
160
+ PyObject *delete_later;
161
+
162
+ /* Tagged pointer to top-most critical section, or zero if there is no
163
+ * active critical section. Critical sections are only used in
164
+ * `--disable-gil` builds (i.e., when Py_GIL_DISABLED is defined to 1). In the
165
+ * default build, this field is always zero.
166
+ */
167
+ uintptr_t critical_section;
168
+
169
+ int coroutine_origin_tracking_depth;
170
+
171
+ PyObject *async_gen_firstiter;
172
+ PyObject *async_gen_finalizer;
173
+
174
+ PyObject *context;
175
+ uint64_t context_ver;
176
+
177
+ /* Unique thread state id. */
178
+ uint64_t id;
179
+
180
+ _PyStackChunk *datastack_chunk;
181
+ PyObject **datastack_top;
182
+ PyObject **datastack_limit;
183
+ /* XXX signal handlers should also be here */
184
+
185
+ /* The following fields are here to avoid allocation during init.
186
+ The data is exposed through PyThreadState pointer fields.
187
+ These fields should not be accessed directly outside of init.
188
+ This is indicated by an underscore prefix on the field names.
189
+
190
+ All other PyInterpreterState pointer fields are populated when
191
+ needed and default to NULL.
192
+ */
193
+ // Note some fields do not have a leading underscore for backward
194
+ // compatibility. See https://bugs.python.org/issue45953#msg412046.
195
+
196
+ /* The thread's exception stack entry. (Always the last entry.) */
197
+ _PyErr_StackItem exc_state;
198
+
199
+ PyObject *current_executor;
200
+
201
+ uint64_t dict_global_version;
202
+
203
+ /* Used to store/retrieve `threading.local` keys/values for this thread */
204
+ PyObject *threading_local_key;
205
+
206
+ /* Used by `threading.local`s to be remove keys/values for dying threads.
207
+ The PyThreadObject must hold the only reference to this value.
208
+ */
209
+ PyObject *threading_local_sentinel;
210
+ _PyRemoteDebuggerSupport remote_debugger_support;
211
+ };
212
+
213
+ /* other API */
214
+
215
+ /* Similar to PyThreadState_Get(), but don't issue a fatal error
216
+ * if it is NULL. */
217
+ PyAPI_FUNC(PyThreadState *) PyThreadState_GetUnchecked(void);
218
+
219
+ // Deprecated alias kept for backward compatibility
220
+ Py_DEPRECATED(3.14) static inline PyThreadState*
221
+ _PyThreadState_UncheckedGet(void)
222
+ {
223
+ return PyThreadState_GetUnchecked();
224
+ }
225
+
226
+ // Disable tracing and profiling.
227
+ PyAPI_FUNC(void) PyThreadState_EnterTracing(PyThreadState *tstate);
228
+
229
+ // Reset tracing and profiling: enable them if a trace function or a profile
230
+ // function is set, otherwise disable them.
231
+ PyAPI_FUNC(void) PyThreadState_LeaveTracing(PyThreadState *tstate);
232
+
233
+ /* PyGILState */
234
+
235
+ /* Helper/diagnostic function - return 1 if the current thread
236
+ currently holds the GIL, 0 otherwise.
237
+
238
+ The function returns 1 if _PyGILState_check_enabled is non-zero. */
239
+ PyAPI_FUNC(int) PyGILState_Check(void);
240
+
241
+ /* The implementation of sys._current_frames() Returns a dict mapping
242
+ thread id to that thread's current frame.
243
+ */
244
+ PyAPI_FUNC(PyObject*) _PyThread_CurrentFrames(void);
245
+
246
+ // Set the stack protection start address and stack protection size
247
+ // of a Python thread state
248
+ PyAPI_FUNC(int) PyUnstable_ThreadState_SetStackProtection(
249
+ PyThreadState *tstate,
250
+ void *stack_start_addr, // Stack start address
251
+ size_t stack_size); // Stack size (in bytes)
252
+
253
+ // Reset the stack protection start address and stack protection size
254
+ // of a Python thread state
255
+ PyAPI_FUNC(void) PyUnstable_ThreadState_ResetStackProtection(
256
+ PyThreadState *tstate);
257
+
258
+ /* Routines for advanced debuggers, requested by David Beazley.
259
+ Don't use unless you know what you are doing! */
260
+ PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void);
261
+ PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
262
+ PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
263
+ PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
264
+ PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
265
+ PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void);
266
+
267
+ /* Frame evaluation API */
268
+
269
+ typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, struct _PyInterpreterFrame *, int);
270
+
271
+ PyAPI_FUNC(_PyFrameEvalFunction) _PyInterpreterState_GetEvalFrameFunc(
272
+ PyInterpreterState *interp);
273
+ PyAPI_FUNC(void) _PyInterpreterState_SetEvalFrameFunc(
274
+ PyInterpreterState *interp,
275
+ _PyFrameEvalFunction eval_frame);
@@ -0,0 +1,194 @@
1
+ // Statistics on Python performance.
2
+ //
3
+ // API:
4
+ //
5
+ // - _Py_INCREF_STAT_INC() and _Py_DECREF_STAT_INC() used by Py_INCREF()
6
+ // and Py_DECREF().
7
+ // - _Py_stats variable
8
+ //
9
+ // Functions of the sys module:
10
+ //
11
+ // - sys._stats_on()
12
+ // - sys._stats_off()
13
+ // - sys._stats_clear()
14
+ // - sys._stats_dump()
15
+ //
16
+ // Python must be built with ./configure --enable-pystats to define the
17
+ // Py_STATS macro.
18
+ //
19
+ // Define _PY_INTERPRETER macro to increment interpreter_increfs and
20
+ // interpreter_decrefs. Otherwise, increment increfs and decrefs.
21
+ //
22
+ // The number of incref operations counted by `incref` and
23
+ // `interpreter_incref` is the number of increment operations, which is
24
+ // not equal to the total of all reference counts. A single increment
25
+ // operation may increase the reference count of an object by more than
26
+ // one. For example, see `_Py_RefcntAdd`.
27
+
28
+ #ifndef Py_CPYTHON_PYSTATS_H
29
+ # error "this header file must not be included directly"
30
+ #endif
31
+
32
+ #define PYSTATS_MAX_UOP_ID 1024
33
+
34
+ #define SPECIALIZATION_FAILURE_KINDS 60
35
+
36
+ /* Stats for determining who is calling PyEval_EvalFrame */
37
+ #define EVAL_CALL_TOTAL 0
38
+ #define EVAL_CALL_VECTOR 1
39
+ #define EVAL_CALL_GENERATOR 2
40
+ #define EVAL_CALL_LEGACY 3
41
+ #define EVAL_CALL_FUNCTION_VECTORCALL 4
42
+ #define EVAL_CALL_BUILD_CLASS 5
43
+ #define EVAL_CALL_SLOT 6
44
+ #define EVAL_CALL_FUNCTION_EX 7
45
+ #define EVAL_CALL_API 8
46
+ #define EVAL_CALL_METHOD 9
47
+
48
+ #define EVAL_CALL_KINDS 10
49
+
50
+ typedef struct _specialization_stats {
51
+ uint64_t success;
52
+ uint64_t failure;
53
+ uint64_t hit;
54
+ uint64_t deferred;
55
+ uint64_t miss;
56
+ uint64_t deopt;
57
+ uint64_t failure_kinds[SPECIALIZATION_FAILURE_KINDS];
58
+ } SpecializationStats;
59
+
60
+ typedef struct _opcode_stats {
61
+ SpecializationStats specialization;
62
+ uint64_t execution_count;
63
+ uint64_t pair_count[256];
64
+ } OpcodeStats;
65
+
66
+ typedef struct _call_stats {
67
+ uint64_t inlined_py_calls;
68
+ uint64_t pyeval_calls;
69
+ uint64_t frames_pushed;
70
+ uint64_t frame_objects_created;
71
+ uint64_t eval_calls[EVAL_CALL_KINDS];
72
+ } CallStats;
73
+
74
+ typedef struct _object_stats {
75
+ uint64_t increfs;
76
+ uint64_t decrefs;
77
+ uint64_t interpreter_increfs;
78
+ uint64_t interpreter_decrefs;
79
+ uint64_t immortal_increfs;
80
+ uint64_t immortal_decrefs;
81
+ uint64_t interpreter_immortal_increfs;
82
+ uint64_t interpreter_immortal_decrefs;
83
+ uint64_t allocations;
84
+ uint64_t allocations512;
85
+ uint64_t allocations4k;
86
+ uint64_t allocations_big;
87
+ uint64_t frees;
88
+ uint64_t to_freelist;
89
+ uint64_t from_freelist;
90
+ uint64_t inline_values;
91
+ uint64_t dict_materialized_on_request;
92
+ uint64_t dict_materialized_new_key;
93
+ uint64_t dict_materialized_too_big;
94
+ uint64_t dict_materialized_str_subclass;
95
+ uint64_t type_cache_hits;
96
+ uint64_t type_cache_misses;
97
+ uint64_t type_cache_dunder_hits;
98
+ uint64_t type_cache_dunder_misses;
99
+ uint64_t type_cache_collisions;
100
+ /* Temporary value used during GC */
101
+ uint64_t object_visits;
102
+ } ObjectStats;
103
+
104
+ typedef struct _gc_stats {
105
+ uint64_t collections;
106
+ uint64_t object_visits;
107
+ uint64_t objects_collected;
108
+ uint64_t objects_transitively_reachable;
109
+ uint64_t objects_not_transitively_reachable;
110
+ } GCStats;
111
+
112
+ typedef struct _uop_stats {
113
+ uint64_t execution_count;
114
+ uint64_t miss;
115
+ uint64_t pair_count[PYSTATS_MAX_UOP_ID + 1];
116
+ } UOpStats;
117
+
118
+ #define _Py_UOP_HIST_SIZE 32
119
+
120
+ typedef struct _optimization_stats {
121
+ uint64_t attempts;
122
+ uint64_t traces_created;
123
+ uint64_t traces_executed;
124
+ uint64_t uops_executed;
125
+ uint64_t trace_stack_overflow;
126
+ uint64_t trace_stack_underflow;
127
+ uint64_t trace_too_long;
128
+ uint64_t trace_too_short;
129
+ uint64_t inner_loop;
130
+ uint64_t recursive_call;
131
+ uint64_t low_confidence;
132
+ uint64_t unknown_callee;
133
+ uint64_t executors_invalidated;
134
+ UOpStats opcode[PYSTATS_MAX_UOP_ID + 1];
135
+ uint64_t unsupported_opcode[256];
136
+ uint64_t trace_length_hist[_Py_UOP_HIST_SIZE];
137
+ uint64_t trace_run_length_hist[_Py_UOP_HIST_SIZE];
138
+ uint64_t optimized_trace_length_hist[_Py_UOP_HIST_SIZE];
139
+ uint64_t optimizer_attempts;
140
+ uint64_t optimizer_successes;
141
+ uint64_t optimizer_failure_reason_no_memory;
142
+ uint64_t remove_globals_builtins_changed;
143
+ uint64_t remove_globals_incorrect_keys;
144
+ uint64_t error_in_opcode[PYSTATS_MAX_UOP_ID + 1];
145
+ // JIT memory stats
146
+ uint64_t jit_total_memory_size;
147
+ uint64_t jit_code_size;
148
+ uint64_t jit_trampoline_size;
149
+ uint64_t jit_data_size;
150
+ uint64_t jit_padding_size;
151
+ uint64_t jit_freed_memory_size;
152
+ uint64_t trace_total_memory_hist[_Py_UOP_HIST_SIZE];
153
+ } OptimizationStats;
154
+
155
+ typedef struct _rare_event_stats {
156
+ /* Setting an object's class, obj.__class__ = ... */
157
+ uint64_t set_class;
158
+ /* Setting the bases of a class, cls.__bases__ = ... */
159
+ uint64_t set_bases;
160
+ /* Setting the PEP 523 frame eval function, _PyInterpreterState_SetFrameEvalFunc() */
161
+ uint64_t set_eval_frame_func;
162
+ /* Modifying the builtins, __builtins__.__dict__[var] = ... */
163
+ uint64_t builtin_dict;
164
+ /* Modifying a function, e.g. func.__defaults__ = ..., etc. */
165
+ uint64_t func_modification;
166
+ /* Modifying a dict that is being watched */
167
+ uint64_t watched_dict_modification;
168
+ uint64_t watched_globals_modification;
169
+ } RareEventStats;
170
+
171
+ typedef struct _stats {
172
+ OpcodeStats opcode_stats[256];
173
+ CallStats call_stats;
174
+ ObjectStats object_stats;
175
+ OptimizationStats optimization_stats;
176
+ RareEventStats rare_event_stats;
177
+ GCStats *gc_stats;
178
+ } PyStats;
179
+
180
+
181
+ // Export for shared extensions like 'math'
182
+ PyAPI_DATA(PyStats*) _Py_stats;
183
+
184
+ #ifdef _PY_INTERPRETER
185
+ # define _Py_INCREF_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.interpreter_increfs++; } while (0)
186
+ # define _Py_DECREF_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.interpreter_decrefs++; } while (0)
187
+ # define _Py_INCREF_IMMORTAL_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.interpreter_immortal_increfs++; } while (0)
188
+ # define _Py_DECREF_IMMORTAL_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.interpreter_immortal_decrefs++; } while (0)
189
+ #else
190
+ # define _Py_INCREF_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.increfs++; } while (0)
191
+ # define _Py_DECREF_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.decrefs++; } while (0)
192
+ # define _Py_INCREF_IMMORTAL_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.immortal_increfs++; } while (0)
193
+ # define _Py_DECREF_IMMORTAL_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.immortal_decrefs++; } while (0)
194
+ #endif
@@ -0,0 +1,96 @@
1
+ #ifndef Py_CPYTHON_PYTHONRUN_H
2
+ # error "this header file must not be included directly"
3
+ #endif
4
+
5
+ PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
6
+ PyAPI_FUNC(int) PyRun_AnyFileExFlags(
7
+ FILE *fp,
8
+ const char *filename, /* decoded from the filesystem encoding */
9
+ int closeit,
10
+ PyCompilerFlags *flags);
11
+ PyAPI_FUNC(int) PyRun_SimpleFileExFlags(
12
+ FILE *fp,
13
+ const char *filename, /* decoded from the filesystem encoding */
14
+ int closeit,
15
+ PyCompilerFlags *flags);
16
+ PyAPI_FUNC(int) PyRun_InteractiveOneFlags(
17
+ FILE *fp,
18
+ const char *filename, /* decoded from the filesystem encoding */
19
+ PyCompilerFlags *flags);
20
+ PyAPI_FUNC(int) PyRun_InteractiveOneObject(
21
+ FILE *fp,
22
+ PyObject *filename,
23
+ PyCompilerFlags *flags);
24
+ PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(
25
+ FILE *fp,
26
+ const char *filename, /* decoded from the filesystem encoding */
27
+ PyCompilerFlags *flags);
28
+
29
+
30
+ PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,
31
+ PyObject *, PyCompilerFlags *);
32
+
33
+ PyAPI_FUNC(PyObject *) PyRun_FileExFlags(
34
+ FILE *fp,
35
+ const char *filename, /* decoded from the filesystem encoding */
36
+ int start,
37
+ PyObject *globals,
38
+ PyObject *locals,
39
+ int closeit,
40
+ PyCompilerFlags *flags);
41
+
42
+
43
+ PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(
44
+ const char *str,
45
+ const char *filename, /* decoded from the filesystem encoding */
46
+ int start,
47
+ PyCompilerFlags *flags,
48
+ int optimize);
49
+ PyAPI_FUNC(PyObject *) Py_CompileStringObject(
50
+ const char *str,
51
+ PyObject *filename, int start,
52
+ PyCompilerFlags *flags,
53
+ int optimize);
54
+
55
+ #define Py_CompileString(str, p, s) Py_CompileStringExFlags((str), (p), (s), NULL, -1)
56
+ #define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags((str), (p), (s), (f), -1)
57
+
58
+ /* A function flavor is also exported by libpython. It is required when
59
+ libpython is accessed directly rather than using header files which defines
60
+ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to
61
+ export functions in pythonXX.dll. */
62
+ PyAPI_FUNC(PyObject *) PyRun_String(const char *str, int s, PyObject *g, PyObject *l);
63
+ PyAPI_FUNC(int) PyRun_AnyFile(FILE *fp, const char *name);
64
+ PyAPI_FUNC(int) PyRun_AnyFileEx(FILE *fp, const char *name, int closeit);
65
+ PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
66
+ PyAPI_FUNC(int) PyRun_SimpleString(const char *s);
67
+ PyAPI_FUNC(int) PyRun_SimpleFile(FILE *f, const char *p);
68
+ PyAPI_FUNC(int) PyRun_SimpleFileEx(FILE *f, const char *p, int c);
69
+ PyAPI_FUNC(int) PyRun_InteractiveOne(FILE *f, const char *p);
70
+ PyAPI_FUNC(int) PyRun_InteractiveLoop(FILE *f, const char *p);
71
+ PyAPI_FUNC(PyObject *) PyRun_File(FILE *fp, const char *p, int s, PyObject *g, PyObject *l);
72
+ PyAPI_FUNC(PyObject *) PyRun_FileEx(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, int c);
73
+ PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, PyCompilerFlags *flags);
74
+
75
+ /* Use macros for a bunch of old variants */
76
+ #define PyRun_String(str, s, g, l) PyRun_StringFlags((str), (s), (g), (l), NULL)
77
+ #define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags((fp), (name), 0, NULL)
78
+ #define PyRun_AnyFileEx(fp, name, closeit) \
79
+ PyRun_AnyFileExFlags((fp), (name), (closeit), NULL)
80
+ #define PyRun_AnyFileFlags(fp, name, flags) \
81
+ PyRun_AnyFileExFlags((fp), (name), 0, (flags))
82
+ #define PyRun_SimpleString(s) PyRun_SimpleStringFlags((s), NULL)
83
+ #define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags((f), (p), 0, NULL)
84
+ #define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags((f), (p), (c), NULL)
85
+ #define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags((f), (p), NULL)
86
+ #define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags((f), (p), NULL)
87
+ #define PyRun_File(fp, p, s, g, l) \
88
+ PyRun_FileExFlags((fp), (p), (s), (g), (l), 0, NULL)
89
+ #define PyRun_FileEx(fp, p, s, g, l, c) \
90
+ PyRun_FileExFlags((fp), (p), (s), (g), (l), (c), NULL)
91
+ #define PyRun_FileFlags(fp, p, s, g, l, flags) \
92
+ PyRun_FileExFlags((fp), (p), (s), (g), (l), 0, (flags))
93
+
94
+ /* Stuff with no proper home (yet) */
95
+ PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
96
+ PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
@@ -0,0 +1,43 @@
1
+ #ifndef Py_CPYTHON_PYTHREAD_H
2
+ # error "this header file must not be included directly"
3
+ #endif
4
+
5
+ // PY_TIMEOUT_MAX is the highest usable value (in microseconds) of PY_TIMEOUT_T
6
+ // type, and depends on the system threading API.
7
+ //
8
+ // NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`. The _thread module
9
+ // exposes a higher-level API, with timeouts expressed in seconds and
10
+ // floating-point numbers allowed.
11
+ PyAPI_DATA(const long long) PY_TIMEOUT_MAX;
12
+
13
+ #define PYTHREAD_INVALID_THREAD_ID ((unsigned long)-1)
14
+
15
+ #ifdef HAVE_PTHREAD_H
16
+ /* Darwin needs pthread.h to know type name the pthread_key_t. */
17
+ # include <pthread.h>
18
+ # define NATIVE_TSS_KEY_T pthread_key_t
19
+ #elif defined(NT_THREADS)
20
+ /* In Windows, native TSS key type is DWORD,
21
+ but hardcode the unsigned long to avoid errors for include directive.
22
+ */
23
+ # define NATIVE_TSS_KEY_T unsigned long
24
+ #elif defined(HAVE_PTHREAD_STUBS)
25
+ # include "pthread_stubs.h"
26
+ # define NATIVE_TSS_KEY_T pthread_key_t
27
+ #else
28
+ # error "Require native threads. See https://bugs.python.org/issue31370"
29
+ #endif
30
+
31
+ /* When Py_LIMITED_API is not defined, the type layout of Py_tss_t is
32
+ exposed to allow static allocation in the API clients. Even in this case,
33
+ you must handle TSS keys through API functions due to compatibility.
34
+ */
35
+ struct _Py_tss_t {
36
+ int _is_initialized;
37
+ NATIVE_TSS_KEY_T _key;
38
+ };
39
+
40
+ #undef NATIVE_TSS_KEY_T
41
+
42
+ /* When static allocation, you must initialize with Py_tss_NEEDS_INIT. */
43
+ #define Py_tss_NEEDS_INIT {0}
@@ -0,0 +1,27 @@
1
+ // PyTime_t C API: see Doc/c-api/time.rst for the documentation.
2
+
3
+ #ifndef Py_LIMITED_API
4
+ #ifndef Py_PYTIME_H
5
+ #define Py_PYTIME_H
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ typedef int64_t PyTime_t;
11
+ #define PyTime_MIN INT64_MIN
12
+ #define PyTime_MAX INT64_MAX
13
+
14
+ PyAPI_FUNC(double) PyTime_AsSecondsDouble(PyTime_t t);
15
+ PyAPI_FUNC(int) PyTime_Monotonic(PyTime_t *result);
16
+ PyAPI_FUNC(int) PyTime_PerfCounter(PyTime_t *result);
17
+ PyAPI_FUNC(int) PyTime_Time(PyTime_t *result);
18
+
19
+ PyAPI_FUNC(int) PyTime_MonotonicRaw(PyTime_t *result);
20
+ PyAPI_FUNC(int) PyTime_PerfCounterRaw(PyTime_t *result);
21
+ PyAPI_FUNC(int) PyTime_TimeRaw(PyTime_t *result);
22
+
23
+ #ifdef __cplusplus
24
+ }
25
+ #endif
26
+ #endif /* Py_PYTIME_H */
27
+ #endif /* Py_LIMITED_API */