@rowstile/cli-linux-x64 0.1.0-alpha.2

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 (565) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +5 -0
  3. package/package.json +26 -0
  4. package/python/bin/python3.13 +0 -0
  5. package/python/bin/python3.13-config +122 -0
  6. package/python/lib/libpython3.13.so.1.0 +0 -0
  7. package/python/lib/libpython3.so +0 -0
  8. package/python/lib/python3.13/LICENSE.txt +277 -0
  9. package/python/lib/python3.13/__future__.py +147 -0
  10. package/python/lib/python3.13/__hello__.py +16 -0
  11. package/python/lib/python3.13/_aix_support.py +108 -0
  12. package/python/lib/python3.13/_android_support.py +192 -0
  13. package/python/lib/python3.13/_apple_support.py +66 -0
  14. package/python/lib/python3.13/_collections_abc.py +1187 -0
  15. package/python/lib/python3.13/_colorize.py +119 -0
  16. package/python/lib/python3.13/_compat_pickle.py +251 -0
  17. package/python/lib/python3.13/_compression.py +162 -0
  18. package/python/lib/python3.13/_ios_support.py +71 -0
  19. package/python/lib/python3.13/_markupbase.py +396 -0
  20. package/python/lib/python3.13/_opcode_metadata.py +343 -0
  21. package/python/lib/python3.13/_osx_support.py +579 -0
  22. package/python/lib/python3.13/_py_abc.py +147 -0
  23. package/python/lib/python3.13/_pydatetime.py +2640 -0
  24. package/python/lib/python3.13/_pydecimal.py +6356 -0
  25. package/python/lib/python3.13/_pyio.py +2714 -0
  26. package/python/lib/python3.13/_pylong.py +363 -0
  27. package/python/lib/python3.13/_pyrepl/__init__.py +19 -0
  28. package/python/lib/python3.13/_pyrepl/__main__.py +10 -0
  29. package/python/lib/python3.13/_pyrepl/_minimal_curses.py +68 -0
  30. package/python/lib/python3.13/_pyrepl/_threading_handler.py +74 -0
  31. package/python/lib/python3.13/_pyrepl/base_eventqueue.py +110 -0
  32. package/python/lib/python3.13/_pyrepl/commands.py +492 -0
  33. package/python/lib/python3.13/_pyrepl/completing_reader.py +295 -0
  34. package/python/lib/python3.13/_pyrepl/console.py +229 -0
  35. package/python/lib/python3.13/_pyrepl/curses.py +33 -0
  36. package/python/lib/python3.13/_pyrepl/fancy_termios.py +82 -0
  37. package/python/lib/python3.13/_pyrepl/historical_reader.py +419 -0
  38. package/python/lib/python3.13/_pyrepl/input.py +114 -0
  39. package/python/lib/python3.13/_pyrepl/keymap.py +213 -0
  40. package/python/lib/python3.13/_pyrepl/main.py +59 -0
  41. package/python/lib/python3.13/_pyrepl/mypy.ini +29 -0
  42. package/python/lib/python3.13/_pyrepl/pager.py +175 -0
  43. package/python/lib/python3.13/_pyrepl/reader.py +764 -0
  44. package/python/lib/python3.13/_pyrepl/readline.py +599 -0
  45. package/python/lib/python3.13/_pyrepl/simple_interact.py +180 -0
  46. package/python/lib/python3.13/_pyrepl/trace.py +21 -0
  47. package/python/lib/python3.13/_pyrepl/types.py +10 -0
  48. package/python/lib/python3.13/_pyrepl/unix_console.py +852 -0
  49. package/python/lib/python3.13/_pyrepl/unix_eventqueue.py +76 -0
  50. package/python/lib/python3.13/_pyrepl/utils.py +83 -0
  51. package/python/lib/python3.13/_pyrepl/windows_console.py +687 -0
  52. package/python/lib/python3.13/_pyrepl/windows_eventqueue.py +42 -0
  53. package/python/lib/python3.13/_sitebuiltins.py +91 -0
  54. package/python/lib/python3.13/_strptime.py +800 -0
  55. package/python/lib/python3.13/_sysconfigdata__linux_x86_64-linux-gnu.py +1079 -0
  56. package/python/lib/python3.13/_threading_local.py +120 -0
  57. package/python/lib/python3.13/_weakrefset.py +205 -0
  58. package/python/lib/python3.13/abc.py +188 -0
  59. package/python/lib/python3.13/antigravity.py +17 -0
  60. package/python/lib/python3.13/argparse.py +2690 -0
  61. package/python/lib/python3.13/ast.py +1865 -0
  62. package/python/lib/python3.13/asyncio/__init__.py +47 -0
  63. package/python/lib/python3.13/asyncio/__main__.py +211 -0
  64. package/python/lib/python3.13/asyncio/base_events.py +2086 -0
  65. package/python/lib/python3.13/asyncio/base_futures.py +67 -0
  66. package/python/lib/python3.13/asyncio/base_subprocess.py +312 -0
  67. package/python/lib/python3.13/asyncio/base_tasks.py +94 -0
  68. package/python/lib/python3.13/asyncio/constants.py +41 -0
  69. package/python/lib/python3.13/asyncio/coroutines.py +109 -0
  70. package/python/lib/python3.13/asyncio/events.py +885 -0
  71. package/python/lib/python3.13/asyncio/exceptions.py +62 -0
  72. package/python/lib/python3.13/asyncio/format_helpers.py +84 -0
  73. package/python/lib/python3.13/asyncio/futures.py +425 -0
  74. package/python/lib/python3.13/asyncio/locks.py +617 -0
  75. package/python/lib/python3.13/asyncio/log.py +7 -0
  76. package/python/lib/python3.13/asyncio/mixins.py +21 -0
  77. package/python/lib/python3.13/asyncio/proactor_events.py +891 -0
  78. package/python/lib/python3.13/asyncio/protocols.py +216 -0
  79. package/python/lib/python3.13/asyncio/queues.py +309 -0
  80. package/python/lib/python3.13/asyncio/runners.py +217 -0
  81. package/python/lib/python3.13/asyncio/selector_events.py +1328 -0
  82. package/python/lib/python3.13/asyncio/sslproto.py +929 -0
  83. package/python/lib/python3.13/asyncio/staggered.py +174 -0
  84. package/python/lib/python3.13/asyncio/streams.py +787 -0
  85. package/python/lib/python3.13/asyncio/subprocess.py +229 -0
  86. package/python/lib/python3.13/asyncio/taskgroups.py +278 -0
  87. package/python/lib/python3.13/asyncio/tasks.py +1121 -0
  88. package/python/lib/python3.13/asyncio/threads.py +26 -0
  89. package/python/lib/python3.13/asyncio/timeouts.py +185 -0
  90. package/python/lib/python3.13/asyncio/transports.py +337 -0
  91. package/python/lib/python3.13/asyncio/trsock.py +98 -0
  92. package/python/lib/python3.13/asyncio/unix_events.py +1550 -0
  93. package/python/lib/python3.13/asyncio/windows_events.py +906 -0
  94. package/python/lib/python3.13/asyncio/windows_utils.py +181 -0
  95. package/python/lib/python3.13/base64.py +628 -0
  96. package/python/lib/python3.13/bdb.py +973 -0
  97. package/python/lib/python3.13/bisect.py +118 -0
  98. package/python/lib/python3.13/bz2.py +352 -0
  99. package/python/lib/python3.13/cProfile.py +197 -0
  100. package/python/lib/python3.13/calendar.py +813 -0
  101. package/python/lib/python3.13/cmd.py +409 -0
  102. package/python/lib/python3.13/code.py +386 -0
  103. package/python/lib/python3.13/codecs.py +1132 -0
  104. package/python/lib/python3.13/codeop.py +155 -0
  105. package/python/lib/python3.13/collections/__init__.py +1603 -0
  106. package/python/lib/python3.13/colorsys.py +166 -0
  107. package/python/lib/python3.13/compileall.py +470 -0
  108. package/python/lib/python3.13/concurrent/__init__.py +1 -0
  109. package/python/lib/python3.13/concurrent/futures/__init__.py +54 -0
  110. package/python/lib/python3.13/concurrent/futures/_base.py +660 -0
  111. package/python/lib/python3.13/concurrent/futures/process.py +892 -0
  112. package/python/lib/python3.13/concurrent/futures/thread.py +240 -0
  113. package/python/lib/python3.13/configparser.py +1396 -0
  114. package/python/lib/python3.13/contextlib.py +814 -0
  115. package/python/lib/python3.13/contextvars.py +4 -0
  116. package/python/lib/python3.13/copy.py +306 -0
  117. package/python/lib/python3.13/copyreg.py +217 -0
  118. package/python/lib/python3.13/csv.py +527 -0
  119. package/python/lib/python3.13/ctypes/__init__.py +605 -0
  120. package/python/lib/python3.13/ctypes/_aix.py +327 -0
  121. package/python/lib/python3.13/ctypes/_endian.py +78 -0
  122. package/python/lib/python3.13/ctypes/macholib/README.ctypes +7 -0
  123. package/python/lib/python3.13/ctypes/macholib/__init__.py +9 -0
  124. package/python/lib/python3.13/ctypes/macholib/dyld.py +165 -0
  125. package/python/lib/python3.13/ctypes/macholib/dylib.py +42 -0
  126. package/python/lib/python3.13/ctypes/macholib/fetch_macholib +2 -0
  127. package/python/lib/python3.13/ctypes/macholib/fetch_macholib.bat +1 -0
  128. package/python/lib/python3.13/ctypes/macholib/framework.py +42 -0
  129. package/python/lib/python3.13/ctypes/util.py +387 -0
  130. package/python/lib/python3.13/ctypes/wintypes.py +202 -0
  131. package/python/lib/python3.13/curses/__init__.py +101 -0
  132. package/python/lib/python3.13/curses/ascii.py +99 -0
  133. package/python/lib/python3.13/curses/has_key.py +192 -0
  134. package/python/lib/python3.13/curses/panel.py +6 -0
  135. package/python/lib/python3.13/curses/textpad.py +236 -0
  136. package/python/lib/python3.13/dataclasses.py +1679 -0
  137. package/python/lib/python3.13/datetime.py +9 -0
  138. package/python/lib/python3.13/dbm/__init__.py +194 -0
  139. package/python/lib/python3.13/dbm/dumb.py +319 -0
  140. package/python/lib/python3.13/dbm/gnu.py +3 -0
  141. package/python/lib/python3.13/dbm/ndbm.py +3 -0
  142. package/python/lib/python3.13/dbm/sqlite3.py +144 -0
  143. package/python/lib/python3.13/decimal.py +109 -0
  144. package/python/lib/python3.13/difflib.py +2058 -0
  145. package/python/lib/python3.13/dis.py +1075 -0
  146. package/python/lib/python3.13/doctest.py +2919 -0
  147. package/python/lib/python3.13/email/__init__.py +61 -0
  148. package/python/lib/python3.13/email/_encoded_words.py +233 -0
  149. package/python/lib/python3.13/email/_header_value_parser.py +3153 -0
  150. package/python/lib/python3.13/email/_parseaddr.py +563 -0
  151. package/python/lib/python3.13/email/_policybase.py +382 -0
  152. package/python/lib/python3.13/email/architecture.rst +216 -0
  153. package/python/lib/python3.13/email/base64mime.py +115 -0
  154. package/python/lib/python3.13/email/charset.py +396 -0
  155. package/python/lib/python3.13/email/contentmanager.py +254 -0
  156. package/python/lib/python3.13/email/encoders.py +65 -0
  157. package/python/lib/python3.13/email/errors.py +117 -0
  158. package/python/lib/python3.13/email/feedparser.py +536 -0
  159. package/python/lib/python3.13/email/generator.py +530 -0
  160. package/python/lib/python3.13/email/header.py +582 -0
  161. package/python/lib/python3.13/email/headerregistry.py +618 -0
  162. package/python/lib/python3.13/email/iterators.py +68 -0
  163. package/python/lib/python3.13/email/message.py +1217 -0
  164. package/python/lib/python3.13/email/mime/__init__.py +0 -0
  165. package/python/lib/python3.13/email/mime/application.py +37 -0
  166. package/python/lib/python3.13/email/mime/audio.py +97 -0
  167. package/python/lib/python3.13/email/mime/base.py +29 -0
  168. package/python/lib/python3.13/email/mime/image.py +152 -0
  169. package/python/lib/python3.13/email/mime/message.py +33 -0
  170. package/python/lib/python3.13/email/mime/multipart.py +47 -0
  171. package/python/lib/python3.13/email/mime/nonmultipart.py +21 -0
  172. package/python/lib/python3.13/email/mime/text.py +40 -0
  173. package/python/lib/python3.13/email/parser.py +127 -0
  174. package/python/lib/python3.13/email/policy.py +232 -0
  175. package/python/lib/python3.13/email/quoprimime.py +300 -0
  176. package/python/lib/python3.13/email/utils.py +497 -0
  177. package/python/lib/python3.13/encodings/__init__.py +179 -0
  178. package/python/lib/python3.13/encodings/__pycache__/__init__.cpython-313.pyc +0 -0
  179. package/python/lib/python3.13/encodings/__pycache__/aliases.cpython-313.pyc +0 -0
  180. package/python/lib/python3.13/encodings/__pycache__/utf_8.cpython-313.pyc +0 -0
  181. package/python/lib/python3.13/encodings/aliases.py +560 -0
  182. package/python/lib/python3.13/encodings/ascii.py +50 -0
  183. package/python/lib/python3.13/encodings/base64_codec.py +55 -0
  184. package/python/lib/python3.13/encodings/big5.py +39 -0
  185. package/python/lib/python3.13/encodings/big5hkscs.py +39 -0
  186. package/python/lib/python3.13/encodings/bz2_codec.py +78 -0
  187. package/python/lib/python3.13/encodings/charmap.py +69 -0
  188. package/python/lib/python3.13/encodings/cp037.py +307 -0
  189. package/python/lib/python3.13/encodings/cp1006.py +307 -0
  190. package/python/lib/python3.13/encodings/cp1026.py +307 -0
  191. package/python/lib/python3.13/encodings/cp1125.py +698 -0
  192. package/python/lib/python3.13/encodings/cp1140.py +307 -0
  193. package/python/lib/python3.13/encodings/cp1250.py +307 -0
  194. package/python/lib/python3.13/encodings/cp1251.py +307 -0
  195. package/python/lib/python3.13/encodings/cp1252.py +307 -0
  196. package/python/lib/python3.13/encodings/cp1253.py +307 -0
  197. package/python/lib/python3.13/encodings/cp1254.py +307 -0
  198. package/python/lib/python3.13/encodings/cp1255.py +307 -0
  199. package/python/lib/python3.13/encodings/cp1256.py +307 -0
  200. package/python/lib/python3.13/encodings/cp1257.py +307 -0
  201. package/python/lib/python3.13/encodings/cp1258.py +307 -0
  202. package/python/lib/python3.13/encodings/cp273.py +307 -0
  203. package/python/lib/python3.13/encodings/cp424.py +307 -0
  204. package/python/lib/python3.13/encodings/cp437.py +698 -0
  205. package/python/lib/python3.13/encodings/cp500.py +307 -0
  206. package/python/lib/python3.13/encodings/cp720.py +309 -0
  207. package/python/lib/python3.13/encodings/cp737.py +698 -0
  208. package/python/lib/python3.13/encodings/cp775.py +697 -0
  209. package/python/lib/python3.13/encodings/cp850.py +698 -0
  210. package/python/lib/python3.13/encodings/cp852.py +698 -0
  211. package/python/lib/python3.13/encodings/cp855.py +698 -0
  212. package/python/lib/python3.13/encodings/cp856.py +307 -0
  213. package/python/lib/python3.13/encodings/cp857.py +694 -0
  214. package/python/lib/python3.13/encodings/cp858.py +698 -0
  215. package/python/lib/python3.13/encodings/cp860.py +698 -0
  216. package/python/lib/python3.13/encodings/cp861.py +698 -0
  217. package/python/lib/python3.13/encodings/cp862.py +698 -0
  218. package/python/lib/python3.13/encodings/cp863.py +698 -0
  219. package/python/lib/python3.13/encodings/cp864.py +690 -0
  220. package/python/lib/python3.13/encodings/cp865.py +698 -0
  221. package/python/lib/python3.13/encodings/cp866.py +698 -0
  222. package/python/lib/python3.13/encodings/cp869.py +689 -0
  223. package/python/lib/python3.13/encodings/cp874.py +307 -0
  224. package/python/lib/python3.13/encodings/cp875.py +307 -0
  225. package/python/lib/python3.13/encodings/cp932.py +39 -0
  226. package/python/lib/python3.13/encodings/cp949.py +39 -0
  227. package/python/lib/python3.13/encodings/cp950.py +39 -0
  228. package/python/lib/python3.13/encodings/euc_jis_2004.py +39 -0
  229. package/python/lib/python3.13/encodings/euc_jisx0213.py +39 -0
  230. package/python/lib/python3.13/encodings/euc_jp.py +39 -0
  231. package/python/lib/python3.13/encodings/euc_kr.py +39 -0
  232. package/python/lib/python3.13/encodings/gb18030.py +39 -0
  233. package/python/lib/python3.13/encodings/gb2312.py +39 -0
  234. package/python/lib/python3.13/encodings/gbk.py +39 -0
  235. package/python/lib/python3.13/encodings/hex_codec.py +55 -0
  236. package/python/lib/python3.13/encodings/hp_roman8.py +314 -0
  237. package/python/lib/python3.13/encodings/hz.py +39 -0
  238. package/python/lib/python3.13/encodings/idna.py +387 -0
  239. package/python/lib/python3.13/encodings/iso2022_jp.py +39 -0
  240. package/python/lib/python3.13/encodings/iso2022_jp_1.py +39 -0
  241. package/python/lib/python3.13/encodings/iso2022_jp_2.py +39 -0
  242. package/python/lib/python3.13/encodings/iso2022_jp_2004.py +39 -0
  243. package/python/lib/python3.13/encodings/iso2022_jp_3.py +39 -0
  244. package/python/lib/python3.13/encodings/iso2022_jp_ext.py +39 -0
  245. package/python/lib/python3.13/encodings/iso2022_kr.py +39 -0
  246. package/python/lib/python3.13/encodings/iso8859_1.py +307 -0
  247. package/python/lib/python3.13/encodings/iso8859_10.py +307 -0
  248. package/python/lib/python3.13/encodings/iso8859_11.py +307 -0
  249. package/python/lib/python3.13/encodings/iso8859_13.py +307 -0
  250. package/python/lib/python3.13/encodings/iso8859_14.py +307 -0
  251. package/python/lib/python3.13/encodings/iso8859_15.py +307 -0
  252. package/python/lib/python3.13/encodings/iso8859_16.py +307 -0
  253. package/python/lib/python3.13/encodings/iso8859_2.py +307 -0
  254. package/python/lib/python3.13/encodings/iso8859_3.py +307 -0
  255. package/python/lib/python3.13/encodings/iso8859_4.py +307 -0
  256. package/python/lib/python3.13/encodings/iso8859_5.py +307 -0
  257. package/python/lib/python3.13/encodings/iso8859_6.py +307 -0
  258. package/python/lib/python3.13/encodings/iso8859_7.py +307 -0
  259. package/python/lib/python3.13/encodings/iso8859_8.py +307 -0
  260. package/python/lib/python3.13/encodings/iso8859_9.py +307 -0
  261. package/python/lib/python3.13/encodings/johab.py +39 -0
  262. package/python/lib/python3.13/encodings/koi8_r.py +307 -0
  263. package/python/lib/python3.13/encodings/koi8_t.py +308 -0
  264. package/python/lib/python3.13/encodings/koi8_u.py +307 -0
  265. package/python/lib/python3.13/encodings/kz1048.py +307 -0
  266. package/python/lib/python3.13/encodings/latin_1.py +50 -0
  267. package/python/lib/python3.13/encodings/mac_arabic.py +698 -0
  268. package/python/lib/python3.13/encodings/mac_croatian.py +307 -0
  269. package/python/lib/python3.13/encodings/mac_cyrillic.py +307 -0
  270. package/python/lib/python3.13/encodings/mac_farsi.py +307 -0
  271. package/python/lib/python3.13/encodings/mac_greek.py +307 -0
  272. package/python/lib/python3.13/encodings/mac_iceland.py +307 -0
  273. package/python/lib/python3.13/encodings/mac_latin2.py +312 -0
  274. package/python/lib/python3.13/encodings/mac_roman.py +307 -0
  275. package/python/lib/python3.13/encodings/mac_romanian.py +307 -0
  276. package/python/lib/python3.13/encodings/mac_turkish.py +307 -0
  277. package/python/lib/python3.13/encodings/mbcs.py +47 -0
  278. package/python/lib/python3.13/encodings/oem.py +41 -0
  279. package/python/lib/python3.13/encodings/palmos.py +308 -0
  280. package/python/lib/python3.13/encodings/ptcp154.py +312 -0
  281. package/python/lib/python3.13/encodings/punycode.py +253 -0
  282. package/python/lib/python3.13/encodings/quopri_codec.py +56 -0
  283. package/python/lib/python3.13/encodings/raw_unicode_escape.py +46 -0
  284. package/python/lib/python3.13/encodings/rot_13.py +113 -0
  285. package/python/lib/python3.13/encodings/shift_jis.py +39 -0
  286. package/python/lib/python3.13/encodings/shift_jis_2004.py +39 -0
  287. package/python/lib/python3.13/encodings/shift_jisx0213.py +39 -0
  288. package/python/lib/python3.13/encodings/tis_620.py +307 -0
  289. package/python/lib/python3.13/encodings/undefined.py +49 -0
  290. package/python/lib/python3.13/encodings/unicode_escape.py +46 -0
  291. package/python/lib/python3.13/encodings/utf_16.py +155 -0
  292. package/python/lib/python3.13/encodings/utf_16_be.py +42 -0
  293. package/python/lib/python3.13/encodings/utf_16_le.py +42 -0
  294. package/python/lib/python3.13/encodings/utf_32.py +150 -0
  295. package/python/lib/python3.13/encodings/utf_32_be.py +37 -0
  296. package/python/lib/python3.13/encodings/utf_32_le.py +37 -0
  297. package/python/lib/python3.13/encodings/utf_7.py +38 -0
  298. package/python/lib/python3.13/encodings/utf_8.py +42 -0
  299. package/python/lib/python3.13/encodings/utf_8_sig.py +130 -0
  300. package/python/lib/python3.13/encodings/uu_codec.py +103 -0
  301. package/python/lib/python3.13/encodings/zlib_codec.py +77 -0
  302. package/python/lib/python3.13/enum.py +2183 -0
  303. package/python/lib/python3.13/filecmp.py +320 -0
  304. package/python/lib/python3.13/fileinput.py +442 -0
  305. package/python/lib/python3.13/fnmatch.py +192 -0
  306. package/python/lib/python3.13/fractions.py +1043 -0
  307. package/python/lib/python3.13/ftplib.py +975 -0
  308. package/python/lib/python3.13/functools.py +1036 -0
  309. package/python/lib/python3.13/genericpath.py +200 -0
  310. package/python/lib/python3.13/getopt.py +215 -0
  311. package/python/lib/python3.13/getpass.py +192 -0
  312. package/python/lib/python3.13/gettext.py +657 -0
  313. package/python/lib/python3.13/glob.py +572 -0
  314. package/python/lib/python3.13/graphlib.py +250 -0
  315. package/python/lib/python3.13/gzip.py +693 -0
  316. package/python/lib/python3.13/hashlib.py +255 -0
  317. package/python/lib/python3.13/heapq.py +603 -0
  318. package/python/lib/python3.13/hmac.py +220 -0
  319. package/python/lib/python3.13/html/__init__.py +132 -0
  320. package/python/lib/python3.13/html/entities.py +2513 -0
  321. package/python/lib/python3.13/html/parser.py +583 -0
  322. package/python/lib/python3.13/http/__init__.py +202 -0
  323. package/python/lib/python3.13/http/client.py +1598 -0
  324. package/python/lib/python3.13/http/cookiejar.py +2122 -0
  325. package/python/lib/python3.13/http/cookies.py +635 -0
  326. package/python/lib/python3.13/http/server.py +1355 -0
  327. package/python/lib/python3.13/imaplib.py +1769 -0
  328. package/python/lib/python3.13/importlib/__init__.py +136 -0
  329. package/python/lib/python3.13/importlib/_abc.py +39 -0
  330. package/python/lib/python3.13/importlib/_bootstrap.py +1559 -0
  331. package/python/lib/python3.13/importlib/_bootstrap_external.py +1826 -0
  332. package/python/lib/python3.13/importlib/abc.py +243 -0
  333. package/python/lib/python3.13/importlib/machinery.py +21 -0
  334. package/python/lib/python3.13/importlib/metadata/__init__.py +1093 -0
  335. package/python/lib/python3.13/importlib/metadata/_adapters.py +89 -0
  336. package/python/lib/python3.13/importlib/metadata/_collections.py +30 -0
  337. package/python/lib/python3.13/importlib/metadata/_functools.py +104 -0
  338. package/python/lib/python3.13/importlib/metadata/_itertools.py +73 -0
  339. package/python/lib/python3.13/importlib/metadata/_meta.py +67 -0
  340. package/python/lib/python3.13/importlib/metadata/_text.py +99 -0
  341. package/python/lib/python3.13/importlib/metadata/diagnose.py +21 -0
  342. package/python/lib/python3.13/importlib/readers.py +12 -0
  343. package/python/lib/python3.13/importlib/resources/__init__.py +43 -0
  344. package/python/lib/python3.13/importlib/resources/_adapters.py +168 -0
  345. package/python/lib/python3.13/importlib/resources/_common.py +211 -0
  346. package/python/lib/python3.13/importlib/resources/_functional.py +81 -0
  347. package/python/lib/python3.13/importlib/resources/_itertools.py +38 -0
  348. package/python/lib/python3.13/importlib/resources/abc.py +173 -0
  349. package/python/lib/python3.13/importlib/resources/readers.py +203 -0
  350. package/python/lib/python3.13/importlib/resources/simple.py +106 -0
  351. package/python/lib/python3.13/importlib/simple.py +14 -0
  352. package/python/lib/python3.13/importlib/util.py +274 -0
  353. package/python/lib/python3.13/inspect.py +3479 -0
  354. package/python/lib/python3.13/io.py +99 -0
  355. package/python/lib/python3.13/ipaddress.py +2440 -0
  356. package/python/lib/python3.13/json/__init__.py +365 -0
  357. package/python/lib/python3.13/json/decoder.py +364 -0
  358. package/python/lib/python3.13/json/encoder.py +446 -0
  359. package/python/lib/python3.13/json/scanner.py +73 -0
  360. package/python/lib/python3.13/json/tool.py +90 -0
  361. package/python/lib/python3.13/keyword.py +64 -0
  362. package/python/lib/python3.13/lib-dynload/.empty +0 -0
  363. package/python/lib/python3.13/lib-dynload/_dbm.cpython-313-x86_64-linux-gnu.so +0 -0
  364. package/python/lib/python3.13/linecache.py +236 -0
  365. package/python/lib/python3.13/locale.py +1987 -0
  366. package/python/lib/python3.13/logging/__init__.py +2330 -0
  367. package/python/lib/python3.13/logging/config.py +1080 -0
  368. package/python/lib/python3.13/logging/handlers.py +1629 -0
  369. package/python/lib/python3.13/lzma.py +364 -0
  370. package/python/lib/python3.13/mailbox.py +2219 -0
  371. package/python/lib/python3.13/mimetypes.py +679 -0
  372. package/python/lib/python3.13/modulefinder.py +671 -0
  373. package/python/lib/python3.13/multiprocessing/__init__.py +37 -0
  374. package/python/lib/python3.13/multiprocessing/connection.py +1216 -0
  375. package/python/lib/python3.13/multiprocessing/context.py +383 -0
  376. package/python/lib/python3.13/multiprocessing/dummy/__init__.py +126 -0
  377. package/python/lib/python3.13/multiprocessing/dummy/connection.py +75 -0
  378. package/python/lib/python3.13/multiprocessing/forkserver.py +373 -0
  379. package/python/lib/python3.13/multiprocessing/heap.py +337 -0
  380. package/python/lib/python3.13/multiprocessing/managers.py +1397 -0
  381. package/python/lib/python3.13/multiprocessing/pool.py +957 -0
  382. package/python/lib/python3.13/multiprocessing/popen_fork.py +97 -0
  383. package/python/lib/python3.13/multiprocessing/popen_forkserver.py +74 -0
  384. package/python/lib/python3.13/multiprocessing/popen_spawn_posix.py +76 -0
  385. package/python/lib/python3.13/multiprocessing/popen_spawn_win32.py +147 -0
  386. package/python/lib/python3.13/multiprocessing/process.py +436 -0
  387. package/python/lib/python3.13/multiprocessing/queues.py +399 -0
  388. package/python/lib/python3.13/multiprocessing/reduction.py +281 -0
  389. package/python/lib/python3.13/multiprocessing/resource_sharer.py +154 -0
  390. package/python/lib/python3.13/multiprocessing/resource_tracker.py +499 -0
  391. package/python/lib/python3.13/multiprocessing/shared_memory.py +544 -0
  392. package/python/lib/python3.13/multiprocessing/sharedctypes.py +240 -0
  393. package/python/lib/python3.13/multiprocessing/spawn.py +307 -0
  394. package/python/lib/python3.13/multiprocessing/synchronize.py +404 -0
  395. package/python/lib/python3.13/multiprocessing/util.py +562 -0
  396. package/python/lib/python3.13/netrc.py +199 -0
  397. package/python/lib/python3.13/ntpath.py +872 -0
  398. package/python/lib/python3.13/nturl2path.py +69 -0
  399. package/python/lib/python3.13/numbers.py +427 -0
  400. package/python/lib/python3.13/opcode.py +115 -0
  401. package/python/lib/python3.13/operator.py +467 -0
  402. package/python/lib/python3.13/optparse.py +1681 -0
  403. package/python/lib/python3.13/os.py +1184 -0
  404. package/python/lib/python3.13/pathlib/__init__.py +12 -0
  405. package/python/lib/python3.13/pathlib/_abc.py +930 -0
  406. package/python/lib/python3.13/pathlib/_local.py +861 -0
  407. package/python/lib/python3.13/pdb.py +2550 -0
  408. package/python/lib/python3.13/pickle.py +1860 -0
  409. package/python/lib/python3.13/pickletools.py +2904 -0
  410. package/python/lib/python3.13/pkgutil.py +529 -0
  411. package/python/lib/python3.13/platform.py +1454 -0
  412. package/python/lib/python3.13/plistlib.py +948 -0
  413. package/python/lib/python3.13/poplib.py +477 -0
  414. package/python/lib/python3.13/posixpath.py +578 -0
  415. package/python/lib/python3.13/pprint.py +658 -0
  416. package/python/lib/python3.13/profile.py +616 -0
  417. package/python/lib/python3.13/pstats.py +778 -0
  418. package/python/lib/python3.13/pty.py +211 -0
  419. package/python/lib/python3.13/py_compile.py +212 -0
  420. package/python/lib/python3.13/pyclbr.py +314 -0
  421. package/python/lib/python3.13/pydoc.py +2861 -0
  422. package/python/lib/python3.13/queue.py +383 -0
  423. package/python/lib/python3.13/quopri.py +237 -0
  424. package/python/lib/python3.13/random.py +1078 -0
  425. package/python/lib/python3.13/re/__init__.py +428 -0
  426. package/python/lib/python3.13/re/_casefix.py +106 -0
  427. package/python/lib/python3.13/re/_compiler.py +768 -0
  428. package/python/lib/python3.13/re/_constants.py +222 -0
  429. package/python/lib/python3.13/re/_parser.py +1081 -0
  430. package/python/lib/python3.13/reprlib.py +230 -0
  431. package/python/lib/python3.13/rlcompleter.py +222 -0
  432. package/python/lib/python3.13/runpy.py +326 -0
  433. package/python/lib/python3.13/sched.py +167 -0
  434. package/python/lib/python3.13/secrets.py +71 -0
  435. package/python/lib/python3.13/selectors.py +603 -0
  436. package/python/lib/python3.13/shelve.py +250 -0
  437. package/python/lib/python3.13/shlex.py +345 -0
  438. package/python/lib/python3.13/shutil.py +1569 -0
  439. package/python/lib/python3.13/signal.py +94 -0
  440. package/python/lib/python3.13/site.py +773 -0
  441. package/python/lib/python3.13/smtplib.py +1123 -0
  442. package/python/lib/python3.13/socket.py +988 -0
  443. package/python/lib/python3.13/socketserver.py +863 -0
  444. package/python/lib/python3.13/sqlite3/__init__.py +70 -0
  445. package/python/lib/python3.13/sqlite3/__main__.py +139 -0
  446. package/python/lib/python3.13/sqlite3/dbapi2.py +108 -0
  447. package/python/lib/python3.13/sqlite3/dump.py +118 -0
  448. package/python/lib/python3.13/sre_compile.py +7 -0
  449. package/python/lib/python3.13/sre_constants.py +7 -0
  450. package/python/lib/python3.13/sre_parse.py +7 -0
  451. package/python/lib/python3.13/ssl.py +1541 -0
  452. package/python/lib/python3.13/stat.py +212 -0
  453. package/python/lib/python3.13/statistics.py +1817 -0
  454. package/python/lib/python3.13/string.py +314 -0
  455. package/python/lib/python3.13/stringprep.py +272 -0
  456. package/python/lib/python3.13/struct.py +15 -0
  457. package/python/lib/python3.13/subprocess.py +2258 -0
  458. package/python/lib/python3.13/symtable.py +414 -0
  459. package/python/lib/python3.13/sysconfig/__init__.py +734 -0
  460. package/python/lib/python3.13/sysconfig/__main__.py +248 -0
  461. package/python/lib/python3.13/tabnanny.py +340 -0
  462. package/python/lib/python3.13/tarfile.py +3136 -0
  463. package/python/lib/python3.13/tempfile.py +958 -0
  464. package/python/lib/python3.13/textwrap.py +497 -0
  465. package/python/lib/python3.13/this.py +28 -0
  466. package/python/lib/python3.13/threading.py +1602 -0
  467. package/python/lib/python3.13/timeit.py +381 -0
  468. package/python/lib/python3.13/token.py +141 -0
  469. package/python/lib/python3.13/tokenize.py +592 -0
  470. package/python/lib/python3.13/tomllib/__init__.py +10 -0
  471. package/python/lib/python3.13/tomllib/_parser.py +703 -0
  472. package/python/lib/python3.13/tomllib/_re.py +107 -0
  473. package/python/lib/python3.13/tomllib/_types.py +10 -0
  474. package/python/lib/python3.13/tomllib/mypy.ini +15 -0
  475. package/python/lib/python3.13/trace.py +754 -0
  476. package/python/lib/python3.13/traceback.py +1639 -0
  477. package/python/lib/python3.13/tracemalloc.py +560 -0
  478. package/python/lib/python3.13/tty.py +73 -0
  479. package/python/lib/python3.13/types.py +346 -0
  480. package/python/lib/python3.13/typing.py +3846 -0
  481. package/python/lib/python3.13/unittest/__init__.py +80 -0
  482. package/python/lib/python3.13/unittest/__main__.py +18 -0
  483. package/python/lib/python3.13/unittest/_log.py +86 -0
  484. package/python/lib/python3.13/unittest/async_case.py +146 -0
  485. package/python/lib/python3.13/unittest/case.py +1478 -0
  486. package/python/lib/python3.13/unittest/loader.py +460 -0
  487. package/python/lib/python3.13/unittest/main.py +280 -0
  488. package/python/lib/python3.13/unittest/mock.py +3189 -0
  489. package/python/lib/python3.13/unittest/result.py +256 -0
  490. package/python/lib/python3.13/unittest/runner.py +292 -0
  491. package/python/lib/python3.13/unittest/signals.py +71 -0
  492. package/python/lib/python3.13/unittest/suite.py +379 -0
  493. package/python/lib/python3.13/unittest/util.py +170 -0
  494. package/python/lib/python3.13/urllib/__init__.py +0 -0
  495. package/python/lib/python3.13/urllib/error.py +74 -0
  496. package/python/lib/python3.13/urllib/parse.py +1264 -0
  497. package/python/lib/python3.13/urllib/request.py +2796 -0
  498. package/python/lib/python3.13/urllib/response.py +84 -0
  499. package/python/lib/python3.13/urllib/robotparser.py +363 -0
  500. package/python/lib/python3.13/uuid.py +784 -0
  501. package/python/lib/python3.13/warnings.py +735 -0
  502. package/python/lib/python3.13/wave.py +665 -0
  503. package/python/lib/python3.13/weakref.py +674 -0
  504. package/python/lib/python3.13/webbrowser.py +724 -0
  505. package/python/lib/python3.13/wsgiref/__init__.py +25 -0
  506. package/python/lib/python3.13/wsgiref/handlers.py +575 -0
  507. package/python/lib/python3.13/wsgiref/headers.py +192 -0
  508. package/python/lib/python3.13/wsgiref/simple_server.py +161 -0
  509. package/python/lib/python3.13/wsgiref/types.py +54 -0
  510. package/python/lib/python3.13/wsgiref/util.py +159 -0
  511. package/python/lib/python3.13/wsgiref/validate.py +438 -0
  512. package/python/lib/python3.13/xml/__init__.py +20 -0
  513. package/python/lib/python3.13/xml/dom/NodeFilter.py +27 -0
  514. package/python/lib/python3.13/xml/dom/__init__.py +140 -0
  515. package/python/lib/python3.13/xml/dom/domreg.py +99 -0
  516. package/python/lib/python3.13/xml/dom/expatbuilder.py +962 -0
  517. package/python/lib/python3.13/xml/dom/minicompat.py +109 -0
  518. package/python/lib/python3.13/xml/dom/minidom.py +2024 -0
  519. package/python/lib/python3.13/xml/dom/pulldom.py +336 -0
  520. package/python/lib/python3.13/xml/dom/xmlbuilder.py +389 -0
  521. package/python/lib/python3.13/xml/etree/ElementInclude.py +186 -0
  522. package/python/lib/python3.13/xml/etree/ElementPath.py +430 -0
  523. package/python/lib/python3.13/xml/etree/ElementTree.py +2116 -0
  524. package/python/lib/python3.13/xml/etree/__init__.py +33 -0
  525. package/python/lib/python3.13/xml/etree/cElementTree.py +3 -0
  526. package/python/lib/python3.13/xml/parsers/__init__.py +8 -0
  527. package/python/lib/python3.13/xml/parsers/expat.py +8 -0
  528. package/python/lib/python3.13/xml/sax/__init__.py +94 -0
  529. package/python/lib/python3.13/xml/sax/_exceptions.py +127 -0
  530. package/python/lib/python3.13/xml/sax/expatreader.py +454 -0
  531. package/python/lib/python3.13/xml/sax/handler.py +387 -0
  532. package/python/lib/python3.13/xml/sax/saxutils.py +369 -0
  533. package/python/lib/python3.13/xml/sax/xmlreader.py +378 -0
  534. package/python/lib/python3.13/xmlrpc/__init__.py +1 -0
  535. package/python/lib/python3.13/xmlrpc/client.py +1503 -0
  536. package/python/lib/python3.13/xmlrpc/server.py +1002 -0
  537. package/python/lib/python3.13/zipapp.py +229 -0
  538. package/python/lib/python3.13/zipfile/__init__.py +2391 -0
  539. package/python/lib/python3.13/zipfile/__main__.py +4 -0
  540. package/python/lib/python3.13/zipfile/_path/__init__.py +452 -0
  541. package/python/lib/python3.13/zipfile/_path/glob.py +113 -0
  542. package/python/lib/python3.13/zipimport.py +803 -0
  543. package/python/lib/python3.13/zoneinfo/__init__.py +34 -0
  544. package/python/lib/python3.13/zoneinfo/_common.py +172 -0
  545. package/python/lib/python3.13/zoneinfo/_tzpath.py +189 -0
  546. package/python/lib/python3.13/zoneinfo/_zoneinfo.py +779 -0
  547. package/python/licenses/LICENSE.bdb.txt +126 -0
  548. package/python/licenses/LICENSE.bzip2.txt +37 -0
  549. package/python/licenses/LICENSE.cpython.txt +771 -0
  550. package/python/licenses/LICENSE.expat.txt +21 -0
  551. package/python/licenses/LICENSE.libX11.txt +942 -0
  552. package/python/licenses/LICENSE.libXau.txt +21 -0
  553. package/python/licenses/LICENSE.libedit.txt +29 -0
  554. package/python/licenses/LICENSE.libffi.txt +21 -0
  555. package/python/licenses/LICENSE.liblzma.txt +13 -0
  556. package/python/licenses/LICENSE.libuuid.txt +27 -0
  557. package/python/licenses/LICENSE.libxcb.txt +30 -0
  558. package/python/licenses/LICENSE.mpdecimal.txt +24 -0
  559. package/python/licenses/LICENSE.ncurses.txt +29 -0
  560. package/python/licenses/LICENSE.openssl-1.1.txt +124 -0
  561. package/python/licenses/LICENSE.openssl-3.txt +177 -0
  562. package/python/licenses/LICENSE.sqlite.txt +23 -0
  563. package/python/licenses/LICENSE.tcl.txt +40 -0
  564. package/python/licenses/LICENSE.tix.txt +54 -0
  565. package/python/licenses/LICENSE.zlib.txt +21 -0
@@ -0,0 +1,734 @@
1
+ """Access to Python's configuration information."""
2
+
3
+ import os
4
+ import sys
5
+ import threading
6
+ from os.path import realpath
7
+
8
+ __all__ = [
9
+ 'get_config_h_filename',
10
+ 'get_config_var',
11
+ 'get_config_vars',
12
+ 'get_makefile_filename',
13
+ 'get_path',
14
+ 'get_path_names',
15
+ 'get_paths',
16
+ 'get_platform',
17
+ 'get_python_version',
18
+ 'get_scheme_names',
19
+ 'parse_config_h',
20
+ ]
21
+
22
+ # Keys for get_config_var() that are never converted to Python integers.
23
+ _ALWAYS_STR = {
24
+ 'IPHONEOS_DEPLOYMENT_TARGET',
25
+ 'MACOSX_DEPLOYMENT_TARGET',
26
+ }
27
+
28
+ _INSTALL_SCHEMES = {
29
+ 'posix_prefix': {
30
+ 'stdlib': '{installed_base}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
31
+ 'platstdlib': '{platbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
32
+ 'purelib': '{base}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
33
+ 'platlib': '{platbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
34
+ 'include':
35
+ '{installed_base}/include/{implementation_lower}{py_version_short}{abiflags}',
36
+ 'platinclude':
37
+ '{installed_platbase}/include/{implementation_lower}{py_version_short}{abiflags}',
38
+ 'scripts': '{base}/bin',
39
+ 'data': '{base}',
40
+ },
41
+ 'posix_home': {
42
+ 'stdlib': '{installed_base}/lib/{implementation_lower}',
43
+ 'platstdlib': '{base}/lib/{implementation_lower}',
44
+ 'purelib': '{base}/lib/{implementation_lower}',
45
+ 'platlib': '{base}/lib/{implementation_lower}',
46
+ 'include': '{installed_base}/include/{implementation_lower}',
47
+ 'platinclude': '{installed_base}/include/{implementation_lower}',
48
+ 'scripts': '{base}/bin',
49
+ 'data': '{base}',
50
+ },
51
+ 'nt': {
52
+ 'stdlib': '{installed_base}/Lib',
53
+ 'platstdlib': '{base}/Lib',
54
+ 'purelib': '{base}/Lib/site-packages',
55
+ 'platlib': '{base}/Lib/site-packages',
56
+ 'include': '{installed_base}/Include',
57
+ 'platinclude': '{installed_base}/Include',
58
+ 'scripts': '{base}/Scripts',
59
+ 'data': '{base}',
60
+ },
61
+
62
+ # Downstream distributors can overwrite the default install scheme.
63
+ # This is done to support downstream modifications where distributors change
64
+ # the installation layout (eg. different site-packages directory).
65
+ # So, distributors will change the default scheme to one that correctly
66
+ # represents their layout.
67
+ # This presents an issue for projects/people that need to bootstrap virtual
68
+ # environments, like virtualenv. As distributors might now be customizing
69
+ # the default install scheme, there is no guarantee that the information
70
+ # returned by sysconfig.get_default_scheme/get_paths is correct for
71
+ # a virtual environment, the only guarantee we have is that it is correct
72
+ # for the *current* environment. When bootstrapping a virtual environment,
73
+ # we need to know its layout, so that we can place the files in the
74
+ # correct locations.
75
+ # The "*_venv" install scheme is a scheme to bootstrap virtual environments,
76
+ # essentially identical to the default posix_prefix/nt schemes.
77
+ # Downstream distributors who patch posix_prefix/nt scheme are encouraged to
78
+ # leave the following schemes unchanged
79
+ 'posix_venv': {
80
+ 'stdlib': '{installed_base}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
81
+ 'platstdlib': '{platbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
82
+ 'purelib': '{base}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
83
+ 'platlib': '{platbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
84
+ 'include':
85
+ '{installed_base}/include/{implementation_lower}{py_version_short}{abiflags}',
86
+ 'platinclude':
87
+ '{installed_platbase}/include/{implementation_lower}{py_version_short}{abiflags}',
88
+ 'scripts': '{base}/bin',
89
+ 'data': '{base}',
90
+ },
91
+ 'nt_venv': {
92
+ 'stdlib': '{installed_base}/Lib',
93
+ 'platstdlib': '{base}/Lib',
94
+ 'purelib': '{base}/Lib/site-packages',
95
+ 'platlib': '{base}/Lib/site-packages',
96
+ 'include': '{installed_base}/Include',
97
+ 'platinclude': '{installed_base}/Include',
98
+ 'scripts': '{base}/Scripts',
99
+ 'data': '{base}',
100
+ },
101
+ }
102
+
103
+ # For the OS-native venv scheme, we essentially provide an alias:
104
+ if os.name == 'nt':
105
+ _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['nt_venv']
106
+ else:
107
+ _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_venv']
108
+
109
+ def _get_implementation():
110
+ return 'Python'
111
+
112
+ # NOTE: site.py has copy of this function.
113
+ # Sync it when modify this function.
114
+ def _getuserbase():
115
+ env_base = os.environ.get("PYTHONUSERBASE", None)
116
+ if env_base:
117
+ return env_base
118
+
119
+ # Emscripten, iOS, tvOS, VxWorks, WASI, and watchOS have no home directories
120
+ if sys.platform in {"emscripten", "ios", "tvos", "vxworks", "wasi", "watchos"}:
121
+ return None
122
+
123
+ def joinuser(*args):
124
+ return os.path.expanduser(os.path.join(*args))
125
+
126
+ if os.name == "nt":
127
+ base = os.environ.get("APPDATA") or "~"
128
+ return joinuser(base, _get_implementation())
129
+
130
+ if sys.platform == "darwin" and sys._framework:
131
+ return joinuser("~", "Library", sys._framework,
132
+ f"{sys.version_info[0]}.{sys.version_info[1]}")
133
+
134
+ return joinuser("~", ".local")
135
+
136
+ _HAS_USER_BASE = (_getuserbase() is not None)
137
+
138
+ if _HAS_USER_BASE:
139
+ _INSTALL_SCHEMES |= {
140
+ # NOTE: When modifying "purelib" scheme, update site._get_path() too.
141
+ 'nt_user': {
142
+ 'stdlib': '{userbase}/{implementation}{py_version_nodot_plat}',
143
+ 'platstdlib': '{userbase}/{implementation}{py_version_nodot_plat}',
144
+ 'purelib': '{userbase}/{implementation}{py_version_nodot_plat}/site-packages',
145
+ 'platlib': '{userbase}/{implementation}{py_version_nodot_plat}/site-packages',
146
+ 'include': '{userbase}/{implementation}{py_version_nodot_plat}/Include',
147
+ 'scripts': '{userbase}/{implementation}{py_version_nodot_plat}/Scripts',
148
+ 'data': '{userbase}',
149
+ },
150
+ 'posix_user': {
151
+ 'stdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
152
+ 'platstdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
153
+ 'purelib': '{userbase}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
154
+ 'platlib': '{userbase}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
155
+ 'include': '{userbase}/include/{implementation_lower}{py_version_short}{abi_thread}',
156
+ 'scripts': '{userbase}/bin',
157
+ 'data': '{userbase}',
158
+ },
159
+ 'osx_framework_user': {
160
+ 'stdlib': '{userbase}/lib/{implementation_lower}',
161
+ 'platstdlib': '{userbase}/lib/{implementation_lower}',
162
+ 'purelib': '{userbase}/lib/{implementation_lower}/site-packages',
163
+ 'platlib': '{userbase}/lib/{implementation_lower}/site-packages',
164
+ 'include': '{userbase}/include/{implementation_lower}{py_version_short}',
165
+ 'scripts': '{userbase}/bin',
166
+ 'data': '{userbase}',
167
+ },
168
+ }
169
+
170
+ _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include',
171
+ 'scripts', 'data')
172
+
173
+ _PY_VERSION = sys.version.split()[0]
174
+ _PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}'
175
+ _PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}'
176
+ _BASE_PREFIX = os.path.normpath(sys.base_prefix)
177
+ _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
178
+ # Mutex guarding initialization of _CONFIG_VARS.
179
+ _CONFIG_VARS_LOCK = threading.RLock()
180
+ _CONFIG_VARS = None
181
+ # True iff _CONFIG_VARS has been fully initialized.
182
+ _CONFIG_VARS_INITIALIZED = False
183
+ _USER_BASE = None
184
+
185
+
186
+ def _safe_realpath(path):
187
+ try:
188
+ return realpath(path)
189
+ except OSError:
190
+ return path
191
+
192
+ if sys.executable:
193
+ _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
194
+ else:
195
+ # sys.executable can be empty if argv[0] has been changed and Python is
196
+ # unable to retrieve the real program name
197
+ _PROJECT_BASE = _safe_realpath(os.getcwd())
198
+
199
+ # In a virtual environment, `sys._home` gives us the target directory
200
+ # `_PROJECT_BASE` for the executable that created it when the virtual
201
+ # python is an actual executable ('venv --copies' or Windows).
202
+ _sys_home = getattr(sys, '_home', None)
203
+ if _sys_home:
204
+ _PROJECT_BASE = _sys_home
205
+
206
+ if os.name == 'nt':
207
+ # In a source build, the executable is in a subdirectory of the root
208
+ # that we want (<root>\PCbuild\<platname>).
209
+ # `_BASE_PREFIX` is used as the base installation is where the source
210
+ # will be. The realpath is needed to prevent mount point confusion
211
+ # that can occur with just string comparisons.
212
+ if _safe_realpath(_PROJECT_BASE).startswith(
213
+ _safe_realpath(f'{_BASE_PREFIX}\\PCbuild')):
214
+ _PROJECT_BASE = _BASE_PREFIX
215
+
216
+ # set for cross builds
217
+ if "_PYTHON_PROJECT_BASE" in os.environ:
218
+ _PROJECT_BASE = _safe_realpath(os.environ["_PYTHON_PROJECT_BASE"])
219
+
220
+ def is_python_build(check_home=None):
221
+ if check_home is not None:
222
+ import warnings
223
+ warnings.warn(
224
+ (
225
+ 'The check_home argument of sysconfig.is_python_build is '
226
+ 'deprecated and its value is ignored. '
227
+ 'It will be removed in Python 3.15.'
228
+ ),
229
+ DeprecationWarning,
230
+ stacklevel=2,
231
+ )
232
+ for fn in ("Setup", "Setup.local"):
233
+ if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)):
234
+ return True
235
+ return False
236
+
237
+ _PYTHON_BUILD = is_python_build()
238
+
239
+ if _PYTHON_BUILD:
240
+ for scheme in ('posix_prefix', 'posix_home'):
241
+ # On POSIX-y platforms, Python will:
242
+ # - Build from .h files in 'headers' (which is only added to the
243
+ # scheme when building CPython)
244
+ # - Install .h files to 'include'
245
+ scheme = _INSTALL_SCHEMES[scheme]
246
+ scheme['headers'] = scheme['include']
247
+ scheme['include'] = '{srcdir}/Include'
248
+ scheme['platinclude'] = '{projectbase}/.'
249
+ del scheme
250
+
251
+
252
+ def _subst_vars(s, local_vars):
253
+ try:
254
+ return s.format(**local_vars)
255
+ except KeyError as var:
256
+ try:
257
+ return s.format(**os.environ)
258
+ except KeyError:
259
+ raise AttributeError(f'{var}') from None
260
+
261
+ def _extend_dict(target_dict, other_dict):
262
+ target_keys = target_dict.keys()
263
+ for key, value in other_dict.items():
264
+ if key in target_keys:
265
+ continue
266
+ target_dict[key] = value
267
+
268
+
269
+ def _expand_vars(scheme, vars):
270
+ res = {}
271
+ if vars is None:
272
+ vars = {}
273
+ _extend_dict(vars, get_config_vars())
274
+ if os.name == 'nt':
275
+ # On Windows we want to substitute 'lib' for schemes rather
276
+ # than the native value (without modifying vars, in case it
277
+ # was passed in)
278
+ vars = vars | {'platlibdir': 'lib'}
279
+
280
+ for key, value in _INSTALL_SCHEMES[scheme].items():
281
+ if os.name in ('posix', 'nt'):
282
+ value = os.path.expanduser(value)
283
+ res[key] = os.path.normpath(_subst_vars(value, vars))
284
+ return res
285
+
286
+
287
+ def _get_preferred_schemes():
288
+ if os.name == 'nt':
289
+ return {
290
+ 'prefix': 'nt',
291
+ 'home': 'posix_home',
292
+ 'user': 'nt_user',
293
+ }
294
+ if sys.platform == 'darwin' and sys._framework:
295
+ return {
296
+ 'prefix': 'posix_prefix',
297
+ 'home': 'posix_home',
298
+ 'user': 'osx_framework_user',
299
+ }
300
+
301
+ return {
302
+ 'prefix': 'posix_prefix',
303
+ 'home': 'posix_home',
304
+ 'user': 'posix_user',
305
+ }
306
+
307
+
308
+ def get_preferred_scheme(key):
309
+ if key == 'prefix' and sys.prefix != sys.base_prefix:
310
+ return 'venv'
311
+ scheme = _get_preferred_schemes()[key]
312
+ if scheme not in _INSTALL_SCHEMES:
313
+ raise ValueError(
314
+ f"{key!r} returned {scheme!r}, which is not a valid scheme "
315
+ f"on this platform"
316
+ )
317
+ return scheme
318
+
319
+
320
+ def get_default_scheme():
321
+ return get_preferred_scheme('prefix')
322
+
323
+
324
+ def get_makefile_filename():
325
+ """Return the path of the Makefile."""
326
+ if _PYTHON_BUILD:
327
+ return os.path.join(_PROJECT_BASE, "Makefile")
328
+ if hasattr(sys, 'abiflags'):
329
+ config_dir_name = f'config-{_PY_VERSION_SHORT}{sys.abiflags}'
330
+ else:
331
+ config_dir_name = 'config'
332
+ if hasattr(sys.implementation, '_multiarch'):
333
+ config_dir_name += f'-{sys.implementation._multiarch}'
334
+ return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile')
335
+
336
+
337
+ def _get_sysconfigdata_name():
338
+ multiarch = getattr(sys.implementation, '_multiarch', '')
339
+ return os.environ.get(
340
+ '_PYTHON_SYSCONFIGDATA_NAME',
341
+ f'_sysconfigdata_{sys.abiflags}_{sys.platform}_{multiarch}',
342
+ )
343
+
344
+ def _init_posix(vars):
345
+ """Initialize the module as appropriate for POSIX systems."""
346
+ # _sysconfigdata is generated at build time, see _generate_posix_vars()
347
+ name = _get_sysconfigdata_name()
348
+
349
+ # For cross builds, the path to the target's sysconfigdata must be specified
350
+ # so it can be imported. It cannot be in PYTHONPATH, as foreign modules in
351
+ # sys.path can cause crashes when loaded by the host interpreter.
352
+ # Rely on truthiness as a valueless env variable is still an empty string.
353
+ # See OS X note in _generate_posix_vars re _sysconfigdata.
354
+ if (path := os.environ.get('_PYTHON_SYSCONFIGDATA_PATH')):
355
+ from importlib.machinery import FileFinder, SourceFileLoader, SOURCE_SUFFIXES
356
+ from importlib.util import module_from_spec
357
+ spec = FileFinder(path, (SourceFileLoader, SOURCE_SUFFIXES)).find_spec(name)
358
+ _temp = module_from_spec(spec)
359
+ spec.loader.exec_module(_temp)
360
+ else:
361
+ _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
362
+ build_time_vars = _temp.build_time_vars
363
+ vars.update(build_time_vars)
364
+
365
+ def _init_non_posix(vars):
366
+ """Initialize the module as appropriate for NT"""
367
+ # set basic install directories
368
+ import _winapi
369
+ import _sysconfig
370
+ vars['LIBDEST'] = get_path('stdlib')
371
+ vars['BINLIBDEST'] = get_path('platstdlib')
372
+ vars['INCLUDEPY'] = get_path('include')
373
+
374
+ # Add EXT_SUFFIX, SOABI, and Py_GIL_DISABLED
375
+ vars.update(_sysconfig.config_vars())
376
+
377
+ vars['LIBDIR'] = _safe_realpath(os.path.join(get_config_var('installed_base'), 'libs'))
378
+ if hasattr(sys, 'dllhandle'):
379
+ dllhandle = _winapi.GetModuleFileName(sys.dllhandle)
380
+ vars['LIBRARY'] = os.path.basename(_safe_realpath(dllhandle))
381
+ vars['LDLIBRARY'] = vars['LIBRARY']
382
+ vars['EXE'] = '.exe'
383
+ vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
384
+ vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
385
+ vars['TZPATH'] = ''
386
+
387
+ #
388
+ # public APIs
389
+ #
390
+
391
+
392
+ def parse_config_h(fp, vars=None):
393
+ """Parse a config.h-style file.
394
+
395
+ A dictionary containing name/value pairs is returned. If an
396
+ optional dictionary is passed in as the second argument, it is
397
+ used instead of a new dictionary.
398
+ """
399
+ if vars is None:
400
+ vars = {}
401
+ import re
402
+ define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
403
+ undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")
404
+
405
+ while True:
406
+ line = fp.readline()
407
+ if not line:
408
+ break
409
+ m = define_rx.match(line)
410
+ if m:
411
+ n, v = m.group(1, 2)
412
+ try:
413
+ if n in _ALWAYS_STR:
414
+ raise ValueError
415
+ v = int(v)
416
+ except ValueError:
417
+ pass
418
+ vars[n] = v
419
+ else:
420
+ m = undef_rx.match(line)
421
+ if m:
422
+ vars[m.group(1)] = 0
423
+ return vars
424
+
425
+
426
+ def get_config_h_filename():
427
+ """Return the path of pyconfig.h."""
428
+ if _PYTHON_BUILD:
429
+ if os.name == "nt":
430
+ inc_dir = os.path.dirname(sys._base_executable)
431
+ else:
432
+ inc_dir = _PROJECT_BASE
433
+ else:
434
+ inc_dir = get_path('platinclude')
435
+ return os.path.join(inc_dir, 'pyconfig.h')
436
+
437
+
438
+ def get_scheme_names():
439
+ """Return a tuple containing the schemes names."""
440
+ return tuple(sorted(_INSTALL_SCHEMES))
441
+
442
+
443
+ def get_path_names():
444
+ """Return a tuple containing the paths names."""
445
+ return _SCHEME_KEYS
446
+
447
+
448
+ def get_paths(scheme=get_default_scheme(), vars=None, expand=True):
449
+ """Return a mapping containing an install scheme.
450
+
451
+ ``scheme`` is the install scheme name. If not provided, it will
452
+ return the default scheme for the current platform.
453
+ """
454
+ if expand:
455
+ return _expand_vars(scheme, vars)
456
+ else:
457
+ return _INSTALL_SCHEMES[scheme]
458
+
459
+
460
+ def get_path(name, scheme=get_default_scheme(), vars=None, expand=True):
461
+ """Return a path corresponding to the scheme.
462
+
463
+ ``scheme`` is the install scheme name.
464
+ """
465
+ return get_paths(scheme, vars, expand)[name]
466
+
467
+
468
+ def _init_config_vars():
469
+ global _CONFIG_VARS
470
+ _CONFIG_VARS = {}
471
+ # Normalized versions of prefix and exec_prefix are handy to have;
472
+ # in fact, these are the standard versions used most places in the
473
+ # Distutils.
474
+ _PREFIX = os.path.normpath(sys.prefix)
475
+ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
476
+ _CONFIG_VARS['prefix'] = _PREFIX # FIXME: This gets overwriten by _init_posix.
477
+ _CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX # FIXME: This gets overwriten by _init_posix.
478
+ _CONFIG_VARS['py_version'] = _PY_VERSION
479
+ _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT
480
+ _CONFIG_VARS['py_version_nodot'] = _PY_VERSION_SHORT_NO_DOT
481
+ _CONFIG_VARS['installed_base'] = _BASE_PREFIX
482
+ _CONFIG_VARS['base'] = _PREFIX
483
+ _CONFIG_VARS['installed_platbase'] = _BASE_EXEC_PREFIX
484
+ _CONFIG_VARS['platbase'] = _EXEC_PREFIX
485
+ _CONFIG_VARS['projectbase'] = _PROJECT_BASE
486
+ _CONFIG_VARS['platlibdir'] = sys.platlibdir
487
+ _CONFIG_VARS['implementation'] = _get_implementation()
488
+ _CONFIG_VARS['implementation_lower'] = _get_implementation().lower()
489
+ try:
490
+ _CONFIG_VARS['abiflags'] = sys.abiflags
491
+ except AttributeError:
492
+ # sys.abiflags may not be defined on all platforms.
493
+ _CONFIG_VARS['abiflags'] = ''
494
+ try:
495
+ _CONFIG_VARS['py_version_nodot_plat'] = sys.winver.replace('.', '')
496
+ except AttributeError:
497
+ _CONFIG_VARS['py_version_nodot_plat'] = ''
498
+
499
+ if os.name == 'nt':
500
+ _init_non_posix(_CONFIG_VARS)
501
+ _CONFIG_VARS['VPATH'] = sys._vpath
502
+ if os.name == 'posix':
503
+ _init_posix(_CONFIG_VARS)
504
+ if _HAS_USER_BASE:
505
+ # Setting 'userbase' is done below the call to the
506
+ # init function to enable using 'get_config_var' in
507
+ # the init-function.
508
+ _CONFIG_VARS['userbase'] = _getuserbase()
509
+
510
+ # e.g., 't' for free-threaded or '' for default build
511
+ _CONFIG_VARS['abi_thread'] = 't' if _CONFIG_VARS.get('Py_GIL_DISABLED') else ''
512
+
513
+ # Always convert srcdir to an absolute path
514
+ srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
515
+ if os.name == 'posix':
516
+ if _PYTHON_BUILD:
517
+ # If srcdir is a relative path (typically '.' or '..')
518
+ # then it should be interpreted relative to the directory
519
+ # containing Makefile.
520
+ base = os.path.dirname(get_makefile_filename())
521
+ srcdir = os.path.join(base, srcdir)
522
+ else:
523
+ # srcdir is not meaningful since the installation is
524
+ # spread about the filesystem. We choose the
525
+ # directory containing the Makefile since we know it
526
+ # exists.
527
+ srcdir = os.path.dirname(get_makefile_filename())
528
+ _CONFIG_VARS['srcdir'] = _safe_realpath(srcdir)
529
+
530
+ # OS X platforms require special customization to handle
531
+ # multi-architecture, multi-os-version installers
532
+ if sys.platform == 'darwin':
533
+ import _osx_support
534
+ _osx_support.customize_config_vars(_CONFIG_VARS)
535
+
536
+ global _CONFIG_VARS_INITIALIZED
537
+ _CONFIG_VARS_INITIALIZED = True
538
+
539
+
540
+ def get_config_vars(*args):
541
+ """With no arguments, return a dictionary of all configuration
542
+ variables relevant for the current platform.
543
+
544
+ On Unix, this means every variable defined in Python's installed Makefile;
545
+ On Windows it's a much smaller set.
546
+
547
+ With arguments, return a list of values that result from looking up
548
+ each argument in the configuration variable dictionary.
549
+ """
550
+ global _CONFIG_VARS_INITIALIZED
551
+
552
+ # Avoid claiming the lock once initialization is complete.
553
+ if not _CONFIG_VARS_INITIALIZED:
554
+ with _CONFIG_VARS_LOCK:
555
+ # Test again with the lock held to avoid races. Note that
556
+ # we test _CONFIG_VARS here, not _CONFIG_VARS_INITIALIZED,
557
+ # to ensure that recursive calls to get_config_vars()
558
+ # don't re-enter init_config_vars().
559
+ if _CONFIG_VARS is None:
560
+ _init_config_vars()
561
+ else:
562
+ # If the site module initialization happened after _CONFIG_VARS was
563
+ # initialized, a virtual environment might have been activated, resulting in
564
+ # variables like sys.prefix changing their value, so we need to re-init the
565
+ # config vars (see GH-126789).
566
+ if _CONFIG_VARS['base'] != os.path.normpath(sys.prefix):
567
+ with _CONFIG_VARS_LOCK:
568
+ _CONFIG_VARS_INITIALIZED = False
569
+ _init_config_vars()
570
+
571
+ if args:
572
+ vals = []
573
+ for name in args:
574
+ vals.append(_CONFIG_VARS.get(name))
575
+ return vals
576
+ else:
577
+ return _CONFIG_VARS
578
+
579
+
580
+ def get_config_var(name):
581
+ """Return the value of a single variable using the dictionary returned by
582
+ 'get_config_vars()'.
583
+
584
+ Equivalent to get_config_vars().get(name)
585
+ """
586
+ return get_config_vars().get(name)
587
+
588
+
589
+ def get_platform():
590
+ """Return a string that identifies the current platform.
591
+
592
+ This is used mainly to distinguish platform-specific build directories and
593
+ platform-specific built distributions. Typically includes the OS name and
594
+ version and the architecture (as supplied by 'os.uname()'), although the
595
+ exact information included depends on the OS; on Linux, the kernel version
596
+ isn't particularly important.
597
+
598
+ Examples of returned values:
599
+
600
+
601
+ Windows:
602
+
603
+ - win-amd64 (64-bit Windows on AMD64, aka x86_64, Intel64, and EM64T)
604
+ - win-arm64 (64-bit Windows on ARM64, aka AArch64)
605
+ - win32 (all others - specifically, sys.platform is returned)
606
+
607
+ POSIX based OS:
608
+
609
+ - linux-x86_64
610
+ - macosx-15.5-arm64
611
+ - macosx-26.0-universal2 (macOS on Apple Silicon or Intel)
612
+ - android-24-arm64_v8a
613
+
614
+ For other non-POSIX platforms, currently just returns :data:`sys.platform`."""
615
+ if os.name == 'nt':
616
+ if 'amd64' in sys.version.lower():
617
+ return 'win-amd64'
618
+ if '(arm)' in sys.version.lower():
619
+ return 'win-arm32'
620
+ if '(arm64)' in sys.version.lower():
621
+ return 'win-arm64'
622
+ return sys.platform
623
+
624
+ if os.name != "posix" or not hasattr(os, 'uname'):
625
+ # XXX what about the architecture? NT is Intel or Alpha
626
+ return sys.platform
627
+
628
+ # Set for cross builds explicitly
629
+ if "_PYTHON_HOST_PLATFORM" in os.environ:
630
+ return os.environ["_PYTHON_HOST_PLATFORM"]
631
+
632
+ # Try to distinguish various flavours of Unix
633
+ osname, host, release, version, machine = os.uname()
634
+
635
+ # Convert the OS name to lowercase, remove '/' characters, and translate
636
+ # spaces (for "Power Macintosh")
637
+ osname = osname.lower().replace('/', '')
638
+ machine = machine.replace(' ', '_')
639
+ machine = machine.replace('/', '-')
640
+
641
+ if osname[:5] == "linux":
642
+ if sys.platform == "android":
643
+ osname = "android"
644
+ release = get_config_var("ANDROID_API_LEVEL")
645
+
646
+ # Wheel tags use the ABI names from Android's own tools.
647
+ # When Python is running on 32-bit ARM Android on a 64-bit ARM kernel,
648
+ # 'os.uname().machine' is 'armv8l'. Such devices run the same userspace
649
+ # code as 'armv7l' devices.
650
+ # During the build process of the Android testbed when targeting 32-bit ARM,
651
+ # '_PYTHON_HOST_PLATFORM' is 'arm-linux-androideabi', so 'machine' becomes
652
+ # 'arm'.
653
+ machine = {
654
+ "aarch64": "arm64_v8a",
655
+ "arm": "armeabi_v7a",
656
+ "armv7l": "armeabi_v7a",
657
+ "armv8l": "armeabi_v7a",
658
+ "i686": "x86",
659
+ "x86_64": "x86_64",
660
+ }[machine]
661
+ else:
662
+ # At least on Linux/Intel, 'machine' is the processor --
663
+ # i386, etc.
664
+ # XXX what about Alpha, SPARC, etc?
665
+ return f"{osname}-{machine}"
666
+ elif osname[:5] == "sunos":
667
+ if release[0] >= "5": # SunOS 5 == Solaris 2
668
+ osname = "solaris"
669
+ release = f"{int(release[0]) - 3}.{release[2:]}"
670
+ # We can't use "platform.architecture()[0]" because a
671
+ # bootstrap problem. We use a dict to get an error
672
+ # if some suspicious happens.
673
+ bitness = {2147483647:"32bit", 9223372036854775807:"64bit"}
674
+ machine += f".{bitness[sys.maxsize]}"
675
+ # fall through to standard osname-release-machine representation
676
+ elif osname[:3] == "aix":
677
+ from _aix_support import aix_platform
678
+ return aix_platform()
679
+ elif osname[:6] == "cygwin":
680
+ osname = "cygwin"
681
+ import re
682
+ rel_re = re.compile(r'[\d.]+')
683
+ m = rel_re.match(release)
684
+ if m:
685
+ release = m.group()
686
+ elif osname[:6] == "darwin":
687
+ if sys.platform == "ios":
688
+ release = get_config_vars().get("IPHONEOS_DEPLOYMENT_TARGET", "13.0")
689
+ osname = sys.platform
690
+ machine = sys.implementation._multiarch
691
+ else:
692
+ import _osx_support
693
+ osname, release, machine = _osx_support.get_platform_osx(
694
+ get_config_vars(),
695
+ osname, release, machine)
696
+
697
+ return f"{osname}-{release}-{machine}"
698
+
699
+
700
+ def get_python_version():
701
+ return _PY_VERSION_SHORT
702
+
703
+
704
+ def _get_python_version_abi():
705
+ return _PY_VERSION_SHORT + get_config_var("abi_thread")
706
+
707
+
708
+ def expand_makefile_vars(s, vars):
709
+ """Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in
710
+ 'string' according to 'vars' (a dictionary mapping variable names to
711
+ values). Variables not present in 'vars' are silently expanded to the
712
+ empty string. The variable values in 'vars' should not contain further
713
+ variable expansions; if 'vars' is the output of 'parse_makefile()',
714
+ you're fine. Returns a variable-expanded version of 's'.
715
+ """
716
+ import re
717
+
718
+ _findvar1_rx = r"\$\(([A-Za-z][A-Za-z0-9_]*)\)"
719
+ _findvar2_rx = r"\${([A-Za-z][A-Za-z0-9_]*)}"
720
+
721
+ # This algorithm does multiple expansion, so if vars['foo'] contains
722
+ # "${bar}", it will expand ${foo} to ${bar}, and then expand
723
+ # ${bar}... and so forth. This is fine as long as 'vars' comes from
724
+ # 'parse_makefile()', which takes care of such expansions eagerly,
725
+ # according to make's variable expansion semantics.
726
+
727
+ while True:
728
+ m = re.search(_findvar1_rx, s) or re.search(_findvar2_rx, s)
729
+ if m:
730
+ (beg, end) = m.span()
731
+ s = s[0:beg] + vars.get(m.group(1)) + s[end:]
732
+ else:
733
+ break
734
+ return s