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,91 @@
1
+ // This file moves some of the autoconf magic to compile-time when building on
2
+ // macOS. This is needed for building 4-way universal binaries and for 64-bit
3
+ // universal binaries because the values redefined below aren't configure-time
4
+ // constant but only compile-time constant in these scenarios.
5
+
6
+ #ifndef PY_MACCONFIG_H
7
+ #define PY_MACCONFIG_H
8
+ #ifdef __APPLE__
9
+
10
+ #undef ALIGNOF_MAX_ALIGN_T
11
+ #undef SIZEOF_LONG
12
+ #undef SIZEOF_LONG_DOUBLE
13
+ #undef SIZEOF_PTHREAD_T
14
+ #undef SIZEOF_SIZE_T
15
+ #undef SIZEOF_TIME_T
16
+ #undef SIZEOF_VOID_P
17
+ #undef SIZEOF__BOOL
18
+ #undef SIZEOF_UINTPTR_T
19
+ #undef SIZEOF_PTHREAD_T
20
+ #undef WORDS_BIGENDIAN
21
+ #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
22
+ #undef DOUBLE_IS_BIG_ENDIAN_IEEE754
23
+ #undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
24
+ #undef HAVE_GCC_ASM_FOR_X87
25
+ #undef HAVE_GCC_ASM_FOR_X64
26
+
27
+ #undef VA_LIST_IS_ARRAY
28
+ #if defined(__LP64__) && defined(__x86_64__)
29
+ # define VA_LIST_IS_ARRAY 1
30
+ #endif
31
+
32
+ #undef HAVE_LARGEFILE_SUPPORT
33
+ #ifndef __LP64__
34
+ # define HAVE_LARGEFILE_SUPPORT 1
35
+ #endif
36
+
37
+ #undef SIZEOF_LONG
38
+ #ifdef __LP64__
39
+ # define SIZEOF__BOOL 1
40
+ # define SIZEOF__BOOL 1
41
+ # define SIZEOF_LONG 8
42
+ # define SIZEOF_PTHREAD_T 8
43
+ # define SIZEOF_SIZE_T 8
44
+ # define SIZEOF_TIME_T 8
45
+ # define SIZEOF_VOID_P 8
46
+ # define SIZEOF_UINTPTR_T 8
47
+ # define SIZEOF_PTHREAD_T 8
48
+ #else
49
+ # ifdef __ppc__
50
+ # define SIZEOF__BOOL 4
51
+ # else
52
+ # define SIZEOF__BOOL 1
53
+ # endif
54
+ # define SIZEOF_LONG 4
55
+ # define SIZEOF_PTHREAD_T 4
56
+ # define SIZEOF_SIZE_T 4
57
+ # define SIZEOF_TIME_T 4
58
+ # define SIZEOF_VOID_P 4
59
+ # define SIZEOF_UINTPTR_T 4
60
+ # define SIZEOF_PTHREAD_T 4
61
+ #endif
62
+
63
+ // macOS 10.4 (the first release to support 64-bit code
64
+ // at all) only supports 64-bit in the UNIX layer.
65
+ // Therefore suppress the toolbox-glue in 64-bit mode.
66
+ //
67
+ // In 64-bit mode setpgrp always has no arguments, in 32-bit
68
+ // mode that depends on the compilation environment
69
+ #if defined(__LP64__)
70
+ # undef SETPGRP_HAVE_ARG
71
+ #endif
72
+
73
+ #ifdef __BIG_ENDIAN__
74
+ # define WORDS_BIGENDIAN 1
75
+ # define DOUBLE_IS_BIG_ENDIAN_IEEE754
76
+ #else
77
+ # define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
78
+ #endif
79
+
80
+ #if defined(__i386__) || defined(__x86_64__)
81
+ # define HAVE_GCC_ASM_FOR_X87
82
+ # define ALIGNOF_MAX_ALIGN_T 16
83
+ # define HAVE_GCC_ASM_FOR_X64 1
84
+ # define SIZEOF_LONG_DOUBLE 16
85
+ #else
86
+ # define ALIGNOF_MAX_ALIGN_T 8
87
+ # define SIZEOF_LONG_DOUBLE 8
88
+ #endif
89
+
90
+ #endif // __APPLE__
91
+ #endif // !PY_MACCONFIG_H
@@ -0,0 +1,243 @@
1
+ #ifndef Py_PYMACRO_H
2
+ #define Py_PYMACRO_H
3
+
4
+ // gh-91782: On FreeBSD 12, if the _POSIX_C_SOURCE and _XOPEN_SOURCE macros are
5
+ // defined, <sys/cdefs.h> disables C11 support and <assert.h> does not define
6
+ // the static_assert() macro.
7
+ // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255290
8
+ //
9
+ // macOS <= 10.10 doesn't define static_assert in assert.h at all despite
10
+ // having C11 compiler support.
11
+ //
12
+ // static_assert is defined in glibc from version 2.16. Compiler support for
13
+ // the C11 _Static_assert keyword is in gcc >= 4.6.
14
+ //
15
+ // MSVC makes static_assert a keyword in C11-17, contrary to the standards.
16
+ //
17
+ // In C++11 and C2x, static_assert is a keyword, redefining is undefined
18
+ // behaviour. So only define if building as C, not C++ (if __cplusplus is
19
+ // not defined), and only for C11-17.
20
+ #if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \
21
+ && !defined(__cplusplus) && defined(__STDC_VERSION__) \
22
+ && __STDC_VERSION__ >= 201112L && __STDC_VERSION__ <= 201710L
23
+ # define static_assert _Static_assert
24
+ #endif
25
+
26
+
27
+ // _Py_ALIGN_AS: this compiler's spelling of `alignas` keyword,
28
+ // We currently use alignas for free-threaded builds only; additional compat
29
+ // checking would be great before we add it to the default build.
30
+ // Standards/compiler support:
31
+ // - `alignas` is a keyword in C23 and C++11.
32
+ // - `_Alignas` is a keyword in C11
33
+ // - GCC & clang has __attribute__((aligned))
34
+ // (use that for older standards in pedantic mode)
35
+ // - MSVC has __declspec(align)
36
+ // - `_Alignas` is common C compiler extension
37
+ // Older compilers may name it differently; to allow compilation on such
38
+ // unsupported platforms, we don't redefine _Py_ALIGN_AS if it's already
39
+ // defined. Note that defining it wrong (including defining it to nothing) will
40
+ // cause ABI incompatibilities.
41
+ #ifdef Py_GIL_DISABLED
42
+ # ifndef _Py_ALIGN_AS
43
+ # ifdef __cplusplus
44
+ # if __cplusplus >= 201103L
45
+ # define _Py_ALIGN_AS(V) alignas(V)
46
+ # elif defined(__GNUC__) || defined(__clang__)
47
+ # define _Py_ALIGN_AS(V) __attribute__((aligned(V)))
48
+ # elif defined(_MSC_VER)
49
+ # define _Py_ALIGN_AS(V) __declspec(align(V))
50
+ # else
51
+ # define _Py_ALIGN_AS(V) alignas(V)
52
+ # endif
53
+ # elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
54
+ # define _Py_ALIGN_AS(V) alignas(V)
55
+ # elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
56
+ # define _Py_ALIGN_AS(V) _Alignas(V)
57
+ # elif (defined(__GNUC__) || defined(__clang__))
58
+ # define _Py_ALIGN_AS(V) __attribute__((aligned(V)))
59
+ # elif defined(_MSC_VER)
60
+ # define _Py_ALIGN_AS(V) __declspec(align(V))
61
+ # else
62
+ # define _Py_ALIGN_AS(V) _Alignas(V)
63
+ # endif
64
+ # endif
65
+ #endif
66
+
67
+ /* Minimum value between x and y */
68
+ #define Py_MIN(x, y) (((x) > (y)) ? (y) : (x))
69
+
70
+ /* Maximum value between x and y */
71
+ #define Py_MAX(x, y) (((x) > (y)) ? (x) : (y))
72
+
73
+ /* Absolute value of the number x */
74
+ #define Py_ABS(x) ((x) < 0 ? -(x) : (x))
75
+
76
+ #define _Py_XSTRINGIFY(x) #x
77
+
78
+ /* Convert the argument to a string. For example, Py_STRINGIFY(123) is replaced
79
+ with "123" by the preprocessor. Defines are also replaced by their value.
80
+ For example Py_STRINGIFY(__LINE__) is replaced by the line number, not
81
+ by "__LINE__". */
82
+ #define Py_STRINGIFY(x) _Py_XSTRINGIFY(x)
83
+
84
+ /* Get the size of a structure member in bytes */
85
+ #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
86
+
87
+ /* Argument must be a char or an int in [-128, 127] or [0, 255]. */
88
+ #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
89
+
90
+ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
91
+ && !defined(__cplusplus) && !defined(_MSC_VER))
92
+ # define Py_BUILD_ASSERT_EXPR(cond) \
93
+ ((void)sizeof(struct { int dummy; _Static_assert(cond, #cond); }), \
94
+ 0)
95
+ #else
96
+ /* Assert a build-time dependency, as an expression.
97
+ *
98
+ * Your compile will fail if the condition isn't true, or can't be evaluated
99
+ * by the compiler. This can be used in an expression: its value is 0.
100
+ *
101
+ * Example:
102
+ *
103
+ * #define foo_to_char(foo) \
104
+ * ((char *)(foo) \
105
+ * + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))
106
+ *
107
+ * Written by Rusty Russell, public domain, http://ccodearchive.net/
108
+ */
109
+ # define Py_BUILD_ASSERT_EXPR(cond) \
110
+ (sizeof(char [1 - 2*!(cond)]) - 1)
111
+ #endif
112
+
113
+ #if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
114
+ || (defined(__cplusplus) && __cplusplus >= 201103L))
115
+ // Use static_assert() on C11 and newer
116
+ # define Py_BUILD_ASSERT(cond) \
117
+ do { \
118
+ static_assert((cond), #cond); \
119
+ } while (0)
120
+ #else
121
+ # define Py_BUILD_ASSERT(cond) \
122
+ do { \
123
+ (void)Py_BUILD_ASSERT_EXPR(cond); \
124
+ } while(0)
125
+ #endif
126
+
127
+ /* Get the number of elements in a visible array
128
+
129
+ This does not work on pointers, or arrays declared as [], or function
130
+ parameters. With correct compiler support, such usage will cause a build
131
+ error (see Py_BUILD_ASSERT_EXPR).
132
+
133
+ Written by Rusty Russell, public domain, http://ccodearchive.net/
134
+
135
+ Requires at GCC 3.1+ */
136
+ #if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
137
+ (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ >= 4)))
138
+ /* Two gcc extensions.
139
+ &a[0] degrades to a pointer: a different type from an array */
140
+ #define Py_ARRAY_LENGTH(array) \
141
+ (sizeof(array) / sizeof((array)[0]) \
142
+ + Py_BUILD_ASSERT_EXPR(!__builtin_types_compatible_p(typeof(array), \
143
+ typeof(&(array)[0]))))
144
+ #else
145
+ #define Py_ARRAY_LENGTH(array) \
146
+ (sizeof(array) / sizeof((array)[0]))
147
+ #endif
148
+
149
+
150
+ /* Define macros for inline documentation. */
151
+ #define PyDoc_VAR(name) static const char name[]
152
+ #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
153
+ #ifdef WITH_DOC_STRINGS
154
+ #define PyDoc_STR(str) str
155
+ #else
156
+ #define PyDoc_STR(str) ""
157
+ #endif
158
+
159
+ /* Below "a" is a power of 2. */
160
+ /* Round down size "n" to be a multiple of "a". */
161
+ #define _Py_SIZE_ROUND_DOWN(n, a) ((size_t)(n) & ~(size_t)((a) - 1))
162
+ /* Round up size "n" to be a multiple of "a". */
163
+ #define _Py_SIZE_ROUND_UP(n, a) (((size_t)(n) + \
164
+ (size_t)((a) - 1)) & ~(size_t)((a) - 1))
165
+ /* Round pointer "p" down to the closest "a"-aligned address <= "p". */
166
+ #define _Py_ALIGN_DOWN(p, a) ((void *)((uintptr_t)(p) & ~(uintptr_t)((a) - 1)))
167
+ /* Round pointer "p" up to the closest "a"-aligned address >= "p". */
168
+ #define _Py_ALIGN_UP(p, a) ((void *)(((uintptr_t)(p) + \
169
+ (uintptr_t)((a) - 1)) & ~(uintptr_t)((a) - 1)))
170
+ /* Check if pointer "p" is aligned to "a"-bytes boundary. */
171
+ #define _Py_IS_ALIGNED(p, a) (!((uintptr_t)(p) & (uintptr_t)((a) - 1)))
172
+
173
+ /* Use this for unused arguments in a function definition to silence compiler
174
+ * warnings. Example:
175
+ *
176
+ * int func(int a, int Py_UNUSED(b)) { return a; }
177
+ */
178
+ #if defined(__GNUC__) || defined(__clang__)
179
+ # define Py_UNUSED(name) _unused_ ## name __attribute__((unused))
180
+ #elif defined(_MSC_VER)
181
+ // Disable warning C4100: unreferenced formal parameter,
182
+ // declare the parameter,
183
+ // restore old compiler warnings.
184
+ # define Py_UNUSED(name) \
185
+ __pragma(warning(push)) \
186
+ __pragma(warning(suppress: 4100)) \
187
+ _unused_ ## name \
188
+ __pragma(warning(pop))
189
+ #else
190
+ # define Py_UNUSED(name) _unused_ ## name
191
+ #endif
192
+
193
+ #if defined(RANDALL_WAS_HERE)
194
+ # define Py_UNREACHABLE() \
195
+ Py_FatalError( \
196
+ "If you're seeing this, the code is in what I thought was\n" \
197
+ "an unreachable state.\n\n" \
198
+ "I could give you advice for what to do, but honestly, why\n" \
199
+ "should you trust me? I clearly screwed this up. I'm writing\n" \
200
+ "a message that should never appear, yet I know it will\n" \
201
+ "probably appear someday.\n\n" \
202
+ "On a deep level, I know I'm not up to this task.\n" \
203
+ "I'm so sorry.\n" \
204
+ "https://xkcd.com/2200")
205
+ #elif defined(Py_DEBUG)
206
+ # define Py_UNREACHABLE() \
207
+ Py_FatalError( \
208
+ "We've reached an unreachable state. Anything is possible.\n" \
209
+ "The limits were in our heads all along. Follow your dreams.\n" \
210
+ "https://xkcd.com/2200")
211
+ #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
212
+ # define Py_UNREACHABLE() __builtin_unreachable()
213
+ #elif defined(__clang__) || defined(__INTEL_COMPILER)
214
+ # define Py_UNREACHABLE() __builtin_unreachable()
215
+ #elif defined(_MSC_VER)
216
+ # define Py_UNREACHABLE() __assume(0)
217
+ #else
218
+ # define Py_UNREACHABLE() \
219
+ Py_FatalError("Unreachable C code path reached")
220
+ #endif
221
+
222
+ #define _Py_CONTAINER_OF(ptr, type, member) \
223
+ (type*)((char*)ptr - offsetof(type, member))
224
+
225
+ // Prevent using an expression as a l-value.
226
+ // For example, "int x; _Py_RVALUE(x) = 1;" fails with a compiler error.
227
+ #define _Py_RVALUE(EXPR) ((void)0, (EXPR))
228
+
229
+ // Return non-zero if the type is signed, return zero if it's unsigned.
230
+ // Use "<= 0" rather than "< 0" to prevent the compiler warning:
231
+ // "comparison of unsigned expression in '< 0' is always false".
232
+ #define _Py_IS_TYPE_SIGNED(type) ((type)(-1) <= 0)
233
+
234
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030E0000 // 3.14
235
+ // Version helpers. These are primarily macros, but have exported equivalents.
236
+ PyAPI_FUNC(uint32_t) Py_PACK_FULL_VERSION(int x, int y, int z, int level, int serial);
237
+ PyAPI_FUNC(uint32_t) Py_PACK_VERSION(int x, int y);
238
+ #define Py_PACK_FULL_VERSION _Py_PACK_FULL_VERSION
239
+ #define Py_PACK_VERSION(X, Y) Py_PACK_FULL_VERSION(X, Y, 0, 0, 0)
240
+ #endif // Py_LIMITED_API < 3.14
241
+
242
+
243
+ #endif /* Py_PYMACRO_H */
@@ -0,0 +1,65 @@
1
+ // Symbols and macros to supply platform-independent interfaces to mathematical
2
+ // functions and constants.
3
+
4
+ #ifndef Py_PYMATH_H
5
+ #define Py_PYMATH_H
6
+
7
+ /* High precision definition of pi and e (Euler)
8
+ * The values are taken from libc6's math.h.
9
+ */
10
+ #ifndef Py_MATH_PIl
11
+ #define Py_MATH_PIl 3.1415926535897932384626433832795029L
12
+ #endif
13
+ #ifndef Py_MATH_PI
14
+ #define Py_MATH_PI 3.14159265358979323846
15
+ #endif
16
+
17
+ #ifndef Py_MATH_El
18
+ #define Py_MATH_El 2.7182818284590452353602874713526625L
19
+ #endif
20
+
21
+ #ifndef Py_MATH_E
22
+ #define Py_MATH_E 2.7182818284590452354
23
+ #endif
24
+
25
+ /* Tau (2pi) to 40 digits, taken from tauday.com/tau-digits. */
26
+ #ifndef Py_MATH_TAU
27
+ #define Py_MATH_TAU 6.2831853071795864769252867665590057683943L
28
+ #endif
29
+
30
+ // Py_IS_NAN(X)
31
+ // Return 1 if float or double arg is a NaN, else 0.
32
+ // Soft deprecated since Python 3.14, use isnan() instead.
33
+ #define Py_IS_NAN(X) isnan(X)
34
+
35
+ // Py_IS_INFINITY(X)
36
+ // Return 1 if float or double arg is an infinity, else 0.
37
+ // Soft deprecated since Python 3.14, use isinf() instead.
38
+ #define Py_IS_INFINITY(X) isinf(X)
39
+
40
+ // Py_IS_FINITE(X)
41
+ // Return 1 if float or double arg is neither infinite nor NAN, else 0.
42
+ // Soft deprecated since Python 3.14, use isfinite() instead.
43
+ #define Py_IS_FINITE(X) isfinite(X)
44
+
45
+ // Py_INFINITY: Value that evaluates to a positive double infinity.
46
+ #ifndef Py_INFINITY
47
+ # define Py_INFINITY ((double)INFINITY)
48
+ #endif
49
+
50
+ /* Py_HUGE_VAL should always be the same as Py_INFINITY. But historically
51
+ * this was not reliable and Python did not require IEEE floats and C99
52
+ * conformity. The macro was soft deprecated in Python 3.14, use Py_INFINITY instead.
53
+ */
54
+ #ifndef Py_HUGE_VAL
55
+ # define Py_HUGE_VAL HUGE_VAL
56
+ #endif
57
+
58
+ /* Py_NAN: Value that evaluates to a quiet Not-a-Number (NaN). The sign is
59
+ * undefined and normally not relevant, but e.g. fixed for float("nan").
60
+ */
61
+ #if !defined(Py_NAN)
62
+ # define Py_NAN ((double)NAN)
63
+ #endif
64
+
65
+ #endif /* Py_PYMATH_H */
@@ -0,0 +1,110 @@
1
+ // The PyMem_ family: low-level memory allocation interfaces.
2
+ // See objimpl.h for the PyObject_ memory family.
3
+
4
+ #ifndef Py_PYMEM_H
5
+ #define Py_PYMEM_H
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ /* BEWARE:
11
+
12
+ Each interface exports both functions and macros. Extension modules should
13
+ use the functions, to ensure binary compatibility across Python versions.
14
+ Because the Python implementation is free to change internal details, and
15
+ the macros may (or may not) expose details for speed, if you do use the
16
+ macros you must recompile your extensions with each Python release.
17
+
18
+ Never mix calls to PyMem_ with calls to the platform malloc/realloc/
19
+ calloc/free. For example, on Windows different DLLs may end up using
20
+ different heaps, and if you use PyMem_Malloc you'll get the memory from the
21
+ heap used by the Python DLL; it could be a disaster if you free()'ed that
22
+ directly in your own extension. Using PyMem_Free instead ensures Python
23
+ can return the memory to the proper heap. As another example, in
24
+ a debug build (Py_DEBUG macro), Python wraps all calls to all PyMem_ and
25
+ PyObject_ memory functions in special debugging wrappers that add additional
26
+ debugging info to dynamic memory blocks. The system routines have no idea
27
+ what to do with that stuff, and the Python wrappers have no idea what to do
28
+ with raw blocks obtained directly by the system routines then.
29
+
30
+ The GIL must be held when using these APIs.
31
+ */
32
+
33
+ /*
34
+ * Raw memory interface
35
+ * ====================
36
+ */
37
+
38
+ /* Functions
39
+
40
+ Functions supplying platform-independent semantics for malloc/realloc/
41
+ free. These functions make sure that allocating 0 bytes returns a distinct
42
+ non-NULL pointer (whenever possible -- if we're flat out of memory, NULL
43
+ may be returned), even if the platform malloc and realloc don't.
44
+ Returned pointers must be checked for NULL explicitly. No action is
45
+ performed on failure (no exception is set, no warning is printed, etc).
46
+ */
47
+
48
+ PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
49
+ PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
50
+ PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size);
51
+ PyAPI_FUNC(void) PyMem_Free(void *ptr);
52
+
53
+ /*
54
+ * Type-oriented memory interface
55
+ * ==============================
56
+ *
57
+ * Allocate memory for n objects of the given type. Returns a new pointer
58
+ * or NULL if the request was too large or memory allocation failed. Use
59
+ * these macros rather than doing the multiplication yourself so that proper
60
+ * overflow checking is always done.
61
+ */
62
+
63
+ #define PyMem_New(type, n) \
64
+ ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
65
+ ( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
66
+
67
+ /*
68
+ * The value of (p) is always clobbered by this macro regardless of success.
69
+ * The caller MUST check if (p) is NULL afterwards and deal with the memory
70
+ * error if so. This means the original value of (p) MUST be saved for the
71
+ * caller's memory error handler to not lose track of it.
72
+ */
73
+ #define PyMem_Resize(p, type, n) \
74
+ ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
75
+ (type *) PyMem_Realloc((p), (n) * sizeof(type)) )
76
+
77
+
78
+ // Deprecated aliases only kept for backward compatibility.
79
+ // PyMem_Del and PyMem_DEL are defined with no parameter to be able to use
80
+ // them as function pointers (ex: dealloc = PyMem_Del).
81
+ #define PyMem_MALLOC(n) PyMem_Malloc((n))
82
+ #define PyMem_NEW(type, n) PyMem_New(type, (n))
83
+ #define PyMem_REALLOC(p, n) PyMem_Realloc((p), (n))
84
+ #define PyMem_RESIZE(p, type, n) PyMem_Resize((p), type, (n))
85
+ #define PyMem_FREE(p) PyMem_Free((p))
86
+ #define PyMem_Del(p) PyMem_Free((p))
87
+ #define PyMem_DEL(p) PyMem_Free((p))
88
+
89
+
90
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
91
+ // Memory allocator which doesn't require the GIL to be held.
92
+ // Usually, it's just a thin wrapper to functions of the standard C library:
93
+ // malloc(), calloc(), realloc() and free(). The difference is that
94
+ // tracemalloc can track these memory allocations.
95
+ PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
96
+ PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize);
97
+ PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
98
+ PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
99
+ #endif
100
+
101
+ #ifndef Py_LIMITED_API
102
+ # define Py_CPYTHON_PYMEM_H
103
+ # include "cpython/pymem.h"
104
+ # undef Py_CPYTHON_PYMEM_H
105
+ #endif
106
+
107
+ #ifdef __cplusplus
108
+ }
109
+ #endif
110
+ #endif // !Py_PYMEM_H