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,719 +0,0 @@
1
- """
2
- requests.adapters
3
- ~~~~~~~~~~~~~~~~~
4
-
5
- This module contains the transport adapters that Requests uses to define
6
- and maintain connections.
7
- """
8
-
9
- import os.path
10
- import socket # noqa: F401
11
- import typing
12
- import warnings
13
-
14
- from pip._vendor.urllib3.exceptions import ClosedPoolError, ConnectTimeoutError
15
- from pip._vendor.urllib3.exceptions import HTTPError as _HTTPError
16
- from pip._vendor.urllib3.exceptions import InvalidHeader as _InvalidHeader
17
- from pip._vendor.urllib3.exceptions import (
18
- LocationValueError,
19
- MaxRetryError,
20
- NewConnectionError,
21
- ProtocolError,
22
- )
23
- from pip._vendor.urllib3.exceptions import ProxyError as _ProxyError
24
- from pip._vendor.urllib3.exceptions import ReadTimeoutError, ResponseError
25
- from pip._vendor.urllib3.exceptions import SSLError as _SSLError
26
- from pip._vendor.urllib3.poolmanager import PoolManager, proxy_from_url
27
- from pip._vendor.urllib3.util import Timeout as TimeoutSauce
28
- from pip._vendor.urllib3.util import parse_url
29
- from pip._vendor.urllib3.util.retry import Retry
30
- from pip._vendor.urllib3.util.ssl_ import create_urllib3_context
31
-
32
- from .auth import _basic_auth_str
33
- from .compat import basestring, urlparse
34
- from .cookies import extract_cookies_to_jar
35
- from .exceptions import (
36
- ConnectionError,
37
- ConnectTimeout,
38
- InvalidHeader,
39
- InvalidProxyURL,
40
- InvalidSchema,
41
- InvalidURL,
42
- ProxyError,
43
- ReadTimeout,
44
- RetryError,
45
- SSLError,
46
- )
47
- from .models import Response
48
- from .structures import CaseInsensitiveDict
49
- from .utils import (
50
- DEFAULT_CA_BUNDLE_PATH,
51
- extract_zipped_paths,
52
- get_auth_from_url,
53
- get_encoding_from_headers,
54
- prepend_scheme_if_needed,
55
- select_proxy,
56
- urldefragauth,
57
- )
58
-
59
- try:
60
- from pip._vendor.urllib3.contrib.socks import SOCKSProxyManager
61
- except ImportError:
62
-
63
- def SOCKSProxyManager(*args, **kwargs):
64
- raise InvalidSchema("Missing dependencies for SOCKS support.")
65
-
66
-
67
- if typing.TYPE_CHECKING:
68
- from .models import PreparedRequest
69
-
70
-
71
- DEFAULT_POOLBLOCK = False
72
- DEFAULT_POOLSIZE = 10
73
- DEFAULT_RETRIES = 0
74
- DEFAULT_POOL_TIMEOUT = None
75
-
76
-
77
- try:
78
- import ssl # noqa: F401
79
-
80
- _preloaded_ssl_context = create_urllib3_context()
81
- _preloaded_ssl_context.load_verify_locations(
82
- extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
83
- )
84
- except ImportError:
85
- # Bypass default SSLContext creation when Python
86
- # interpreter isn't built with the ssl module.
87
- _preloaded_ssl_context = None
88
-
89
-
90
- def _urllib3_request_context(
91
- request: "PreparedRequest",
92
- verify: "bool | str | None",
93
- client_cert: "typing.Tuple[str, str] | str | None",
94
- poolmanager: "PoolManager",
95
- ) -> "(typing.Dict[str, typing.Any], typing.Dict[str, typing.Any])":
96
- host_params = {}
97
- pool_kwargs = {}
98
- parsed_request_url = urlparse(request.url)
99
- scheme = parsed_request_url.scheme.lower()
100
- port = parsed_request_url.port
101
-
102
- # Determine if we have and should use our default SSLContext
103
- # to optimize performance on standard requests.
104
- poolmanager_kwargs = getattr(poolmanager, "connection_pool_kw", {})
105
- has_poolmanager_ssl_context = poolmanager_kwargs.get("ssl_context")
106
- should_use_default_ssl_context = (
107
- _preloaded_ssl_context is not None and not has_poolmanager_ssl_context
108
- )
109
-
110
- cert_reqs = "CERT_REQUIRED"
111
- if verify is False:
112
- cert_reqs = "CERT_NONE"
113
- elif verify is True and should_use_default_ssl_context:
114
- pool_kwargs["ssl_context"] = _preloaded_ssl_context
115
- elif isinstance(verify, str):
116
- if not os.path.isdir(verify):
117
- pool_kwargs["ca_certs"] = verify
118
- else:
119
- pool_kwargs["ca_cert_dir"] = verify
120
- pool_kwargs["cert_reqs"] = cert_reqs
121
- if client_cert is not None:
122
- if isinstance(client_cert, tuple) and len(client_cert) == 2:
123
- pool_kwargs["cert_file"] = client_cert[0]
124
- pool_kwargs["key_file"] = client_cert[1]
125
- else:
126
- # According to our docs, we allow users to specify just the client
127
- # cert path
128
- pool_kwargs["cert_file"] = client_cert
129
- host_params = {
130
- "scheme": scheme,
131
- "host": parsed_request_url.hostname,
132
- "port": port,
133
- }
134
- return host_params, pool_kwargs
135
-
136
-
137
- class BaseAdapter:
138
- """The Base Transport Adapter"""
139
-
140
- def __init__(self):
141
- super().__init__()
142
-
143
- def send(
144
- self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
145
- ):
146
- """Sends PreparedRequest object. Returns Response object.
147
-
148
- :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
149
- :param stream: (optional) Whether to stream the request content.
150
- :param timeout: (optional) How long to wait for the server to send
151
- data before giving up, as a float, or a :ref:`(connect timeout,
152
- read timeout) <timeouts>` tuple.
153
- :type timeout: float or tuple
154
- :param verify: (optional) Either a boolean, in which case it controls whether we verify
155
- the server's TLS certificate, or a string, in which case it must be a path
156
- to a CA bundle to use
157
- :param cert: (optional) Any user-provided SSL certificate to be trusted.
158
- :param proxies: (optional) The proxies dictionary to apply to the request.
159
- """
160
- raise NotImplementedError
161
-
162
- def close(self):
163
- """Cleans up adapter specific items."""
164
- raise NotImplementedError
165
-
166
-
167
- class HTTPAdapter(BaseAdapter):
168
- """The built-in HTTP Adapter for urllib3.
169
-
170
- Provides a general-case interface for Requests sessions to contact HTTP and
171
- HTTPS urls by implementing the Transport Adapter interface. This class will
172
- usually be created by the :class:`Session <Session>` class under the
173
- covers.
174
-
175
- :param pool_connections: The number of urllib3 connection pools to cache.
176
- :param pool_maxsize: The maximum number of connections to save in the pool.
177
- :param max_retries: The maximum number of retries each connection
178
- should attempt. Note, this applies only to failed DNS lookups, socket
179
- connections and connection timeouts, never to requests where data has
180
- made it to the server. By default, Requests does not retry failed
181
- connections. If you need granular control over the conditions under
182
- which we retry a request, import urllib3's ``Retry`` class and pass
183
- that instead.
184
- :param pool_block: Whether the connection pool should block for connections.
185
-
186
- Usage::
187
-
188
- >>> import requests
189
- >>> s = requests.Session()
190
- >>> a = requests.adapters.HTTPAdapter(max_retries=3)
191
- >>> s.mount('http://', a)
192
- """
193
-
194
- __attrs__ = [
195
- "max_retries",
196
- "config",
197
- "_pool_connections",
198
- "_pool_maxsize",
199
- "_pool_block",
200
- ]
201
-
202
- def __init__(
203
- self,
204
- pool_connections=DEFAULT_POOLSIZE,
205
- pool_maxsize=DEFAULT_POOLSIZE,
206
- max_retries=DEFAULT_RETRIES,
207
- pool_block=DEFAULT_POOLBLOCK,
208
- ):
209
- if max_retries == DEFAULT_RETRIES:
210
- self.max_retries = Retry(0, read=False)
211
- else:
212
- self.max_retries = Retry.from_int(max_retries)
213
- self.config = {}
214
- self.proxy_manager = {}
215
-
216
- super().__init__()
217
-
218
- self._pool_connections = pool_connections
219
- self._pool_maxsize = pool_maxsize
220
- self._pool_block = pool_block
221
-
222
- self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block)
223
-
224
- def __getstate__(self):
225
- return {attr: getattr(self, attr, None) for attr in self.__attrs__}
226
-
227
- def __setstate__(self, state):
228
- # Can't handle by adding 'proxy_manager' to self.__attrs__ because
229
- # self.poolmanager uses a lambda function, which isn't pickleable.
230
- self.proxy_manager = {}
231
- self.config = {}
232
-
233
- for attr, value in state.items():
234
- setattr(self, attr, value)
235
-
236
- self.init_poolmanager(
237
- self._pool_connections, self._pool_maxsize, block=self._pool_block
238
- )
239
-
240
- def init_poolmanager(
241
- self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs
242
- ):
243
- """Initializes a urllib3 PoolManager.
244
-
245
- This method should not be called from user code, and is only
246
- exposed for use when subclassing the
247
- :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
248
-
249
- :param connections: The number of urllib3 connection pools to cache.
250
- :param maxsize: The maximum number of connections to save in the pool.
251
- :param block: Block when no free connections are available.
252
- :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager.
253
- """
254
- # save these values for pickling
255
- self._pool_connections = connections
256
- self._pool_maxsize = maxsize
257
- self._pool_block = block
258
-
259
- self.poolmanager = PoolManager(
260
- num_pools=connections,
261
- maxsize=maxsize,
262
- block=block,
263
- **pool_kwargs,
264
- )
265
-
266
- def proxy_manager_for(self, proxy, **proxy_kwargs):
267
- """Return urllib3 ProxyManager for the given proxy.
268
-
269
- This method should not be called from user code, and is only
270
- exposed for use when subclassing the
271
- :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
272
-
273
- :param proxy: The proxy to return a urllib3 ProxyManager for.
274
- :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager.
275
- :returns: ProxyManager
276
- :rtype: urllib3.ProxyManager
277
- """
278
- if proxy in self.proxy_manager:
279
- manager = self.proxy_manager[proxy]
280
- elif proxy.lower().startswith("socks"):
281
- username, password = get_auth_from_url(proxy)
282
- manager = self.proxy_manager[proxy] = SOCKSProxyManager(
283
- proxy,
284
- username=username,
285
- password=password,
286
- num_pools=self._pool_connections,
287
- maxsize=self._pool_maxsize,
288
- block=self._pool_block,
289
- **proxy_kwargs,
290
- )
291
- else:
292
- proxy_headers = self.proxy_headers(proxy)
293
- manager = self.proxy_manager[proxy] = proxy_from_url(
294
- proxy,
295
- proxy_headers=proxy_headers,
296
- num_pools=self._pool_connections,
297
- maxsize=self._pool_maxsize,
298
- block=self._pool_block,
299
- **proxy_kwargs,
300
- )
301
-
302
- return manager
303
-
304
- def cert_verify(self, conn, url, verify, cert):
305
- """Verify a SSL certificate. This method should not be called from user
306
- code, and is only exposed for use when subclassing the
307
- :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
308
-
309
- :param conn: The urllib3 connection object associated with the cert.
310
- :param url: The requested URL.
311
- :param verify: Either a boolean, in which case it controls whether we verify
312
- the server's TLS certificate, or a string, in which case it must be a path
313
- to a CA bundle to use
314
- :param cert: The SSL certificate to verify.
315
- """
316
- if url.lower().startswith("https") and verify:
317
- conn.cert_reqs = "CERT_REQUIRED"
318
-
319
- # Only load the CA certificates if 'verify' is a string indicating the CA bundle to use.
320
- # Otherwise, if verify is a boolean, we don't load anything since
321
- # the connection will be using a context with the default certificates already loaded,
322
- # and this avoids a call to the slow load_verify_locations()
323
- if verify is not True:
324
- # `verify` must be a str with a path then
325
- cert_loc = verify
326
-
327
- if not os.path.exists(cert_loc):
328
- raise OSError(
329
- f"Could not find a suitable TLS CA certificate bundle, "
330
- f"invalid path: {cert_loc}"
331
- )
332
-
333
- if not os.path.isdir(cert_loc):
334
- conn.ca_certs = cert_loc
335
- else:
336
- conn.ca_cert_dir = cert_loc
337
- else:
338
- conn.cert_reqs = "CERT_NONE"
339
- conn.ca_certs = None
340
- conn.ca_cert_dir = None
341
-
342
- if cert:
343
- if not isinstance(cert, basestring):
344
- conn.cert_file = cert[0]
345
- conn.key_file = cert[1]
346
- else:
347
- conn.cert_file = cert
348
- conn.key_file = None
349
- if conn.cert_file and not os.path.exists(conn.cert_file):
350
- raise OSError(
351
- f"Could not find the TLS certificate file, "
352
- f"invalid path: {conn.cert_file}"
353
- )
354
- if conn.key_file and not os.path.exists(conn.key_file):
355
- raise OSError(
356
- f"Could not find the TLS key file, invalid path: {conn.key_file}"
357
- )
358
-
359
- def build_response(self, req, resp):
360
- """Builds a :class:`Response <requests.Response>` object from a urllib3
361
- response. This should not be called from user code, and is only exposed
362
- for use when subclassing the
363
- :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`
364
-
365
- :param req: The :class:`PreparedRequest <PreparedRequest>` used to generate the response.
366
- :param resp: The urllib3 response object.
367
- :rtype: requests.Response
368
- """
369
- response = Response()
370
-
371
- # Fallback to None if there's no status_code, for whatever reason.
372
- response.status_code = getattr(resp, "status", None)
373
-
374
- # Make headers case-insensitive.
375
- response.headers = CaseInsensitiveDict(getattr(resp, "headers", {}))
376
-
377
- # Set encoding.
378
- response.encoding = get_encoding_from_headers(response.headers)
379
- response.raw = resp
380
- response.reason = response.raw.reason
381
-
382
- if isinstance(req.url, bytes):
383
- response.url = req.url.decode("utf-8")
384
- else:
385
- response.url = req.url
386
-
387
- # Add new cookies from the server.
388
- extract_cookies_to_jar(response.cookies, req, resp)
389
-
390
- # Give the Response some context.
391
- response.request = req
392
- response.connection = self
393
-
394
- return response
395
-
396
- def build_connection_pool_key_attributes(self, request, verify, cert=None):
397
- """Build the PoolKey attributes used by urllib3 to return a connection.
398
-
399
- This looks at the PreparedRequest, the user-specified verify value,
400
- and the value of the cert parameter to determine what PoolKey values
401
- to use to select a connection from a given urllib3 Connection Pool.
402
-
403
- The SSL related pool key arguments are not consistently set. As of
404
- this writing, use the following to determine what keys may be in that
405
- dictionary:
406
-
407
- * If ``verify`` is ``True``, ``"ssl_context"`` will be set and will be the
408
- default Requests SSL Context
409
- * If ``verify`` is ``False``, ``"ssl_context"`` will not be set but
410
- ``"cert_reqs"`` will be set
411
- * If ``verify`` is a string, (i.e., it is a user-specified trust bundle)
412
- ``"ca_certs"`` will be set if the string is not a directory recognized
413
- by :py:func:`os.path.isdir`, otherwise ``"ca_certs_dir"`` will be
414
- set.
415
- * If ``"cert"`` is specified, ``"cert_file"`` will always be set. If
416
- ``"cert"`` is a tuple with a second item, ``"key_file"`` will also
417
- be present
418
-
419
- To override these settings, one may subclass this class, call this
420
- method and use the above logic to change parameters as desired. For
421
- example, if one wishes to use a custom :py:class:`ssl.SSLContext` one
422
- must both set ``"ssl_context"`` and based on what else they require,
423
- alter the other keys to ensure the desired behaviour.
424
-
425
- :param request:
426
- The PreparedReqest being sent over the connection.
427
- :type request:
428
- :class:`~requests.models.PreparedRequest`
429
- :param verify:
430
- Either a boolean, in which case it controls whether
431
- we verify the server's TLS certificate, or a string, in which case it
432
- must be a path to a CA bundle to use.
433
- :param cert:
434
- (optional) Any user-provided SSL certificate for client
435
- authentication (a.k.a., mTLS). This may be a string (i.e., just
436
- the path to a file which holds both certificate and key) or a
437
- tuple of length 2 with the certificate file path and key file
438
- path.
439
- :returns:
440
- A tuple of two dictionaries. The first is the "host parameters"
441
- portion of the Pool Key including scheme, hostname, and port. The
442
- second is a dictionary of SSLContext related parameters.
443
- """
444
- return _urllib3_request_context(request, verify, cert, self.poolmanager)
445
-
446
- def get_connection_with_tls_context(self, request, verify, proxies=None, cert=None):
447
- """Returns a urllib3 connection for the given request and TLS settings.
448
- This should not be called from user code, and is only exposed for use
449
- when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
450
-
451
- :param request:
452
- The :class:`PreparedRequest <PreparedRequest>` object to be sent
453
- over the connection.
454
- :param verify:
455
- Either a boolean, in which case it controls whether we verify the
456
- server's TLS certificate, or a string, in which case it must be a
457
- path to a CA bundle to use.
458
- :param proxies:
459
- (optional) The proxies dictionary to apply to the request.
460
- :param cert:
461
- (optional) Any user-provided SSL certificate to be used for client
462
- authentication (a.k.a., mTLS).
463
- :rtype:
464
- urllib3.ConnectionPool
465
- """
466
- proxy = select_proxy(request.url, proxies)
467
- try:
468
- host_params, pool_kwargs = self.build_connection_pool_key_attributes(
469
- request,
470
- verify,
471
- cert,
472
- )
473
- except ValueError as e:
474
- raise InvalidURL(e, request=request)
475
- if proxy:
476
- proxy = prepend_scheme_if_needed(proxy, "http")
477
- proxy_url = parse_url(proxy)
478
- if not proxy_url.host:
479
- raise InvalidProxyURL(
480
- "Please check proxy URL. It is malformed "
481
- "and could be missing the host."
482
- )
483
- proxy_manager = self.proxy_manager_for(proxy)
484
- conn = proxy_manager.connection_from_host(
485
- **host_params, pool_kwargs=pool_kwargs
486
- )
487
- else:
488
- # Only scheme should be lower case
489
- conn = self.poolmanager.connection_from_host(
490
- **host_params, pool_kwargs=pool_kwargs
491
- )
492
-
493
- return conn
494
-
495
- def get_connection(self, url, proxies=None):
496
- """DEPRECATED: Users should move to `get_connection_with_tls_context`
497
- for all subclasses of HTTPAdapter using Requests>=2.32.2.
498
-
499
- Returns a urllib3 connection for the given URL. This should not be
500
- called from user code, and is only exposed for use when subclassing the
501
- :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
502
-
503
- :param url: The URL to connect to.
504
- :param proxies: (optional) A Requests-style dictionary of proxies used on this request.
505
- :rtype: urllib3.ConnectionPool
506
- """
507
- warnings.warn(
508
- (
509
- "`get_connection` has been deprecated in favor of "
510
- "`get_connection_with_tls_context`. Custom HTTPAdapter subclasses "
511
- "will need to migrate for Requests>=2.32.2. Please see "
512
- "https://github.com/psf/requests/pull/6710 for more details."
513
- ),
514
- DeprecationWarning,
515
- )
516
- proxy = select_proxy(url, proxies)
517
-
518
- if proxy:
519
- proxy = prepend_scheme_if_needed(proxy, "http")
520
- proxy_url = parse_url(proxy)
521
- if not proxy_url.host:
522
- raise InvalidProxyURL(
523
- "Please check proxy URL. It is malformed "
524
- "and could be missing the host."
525
- )
526
- proxy_manager = self.proxy_manager_for(proxy)
527
- conn = proxy_manager.connection_from_url(url)
528
- else:
529
- # Only scheme should be lower case
530
- parsed = urlparse(url)
531
- url = parsed.geturl()
532
- conn = self.poolmanager.connection_from_url(url)
533
-
534
- return conn
535
-
536
- def close(self):
537
- """Disposes of any internal state.
538
-
539
- Currently, this closes the PoolManager and any active ProxyManager,
540
- which closes any pooled connections.
541
- """
542
- self.poolmanager.clear()
543
- for proxy in self.proxy_manager.values():
544
- proxy.clear()
545
-
546
- def request_url(self, request, proxies):
547
- """Obtain the url to use when making the final request.
548
-
549
- If the message is being sent through a HTTP proxy, the full URL has to
550
- be used. Otherwise, we should only use the path portion of the URL.
551
-
552
- This should not be called from user code, and is only exposed for use
553
- when subclassing the
554
- :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
555
-
556
- :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
557
- :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs.
558
- :rtype: str
559
- """
560
- proxy = select_proxy(request.url, proxies)
561
- scheme = urlparse(request.url).scheme
562
-
563
- is_proxied_http_request = proxy and scheme != "https"
564
- using_socks_proxy = False
565
- if proxy:
566
- proxy_scheme = urlparse(proxy).scheme.lower()
567
- using_socks_proxy = proxy_scheme.startswith("socks")
568
-
569
- url = request.path_url
570
- if url.startswith("//"): # Don't confuse urllib3
571
- url = f"/{url.lstrip('/')}"
572
-
573
- if is_proxied_http_request and not using_socks_proxy:
574
- url = urldefragauth(request.url)
575
-
576
- return url
577
-
578
- def add_headers(self, request, **kwargs):
579
- """Add any headers needed by the connection. As of v2.0 this does
580
- nothing by default, but is left for overriding by users that subclass
581
- the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
582
-
583
- This should not be called from user code, and is only exposed for use
584
- when subclassing the
585
- :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
586
-
587
- :param request: The :class:`PreparedRequest <PreparedRequest>` to add headers to.
588
- :param kwargs: The keyword arguments from the call to send().
589
- """
590
- pass
591
-
592
- def proxy_headers(self, proxy):
593
- """Returns a dictionary of the headers to add to any request sent
594
- through a proxy. This works with urllib3 magic to ensure that they are
595
- correctly sent to the proxy, rather than in a tunnelled request if
596
- CONNECT is being used.
597
-
598
- This should not be called from user code, and is only exposed for use
599
- when subclassing the
600
- :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
601
-
602
- :param proxy: The url of the proxy being used for this request.
603
- :rtype: dict
604
- """
605
- headers = {}
606
- username, password = get_auth_from_url(proxy)
607
-
608
- if username:
609
- headers["Proxy-Authorization"] = _basic_auth_str(username, password)
610
-
611
- return headers
612
-
613
- def send(
614
- self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
615
- ):
616
- """Sends PreparedRequest object. Returns Response object.
617
-
618
- :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
619
- :param stream: (optional) Whether to stream the request content.
620
- :param timeout: (optional) How long to wait for the server to send
621
- data before giving up, as a float, or a :ref:`(connect timeout,
622
- read timeout) <timeouts>` tuple.
623
- :type timeout: float or tuple or urllib3 Timeout object
624
- :param verify: (optional) Either a boolean, in which case it controls whether
625
- we verify the server's TLS certificate, or a string, in which case it
626
- must be a path to a CA bundle to use
627
- :param cert: (optional) Any user-provided SSL certificate to be trusted.
628
- :param proxies: (optional) The proxies dictionary to apply to the request.
629
- :rtype: requests.Response
630
- """
631
-
632
- try:
633
- conn = self.get_connection_with_tls_context(
634
- request, verify, proxies=proxies, cert=cert
635
- )
636
- except LocationValueError as e:
637
- raise InvalidURL(e, request=request)
638
-
639
- self.cert_verify(conn, request.url, verify, cert)
640
- url = self.request_url(request, proxies)
641
- self.add_headers(
642
- request,
643
- stream=stream,
644
- timeout=timeout,
645
- verify=verify,
646
- cert=cert,
647
- proxies=proxies,
648
- )
649
-
650
- chunked = not (request.body is None or "Content-Length" in request.headers)
651
-
652
- if isinstance(timeout, tuple):
653
- try:
654
- connect, read = timeout
655
- timeout = TimeoutSauce(connect=connect, read=read)
656
- except ValueError:
657
- raise ValueError(
658
- f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
659
- f"or a single float to set both timeouts to the same value."
660
- )
661
- elif isinstance(timeout, TimeoutSauce):
662
- pass
663
- else:
664
- timeout = TimeoutSauce(connect=timeout, read=timeout)
665
-
666
- try:
667
- resp = conn.urlopen(
668
- method=request.method,
669
- url=url,
670
- body=request.body,
671
- headers=request.headers,
672
- redirect=False,
673
- assert_same_host=False,
674
- preload_content=False,
675
- decode_content=False,
676
- retries=self.max_retries,
677
- timeout=timeout,
678
- chunked=chunked,
679
- )
680
-
681
- except (ProtocolError, OSError) as err:
682
- raise ConnectionError(err, request=request)
683
-
684
- except MaxRetryError as e:
685
- if isinstance(e.reason, ConnectTimeoutError):
686
- # TODO: Remove this in 3.0.0: see #2811
687
- if not isinstance(e.reason, NewConnectionError):
688
- raise ConnectTimeout(e, request=request)
689
-
690
- if isinstance(e.reason, ResponseError):
691
- raise RetryError(e, request=request)
692
-
693
- if isinstance(e.reason, _ProxyError):
694
- raise ProxyError(e, request=request)
695
-
696
- if isinstance(e.reason, _SSLError):
697
- # This branch is for urllib3 v1.22 and later.
698
- raise SSLError(e, request=request)
699
-
700
- raise ConnectionError(e, request=request)
701
-
702
- except ClosedPoolError as e:
703
- raise ConnectionError(e, request=request)
704
-
705
- except _ProxyError as e:
706
- raise ProxyError(e)
707
-
708
- except (_SSLError, _HTTPError) as e:
709
- if isinstance(e, _SSLError):
710
- # This branch is for urllib3 versions earlier than v1.22
711
- raise SSLError(e, request=request)
712
- elif isinstance(e, ReadTimeoutError):
713
- raise ReadTimeout(e, request=request)
714
- elif isinstance(e, _InvalidHeader):
715
- raise InvalidHeader(e, request=request)
716
- else:
717
- raise
718
-
719
- return self.build_response(request, resp)