cli-ih 0.6.3.1__py3-none-any.whl → 0.7.1__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 (427) hide show
  1. cli_ih/__init__.py +1 -0
  2. cli_ih/asyncClient.py +109 -10
  3. cli_ih/client.py +110 -18
  4. cli_ih/utils.py +51 -0
  5. cli_ih-0.7.1.dist-info/METADATA +100 -0
  6. cli_ih-0.7.1.dist-info/RECORD +9 -0
  7. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.1.dist-info}/top_level.txt +0 -1
  8. cli_ih-0.6.3.1.dist-info/METADATA +0 -86
  9. cli_ih-0.6.3.1.dist-info/RECORD +0 -425
  10. venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +0 -85
  11. venv/Lib/site-packages/pip/__init__.py +0 -13
  12. venv/Lib/site-packages/pip/__main__.py +0 -24
  13. venv/Lib/site-packages/pip/__pip-runner__.py +0 -50
  14. venv/Lib/site-packages/pip/_internal/__init__.py +0 -18
  15. venv/Lib/site-packages/pip/_internal/build_env.py +0 -349
  16. venv/Lib/site-packages/pip/_internal/cache.py +0 -291
  17. venv/Lib/site-packages/pip/_internal/cli/__init__.py +0 -3
  18. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +0 -184
  19. venv/Lib/site-packages/pip/_internal/cli/base_command.py +0 -244
  20. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +0 -1138
  21. venv/Lib/site-packages/pip/_internal/cli/command_context.py +0 -28
  22. venv/Lib/site-packages/pip/_internal/cli/index_command.py +0 -175
  23. venv/Lib/site-packages/pip/_internal/cli/main.py +0 -80
  24. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +0 -134
  25. venv/Lib/site-packages/pip/_internal/cli/parser.py +0 -298
  26. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +0 -151
  27. venv/Lib/site-packages/pip/_internal/cli/req_command.py +0 -351
  28. venv/Lib/site-packages/pip/_internal/cli/spinners.py +0 -235
  29. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +0 -6
  30. venv/Lib/site-packages/pip/_internal/commands/__init__.py +0 -139
  31. venv/Lib/site-packages/pip/_internal/commands/cache.py +0 -231
  32. venv/Lib/site-packages/pip/_internal/commands/check.py +0 -66
  33. venv/Lib/site-packages/pip/_internal/commands/completion.py +0 -135
  34. venv/Lib/site-packages/pip/_internal/commands/configuration.py +0 -288
  35. venv/Lib/site-packages/pip/_internal/commands/debug.py +0 -203
  36. venv/Lib/site-packages/pip/_internal/commands/download.py +0 -145
  37. venv/Lib/site-packages/pip/_internal/commands/freeze.py +0 -107
  38. venv/Lib/site-packages/pip/_internal/commands/hash.py +0 -58
  39. venv/Lib/site-packages/pip/_internal/commands/help.py +0 -40
  40. venv/Lib/site-packages/pip/_internal/commands/index.py +0 -159
  41. venv/Lib/site-packages/pip/_internal/commands/inspect.py +0 -92
  42. venv/Lib/site-packages/pip/_internal/commands/install.py +0 -798
  43. venv/Lib/site-packages/pip/_internal/commands/list.py +0 -400
  44. venv/Lib/site-packages/pip/_internal/commands/lock.py +0 -170
  45. venv/Lib/site-packages/pip/_internal/commands/search.py +0 -178
  46. venv/Lib/site-packages/pip/_internal/commands/show.py +0 -231
  47. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +0 -113
  48. venv/Lib/site-packages/pip/_internal/commands/wheel.py +0 -181
  49. venv/Lib/site-packages/pip/_internal/configuration.py +0 -397
  50. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +0 -21
  51. venv/Lib/site-packages/pip/_internal/distributions/base.py +0 -55
  52. venv/Lib/site-packages/pip/_internal/distributions/installed.py +0 -33
  53. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +0 -165
  54. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +0 -44
  55. venv/Lib/site-packages/pip/_internal/exceptions.py +0 -881
  56. venv/Lib/site-packages/pip/_internal/index/__init__.py +0 -1
  57. venv/Lib/site-packages/pip/_internal/index/collector.py +0 -489
  58. venv/Lib/site-packages/pip/_internal/index/package_finder.py +0 -1059
  59. venv/Lib/site-packages/pip/_internal/index/sources.py +0 -287
  60. venv/Lib/site-packages/pip/_internal/locations/__init__.py +0 -441
  61. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +0 -173
  62. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +0 -215
  63. venv/Lib/site-packages/pip/_internal/locations/base.py +0 -82
  64. venv/Lib/site-packages/pip/_internal/main.py +0 -12
  65. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +0 -164
  66. venv/Lib/site-packages/pip/_internal/metadata/_json.py +0 -87
  67. venv/Lib/site-packages/pip/_internal/metadata/base.py +0 -685
  68. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
  69. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -87
  70. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -223
  71. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -143
  72. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +0 -298
  73. venv/Lib/site-packages/pip/_internal/models/__init__.py +0 -1
  74. venv/Lib/site-packages/pip/_internal/models/candidate.py +0 -25
  75. venv/Lib/site-packages/pip/_internal/models/direct_url.py +0 -227
  76. venv/Lib/site-packages/pip/_internal/models/format_control.py +0 -78
  77. venv/Lib/site-packages/pip/_internal/models/index.py +0 -28
  78. venv/Lib/site-packages/pip/_internal/models/installation_report.py +0 -57
  79. venv/Lib/site-packages/pip/_internal/models/link.py +0 -613
  80. venv/Lib/site-packages/pip/_internal/models/pylock.py +0 -188
  81. venv/Lib/site-packages/pip/_internal/models/scheme.py +0 -25
  82. venv/Lib/site-packages/pip/_internal/models/search_scope.py +0 -126
  83. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -53
  84. venv/Lib/site-packages/pip/_internal/models/target_python.py +0 -122
  85. venv/Lib/site-packages/pip/_internal/models/wheel.py +0 -141
  86. venv/Lib/site-packages/pip/_internal/network/__init__.py +0 -1
  87. venv/Lib/site-packages/pip/_internal/network/auth.py +0 -564
  88. venv/Lib/site-packages/pip/_internal/network/cache.py +0 -133
  89. venv/Lib/site-packages/pip/_internal/network/download.py +0 -342
  90. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +0 -213
  91. venv/Lib/site-packages/pip/_internal/network/session.py +0 -528
  92. venv/Lib/site-packages/pip/_internal/network/utils.py +0 -98
  93. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +0 -61
  94. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  95. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  96. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +0 -140
  97. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +0 -38
  98. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
  99. venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -73
  100. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +0 -38
  101. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -47
  102. venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -119
  103. venv/Lib/site-packages/pip/_internal/operations/check.py +0 -175
  104. venv/Lib/site-packages/pip/_internal/operations/freeze.py +0 -259
  105. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +0 -1
  106. venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -48
  107. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +0 -746
  108. venv/Lib/site-packages/pip/_internal/operations/prepare.py +0 -742
  109. venv/Lib/site-packages/pip/_internal/pyproject.py +0 -182
  110. venv/Lib/site-packages/pip/_internal/req/__init__.py +0 -105
  111. venv/Lib/site-packages/pip/_internal/req/constructors.py +0 -562
  112. venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +0 -75
  113. venv/Lib/site-packages/pip/_internal/req/req_file.py +0 -620
  114. venv/Lib/site-packages/pip/_internal/req/req_install.py +0 -937
  115. venv/Lib/site-packages/pip/_internal/req/req_set.py +0 -81
  116. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +0 -639
  117. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  118. venv/Lib/site-packages/pip/_internal/resolution/base.py +0 -20
  119. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  120. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -598
  121. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  122. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -142
  123. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -582
  124. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -814
  125. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -166
  126. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -276
  127. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -85
  128. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -247
  129. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -336
  130. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +0 -254
  131. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  132. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
  133. venv/Lib/site-packages/pip/_internal/utils/_log.py +0 -38
  134. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +0 -52
  135. venv/Lib/site-packages/pip/_internal/utils/compat.py +0 -85
  136. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -201
  137. venv/Lib/site-packages/pip/_internal/utils/datetime.py +0 -10
  138. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +0 -126
  139. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
  140. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +0 -81
  141. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +0 -88
  142. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +0 -152
  143. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +0 -24
  144. venv/Lib/site-packages/pip/_internal/utils/glibc.py +0 -102
  145. venv/Lib/site-packages/pip/_internal/utils/hashes.py +0 -150
  146. venv/Lib/site-packages/pip/_internal/utils/logging.py +0 -364
  147. venv/Lib/site-packages/pip/_internal/utils/misc.py +0 -765
  148. venv/Lib/site-packages/pip/_internal/utils/packaging.py +0 -44
  149. venv/Lib/site-packages/pip/_internal/utils/retry.py +0 -45
  150. venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +0 -149
  151. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +0 -248
  152. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +0 -294
  153. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +0 -337
  154. venv/Lib/site-packages/pip/_internal/utils/urls.py +0 -55
  155. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +0 -105
  156. venv/Lib/site-packages/pip/_internal/utils/wheel.py +0 -132
  157. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +0 -15
  158. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +0 -130
  159. venv/Lib/site-packages/pip/_internal/vcs/git.py +0 -571
  160. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -186
  161. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +0 -335
  162. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
  163. venv/Lib/site-packages/pip/_internal/wheel_builder.py +0 -334
  164. venv/Lib/site-packages/pip/_vendor/__init__.py +0 -117
  165. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -29
  166. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
  167. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -168
  168. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +0 -75
  169. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
  170. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -145
  171. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
  172. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -511
  173. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
  174. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -157
  175. venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  176. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
  177. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
  178. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +0 -4
  179. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +0 -12
  180. venv/Lib/site-packages/pip/_vendor/certifi/core.py +0 -83
  181. venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
  182. venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +0 -13
  183. venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +0 -65
  184. venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +0 -209
  185. venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +0 -59
  186. venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +0 -62
  187. venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +0 -9
  188. venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
  189. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +0 -33
  190. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +0 -1137
  191. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +0 -358
  192. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +0 -447
  193. venv/Lib/site-packages/pip/_vendor/distlib/util.py +0 -1984
  194. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +0 -54
  195. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +0 -4
  196. venv/Lib/site-packages/pip/_vendor/distro/distro.py +0 -1403
  197. venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
  198. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +0 -45
  199. venv/Lib/site-packages/pip/_vendor/idna/codec.py +0 -122
  200. venv/Lib/site-packages/pip/_vendor/idna/compat.py +0 -15
  201. venv/Lib/site-packages/pip/_vendor/idna/core.py +0 -437
  202. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +0 -4243
  203. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +0 -57
  204. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +0 -1
  205. venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
  206. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +0 -8681
  207. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
  208. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
  209. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +0 -170
  210. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +0 -929
  211. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +0 -15
  212. venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +0 -109
  213. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
  214. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
  215. venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +0 -353
  216. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +0 -61
  217. venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -195
  218. venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +0 -145
  219. venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +0 -759
  220. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +0 -362
  221. venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +0 -862
  222. venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
  223. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +0 -91
  224. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +0 -1019
  225. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -656
  226. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +0 -163
  227. venv/Lib/site-packages/pip/_vendor/packaging/version.py +0 -582
  228. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
  229. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +0 -631
  230. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
  231. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +0 -249
  232. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +0 -299
  233. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +0 -144
  234. venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  235. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +0 -272
  236. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +0 -21
  237. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
  238. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +0 -82
  239. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +0 -17
  240. venv/Lib/site-packages/pip/_vendor/pygments/console.py +0 -70
  241. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +0 -70
  242. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
  243. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +0 -129
  244. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
  245. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
  246. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +0 -963
  247. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
  248. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -602
  249. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1201
  250. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +0 -43
  251. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +0 -72
  252. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
  253. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +0 -104
  254. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
  255. venv/Lib/site-packages/pip/_vendor/pygments/style.py +0 -203
  256. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
  257. venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
  258. venv/Lib/site-packages/pip/_vendor/pygments/token.py +0 -214
  259. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +0 -153
  260. venv/Lib/site-packages/pip/_vendor/pygments/util.py +0 -324
  261. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -31
  262. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -410
  263. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -21
  264. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -389
  265. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  266. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +0 -179
  267. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +0 -14
  268. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
  269. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +0 -719
  270. venv/Lib/site-packages/pip/_vendor/requests/api.py +0 -157
  271. venv/Lib/site-packages/pip/_vendor/requests/auth.py +0 -314
  272. venv/Lib/site-packages/pip/_vendor/requests/certs.py +0 -17
  273. venv/Lib/site-packages/pip/_vendor/requests/compat.py +0 -90
  274. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +0 -561
  275. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +0 -151
  276. venv/Lib/site-packages/pip/_vendor/requests/help.py +0 -127
  277. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +0 -33
  278. venv/Lib/site-packages/pip/_vendor/requests/models.py +0 -1039
  279. venv/Lib/site-packages/pip/_vendor/requests/packages.py +0 -25
  280. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +0 -831
  281. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +0 -128
  282. venv/Lib/site-packages/pip/_vendor/requests/structures.py +0 -99
  283. venv/Lib/site-packages/pip/_vendor/requests/utils.py +0 -1086
  284. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +0 -27
  285. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +0 -196
  286. venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  287. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +0 -55
  288. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +0 -27
  289. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +0 -47
  290. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +0 -48
  291. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +0 -57
  292. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +0 -622
  293. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +0 -209
  294. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +0 -177
  295. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +0 -245
  296. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
  297. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
  298. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
  299. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +0 -76
  300. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +0 -10
  301. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +0 -24
  302. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +0 -268
  303. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +0 -94
  304. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +0 -43
  305. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +0 -69
  306. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +0 -309
  307. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +0 -17
  308. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +0 -153
  309. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +0 -482
  310. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +0 -16
  311. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +0 -19
  312. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +0 -661
  313. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +0 -71
  314. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
  315. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +0 -93
  316. venv/Lib/site-packages/pip/_vendor/rich/abc.py +0 -33
  317. venv/Lib/site-packages/pip/_vendor/rich/align.py +0 -306
  318. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +0 -241
  319. venv/Lib/site-packages/pip/_vendor/rich/bar.py +0 -93
  320. venv/Lib/site-packages/pip/_vendor/rich/box.py +0 -474
  321. venv/Lib/site-packages/pip/_vendor/rich/cells.py +0 -174
  322. venv/Lib/site-packages/pip/_vendor/rich/color.py +0 -621
  323. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
  324. venv/Lib/site-packages/pip/_vendor/rich/columns.py +0 -187
  325. venv/Lib/site-packages/pip/_vendor/rich/console.py +0 -2680
  326. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +0 -37
  327. venv/Lib/site-packages/pip/_vendor/rich/containers.py +0 -167
  328. venv/Lib/site-packages/pip/_vendor/rich/control.py +0 -219
  329. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +0 -193
  330. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +0 -39
  331. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +0 -91
  332. venv/Lib/site-packages/pip/_vendor/rich/errors.py +0 -34
  333. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
  334. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +0 -88
  335. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +0 -232
  336. venv/Lib/site-packages/pip/_vendor/rich/json.py +0 -139
  337. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +0 -101
  338. venv/Lib/site-packages/pip/_vendor/rich/layout.py +0 -442
  339. venv/Lib/site-packages/pip/_vendor/rich/live.py +0 -400
  340. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +0 -106
  341. venv/Lib/site-packages/pip/_vendor/rich/logging.py +0 -297
  342. venv/Lib/site-packages/pip/_vendor/rich/markup.py +0 -251
  343. venv/Lib/site-packages/pip/_vendor/rich/measure.py +0 -151
  344. venv/Lib/site-packages/pip/_vendor/rich/padding.py +0 -141
  345. venv/Lib/site-packages/pip/_vendor/rich/pager.py +0 -34
  346. venv/Lib/site-packages/pip/_vendor/rich/palette.py +0 -100
  347. venv/Lib/site-packages/pip/_vendor/rich/panel.py +0 -317
  348. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +0 -1016
  349. venv/Lib/site-packages/pip/_vendor/rich/progress.py +0 -1715
  350. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
  351. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +0 -400
  352. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +0 -42
  353. venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
  354. venv/Lib/site-packages/pip/_vendor/rich/region.py +0 -10
  355. venv/Lib/site-packages/pip/_vendor/rich/repr.py +0 -149
  356. venv/Lib/site-packages/pip/_vendor/rich/rule.py +0 -130
  357. venv/Lib/site-packages/pip/_vendor/rich/scope.py +0 -86
  358. venv/Lib/site-packages/pip/_vendor/rich/screen.py +0 -54
  359. venv/Lib/site-packages/pip/_vendor/rich/segment.py +0 -752
  360. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +0 -132
  361. venv/Lib/site-packages/pip/_vendor/rich/status.py +0 -131
  362. venv/Lib/site-packages/pip/_vendor/rich/style.py +0 -796
  363. venv/Lib/site-packages/pip/_vendor/rich/styled.py +0 -42
  364. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +0 -985
  365. venv/Lib/site-packages/pip/_vendor/rich/table.py +0 -1006
  366. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
  367. venv/Lib/site-packages/pip/_vendor/rich/text.py +0 -1361
  368. venv/Lib/site-packages/pip/_vendor/rich/theme.py +0 -115
  369. venv/Lib/site-packages/pip/_vendor/rich/themes.py +0 -5
  370. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +0 -899
  371. venv/Lib/site-packages/pip/_vendor/rich/tree.py +0 -257
  372. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +0 -8
  373. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +0 -770
  374. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +0 -112
  375. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +0 -10
  376. venv/Lib/site-packages/pip/_vendor/tomli/py.typed +0 -1
  377. venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +0 -4
  378. venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +0 -229
  379. venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +0 -1
  380. venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +0 -36
  381. venv/Lib/site-packages/pip/_vendor/truststore/_api.py +0 -333
  382. venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +0 -571
  383. venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
  384. venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
  385. venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +0 -567
  386. venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
  387. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
  388. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
  389. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +0 -2
  390. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +0 -572
  391. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
  392. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  393. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
  394. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  395. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
  396. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  397. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
  398. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
  399. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
  400. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
  401. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
  402. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
  403. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +0 -274
  404. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
  405. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  406. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  407. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
  408. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
  409. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
  410. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
  411. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +0 -191
  412. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +0 -879
  413. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
  414. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
  415. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
  416. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
  417. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
  418. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
  419. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
  420. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
  421. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
  422. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
  423. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
  424. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
  425. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
  426. venv/Lib/site-packages/pip/py.typed +0 -4
  427. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.1.dist-info}/WHEEL +0 -0
@@ -1,528 +0,0 @@
1
- """PipSession and supporting code, containing all pip-specific
2
- network request configuration and behavior.
3
- """
4
-
5
- from __future__ import annotations
6
-
7
- import email.utils
8
- import functools
9
- import io
10
- import ipaddress
11
- import json
12
- import logging
13
- import mimetypes
14
- import os
15
- import platform
16
- import shutil
17
- import subprocess
18
- import sys
19
- import urllib.parse
20
- import warnings
21
- from collections.abc import Generator, Mapping, Sequence
22
- from typing import (
23
- TYPE_CHECKING,
24
- Any,
25
- Optional,
26
- Union,
27
- )
28
-
29
- from pip._vendor import requests, urllib3
30
- from pip._vendor.cachecontrol import CacheControlAdapter as _BaseCacheControlAdapter
31
- from pip._vendor.requests.adapters import DEFAULT_POOLBLOCK, BaseAdapter
32
- from pip._vendor.requests.adapters import HTTPAdapter as _BaseHTTPAdapter
33
- from pip._vendor.requests.models import PreparedRequest, Response
34
- from pip._vendor.requests.structures import CaseInsensitiveDict
35
- from pip._vendor.urllib3.connectionpool import ConnectionPool
36
- from pip._vendor.urllib3.exceptions import InsecureRequestWarning
37
-
38
- from pip import __version__
39
- from pip._internal.metadata import get_default_environment
40
- from pip._internal.models.link import Link
41
- from pip._internal.network.auth import MultiDomainBasicAuth
42
- from pip._internal.network.cache import SafeFileCache
43
-
44
- # Import ssl from compat so the initial import occurs in only one place.
45
- from pip._internal.utils.compat import has_tls
46
- from pip._internal.utils.glibc import libc_ver
47
- from pip._internal.utils.misc import build_url_from_netloc, parse_netloc
48
- from pip._internal.utils.urls import url_to_path
49
-
50
- if TYPE_CHECKING:
51
- from ssl import SSLContext
52
-
53
- from pip._vendor.urllib3.poolmanager import PoolManager
54
- from pip._vendor.urllib3.proxymanager import ProxyManager
55
-
56
-
57
- logger = logging.getLogger(__name__)
58
-
59
- SecureOrigin = tuple[str, str, Optional[Union[int, str]]]
60
-
61
-
62
- # Ignore warning raised when using --trusted-host.
63
- warnings.filterwarnings("ignore", category=InsecureRequestWarning)
64
-
65
-
66
- SECURE_ORIGINS: list[SecureOrigin] = [
67
- # protocol, hostname, port
68
- # Taken from Chrome's list of secure origins (See: http://bit.ly/1qrySKC)
69
- ("https", "*", "*"),
70
- ("*", "localhost", "*"),
71
- ("*", "127.0.0.0/8", "*"),
72
- ("*", "::1/128", "*"),
73
- ("file", "*", None),
74
- # ssh is always secure.
75
- ("ssh", "*", "*"),
76
- ]
77
-
78
-
79
- # These are environment variables present when running under various
80
- # CI systems. For each variable, some CI systems that use the variable
81
- # are indicated. The collection was chosen so that for each of a number
82
- # of popular systems, at least one of the environment variables is used.
83
- # This list is used to provide some indication of and lower bound for
84
- # CI traffic to PyPI. Thus, it is okay if the list is not comprehensive.
85
- # For more background, see: https://github.com/pypa/pip/issues/5499
86
- CI_ENVIRONMENT_VARIABLES = (
87
- # Azure Pipelines
88
- "BUILD_BUILDID",
89
- # Jenkins
90
- "BUILD_ID",
91
- # AppVeyor, CircleCI, Codeship, Gitlab CI, Shippable, Travis CI
92
- "CI",
93
- # Explicit environment variable.
94
- "PIP_IS_CI",
95
- )
96
-
97
-
98
- def looks_like_ci() -> bool:
99
- """
100
- Return whether it looks like pip is running under CI.
101
- """
102
- # We don't use the method of checking for a tty (e.g. using isatty())
103
- # because some CI systems mimic a tty (e.g. Travis CI). Thus that
104
- # method doesn't provide definitive information in either direction.
105
- return any(name in os.environ for name in CI_ENVIRONMENT_VARIABLES)
106
-
107
-
108
- @functools.lru_cache(maxsize=1)
109
- def user_agent() -> str:
110
- """
111
- Return a string representing the user agent.
112
- """
113
- data: dict[str, Any] = {
114
- "installer": {"name": "pip", "version": __version__},
115
- "python": platform.python_version(),
116
- "implementation": {
117
- "name": platform.python_implementation(),
118
- },
119
- }
120
-
121
- if data["implementation"]["name"] == "CPython":
122
- data["implementation"]["version"] = platform.python_version()
123
- elif data["implementation"]["name"] == "PyPy":
124
- pypy_version_info = sys.pypy_version_info # type: ignore
125
- if pypy_version_info.releaselevel == "final":
126
- pypy_version_info = pypy_version_info[:3]
127
- data["implementation"]["version"] = ".".join(
128
- [str(x) for x in pypy_version_info]
129
- )
130
- elif data["implementation"]["name"] == "Jython":
131
- # Complete Guess
132
- data["implementation"]["version"] = platform.python_version()
133
- elif data["implementation"]["name"] == "IronPython":
134
- # Complete Guess
135
- data["implementation"]["version"] = platform.python_version()
136
-
137
- if sys.platform.startswith("linux"):
138
- from pip._vendor import distro
139
-
140
- linux_distribution = distro.name(), distro.version(), distro.codename()
141
- distro_infos: dict[str, Any] = dict(
142
- filter(
143
- lambda x: x[1],
144
- zip(["name", "version", "id"], linux_distribution),
145
- )
146
- )
147
- libc = dict(
148
- filter(
149
- lambda x: x[1],
150
- zip(["lib", "version"], libc_ver()),
151
- )
152
- )
153
- if libc:
154
- distro_infos["libc"] = libc
155
- if distro_infos:
156
- data["distro"] = distro_infos
157
-
158
- if sys.platform.startswith("darwin") and platform.mac_ver()[0]:
159
- data["distro"] = {"name": "macOS", "version": platform.mac_ver()[0]}
160
-
161
- if platform.system():
162
- data.setdefault("system", {})["name"] = platform.system()
163
-
164
- if platform.release():
165
- data.setdefault("system", {})["release"] = platform.release()
166
-
167
- if platform.machine():
168
- data["cpu"] = platform.machine()
169
-
170
- if has_tls():
171
- import _ssl as ssl
172
-
173
- data["openssl_version"] = ssl.OPENSSL_VERSION
174
-
175
- setuptools_dist = get_default_environment().get_distribution("setuptools")
176
- if setuptools_dist is not None:
177
- data["setuptools_version"] = str(setuptools_dist.version)
178
-
179
- if shutil.which("rustc") is not None:
180
- # If for any reason `rustc --version` fails, silently ignore it
181
- try:
182
- rustc_output = subprocess.check_output(
183
- ["rustc", "--version"], stderr=subprocess.STDOUT, timeout=0.5
184
- )
185
- except Exception:
186
- pass
187
- else:
188
- if rustc_output.startswith(b"rustc "):
189
- # The format of `rustc --version` is:
190
- # `b'rustc 1.52.1 (9bc8c42bb 2021-05-09)\n'`
191
- # We extract just the middle (1.52.1) part
192
- data["rustc_version"] = rustc_output.split(b" ")[1].decode()
193
-
194
- # Use None rather than False so as not to give the impression that
195
- # pip knows it is not being run under CI. Rather, it is a null or
196
- # inconclusive result. Also, we include some value rather than no
197
- # value to make it easier to know that the check has been run.
198
- data["ci"] = True if looks_like_ci() else None
199
-
200
- user_data = os.environ.get("PIP_USER_AGENT_USER_DATA")
201
- if user_data is not None:
202
- data["user_data"] = user_data
203
-
204
- return "{data[installer][name]}/{data[installer][version]} {json}".format(
205
- data=data,
206
- json=json.dumps(data, separators=(",", ":"), sort_keys=True),
207
- )
208
-
209
-
210
- class LocalFSAdapter(BaseAdapter):
211
- def send(
212
- self,
213
- request: PreparedRequest,
214
- stream: bool = False,
215
- timeout: float | tuple[float, float] | None = None,
216
- verify: bool | str = True,
217
- cert: str | tuple[str, str] | None = None,
218
- proxies: Mapping[str, str] | None = None,
219
- ) -> Response:
220
- pathname = url_to_path(request.url)
221
-
222
- resp = Response()
223
- resp.status_code = 200
224
- resp.url = request.url
225
-
226
- try:
227
- stats = os.stat(pathname)
228
- except OSError as exc:
229
- # format the exception raised as a io.BytesIO object,
230
- # to return a better error message:
231
- resp.status_code = 404
232
- resp.reason = type(exc).__name__
233
- resp.raw = io.BytesIO(f"{resp.reason}: {exc}".encode())
234
- else:
235
- modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
236
- content_type = mimetypes.guess_type(pathname)[0] or "text/plain"
237
- resp.headers = CaseInsensitiveDict(
238
- {
239
- "Content-Type": content_type,
240
- "Content-Length": stats.st_size,
241
- "Last-Modified": modified,
242
- }
243
- )
244
-
245
- resp.raw = open(pathname, "rb")
246
- resp.close = resp.raw.close
247
-
248
- return resp
249
-
250
- def close(self) -> None:
251
- pass
252
-
253
-
254
- class _SSLContextAdapterMixin:
255
- """Mixin to add the ``ssl_context`` constructor argument to HTTP adapters.
256
-
257
- The additional argument is forwarded directly to the pool manager. This allows us
258
- to dynamically decide what SSL store to use at runtime, which is used to implement
259
- the optional ``truststore`` backend.
260
- """
261
-
262
- def __init__(
263
- self,
264
- *,
265
- ssl_context: SSLContext | None = None,
266
- **kwargs: Any,
267
- ) -> None:
268
- self._ssl_context = ssl_context
269
- super().__init__(**kwargs)
270
-
271
- def init_poolmanager(
272
- self,
273
- connections: int,
274
- maxsize: int,
275
- block: bool = DEFAULT_POOLBLOCK,
276
- **pool_kwargs: Any,
277
- ) -> PoolManager:
278
- if self._ssl_context is not None:
279
- pool_kwargs.setdefault("ssl_context", self._ssl_context)
280
- return super().init_poolmanager( # type: ignore[misc]
281
- connections=connections,
282
- maxsize=maxsize,
283
- block=block,
284
- **pool_kwargs,
285
- )
286
-
287
- def proxy_manager_for(self, proxy: str, **proxy_kwargs: Any) -> ProxyManager:
288
- # Proxy manager replaces the pool manager, so inject our SSL
289
- # context here too. https://github.com/pypa/pip/issues/13288
290
- if self._ssl_context is not None:
291
- proxy_kwargs.setdefault("ssl_context", self._ssl_context)
292
- return super().proxy_manager_for(proxy, **proxy_kwargs) # type: ignore[misc]
293
-
294
-
295
- class HTTPAdapter(_SSLContextAdapterMixin, _BaseHTTPAdapter):
296
- pass
297
-
298
-
299
- class CacheControlAdapter(_SSLContextAdapterMixin, _BaseCacheControlAdapter):
300
- pass
301
-
302
-
303
- class InsecureHTTPAdapter(HTTPAdapter):
304
- def cert_verify(
305
- self,
306
- conn: ConnectionPool,
307
- url: str,
308
- verify: bool | str,
309
- cert: str | tuple[str, str] | None,
310
- ) -> None:
311
- super().cert_verify(conn=conn, url=url, verify=False, cert=cert)
312
-
313
-
314
- class InsecureCacheControlAdapter(CacheControlAdapter):
315
- def cert_verify(
316
- self,
317
- conn: ConnectionPool,
318
- url: str,
319
- verify: bool | str,
320
- cert: str | tuple[str, str] | None,
321
- ) -> None:
322
- super().cert_verify(conn=conn, url=url, verify=False, cert=cert)
323
-
324
-
325
- class PipSession(requests.Session):
326
- timeout: int | None = None
327
-
328
- def __init__(
329
- self,
330
- *args: Any,
331
- retries: int = 0,
332
- cache: str | None = None,
333
- trusted_hosts: Sequence[str] = (),
334
- index_urls: list[str] | None = None,
335
- ssl_context: SSLContext | None = None,
336
- **kwargs: Any,
337
- ) -> None:
338
- """
339
- :param trusted_hosts: Domains not to emit warnings for when not using
340
- HTTPS.
341
- """
342
- super().__init__(*args, **kwargs)
343
-
344
- # Namespace the attribute with "pip_" just in case to prevent
345
- # possible conflicts with the base class.
346
- self.pip_trusted_origins: list[tuple[str, int | None]] = []
347
- self.pip_proxy = None
348
-
349
- # Attach our User Agent to the request
350
- self.headers["User-Agent"] = user_agent()
351
-
352
- # Attach our Authentication handler to the session
353
- self.auth = MultiDomainBasicAuth(index_urls=index_urls)
354
-
355
- # Create our urllib3.Retry instance which will allow us to customize
356
- # how we handle retries.
357
- retries = urllib3.Retry(
358
- # Set the total number of retries that a particular request can
359
- # have.
360
- total=retries,
361
- # A 503 error from PyPI typically means that the Fastly -> Origin
362
- # connection got interrupted in some way. A 503 error in general
363
- # is typically considered a transient error so we'll go ahead and
364
- # retry it.
365
- # A 500 may indicate transient error in Amazon S3
366
- # A 502 may be a transient error from a CDN like CloudFlare or CloudFront
367
- # A 520 or 527 - may indicate transient error in CloudFlare
368
- status_forcelist=[500, 502, 503, 520, 527],
369
- # Add a small amount of back off between failed requests in
370
- # order to prevent hammering the service.
371
- backoff_factor=0.25,
372
- ) # type: ignore
373
-
374
- # Our Insecure HTTPAdapter disables HTTPS validation. It does not
375
- # support caching so we'll use it for all http:// URLs.
376
- # If caching is disabled, we will also use it for
377
- # https:// hosts that we've marked as ignoring
378
- # TLS errors for (trusted-hosts).
379
- insecure_adapter = InsecureHTTPAdapter(max_retries=retries)
380
-
381
- # We want to _only_ cache responses on securely fetched origins or when
382
- # the host is specified as trusted. We do this because
383
- # we can't validate the response of an insecurely/untrusted fetched
384
- # origin, and we don't want someone to be able to poison the cache and
385
- # require manual eviction from the cache to fix it.
386
- if cache:
387
- secure_adapter = CacheControlAdapter(
388
- cache=SafeFileCache(cache),
389
- max_retries=retries,
390
- ssl_context=ssl_context,
391
- )
392
- self._trusted_host_adapter = InsecureCacheControlAdapter(
393
- cache=SafeFileCache(cache),
394
- max_retries=retries,
395
- )
396
- else:
397
- secure_adapter = HTTPAdapter(max_retries=retries, ssl_context=ssl_context)
398
- self._trusted_host_adapter = insecure_adapter
399
-
400
- self.mount("https://", secure_adapter)
401
- self.mount("http://", insecure_adapter)
402
-
403
- # Enable file:// urls
404
- self.mount("file://", LocalFSAdapter())
405
-
406
- for host in trusted_hosts:
407
- self.add_trusted_host(host, suppress_logging=True)
408
-
409
- def update_index_urls(self, new_index_urls: list[str]) -> None:
410
- """
411
- :param new_index_urls: New index urls to update the authentication
412
- handler with.
413
- """
414
- self.auth.index_urls = new_index_urls
415
-
416
- def add_trusted_host(
417
- self, host: str, source: str | None = None, suppress_logging: bool = False
418
- ) -> None:
419
- """
420
- :param host: It is okay to provide a host that has previously been
421
- added.
422
- :param source: An optional source string, for logging where the host
423
- string came from.
424
- """
425
- if not suppress_logging:
426
- msg = f"adding trusted host: {host!r}"
427
- if source is not None:
428
- msg += f" (from {source})"
429
- logger.info(msg)
430
-
431
- parsed_host, parsed_port = parse_netloc(host)
432
- if parsed_host is None:
433
- raise ValueError(f"Trusted host URL must include a host part: {host!r}")
434
- if (parsed_host, parsed_port) not in self.pip_trusted_origins:
435
- self.pip_trusted_origins.append((parsed_host, parsed_port))
436
-
437
- self.mount(
438
- build_url_from_netloc(host, scheme="http") + "/", self._trusted_host_adapter
439
- )
440
- self.mount(build_url_from_netloc(host) + "/", self._trusted_host_adapter)
441
- if not parsed_port:
442
- self.mount(
443
- build_url_from_netloc(host, scheme="http") + ":",
444
- self._trusted_host_adapter,
445
- )
446
- # Mount wildcard ports for the same host.
447
- self.mount(build_url_from_netloc(host) + ":", self._trusted_host_adapter)
448
-
449
- def iter_secure_origins(self) -> Generator[SecureOrigin, None, None]:
450
- yield from SECURE_ORIGINS
451
- for host, port in self.pip_trusted_origins:
452
- yield ("*", host, "*" if port is None else port)
453
-
454
- def is_secure_origin(self, location: Link) -> bool:
455
- # Determine if this url used a secure transport mechanism
456
- parsed = urllib.parse.urlparse(str(location))
457
- origin_protocol, origin_host, origin_port = (
458
- parsed.scheme,
459
- parsed.hostname,
460
- parsed.port,
461
- )
462
-
463
- # The protocol to use to see if the protocol matches.
464
- # Don't count the repository type as part of the protocol: in
465
- # cases such as "git+ssh", only use "ssh". (I.e., Only verify against
466
- # the last scheme.)
467
- origin_protocol = origin_protocol.rsplit("+", 1)[-1]
468
-
469
- # Determine if our origin is a secure origin by looking through our
470
- # hardcoded list of secure origins, as well as any additional ones
471
- # configured on this PackageFinder instance.
472
- for secure_origin in self.iter_secure_origins():
473
- secure_protocol, secure_host, secure_port = secure_origin
474
- if origin_protocol != secure_protocol and secure_protocol != "*":
475
- continue
476
-
477
- try:
478
- addr = ipaddress.ip_address(origin_host or "")
479
- network = ipaddress.ip_network(secure_host)
480
- except ValueError:
481
- # We don't have both a valid address or a valid network, so
482
- # we'll check this origin against hostnames.
483
- if (
484
- origin_host
485
- and origin_host.lower() != secure_host.lower()
486
- and secure_host != "*"
487
- ):
488
- continue
489
- else:
490
- # We have a valid address and network, so see if the address
491
- # is contained within the network.
492
- if addr not in network:
493
- continue
494
-
495
- # Check to see if the port matches.
496
- if (
497
- origin_port != secure_port
498
- and secure_port != "*"
499
- and secure_port is not None
500
- ):
501
- continue
502
-
503
- # If we've gotten here, then this origin matches the current
504
- # secure origin and we should return True
505
- return True
506
-
507
- # If we've gotten to this point, then the origin isn't secure and we
508
- # will not accept it as a valid location to search. We will however
509
- # log a warning that we are ignoring it.
510
- logger.warning(
511
- "The repository located at %s is not a trusted or secure host and "
512
- "is being ignored. If this repository is available via HTTPS we "
513
- "recommend you use HTTPS instead, otherwise you may silence "
514
- "this warning and allow it anyway with '--trusted-host %s'.",
515
- origin_host,
516
- origin_host,
517
- )
518
-
519
- return False
520
-
521
- def request(self, method: str, url: str, *args: Any, **kwargs: Any) -> Response:
522
- # Allow setting a default timeout on a session
523
- kwargs.setdefault("timeout", self.timeout)
524
- # Allow setting a default proxies on a session
525
- kwargs.setdefault("proxies", self.proxies)
526
-
527
- # Dispatch the actual request
528
- return super().request(method, url, *args, **kwargs)
@@ -1,98 +0,0 @@
1
- from collections.abc import Generator
2
-
3
- from pip._vendor.requests.models import Response
4
-
5
- from pip._internal.exceptions import NetworkConnectionError
6
-
7
- # The following comments and HTTP headers were originally added by
8
- # Donald Stufft in git commit 22c562429a61bb77172039e480873fb239dd8c03.
9
- #
10
- # We use Accept-Encoding: identity here because requests defaults to
11
- # accepting compressed responses. This breaks in a variety of ways
12
- # depending on how the server is configured.
13
- # - Some servers will notice that the file isn't a compressible file
14
- # and will leave the file alone and with an empty Content-Encoding
15
- # - Some servers will notice that the file is already compressed and
16
- # will leave the file alone, adding a Content-Encoding: gzip header
17
- # - Some servers won't notice anything at all and will take a file
18
- # that's already been compressed and compress it again, and set
19
- # the Content-Encoding: gzip header
20
- # By setting this to request only the identity encoding we're hoping
21
- # to eliminate the third case. Hopefully there does not exist a server
22
- # which when given a file will notice it is already compressed and that
23
- # you're not asking for a compressed file and will then decompress it
24
- # before sending because if that's the case I don't think it'll ever be
25
- # possible to make this work.
26
- HEADERS: dict[str, str] = {"Accept-Encoding": "identity"}
27
-
28
- DOWNLOAD_CHUNK_SIZE = 256 * 1024
29
-
30
-
31
- def raise_for_status(resp: Response) -> None:
32
- http_error_msg = ""
33
- if isinstance(resp.reason, bytes):
34
- # We attempt to decode utf-8 first because some servers
35
- # choose to localize their reason strings. If the string
36
- # isn't utf-8, we fall back to iso-8859-1 for all other
37
- # encodings.
38
- try:
39
- reason = resp.reason.decode("utf-8")
40
- except UnicodeDecodeError:
41
- reason = resp.reason.decode("iso-8859-1")
42
- else:
43
- reason = resp.reason
44
-
45
- if 400 <= resp.status_code < 500:
46
- http_error_msg = (
47
- f"{resp.status_code} Client Error: {reason} for url: {resp.url}"
48
- )
49
-
50
- elif 500 <= resp.status_code < 600:
51
- http_error_msg = (
52
- f"{resp.status_code} Server Error: {reason} for url: {resp.url}"
53
- )
54
-
55
- if http_error_msg:
56
- raise NetworkConnectionError(http_error_msg, response=resp)
57
-
58
-
59
- def response_chunks(
60
- response: Response, chunk_size: int = DOWNLOAD_CHUNK_SIZE
61
- ) -> Generator[bytes, None, None]:
62
- """Given a requests Response, provide the data chunks."""
63
- try:
64
- # Special case for urllib3.
65
- for chunk in response.raw.stream(
66
- chunk_size,
67
- # We use decode_content=False here because we don't
68
- # want urllib3 to mess with the raw bytes we get
69
- # from the server. If we decompress inside of
70
- # urllib3 then we cannot verify the checksum
71
- # because the checksum will be of the compressed
72
- # file. This breakage will only occur if the
73
- # server adds a Content-Encoding header, which
74
- # depends on how the server was configured:
75
- # - Some servers will notice that the file isn't a
76
- # compressible file and will leave the file alone
77
- # and with an empty Content-Encoding
78
- # - Some servers will notice that the file is
79
- # already compressed and will leave the file
80
- # alone and will add a Content-Encoding: gzip
81
- # header
82
- # - Some servers won't notice anything at all and
83
- # will take a file that's already been compressed
84
- # and compress it again and set the
85
- # Content-Encoding: gzip header
86
- #
87
- # By setting this not to decode automatically we
88
- # hope to eliminate problems with the second case.
89
- decode_content=False,
90
- ):
91
- yield chunk
92
- except AttributeError:
93
- # Standard file-like object.
94
- while True:
95
- chunk = response.raw.read(chunk_size)
96
- if not chunk:
97
- break
98
- yield chunk
@@ -1,61 +0,0 @@
1
- """xmlrpclib.Transport implementation"""
2
-
3
- import logging
4
- import urllib.parse
5
- import xmlrpc.client
6
- from typing import TYPE_CHECKING
7
-
8
- from pip._internal.exceptions import NetworkConnectionError
9
- from pip._internal.network.session import PipSession
10
- from pip._internal.network.utils import raise_for_status
11
-
12
- if TYPE_CHECKING:
13
- from xmlrpc.client import _HostType, _Marshallable
14
-
15
- from _typeshed import SizedBuffer
16
-
17
- logger = logging.getLogger(__name__)
18
-
19
-
20
- class PipXmlrpcTransport(xmlrpc.client.Transport):
21
- """Provide a `xmlrpclib.Transport` implementation via a `PipSession`
22
- object.
23
- """
24
-
25
- def __init__(
26
- self, index_url: str, session: PipSession, use_datetime: bool = False
27
- ) -> None:
28
- super().__init__(use_datetime)
29
- index_parts = urllib.parse.urlparse(index_url)
30
- self._scheme = index_parts.scheme
31
- self._session = session
32
-
33
- def request(
34
- self,
35
- host: "_HostType",
36
- handler: str,
37
- request_body: "SizedBuffer",
38
- verbose: bool = False,
39
- ) -> tuple["_Marshallable", ...]:
40
- assert isinstance(host, str)
41
- parts = (self._scheme, host, handler, None, None, None)
42
- url = urllib.parse.urlunparse(parts)
43
- try:
44
- headers = {"Content-Type": "text/xml"}
45
- response = self._session.post(
46
- url,
47
- data=request_body,
48
- headers=headers,
49
- stream=True,
50
- )
51
- raise_for_status(response)
52
- self.verbose = verbose
53
- return self.parse_response(response.raw)
54
- except NetworkConnectionError as exc:
55
- assert exc.response
56
- logger.critical(
57
- "HTTP error %s while getting %s",
58
- exc.response.status_code,
59
- url,
60
- )
61
- raise