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,57 +0,0 @@
1
- from collections.abc import Sequence
2
- from typing import Any
3
-
4
- from pip._vendor.packaging.markers import default_environment
5
-
6
- from pip import __version__
7
- from pip._internal.req.req_install import InstallRequirement
8
-
9
-
10
- class InstallationReport:
11
- def __init__(self, install_requirements: Sequence[InstallRequirement]):
12
- self._install_requirements = install_requirements
13
-
14
- @classmethod
15
- def _install_req_to_dict(cls, ireq: InstallRequirement) -> dict[str, Any]:
16
- assert ireq.download_info, f"No download_info for {ireq}"
17
- res = {
18
- # PEP 610 json for the download URL. download_info.archive_info.hashes may
19
- # be absent when the requirement was installed from the wheel cache
20
- # and the cache entry was populated by an older pip version that did not
21
- # record origin.json.
22
- "download_info": ireq.download_info.to_dict(),
23
- # is_direct is true if the requirement was a direct URL reference (which
24
- # includes editable requirements), and false if the requirement was
25
- # downloaded from a PEP 503 index or --find-links.
26
- "is_direct": ireq.is_direct,
27
- # is_yanked is true if the requirement was yanked from the index, but
28
- # was still selected by pip to conform to PEP 592.
29
- "is_yanked": ireq.link.is_yanked if ireq.link else False,
30
- # requested is true if the requirement was specified by the user (aka
31
- # top level requirement), and false if it was installed as a dependency of a
32
- # requirement. https://peps.python.org/pep-0376/#requested
33
- "requested": ireq.user_supplied,
34
- # PEP 566 json encoding for metadata
35
- # https://www.python.org/dev/peps/pep-0566/#json-compatible-metadata
36
- "metadata": ireq.get_dist().metadata_dict,
37
- }
38
- if ireq.user_supplied and ireq.extras:
39
- # For top level requirements, the list of requested extras, if any.
40
- res["requested_extras"] = sorted(ireq.extras)
41
- return res
42
-
43
- def to_dict(self) -> dict[str, Any]:
44
- return {
45
- "version": "1",
46
- "pip_version": __version__,
47
- "install": [
48
- self._install_req_to_dict(ireq) for ireq in self._install_requirements
49
- ],
50
- # https://peps.python.org/pep-0508/#environment-markers
51
- # TODO: currently, the resolver uses the default environment to evaluate
52
- # environment markers, so that is what we report here. In the future, it
53
- # should also take into account options such as --python-version or
54
- # --platform, perhaps under the form of an environment_override field?
55
- # https://github.com/pypa/pip/issues/11198
56
- "environment": default_environment(),
57
- }
@@ -1,613 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import functools
4
- import itertools
5
- import logging
6
- import os
7
- import posixpath
8
- import re
9
- import urllib.parse
10
- from collections.abc import Mapping
11
- from dataclasses import dataclass
12
- from typing import (
13
- TYPE_CHECKING,
14
- Any,
15
- NamedTuple,
16
- )
17
-
18
- from pip._internal.utils.deprecation import deprecated
19
- from pip._internal.utils.filetypes import WHEEL_EXTENSION
20
- from pip._internal.utils.hashes import Hashes
21
- from pip._internal.utils.misc import (
22
- pairwise,
23
- redact_auth_from_url,
24
- split_auth_from_netloc,
25
- splitext,
26
- )
27
- from pip._internal.utils.urls import path_to_url, url_to_path
28
-
29
- if TYPE_CHECKING:
30
- from pip._internal.index.collector import IndexContent
31
-
32
- logger = logging.getLogger(__name__)
33
-
34
-
35
- # Order matters, earlier hashes have a precedence over later hashes for what
36
- # we will pick to use.
37
- _SUPPORTED_HASHES = ("sha512", "sha384", "sha256", "sha224", "sha1", "md5")
38
-
39
-
40
- @dataclass(frozen=True)
41
- class LinkHash:
42
- """Links to content may have embedded hash values. This class parses those.
43
-
44
- `name` must be any member of `_SUPPORTED_HASHES`.
45
-
46
- This class can be converted to and from `ArchiveInfo`. While ArchiveInfo intends to
47
- be JSON-serializable to conform to PEP 610, this class contains the logic for
48
- parsing a hash name and value for correctness, and then checking whether that hash
49
- conforms to a schema with `.is_hash_allowed()`."""
50
-
51
- name: str
52
- value: str
53
-
54
- _hash_url_fragment_re = re.compile(
55
- # NB: we do not validate that the second group (.*) is a valid hex
56
- # digest. Instead, we simply keep that string in this class, and then check it
57
- # against Hashes when hash-checking is needed. This is easier to debug than
58
- # proactively discarding an invalid hex digest, as we handle incorrect hashes
59
- # and malformed hashes in the same place.
60
- r"[#&]({choices})=([^&]*)".format(
61
- choices="|".join(re.escape(hash_name) for hash_name in _SUPPORTED_HASHES)
62
- ),
63
- )
64
-
65
- def __post_init__(self) -> None:
66
- assert self.name in _SUPPORTED_HASHES
67
-
68
- @classmethod
69
- @functools.cache
70
- def find_hash_url_fragment(cls, url: str) -> LinkHash | None:
71
- """Search a string for a checksum algorithm name and encoded output value."""
72
- match = cls._hash_url_fragment_re.search(url)
73
- if match is None:
74
- return None
75
- name, value = match.groups()
76
- return cls(name=name, value=value)
77
-
78
- def as_dict(self) -> dict[str, str]:
79
- return {self.name: self.value}
80
-
81
- def as_hashes(self) -> Hashes:
82
- """Return a Hashes instance which checks only for the current hash."""
83
- return Hashes({self.name: [self.value]})
84
-
85
- def is_hash_allowed(self, hashes: Hashes | None) -> bool:
86
- """
87
- Return True if the current hash is allowed by `hashes`.
88
- """
89
- if hashes is None:
90
- return False
91
- return hashes.is_hash_allowed(self.name, hex_digest=self.value)
92
-
93
-
94
- @dataclass(frozen=True)
95
- class MetadataFile:
96
- """Information about a core metadata file associated with a distribution."""
97
-
98
- hashes: dict[str, str] | None
99
-
100
- def __post_init__(self) -> None:
101
- if self.hashes is not None:
102
- assert all(name in _SUPPORTED_HASHES for name in self.hashes)
103
-
104
-
105
- def supported_hashes(hashes: dict[str, str] | None) -> dict[str, str] | None:
106
- # Remove any unsupported hash types from the mapping. If this leaves no
107
- # supported hashes, return None
108
- if hashes is None:
109
- return None
110
- hashes = {n: v for n, v in hashes.items() if n in _SUPPORTED_HASHES}
111
- if not hashes:
112
- return None
113
- return hashes
114
-
115
-
116
- def _clean_url_path_part(part: str) -> str:
117
- """
118
- Clean a "part" of a URL path (i.e. after splitting on "@" characters).
119
- """
120
- # We unquote prior to quoting to make sure nothing is double quoted.
121
- return urllib.parse.quote(urllib.parse.unquote(part))
122
-
123
-
124
- def _clean_file_url_path(part: str) -> str:
125
- """
126
- Clean the first part of a URL path that corresponds to a local
127
- filesystem path (i.e. the first part after splitting on "@" characters).
128
- """
129
- # We unquote prior to quoting to make sure nothing is double quoted.
130
- # Also, on Windows the path part might contain a drive letter which
131
- # should not be quoted. On Linux where drive letters do not
132
- # exist, the colon should be quoted. We rely on urllib.request
133
- # to do the right thing here.
134
- ret = urllib.request.pathname2url(urllib.request.url2pathname(part))
135
- if ret.startswith("///"):
136
- # Remove any URL authority section, leaving only the URL path.
137
- ret = ret.removeprefix("//")
138
- return ret
139
-
140
-
141
- # percent-encoded: /
142
- _reserved_chars_re = re.compile("(@|%2F)", re.IGNORECASE)
143
-
144
-
145
- def _clean_url_path(path: str, is_local_path: bool) -> str:
146
- """
147
- Clean the path portion of a URL.
148
- """
149
- if is_local_path:
150
- clean_func = _clean_file_url_path
151
- else:
152
- clean_func = _clean_url_path_part
153
-
154
- # Split on the reserved characters prior to cleaning so that
155
- # revision strings in VCS URLs are properly preserved.
156
- parts = _reserved_chars_re.split(path)
157
-
158
- cleaned_parts = []
159
- for to_clean, reserved in pairwise(itertools.chain(parts, [""])):
160
- cleaned_parts.append(clean_func(to_clean))
161
- # Normalize %xx escapes (e.g. %2f -> %2F)
162
- cleaned_parts.append(reserved.upper())
163
-
164
- return "".join(cleaned_parts)
165
-
166
-
167
- def _ensure_quoted_url(url: str) -> str:
168
- """
169
- Make sure a link is fully quoted.
170
- For example, if ' ' occurs in the URL, it will be replaced with "%20",
171
- and without double-quoting other characters.
172
- """
173
- # Split the URL into parts according to the general structure
174
- # `scheme://netloc/path?query#fragment`.
175
- result = urllib.parse.urlsplit(url)
176
- # If the netloc is empty, then the URL refers to a local filesystem path.
177
- is_local_path = not result.netloc
178
- path = _clean_url_path(result.path, is_local_path=is_local_path)
179
- # Temporarily replace scheme with file to ensure the URL generated by
180
- # urlunsplit() contains an empty netloc (file://) as per RFC 1738.
181
- ret = urllib.parse.urlunsplit(result._replace(scheme="file", path=path))
182
- ret = result.scheme + ret[4:] # Restore original scheme.
183
- return ret
184
-
185
-
186
- def _absolute_link_url(base_url: str, url: str) -> str:
187
- """
188
- A faster implementation of urllib.parse.urljoin with a shortcut
189
- for absolute http/https URLs.
190
- """
191
- if url.startswith(("https://", "http://")):
192
- return url
193
- else:
194
- return urllib.parse.urljoin(base_url, url)
195
-
196
-
197
- @functools.total_ordering
198
- class Link:
199
- """Represents a parsed link from a Package Index's simple URL"""
200
-
201
- __slots__ = [
202
- "_parsed_url",
203
- "_url",
204
- "_path",
205
- "_hashes",
206
- "comes_from",
207
- "requires_python",
208
- "yanked_reason",
209
- "metadata_file_data",
210
- "cache_link_parsing",
211
- "egg_fragment",
212
- ]
213
-
214
- def __init__(
215
- self,
216
- url: str,
217
- comes_from: str | IndexContent | None = None,
218
- requires_python: str | None = None,
219
- yanked_reason: str | None = None,
220
- metadata_file_data: MetadataFile | None = None,
221
- cache_link_parsing: bool = True,
222
- hashes: Mapping[str, str] | None = None,
223
- ) -> None:
224
- """
225
- :param url: url of the resource pointed to (href of the link)
226
- :param comes_from: instance of IndexContent where the link was found,
227
- or string.
228
- :param requires_python: String containing the `Requires-Python`
229
- metadata field, specified in PEP 345. This may be specified by
230
- a data-requires-python attribute in the HTML link tag, as
231
- described in PEP 503.
232
- :param yanked_reason: the reason the file has been yanked, if the
233
- file has been yanked, or None if the file hasn't been yanked.
234
- This is the value of the "data-yanked" attribute, if present, in
235
- a simple repository HTML link. If the file has been yanked but
236
- no reason was provided, this should be the empty string. See
237
- PEP 592 for more information and the specification.
238
- :param metadata_file_data: the metadata attached to the file, or None if
239
- no such metadata is provided. This argument, if not None, indicates
240
- that a separate metadata file exists, and also optionally supplies
241
- hashes for that file.
242
- :param cache_link_parsing: A flag that is used elsewhere to determine
243
- whether resources retrieved from this link should be cached. PyPI
244
- URLs should generally have this set to False, for example.
245
- :param hashes: A mapping of hash names to digests to allow us to
246
- determine the validity of a download.
247
- """
248
-
249
- # The comes_from, requires_python, and metadata_file_data arguments are
250
- # only used by classmethods of this class, and are not used in client
251
- # code directly.
252
-
253
- # url can be a UNC windows share
254
- if url.startswith("\\\\"):
255
- url = path_to_url(url)
256
-
257
- self._parsed_url = urllib.parse.urlsplit(url)
258
- # Store the url as a private attribute to prevent accidentally
259
- # trying to set a new value.
260
- self._url = url
261
- # The .path property is hot, so calculate its value ahead of time.
262
- self._path = urllib.parse.unquote(self._parsed_url.path)
263
-
264
- link_hash = LinkHash.find_hash_url_fragment(url)
265
- hashes_from_link = {} if link_hash is None else link_hash.as_dict()
266
- if hashes is None:
267
- self._hashes = hashes_from_link
268
- else:
269
- self._hashes = {**hashes, **hashes_from_link}
270
-
271
- self.comes_from = comes_from
272
- self.requires_python = requires_python if requires_python else None
273
- self.yanked_reason = yanked_reason
274
- self.metadata_file_data = metadata_file_data
275
-
276
- self.cache_link_parsing = cache_link_parsing
277
- self.egg_fragment = self._egg_fragment()
278
-
279
- @classmethod
280
- def from_json(
281
- cls,
282
- file_data: dict[str, Any],
283
- page_url: str,
284
- ) -> Link | None:
285
- """
286
- Convert an pypi json document from a simple repository page into a Link.
287
- """
288
- file_url = file_data.get("url")
289
- if file_url is None:
290
- return None
291
-
292
- url = _ensure_quoted_url(_absolute_link_url(page_url, file_url))
293
- pyrequire = file_data.get("requires-python")
294
- yanked_reason = file_data.get("yanked")
295
- hashes = file_data.get("hashes", {})
296
-
297
- # PEP 714: Indexes must use the name core-metadata, but
298
- # clients should support the old name as a fallback for compatibility.
299
- metadata_info = file_data.get("core-metadata")
300
- if metadata_info is None:
301
- metadata_info = file_data.get("dist-info-metadata")
302
-
303
- # The metadata info value may be a boolean, or a dict of hashes.
304
- if isinstance(metadata_info, dict):
305
- # The file exists, and hashes have been supplied
306
- metadata_file_data = MetadataFile(supported_hashes(metadata_info))
307
- elif metadata_info:
308
- # The file exists, but there are no hashes
309
- metadata_file_data = MetadataFile(None)
310
- else:
311
- # False or not present: the file does not exist
312
- metadata_file_data = None
313
-
314
- # The Link.yanked_reason expects an empty string instead of a boolean.
315
- if yanked_reason and not isinstance(yanked_reason, str):
316
- yanked_reason = ""
317
- # The Link.yanked_reason expects None instead of False.
318
- elif not yanked_reason:
319
- yanked_reason = None
320
-
321
- return cls(
322
- url,
323
- comes_from=page_url,
324
- requires_python=pyrequire,
325
- yanked_reason=yanked_reason,
326
- hashes=hashes,
327
- metadata_file_data=metadata_file_data,
328
- )
329
-
330
- @classmethod
331
- def from_element(
332
- cls,
333
- anchor_attribs: dict[str, str | None],
334
- page_url: str,
335
- base_url: str,
336
- ) -> Link | None:
337
- """
338
- Convert an anchor element's attributes in a simple repository page to a Link.
339
- """
340
- href = anchor_attribs.get("href")
341
- if not href:
342
- return None
343
-
344
- url = _ensure_quoted_url(_absolute_link_url(base_url, href))
345
- pyrequire = anchor_attribs.get("data-requires-python")
346
- yanked_reason = anchor_attribs.get("data-yanked")
347
-
348
- # PEP 714: Indexes must use the name data-core-metadata, but
349
- # clients should support the old name as a fallback for compatibility.
350
- metadata_info = anchor_attribs.get("data-core-metadata")
351
- if metadata_info is None:
352
- metadata_info = anchor_attribs.get("data-dist-info-metadata")
353
- # The metadata info value may be the string "true", or a string of
354
- # the form "hashname=hashval"
355
- if metadata_info == "true":
356
- # The file exists, but there are no hashes
357
- metadata_file_data = MetadataFile(None)
358
- elif metadata_info is None:
359
- # The file does not exist
360
- metadata_file_data = None
361
- else:
362
- # The file exists, and hashes have been supplied
363
- hashname, sep, hashval = metadata_info.partition("=")
364
- if sep == "=":
365
- metadata_file_data = MetadataFile(supported_hashes({hashname: hashval}))
366
- else:
367
- # Error - data is wrong. Treat as no hashes supplied.
368
- logger.debug(
369
- "Index returned invalid data-dist-info-metadata value: %s",
370
- metadata_info,
371
- )
372
- metadata_file_data = MetadataFile(None)
373
-
374
- return cls(
375
- url,
376
- comes_from=page_url,
377
- requires_python=pyrequire,
378
- yanked_reason=yanked_reason,
379
- metadata_file_data=metadata_file_data,
380
- )
381
-
382
- def __str__(self) -> str:
383
- if self.requires_python:
384
- rp = f" (requires-python:{self.requires_python})"
385
- else:
386
- rp = ""
387
- if self.comes_from:
388
- return f"{self.redacted_url} (from {self.comes_from}){rp}"
389
- else:
390
- return self.redacted_url
391
-
392
- def __repr__(self) -> str:
393
- return f"<Link {self}>"
394
-
395
- def __hash__(self) -> int:
396
- return hash(self.url)
397
-
398
- def __eq__(self, other: Any) -> bool:
399
- if not isinstance(other, Link):
400
- return NotImplemented
401
- return self.url == other.url
402
-
403
- def __lt__(self, other: Any) -> bool:
404
- if not isinstance(other, Link):
405
- return NotImplemented
406
- return self.url < other.url
407
-
408
- @property
409
- def url(self) -> str:
410
- return self._url
411
-
412
- @property
413
- def redacted_url(self) -> str:
414
- return redact_auth_from_url(self.url)
415
-
416
- @property
417
- def filename(self) -> str:
418
- path = self.path.rstrip("/")
419
- name = posixpath.basename(path)
420
- if not name:
421
- # Make sure we don't leak auth information if the netloc
422
- # includes a username and password.
423
- netloc, user_pass = split_auth_from_netloc(self.netloc)
424
- return netloc
425
-
426
- name = urllib.parse.unquote(name)
427
- assert name, f"URL {self._url!r} produced no filename"
428
- return name
429
-
430
- @property
431
- def file_path(self) -> str:
432
- return url_to_path(self.url)
433
-
434
- @property
435
- def scheme(self) -> str:
436
- return self._parsed_url.scheme
437
-
438
- @property
439
- def netloc(self) -> str:
440
- """
441
- This can contain auth information.
442
- """
443
- return self._parsed_url.netloc
444
-
445
- @property
446
- def path(self) -> str:
447
- return self._path
448
-
449
- def splitext(self) -> tuple[str, str]:
450
- return splitext(posixpath.basename(self.path.rstrip("/")))
451
-
452
- @property
453
- def ext(self) -> str:
454
- return self.splitext()[1]
455
-
456
- @property
457
- def url_without_fragment(self) -> str:
458
- scheme, netloc, path, query, fragment = self._parsed_url
459
- return urllib.parse.urlunsplit((scheme, netloc, path, query, ""))
460
-
461
- _egg_fragment_re = re.compile(r"[#&]egg=([^&]*)")
462
-
463
- # Per PEP 508.
464
- _project_name_re = re.compile(
465
- r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$", re.IGNORECASE
466
- )
467
-
468
- def _egg_fragment(self) -> str | None:
469
- match = self._egg_fragment_re.search(self._url)
470
- if not match:
471
- return None
472
-
473
- # An egg fragment looks like a PEP 508 project name, along with
474
- # an optional extras specifier. Anything else is invalid.
475
- project_name = match.group(1)
476
- if not self._project_name_re.match(project_name):
477
- deprecated(
478
- reason=f"{self} contains an egg fragment with a non-PEP 508 name.",
479
- replacement="to use the req @ url syntax, and remove the egg fragment",
480
- gone_in="25.3",
481
- issue=13157,
482
- )
483
-
484
- return project_name
485
-
486
- _subdirectory_fragment_re = re.compile(r"[#&]subdirectory=([^&]*)")
487
-
488
- @property
489
- def subdirectory_fragment(self) -> str | None:
490
- match = self._subdirectory_fragment_re.search(self._url)
491
- if not match:
492
- return None
493
- return match.group(1)
494
-
495
- def metadata_link(self) -> Link | None:
496
- """Return a link to the associated core metadata file (if any)."""
497
- if self.metadata_file_data is None:
498
- return None
499
- metadata_url = f"{self.url_without_fragment}.metadata"
500
- if self.metadata_file_data.hashes is None:
501
- return Link(metadata_url)
502
- return Link(metadata_url, hashes=self.metadata_file_data.hashes)
503
-
504
- def as_hashes(self) -> Hashes:
505
- return Hashes({k: [v] for k, v in self._hashes.items()})
506
-
507
- @property
508
- def hash(self) -> str | None:
509
- return next(iter(self._hashes.values()), None)
510
-
511
- @property
512
- def hash_name(self) -> str | None:
513
- return next(iter(self._hashes), None)
514
-
515
- @property
516
- def show_url(self) -> str:
517
- return posixpath.basename(self._url.split("#", 1)[0].split("?", 1)[0])
518
-
519
- @property
520
- def is_file(self) -> bool:
521
- return self.scheme == "file"
522
-
523
- def is_existing_dir(self) -> bool:
524
- return self.is_file and os.path.isdir(self.file_path)
525
-
526
- @property
527
- def is_wheel(self) -> bool:
528
- return self.ext == WHEEL_EXTENSION
529
-
530
- @property
531
- def is_vcs(self) -> bool:
532
- from pip._internal.vcs import vcs
533
-
534
- return self.scheme in vcs.all_schemes
535
-
536
- @property
537
- def is_yanked(self) -> bool:
538
- return self.yanked_reason is not None
539
-
540
- @property
541
- def has_hash(self) -> bool:
542
- return bool(self._hashes)
543
-
544
- def is_hash_allowed(self, hashes: Hashes | None) -> bool:
545
- """
546
- Return True if the link has a hash and it is allowed by `hashes`.
547
- """
548
- if hashes is None:
549
- return False
550
- return any(hashes.is_hash_allowed(k, v) for k, v in self._hashes.items())
551
-
552
-
553
- class _CleanResult(NamedTuple):
554
- """Convert link for equivalency check.
555
-
556
- This is used in the resolver to check whether two URL-specified requirements
557
- likely point to the same distribution and can be considered equivalent. This
558
- equivalency logic avoids comparing URLs literally, which can be too strict
559
- (e.g. "a=1&b=2" vs "b=2&a=1") and produce conflicts unexpecting to users.
560
-
561
- Currently this does three things:
562
-
563
- 1. Drop the basic auth part. This is technically wrong since a server can
564
- serve different content based on auth, but if it does that, it is even
565
- impossible to guarantee two URLs without auth are equivalent, since
566
- the user can input different auth information when prompted. So the
567
- practical solution is to assume the auth doesn't affect the response.
568
- 2. Parse the query to avoid the ordering issue. Note that ordering under the
569
- same key in the query are NOT cleaned; i.e. "a=1&a=2" and "a=2&a=1" are
570
- still considered different.
571
- 3. Explicitly drop most of the fragment part, except ``subdirectory=`` and
572
- hash values, since it should have no impact the downloaded content. Note
573
- that this drops the "egg=" part historically used to denote the requested
574
- project (and extras), which is wrong in the strictest sense, but too many
575
- people are supplying it inconsistently to cause superfluous resolution
576
- conflicts, so we choose to also ignore them.
577
- """
578
-
579
- parsed: urllib.parse.SplitResult
580
- query: dict[str, list[str]]
581
- subdirectory: str
582
- hashes: dict[str, str]
583
-
584
-
585
- def _clean_link(link: Link) -> _CleanResult:
586
- parsed = link._parsed_url
587
- netloc = parsed.netloc.rsplit("@", 1)[-1]
588
- # According to RFC 8089, an empty host in file: means localhost.
589
- if parsed.scheme == "file" and not netloc:
590
- netloc = "localhost"
591
- fragment = urllib.parse.parse_qs(parsed.fragment)
592
- if "egg" in fragment:
593
- logger.debug("Ignoring egg= fragment in %s", link)
594
- try:
595
- # If there are multiple subdirectory values, use the first one.
596
- # This matches the behavior of Link.subdirectory_fragment.
597
- subdirectory = fragment["subdirectory"][0]
598
- except (IndexError, KeyError):
599
- subdirectory = ""
600
- # If there are multiple hash values under the same algorithm, use the
601
- # first one. This matches the behavior of Link.hash_value.
602
- hashes = {k: fragment[k][0] for k in _SUPPORTED_HASHES if k in fragment}
603
- return _CleanResult(
604
- parsed=parsed._replace(netloc=netloc, query="", fragment=""),
605
- query=urllib.parse.parse_qs(parsed.query),
606
- subdirectory=subdirectory,
607
- hashes=hashes,
608
- )
609
-
610
-
611
- @functools.cache
612
- def links_equivalent(link1: Link, link2: Link) -> bool:
613
- return _clean_link(link1) == _clean_link(link2)