cli-ih 0.6.3.1__py3-none-any.whl → 0.7.0__py3-none-any.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 (426) hide show
  1. cli_ih/__init__.py +1 -0
  2. cli_ih/asyncClient.py +73 -10
  3. cli_ih/client.py +63 -18
  4. cli_ih/utils.py +51 -0
  5. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/METADATA +1 -1
  6. cli_ih-0.7.0.dist-info/RECORD +9 -0
  7. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/top_level.txt +0 -1
  8. cli_ih-0.6.3.1.dist-info/RECORD +0 -425
  9. venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +0 -85
  10. venv/Lib/site-packages/pip/__init__.py +0 -13
  11. venv/Lib/site-packages/pip/__main__.py +0 -24
  12. venv/Lib/site-packages/pip/__pip-runner__.py +0 -50
  13. venv/Lib/site-packages/pip/_internal/__init__.py +0 -18
  14. venv/Lib/site-packages/pip/_internal/build_env.py +0 -349
  15. venv/Lib/site-packages/pip/_internal/cache.py +0 -291
  16. venv/Lib/site-packages/pip/_internal/cli/__init__.py +0 -3
  17. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +0 -184
  18. venv/Lib/site-packages/pip/_internal/cli/base_command.py +0 -244
  19. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +0 -1138
  20. venv/Lib/site-packages/pip/_internal/cli/command_context.py +0 -28
  21. venv/Lib/site-packages/pip/_internal/cli/index_command.py +0 -175
  22. venv/Lib/site-packages/pip/_internal/cli/main.py +0 -80
  23. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +0 -134
  24. venv/Lib/site-packages/pip/_internal/cli/parser.py +0 -298
  25. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +0 -151
  26. venv/Lib/site-packages/pip/_internal/cli/req_command.py +0 -351
  27. venv/Lib/site-packages/pip/_internal/cli/spinners.py +0 -235
  28. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +0 -6
  29. venv/Lib/site-packages/pip/_internal/commands/__init__.py +0 -139
  30. venv/Lib/site-packages/pip/_internal/commands/cache.py +0 -231
  31. venv/Lib/site-packages/pip/_internal/commands/check.py +0 -66
  32. venv/Lib/site-packages/pip/_internal/commands/completion.py +0 -135
  33. venv/Lib/site-packages/pip/_internal/commands/configuration.py +0 -288
  34. venv/Lib/site-packages/pip/_internal/commands/debug.py +0 -203
  35. venv/Lib/site-packages/pip/_internal/commands/download.py +0 -145
  36. venv/Lib/site-packages/pip/_internal/commands/freeze.py +0 -107
  37. venv/Lib/site-packages/pip/_internal/commands/hash.py +0 -58
  38. venv/Lib/site-packages/pip/_internal/commands/help.py +0 -40
  39. venv/Lib/site-packages/pip/_internal/commands/index.py +0 -159
  40. venv/Lib/site-packages/pip/_internal/commands/inspect.py +0 -92
  41. venv/Lib/site-packages/pip/_internal/commands/install.py +0 -798
  42. venv/Lib/site-packages/pip/_internal/commands/list.py +0 -400
  43. venv/Lib/site-packages/pip/_internal/commands/lock.py +0 -170
  44. venv/Lib/site-packages/pip/_internal/commands/search.py +0 -178
  45. venv/Lib/site-packages/pip/_internal/commands/show.py +0 -231
  46. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +0 -113
  47. venv/Lib/site-packages/pip/_internal/commands/wheel.py +0 -181
  48. venv/Lib/site-packages/pip/_internal/configuration.py +0 -397
  49. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +0 -21
  50. venv/Lib/site-packages/pip/_internal/distributions/base.py +0 -55
  51. venv/Lib/site-packages/pip/_internal/distributions/installed.py +0 -33
  52. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +0 -165
  53. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +0 -44
  54. venv/Lib/site-packages/pip/_internal/exceptions.py +0 -881
  55. venv/Lib/site-packages/pip/_internal/index/__init__.py +0 -1
  56. venv/Lib/site-packages/pip/_internal/index/collector.py +0 -489
  57. venv/Lib/site-packages/pip/_internal/index/package_finder.py +0 -1059
  58. venv/Lib/site-packages/pip/_internal/index/sources.py +0 -287
  59. venv/Lib/site-packages/pip/_internal/locations/__init__.py +0 -441
  60. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +0 -173
  61. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +0 -215
  62. venv/Lib/site-packages/pip/_internal/locations/base.py +0 -82
  63. venv/Lib/site-packages/pip/_internal/main.py +0 -12
  64. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +0 -164
  65. venv/Lib/site-packages/pip/_internal/metadata/_json.py +0 -87
  66. venv/Lib/site-packages/pip/_internal/metadata/base.py +0 -685
  67. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
  68. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -87
  69. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -223
  70. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -143
  71. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +0 -298
  72. venv/Lib/site-packages/pip/_internal/models/__init__.py +0 -1
  73. venv/Lib/site-packages/pip/_internal/models/candidate.py +0 -25
  74. venv/Lib/site-packages/pip/_internal/models/direct_url.py +0 -227
  75. venv/Lib/site-packages/pip/_internal/models/format_control.py +0 -78
  76. venv/Lib/site-packages/pip/_internal/models/index.py +0 -28
  77. venv/Lib/site-packages/pip/_internal/models/installation_report.py +0 -57
  78. venv/Lib/site-packages/pip/_internal/models/link.py +0 -613
  79. venv/Lib/site-packages/pip/_internal/models/pylock.py +0 -188
  80. venv/Lib/site-packages/pip/_internal/models/scheme.py +0 -25
  81. venv/Lib/site-packages/pip/_internal/models/search_scope.py +0 -126
  82. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -53
  83. venv/Lib/site-packages/pip/_internal/models/target_python.py +0 -122
  84. venv/Lib/site-packages/pip/_internal/models/wheel.py +0 -141
  85. venv/Lib/site-packages/pip/_internal/network/__init__.py +0 -1
  86. venv/Lib/site-packages/pip/_internal/network/auth.py +0 -564
  87. venv/Lib/site-packages/pip/_internal/network/cache.py +0 -133
  88. venv/Lib/site-packages/pip/_internal/network/download.py +0 -342
  89. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +0 -213
  90. venv/Lib/site-packages/pip/_internal/network/session.py +0 -528
  91. venv/Lib/site-packages/pip/_internal/network/utils.py +0 -98
  92. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +0 -61
  93. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  94. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  95. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +0 -140
  96. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +0 -38
  97. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
  98. venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -73
  99. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +0 -38
  100. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -47
  101. venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -119
  102. venv/Lib/site-packages/pip/_internal/operations/check.py +0 -175
  103. venv/Lib/site-packages/pip/_internal/operations/freeze.py +0 -259
  104. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +0 -1
  105. venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -48
  106. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +0 -746
  107. venv/Lib/site-packages/pip/_internal/operations/prepare.py +0 -742
  108. venv/Lib/site-packages/pip/_internal/pyproject.py +0 -182
  109. venv/Lib/site-packages/pip/_internal/req/__init__.py +0 -105
  110. venv/Lib/site-packages/pip/_internal/req/constructors.py +0 -562
  111. venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +0 -75
  112. venv/Lib/site-packages/pip/_internal/req/req_file.py +0 -620
  113. venv/Lib/site-packages/pip/_internal/req/req_install.py +0 -937
  114. venv/Lib/site-packages/pip/_internal/req/req_set.py +0 -81
  115. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +0 -639
  116. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  117. venv/Lib/site-packages/pip/_internal/resolution/base.py +0 -20
  118. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  119. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -598
  120. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  121. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -142
  122. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -582
  123. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -814
  124. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -166
  125. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -276
  126. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -85
  127. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -247
  128. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -336
  129. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +0 -254
  130. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  131. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
  132. venv/Lib/site-packages/pip/_internal/utils/_log.py +0 -38
  133. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +0 -52
  134. venv/Lib/site-packages/pip/_internal/utils/compat.py +0 -85
  135. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -201
  136. venv/Lib/site-packages/pip/_internal/utils/datetime.py +0 -10
  137. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +0 -126
  138. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
  139. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +0 -81
  140. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +0 -88
  141. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +0 -152
  142. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +0 -24
  143. venv/Lib/site-packages/pip/_internal/utils/glibc.py +0 -102
  144. venv/Lib/site-packages/pip/_internal/utils/hashes.py +0 -150
  145. venv/Lib/site-packages/pip/_internal/utils/logging.py +0 -364
  146. venv/Lib/site-packages/pip/_internal/utils/misc.py +0 -765
  147. venv/Lib/site-packages/pip/_internal/utils/packaging.py +0 -44
  148. venv/Lib/site-packages/pip/_internal/utils/retry.py +0 -45
  149. venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +0 -149
  150. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +0 -248
  151. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +0 -294
  152. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +0 -337
  153. venv/Lib/site-packages/pip/_internal/utils/urls.py +0 -55
  154. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +0 -105
  155. venv/Lib/site-packages/pip/_internal/utils/wheel.py +0 -132
  156. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +0 -15
  157. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +0 -130
  158. venv/Lib/site-packages/pip/_internal/vcs/git.py +0 -571
  159. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -186
  160. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +0 -335
  161. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
  162. venv/Lib/site-packages/pip/_internal/wheel_builder.py +0 -334
  163. venv/Lib/site-packages/pip/_vendor/__init__.py +0 -117
  164. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -29
  165. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
  166. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -168
  167. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +0 -75
  168. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
  169. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -145
  170. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
  171. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -511
  172. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
  173. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -157
  174. venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  175. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
  176. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
  177. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +0 -4
  178. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +0 -12
  179. venv/Lib/site-packages/pip/_vendor/certifi/core.py +0 -83
  180. venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
  181. venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +0 -13
  182. venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +0 -65
  183. venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +0 -209
  184. venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +0 -59
  185. venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +0 -62
  186. venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +0 -9
  187. venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
  188. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +0 -33
  189. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +0 -1137
  190. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +0 -358
  191. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +0 -447
  192. venv/Lib/site-packages/pip/_vendor/distlib/util.py +0 -1984
  193. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +0 -54
  194. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +0 -4
  195. venv/Lib/site-packages/pip/_vendor/distro/distro.py +0 -1403
  196. venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
  197. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +0 -45
  198. venv/Lib/site-packages/pip/_vendor/idna/codec.py +0 -122
  199. venv/Lib/site-packages/pip/_vendor/idna/compat.py +0 -15
  200. venv/Lib/site-packages/pip/_vendor/idna/core.py +0 -437
  201. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +0 -4243
  202. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +0 -57
  203. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +0 -1
  204. venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
  205. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +0 -8681
  206. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
  207. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
  208. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +0 -170
  209. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +0 -929
  210. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +0 -15
  211. venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +0 -109
  212. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
  213. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
  214. venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +0 -353
  215. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +0 -61
  216. venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -195
  217. venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +0 -145
  218. venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +0 -759
  219. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +0 -362
  220. venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +0 -862
  221. venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
  222. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +0 -91
  223. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +0 -1019
  224. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -656
  225. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +0 -163
  226. venv/Lib/site-packages/pip/_vendor/packaging/version.py +0 -582
  227. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
  228. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +0 -631
  229. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
  230. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +0 -249
  231. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +0 -299
  232. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +0 -144
  233. venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  234. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +0 -272
  235. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +0 -21
  236. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
  237. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +0 -82
  238. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +0 -17
  239. venv/Lib/site-packages/pip/_vendor/pygments/console.py +0 -70
  240. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +0 -70
  241. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
  242. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +0 -129
  243. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
  244. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
  245. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +0 -963
  246. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
  247. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -602
  248. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1201
  249. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +0 -43
  250. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +0 -72
  251. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
  252. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +0 -104
  253. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
  254. venv/Lib/site-packages/pip/_vendor/pygments/style.py +0 -203
  255. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
  256. venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
  257. venv/Lib/site-packages/pip/_vendor/pygments/token.py +0 -214
  258. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +0 -153
  259. venv/Lib/site-packages/pip/_vendor/pygments/util.py +0 -324
  260. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -31
  261. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -410
  262. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -21
  263. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -389
  264. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  265. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +0 -179
  266. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +0 -14
  267. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
  268. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +0 -719
  269. venv/Lib/site-packages/pip/_vendor/requests/api.py +0 -157
  270. venv/Lib/site-packages/pip/_vendor/requests/auth.py +0 -314
  271. venv/Lib/site-packages/pip/_vendor/requests/certs.py +0 -17
  272. venv/Lib/site-packages/pip/_vendor/requests/compat.py +0 -90
  273. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +0 -561
  274. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +0 -151
  275. venv/Lib/site-packages/pip/_vendor/requests/help.py +0 -127
  276. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +0 -33
  277. venv/Lib/site-packages/pip/_vendor/requests/models.py +0 -1039
  278. venv/Lib/site-packages/pip/_vendor/requests/packages.py +0 -25
  279. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +0 -831
  280. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +0 -128
  281. venv/Lib/site-packages/pip/_vendor/requests/structures.py +0 -99
  282. venv/Lib/site-packages/pip/_vendor/requests/utils.py +0 -1086
  283. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +0 -27
  284. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +0 -196
  285. venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  286. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +0 -55
  287. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +0 -27
  288. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +0 -47
  289. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +0 -48
  290. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +0 -57
  291. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +0 -622
  292. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +0 -209
  293. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +0 -177
  294. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +0 -245
  295. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
  296. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
  297. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
  298. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +0 -76
  299. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +0 -10
  300. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +0 -24
  301. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +0 -268
  302. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +0 -94
  303. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +0 -43
  304. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +0 -69
  305. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +0 -309
  306. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +0 -17
  307. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +0 -153
  308. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +0 -482
  309. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +0 -16
  310. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +0 -19
  311. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +0 -661
  312. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +0 -71
  313. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
  314. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +0 -93
  315. venv/Lib/site-packages/pip/_vendor/rich/abc.py +0 -33
  316. venv/Lib/site-packages/pip/_vendor/rich/align.py +0 -306
  317. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +0 -241
  318. venv/Lib/site-packages/pip/_vendor/rich/bar.py +0 -93
  319. venv/Lib/site-packages/pip/_vendor/rich/box.py +0 -474
  320. venv/Lib/site-packages/pip/_vendor/rich/cells.py +0 -174
  321. venv/Lib/site-packages/pip/_vendor/rich/color.py +0 -621
  322. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
  323. venv/Lib/site-packages/pip/_vendor/rich/columns.py +0 -187
  324. venv/Lib/site-packages/pip/_vendor/rich/console.py +0 -2680
  325. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +0 -37
  326. venv/Lib/site-packages/pip/_vendor/rich/containers.py +0 -167
  327. venv/Lib/site-packages/pip/_vendor/rich/control.py +0 -219
  328. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +0 -193
  329. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +0 -39
  330. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +0 -91
  331. venv/Lib/site-packages/pip/_vendor/rich/errors.py +0 -34
  332. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
  333. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +0 -88
  334. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +0 -232
  335. venv/Lib/site-packages/pip/_vendor/rich/json.py +0 -139
  336. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +0 -101
  337. venv/Lib/site-packages/pip/_vendor/rich/layout.py +0 -442
  338. venv/Lib/site-packages/pip/_vendor/rich/live.py +0 -400
  339. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +0 -106
  340. venv/Lib/site-packages/pip/_vendor/rich/logging.py +0 -297
  341. venv/Lib/site-packages/pip/_vendor/rich/markup.py +0 -251
  342. venv/Lib/site-packages/pip/_vendor/rich/measure.py +0 -151
  343. venv/Lib/site-packages/pip/_vendor/rich/padding.py +0 -141
  344. venv/Lib/site-packages/pip/_vendor/rich/pager.py +0 -34
  345. venv/Lib/site-packages/pip/_vendor/rich/palette.py +0 -100
  346. venv/Lib/site-packages/pip/_vendor/rich/panel.py +0 -317
  347. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +0 -1016
  348. venv/Lib/site-packages/pip/_vendor/rich/progress.py +0 -1715
  349. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
  350. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +0 -400
  351. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +0 -42
  352. venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
  353. venv/Lib/site-packages/pip/_vendor/rich/region.py +0 -10
  354. venv/Lib/site-packages/pip/_vendor/rich/repr.py +0 -149
  355. venv/Lib/site-packages/pip/_vendor/rich/rule.py +0 -130
  356. venv/Lib/site-packages/pip/_vendor/rich/scope.py +0 -86
  357. venv/Lib/site-packages/pip/_vendor/rich/screen.py +0 -54
  358. venv/Lib/site-packages/pip/_vendor/rich/segment.py +0 -752
  359. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +0 -132
  360. venv/Lib/site-packages/pip/_vendor/rich/status.py +0 -131
  361. venv/Lib/site-packages/pip/_vendor/rich/style.py +0 -796
  362. venv/Lib/site-packages/pip/_vendor/rich/styled.py +0 -42
  363. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +0 -985
  364. venv/Lib/site-packages/pip/_vendor/rich/table.py +0 -1006
  365. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
  366. venv/Lib/site-packages/pip/_vendor/rich/text.py +0 -1361
  367. venv/Lib/site-packages/pip/_vendor/rich/theme.py +0 -115
  368. venv/Lib/site-packages/pip/_vendor/rich/themes.py +0 -5
  369. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +0 -899
  370. venv/Lib/site-packages/pip/_vendor/rich/tree.py +0 -257
  371. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +0 -8
  372. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +0 -770
  373. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +0 -112
  374. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +0 -10
  375. venv/Lib/site-packages/pip/_vendor/tomli/py.typed +0 -1
  376. venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +0 -4
  377. venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +0 -229
  378. venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +0 -1
  379. venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +0 -36
  380. venv/Lib/site-packages/pip/_vendor/truststore/_api.py +0 -333
  381. venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +0 -571
  382. venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
  383. venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
  384. venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +0 -567
  385. venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
  386. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
  387. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
  388. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +0 -2
  389. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +0 -572
  390. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
  391. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  392. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
  393. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  394. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
  395. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  396. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
  397. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
  398. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
  399. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
  400. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
  401. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
  402. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +0 -274
  403. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
  404. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  405. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  406. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
  407. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
  408. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
  409. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
  410. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +0 -191
  411. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +0 -879
  412. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
  413. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
  414. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
  415. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
  416. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
  417. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
  418. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
  419. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
  420. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
  421. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
  422. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
  423. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
  424. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
  425. venv/Lib/site-packages/pip/py.typed +0 -4
  426. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/WHEEL +0 -0
@@ -1,685 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import csv
4
- import email.message
5
- import functools
6
- import json
7
- import logging
8
- import pathlib
9
- import re
10
- import zipfile
11
- from collections.abc import Collection, Container, Iterable, Iterator
12
- from typing import (
13
- IO,
14
- Any,
15
- NamedTuple,
16
- Protocol,
17
- Union,
18
- )
19
-
20
- from pip._vendor.packaging.requirements import Requirement
21
- from pip._vendor.packaging.specifiers import InvalidSpecifier, SpecifierSet
22
- from pip._vendor.packaging.utils import NormalizedName, canonicalize_name
23
- from pip._vendor.packaging.version import Version
24
-
25
- from pip._internal.exceptions import NoneMetadataError
26
- from pip._internal.locations import site_packages, user_site
27
- from pip._internal.models.direct_url import (
28
- DIRECT_URL_METADATA_NAME,
29
- DirectUrl,
30
- DirectUrlValidationError,
31
- )
32
- from pip._internal.utils.compat import stdlib_pkgs # TODO: Move definition here.
33
- from pip._internal.utils.egg_link import egg_link_path_from_sys_path
34
- from pip._internal.utils.misc import is_local, normalize_path
35
- from pip._internal.utils.urls import url_to_path
36
-
37
- from ._json import msg_to_json
38
-
39
- InfoPath = Union[str, pathlib.PurePath]
40
-
41
- logger = logging.getLogger(__name__)
42
-
43
-
44
- class BaseEntryPoint(Protocol):
45
- @property
46
- def name(self) -> str:
47
- raise NotImplementedError()
48
-
49
- @property
50
- def value(self) -> str:
51
- raise NotImplementedError()
52
-
53
- @property
54
- def group(self) -> str:
55
- raise NotImplementedError()
56
-
57
-
58
- def _convert_installed_files_path(
59
- entry: tuple[str, ...],
60
- info: tuple[str, ...],
61
- ) -> str:
62
- """Convert a legacy installed-files.txt path into modern RECORD path.
63
-
64
- The legacy format stores paths relative to the info directory, while the
65
- modern format stores paths relative to the package root, e.g. the
66
- site-packages directory.
67
-
68
- :param entry: Path parts of the installed-files.txt entry.
69
- :param info: Path parts of the egg-info directory relative to package root.
70
- :returns: The converted entry.
71
-
72
- For best compatibility with symlinks, this does not use ``abspath()`` or
73
- ``Path.resolve()``, but tries to work with path parts:
74
-
75
- 1. While ``entry`` starts with ``..``, remove the equal amounts of parts
76
- from ``info``; if ``info`` is empty, start appending ``..`` instead.
77
- 2. Join the two directly.
78
- """
79
- while entry and entry[0] == "..":
80
- if not info or info[-1] == "..":
81
- info += ("..",)
82
- else:
83
- info = info[:-1]
84
- entry = entry[1:]
85
- return str(pathlib.Path(*info, *entry))
86
-
87
-
88
- class RequiresEntry(NamedTuple):
89
- requirement: str
90
- extra: str
91
- marker: str
92
-
93
-
94
- class BaseDistribution(Protocol):
95
- @classmethod
96
- def from_directory(cls, directory: str) -> BaseDistribution:
97
- """Load the distribution from a metadata directory.
98
-
99
- :param directory: Path to a metadata directory, e.g. ``.dist-info``.
100
- """
101
- raise NotImplementedError()
102
-
103
- @classmethod
104
- def from_metadata_file_contents(
105
- cls,
106
- metadata_contents: bytes,
107
- filename: str,
108
- project_name: str,
109
- ) -> BaseDistribution:
110
- """Load the distribution from the contents of a METADATA file.
111
-
112
- This is used to implement PEP 658 by generating a "shallow" dist object that can
113
- be used for resolution without downloading or building the actual dist yet.
114
-
115
- :param metadata_contents: The contents of a METADATA file.
116
- :param filename: File name for the dist with this metadata.
117
- :param project_name: Name of the project this dist represents.
118
- """
119
- raise NotImplementedError()
120
-
121
- @classmethod
122
- def from_wheel(cls, wheel: Wheel, name: str) -> BaseDistribution:
123
- """Load the distribution from a given wheel.
124
-
125
- :param wheel: A concrete wheel definition.
126
- :param name: File name of the wheel.
127
-
128
- :raises InvalidWheel: Whenever loading of the wheel causes a
129
- :py:exc:`zipfile.BadZipFile` exception to be thrown.
130
- :raises UnsupportedWheel: If the wheel is a valid zip, but malformed
131
- internally.
132
- """
133
- raise NotImplementedError()
134
-
135
- def __repr__(self) -> str:
136
- return f"{self.raw_name} {self.raw_version} ({self.location})"
137
-
138
- def __str__(self) -> str:
139
- return f"{self.raw_name} {self.raw_version}"
140
-
141
- @property
142
- def location(self) -> str | None:
143
- """Where the distribution is loaded from.
144
-
145
- A string value is not necessarily a filesystem path, since distributions
146
- can be loaded from other sources, e.g. arbitrary zip archives. ``None``
147
- means the distribution is created in-memory.
148
-
149
- Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If
150
- this is a symbolic link, we want to preserve the relative path between
151
- it and files in the distribution.
152
- """
153
- raise NotImplementedError()
154
-
155
- @property
156
- def editable_project_location(self) -> str | None:
157
- """The project location for editable distributions.
158
-
159
- This is the directory where pyproject.toml or setup.py is located.
160
- None if the distribution is not installed in editable mode.
161
- """
162
- # TODO: this property is relatively costly to compute, memoize it ?
163
- direct_url = self.direct_url
164
- if direct_url:
165
- if direct_url.is_local_editable():
166
- return url_to_path(direct_url.url)
167
- else:
168
- # Search for an .egg-link file by walking sys.path, as it was
169
- # done before by dist_is_editable().
170
- egg_link_path = egg_link_path_from_sys_path(self.raw_name)
171
- if egg_link_path:
172
- # TODO: get project location from second line of egg_link file
173
- # (https://github.com/pypa/pip/issues/10243)
174
- return self.location
175
- return None
176
-
177
- @property
178
- def installed_location(self) -> str | None:
179
- """The distribution's "installed" location.
180
-
181
- This should generally be a ``site-packages`` directory. This is
182
- usually ``dist.location``, except for legacy develop-installed packages,
183
- where ``dist.location`` is the source code location, and this is where
184
- the ``.egg-link`` file is.
185
-
186
- The returned location is normalized (in particular, with symlinks removed).
187
- """
188
- raise NotImplementedError()
189
-
190
- @property
191
- def info_location(self) -> str | None:
192
- """Location of the .[egg|dist]-info directory or file.
193
-
194
- Similarly to ``location``, a string value is not necessarily a
195
- filesystem path. ``None`` means the distribution is created in-memory.
196
-
197
- For a modern .dist-info installation on disk, this should be something
198
- like ``{location}/{raw_name}-{version}.dist-info``.
199
-
200
- Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If
201
- this is a symbolic link, we want to preserve the relative path between
202
- it and other files in the distribution.
203
- """
204
- raise NotImplementedError()
205
-
206
- @property
207
- def installed_by_distutils(self) -> bool:
208
- """Whether this distribution is installed with legacy distutils format.
209
-
210
- A distribution installed with "raw" distutils not patched by setuptools
211
- uses one single file at ``info_location`` to store metadata. We need to
212
- treat this specially on uninstallation.
213
- """
214
- info_location = self.info_location
215
- if not info_location:
216
- return False
217
- return pathlib.Path(info_location).is_file()
218
-
219
- @property
220
- def installed_as_egg(self) -> bool:
221
- """Whether this distribution is installed as an egg.
222
-
223
- This usually indicates the distribution was installed by (older versions
224
- of) easy_install.
225
- """
226
- location = self.location
227
- if not location:
228
- return False
229
- # XXX if the distribution is a zipped egg, location has a trailing /
230
- # so we resort to pathlib.Path to check the suffix in a reliable way.
231
- return pathlib.Path(location).suffix == ".egg"
232
-
233
- @property
234
- def installed_with_setuptools_egg_info(self) -> bool:
235
- """Whether this distribution is installed with the ``.egg-info`` format.
236
-
237
- This usually indicates the distribution was installed with setuptools
238
- with an old pip version or with ``single-version-externally-managed``.
239
-
240
- Note that this ensure the metadata store is a directory. distutils can
241
- also installs an ``.egg-info``, but as a file, not a directory. This
242
- property is *False* for that case. Also see ``installed_by_distutils``.
243
- """
244
- info_location = self.info_location
245
- if not info_location:
246
- return False
247
- if not info_location.endswith(".egg-info"):
248
- return False
249
- return pathlib.Path(info_location).is_dir()
250
-
251
- @property
252
- def installed_with_dist_info(self) -> bool:
253
- """Whether this distribution is installed with the "modern format".
254
-
255
- This indicates a "modern" installation, e.g. storing metadata in the
256
- ``.dist-info`` directory. This applies to installations made by
257
- setuptools (but through pip, not directly), or anything using the
258
- standardized build backend interface (PEP 517).
259
- """
260
- info_location = self.info_location
261
- if not info_location:
262
- return False
263
- if not info_location.endswith(".dist-info"):
264
- return False
265
- return pathlib.Path(info_location).is_dir()
266
-
267
- @property
268
- def canonical_name(self) -> NormalizedName:
269
- raise NotImplementedError()
270
-
271
- @property
272
- def version(self) -> Version:
273
- raise NotImplementedError()
274
-
275
- @property
276
- def raw_version(self) -> str:
277
- raise NotImplementedError()
278
-
279
- @property
280
- def setuptools_filename(self) -> str:
281
- """Convert a project name to its setuptools-compatible filename.
282
-
283
- This is a copy of ``pkg_resources.to_filename()`` for compatibility.
284
- """
285
- return self.raw_name.replace("-", "_")
286
-
287
- @property
288
- def direct_url(self) -> DirectUrl | None:
289
- """Obtain a DirectUrl from this distribution.
290
-
291
- Returns None if the distribution has no `direct_url.json` metadata,
292
- or if `direct_url.json` is invalid.
293
- """
294
- try:
295
- content = self.read_text(DIRECT_URL_METADATA_NAME)
296
- except FileNotFoundError:
297
- return None
298
- try:
299
- return DirectUrl.from_json(content)
300
- except (
301
- UnicodeDecodeError,
302
- json.JSONDecodeError,
303
- DirectUrlValidationError,
304
- ) as e:
305
- logger.warning(
306
- "Error parsing %s for %s: %s",
307
- DIRECT_URL_METADATA_NAME,
308
- self.canonical_name,
309
- e,
310
- )
311
- return None
312
-
313
- @property
314
- def installer(self) -> str:
315
- try:
316
- installer_text = self.read_text("INSTALLER")
317
- except (OSError, ValueError, NoneMetadataError):
318
- return "" # Fail silently if the installer file cannot be read.
319
- for line in installer_text.splitlines():
320
- cleaned_line = line.strip()
321
- if cleaned_line:
322
- return cleaned_line
323
- return ""
324
-
325
- @property
326
- def requested(self) -> bool:
327
- return self.is_file("REQUESTED")
328
-
329
- @property
330
- def editable(self) -> bool:
331
- return bool(self.editable_project_location)
332
-
333
- @property
334
- def local(self) -> bool:
335
- """If distribution is installed in the current virtual environment.
336
-
337
- Always True if we're not in a virtualenv.
338
- """
339
- if self.installed_location is None:
340
- return False
341
- return is_local(self.installed_location)
342
-
343
- @property
344
- def in_usersite(self) -> bool:
345
- if self.installed_location is None or user_site is None:
346
- return False
347
- return self.installed_location.startswith(normalize_path(user_site))
348
-
349
- @property
350
- def in_site_packages(self) -> bool:
351
- if self.installed_location is None or site_packages is None:
352
- return False
353
- return self.installed_location.startswith(normalize_path(site_packages))
354
-
355
- def is_file(self, path: InfoPath) -> bool:
356
- """Check whether an entry in the info directory is a file."""
357
- raise NotImplementedError()
358
-
359
- def iter_distutils_script_names(self) -> Iterator[str]:
360
- """Find distutils 'scripts' entries metadata.
361
-
362
- If 'scripts' is supplied in ``setup.py``, distutils records those in the
363
- installed distribution's ``scripts`` directory, a file for each script.
364
- """
365
- raise NotImplementedError()
366
-
367
- def read_text(self, path: InfoPath) -> str:
368
- """Read a file in the info directory.
369
-
370
- :raise FileNotFoundError: If ``path`` does not exist in the directory.
371
- :raise NoneMetadataError: If ``path`` exists in the info directory, but
372
- cannot be read.
373
- """
374
- raise NotImplementedError()
375
-
376
- def iter_entry_points(self) -> Iterable[BaseEntryPoint]:
377
- raise NotImplementedError()
378
-
379
- def _metadata_impl(self) -> email.message.Message:
380
- raise NotImplementedError()
381
-
382
- @functools.cached_property
383
- def metadata(self) -> email.message.Message:
384
- """Metadata of distribution parsed from e.g. METADATA or PKG-INFO.
385
-
386
- This should return an empty message if the metadata file is unavailable.
387
-
388
- :raises NoneMetadataError: If the metadata file is available, but does
389
- not contain valid metadata.
390
- """
391
- metadata = self._metadata_impl()
392
- self._add_egg_info_requires(metadata)
393
- return metadata
394
-
395
- @property
396
- def metadata_dict(self) -> dict[str, Any]:
397
- """PEP 566 compliant JSON-serializable representation of METADATA or PKG-INFO.
398
-
399
- This should return an empty dict if the metadata file is unavailable.
400
-
401
- :raises NoneMetadataError: If the metadata file is available, but does
402
- not contain valid metadata.
403
- """
404
- return msg_to_json(self.metadata)
405
-
406
- @property
407
- def metadata_version(self) -> str | None:
408
- """Value of "Metadata-Version:" in distribution metadata, if available."""
409
- return self.metadata.get("Metadata-Version")
410
-
411
- @property
412
- def raw_name(self) -> str:
413
- """Value of "Name:" in distribution metadata."""
414
- # The metadata should NEVER be missing the Name: key, but if it somehow
415
- # does, fall back to the known canonical name.
416
- return self.metadata.get("Name", self.canonical_name)
417
-
418
- @property
419
- def requires_python(self) -> SpecifierSet:
420
- """Value of "Requires-Python:" in distribution metadata.
421
-
422
- If the key does not exist or contains an invalid value, an empty
423
- SpecifierSet should be returned.
424
- """
425
- value = self.metadata.get("Requires-Python")
426
- if value is None:
427
- return SpecifierSet()
428
- try:
429
- # Convert to str to satisfy the type checker; this can be a Header object.
430
- spec = SpecifierSet(str(value))
431
- except InvalidSpecifier as e:
432
- message = "Package %r has an invalid Requires-Python: %s"
433
- logger.warning(message, self.raw_name, e)
434
- return SpecifierSet()
435
- return spec
436
-
437
- def iter_dependencies(self, extras: Collection[str] = ()) -> Iterable[Requirement]:
438
- """Dependencies of this distribution.
439
-
440
- For modern .dist-info distributions, this is the collection of
441
- "Requires-Dist:" entries in distribution metadata.
442
- """
443
- raise NotImplementedError()
444
-
445
- def iter_raw_dependencies(self) -> Iterable[str]:
446
- """Raw Requires-Dist metadata."""
447
- return self.metadata.get_all("Requires-Dist", [])
448
-
449
- def iter_provided_extras(self) -> Iterable[NormalizedName]:
450
- """Extras provided by this distribution.
451
-
452
- For modern .dist-info distributions, this is the collection of
453
- "Provides-Extra:" entries in distribution metadata.
454
-
455
- The return value of this function is expected to be normalised names,
456
- per PEP 685, with the returned value being handled appropriately by
457
- `iter_dependencies`.
458
- """
459
- raise NotImplementedError()
460
-
461
- def _iter_declared_entries_from_record(self) -> Iterator[str] | None:
462
- try:
463
- text = self.read_text("RECORD")
464
- except FileNotFoundError:
465
- return None
466
- # This extra Path-str cast normalizes entries.
467
- return (str(pathlib.Path(row[0])) for row in csv.reader(text.splitlines()))
468
-
469
- def _iter_declared_entries_from_legacy(self) -> Iterator[str] | None:
470
- try:
471
- text = self.read_text("installed-files.txt")
472
- except FileNotFoundError:
473
- return None
474
- paths = (p for p in text.splitlines(keepends=False) if p)
475
- root = self.location
476
- info = self.info_location
477
- if root is None or info is None:
478
- return paths
479
- try:
480
- info_rel = pathlib.Path(info).relative_to(root)
481
- except ValueError: # info is not relative to root.
482
- return paths
483
- if not info_rel.parts: # info *is* root.
484
- return paths
485
- return (
486
- _convert_installed_files_path(pathlib.Path(p).parts, info_rel.parts)
487
- for p in paths
488
- )
489
-
490
- def iter_declared_entries(self) -> Iterator[str] | None:
491
- """Iterate through file entries declared in this distribution.
492
-
493
- For modern .dist-info distributions, this is the files listed in the
494
- ``RECORD`` metadata file. For legacy setuptools distributions, this
495
- comes from ``installed-files.txt``, with entries normalized to be
496
- compatible with the format used by ``RECORD``.
497
-
498
- :return: An iterator for listed entries, or None if the distribution
499
- contains neither ``RECORD`` nor ``installed-files.txt``.
500
- """
501
- return (
502
- self._iter_declared_entries_from_record()
503
- or self._iter_declared_entries_from_legacy()
504
- )
505
-
506
- def _iter_requires_txt_entries(self) -> Iterator[RequiresEntry]:
507
- """Parse a ``requires.txt`` in an egg-info directory.
508
-
509
- This is an INI-ish format where an egg-info stores dependencies. A
510
- section name describes extra other environment markers, while each entry
511
- is an arbitrary string (not a key-value pair) representing a dependency
512
- as a requirement string (no markers).
513
-
514
- There is a construct in ``importlib.metadata`` called ``Sectioned`` that
515
- does mostly the same, but the format is currently considered private.
516
- """
517
- try:
518
- content = self.read_text("requires.txt")
519
- except FileNotFoundError:
520
- return
521
- extra = marker = "" # Section-less entries don't have markers.
522
- for line in content.splitlines():
523
- line = line.strip()
524
- if not line or line.startswith("#"): # Comment; ignored.
525
- continue
526
- if line.startswith("[") and line.endswith("]"): # A section header.
527
- extra, _, marker = line.strip("[]").partition(":")
528
- continue
529
- yield RequiresEntry(requirement=line, extra=extra, marker=marker)
530
-
531
- def _iter_egg_info_extras(self) -> Iterable[str]:
532
- """Get extras from the egg-info directory."""
533
- known_extras = {""}
534
- for entry in self._iter_requires_txt_entries():
535
- extra = canonicalize_name(entry.extra)
536
- if extra in known_extras:
537
- continue
538
- known_extras.add(extra)
539
- yield extra
540
-
541
- def _iter_egg_info_dependencies(self) -> Iterable[str]:
542
- """Get distribution dependencies from the egg-info directory.
543
-
544
- To ease parsing, this converts a legacy dependency entry into a PEP 508
545
- requirement string. Like ``_iter_requires_txt_entries()``, there is code
546
- in ``importlib.metadata`` that does mostly the same, but not do exactly
547
- what we need.
548
-
549
- Namely, ``importlib.metadata`` does not normalize the extra name before
550
- putting it into the requirement string, which causes marker comparison
551
- to fail because the dist-info format do normalize. This is consistent in
552
- all currently available PEP 517 backends, although not standardized.
553
- """
554
- for entry in self._iter_requires_txt_entries():
555
- extra = canonicalize_name(entry.extra)
556
- if extra and entry.marker:
557
- marker = f'({entry.marker}) and extra == "{extra}"'
558
- elif extra:
559
- marker = f'extra == "{extra}"'
560
- elif entry.marker:
561
- marker = entry.marker
562
- else:
563
- marker = ""
564
- if marker:
565
- yield f"{entry.requirement} ; {marker}"
566
- else:
567
- yield entry.requirement
568
-
569
- def _add_egg_info_requires(self, metadata: email.message.Message) -> None:
570
- """Add egg-info requires.txt information to the metadata."""
571
- if not metadata.get_all("Requires-Dist"):
572
- for dep in self._iter_egg_info_dependencies():
573
- metadata["Requires-Dist"] = dep
574
- if not metadata.get_all("Provides-Extra"):
575
- for extra in self._iter_egg_info_extras():
576
- metadata["Provides-Extra"] = extra
577
-
578
-
579
- class BaseEnvironment:
580
- """An environment containing distributions to introspect."""
581
-
582
- @classmethod
583
- def default(cls) -> BaseEnvironment:
584
- raise NotImplementedError()
585
-
586
- @classmethod
587
- def from_paths(cls, paths: list[str] | None) -> BaseEnvironment:
588
- raise NotImplementedError()
589
-
590
- def get_distribution(self, name: str) -> BaseDistribution | None:
591
- """Given a requirement name, return the installed distributions.
592
-
593
- The name may not be normalized. The implementation must canonicalize
594
- it for lookup.
595
- """
596
- raise NotImplementedError()
597
-
598
- def _iter_distributions(self) -> Iterator[BaseDistribution]:
599
- """Iterate through installed distributions.
600
-
601
- This function should be implemented by subclass, but never called
602
- directly. Use the public ``iter_distribution()`` instead, which
603
- implements additional logic to make sure the distributions are valid.
604
- """
605
- raise NotImplementedError()
606
-
607
- def iter_all_distributions(self) -> Iterator[BaseDistribution]:
608
- """Iterate through all installed distributions without any filtering."""
609
- for dist in self._iter_distributions():
610
- # Make sure the distribution actually comes from a valid Python
611
- # packaging distribution. Pip's AdjacentTempDirectory leaves folders
612
- # e.g. ``~atplotlib.dist-info`` if cleanup was interrupted. The
613
- # valid project name pattern is taken from PEP 508.
614
- project_name_valid = re.match(
615
- r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$",
616
- dist.canonical_name,
617
- flags=re.IGNORECASE,
618
- )
619
- if not project_name_valid:
620
- logger.warning(
621
- "Ignoring invalid distribution %s (%s)",
622
- dist.canonical_name,
623
- dist.location,
624
- )
625
- continue
626
- yield dist
627
-
628
- def iter_installed_distributions(
629
- self,
630
- local_only: bool = True,
631
- skip: Container[str] = stdlib_pkgs,
632
- include_editables: bool = True,
633
- editables_only: bool = False,
634
- user_only: bool = False,
635
- ) -> Iterator[BaseDistribution]:
636
- """Return a list of installed distributions.
637
-
638
- This is based on ``iter_all_distributions()`` with additional filtering
639
- options. Note that ``iter_installed_distributions()`` without arguments
640
- is *not* equal to ``iter_all_distributions()``, since some of the
641
- configurations exclude packages by default.
642
-
643
- :param local_only: If True (default), only return installations
644
- local to the current virtualenv, if in a virtualenv.
645
- :param skip: An iterable of canonicalized project names to ignore;
646
- defaults to ``stdlib_pkgs``.
647
- :param include_editables: If False, don't report editables.
648
- :param editables_only: If True, only report editables.
649
- :param user_only: If True, only report installations in the user
650
- site directory.
651
- """
652
- it = self.iter_all_distributions()
653
- if local_only:
654
- it = (d for d in it if d.local)
655
- if not include_editables:
656
- it = (d for d in it if not d.editable)
657
- if editables_only:
658
- it = (d for d in it if d.editable)
659
- if user_only:
660
- it = (d for d in it if d.in_usersite)
661
- return (d for d in it if d.canonical_name not in skip)
662
-
663
-
664
- class Wheel(Protocol):
665
- location: str
666
-
667
- def as_zipfile(self) -> zipfile.ZipFile:
668
- raise NotImplementedError()
669
-
670
-
671
- class FilesystemWheel(Wheel):
672
- def __init__(self, location: str) -> None:
673
- self.location = location
674
-
675
- def as_zipfile(self) -> zipfile.ZipFile:
676
- return zipfile.ZipFile(self.location, allowZip64=True)
677
-
678
-
679
- class MemoryWheel(Wheel):
680
- def __init__(self, location: str, stream: IO[bytes]) -> None:
681
- self.location = location
682
- self.stream = stream
683
-
684
- def as_zipfile(self) -> zipfile.ZipFile:
685
- return zipfile.ZipFile(self.stream, allowZip64=True)
@@ -1,6 +0,0 @@
1
- from ._dists import Distribution
2
- from ._envs import Environment
3
-
4
- __all__ = ["NAME", "Distribution", "Environment"]
5
-
6
- NAME = "importlib"