cli-ih 0.6.3.1__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. cli_ih/__init__.py +1 -0
  2. cli_ih/asyncClient.py +73 -10
  3. cli_ih/client.py +63 -18
  4. cli_ih/utils.py +51 -0
  5. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/METADATA +1 -1
  6. cli_ih-0.7.0.dist-info/RECORD +9 -0
  7. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/top_level.txt +0 -1
  8. cli_ih-0.6.3.1.dist-info/RECORD +0 -425
  9. venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +0 -85
  10. venv/Lib/site-packages/pip/__init__.py +0 -13
  11. venv/Lib/site-packages/pip/__main__.py +0 -24
  12. venv/Lib/site-packages/pip/__pip-runner__.py +0 -50
  13. venv/Lib/site-packages/pip/_internal/__init__.py +0 -18
  14. venv/Lib/site-packages/pip/_internal/build_env.py +0 -349
  15. venv/Lib/site-packages/pip/_internal/cache.py +0 -291
  16. venv/Lib/site-packages/pip/_internal/cli/__init__.py +0 -3
  17. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +0 -184
  18. venv/Lib/site-packages/pip/_internal/cli/base_command.py +0 -244
  19. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +0 -1138
  20. venv/Lib/site-packages/pip/_internal/cli/command_context.py +0 -28
  21. venv/Lib/site-packages/pip/_internal/cli/index_command.py +0 -175
  22. venv/Lib/site-packages/pip/_internal/cli/main.py +0 -80
  23. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +0 -134
  24. venv/Lib/site-packages/pip/_internal/cli/parser.py +0 -298
  25. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +0 -151
  26. venv/Lib/site-packages/pip/_internal/cli/req_command.py +0 -351
  27. venv/Lib/site-packages/pip/_internal/cli/spinners.py +0 -235
  28. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +0 -6
  29. venv/Lib/site-packages/pip/_internal/commands/__init__.py +0 -139
  30. venv/Lib/site-packages/pip/_internal/commands/cache.py +0 -231
  31. venv/Lib/site-packages/pip/_internal/commands/check.py +0 -66
  32. venv/Lib/site-packages/pip/_internal/commands/completion.py +0 -135
  33. venv/Lib/site-packages/pip/_internal/commands/configuration.py +0 -288
  34. venv/Lib/site-packages/pip/_internal/commands/debug.py +0 -203
  35. venv/Lib/site-packages/pip/_internal/commands/download.py +0 -145
  36. venv/Lib/site-packages/pip/_internal/commands/freeze.py +0 -107
  37. venv/Lib/site-packages/pip/_internal/commands/hash.py +0 -58
  38. venv/Lib/site-packages/pip/_internal/commands/help.py +0 -40
  39. venv/Lib/site-packages/pip/_internal/commands/index.py +0 -159
  40. venv/Lib/site-packages/pip/_internal/commands/inspect.py +0 -92
  41. venv/Lib/site-packages/pip/_internal/commands/install.py +0 -798
  42. venv/Lib/site-packages/pip/_internal/commands/list.py +0 -400
  43. venv/Lib/site-packages/pip/_internal/commands/lock.py +0 -170
  44. venv/Lib/site-packages/pip/_internal/commands/search.py +0 -178
  45. venv/Lib/site-packages/pip/_internal/commands/show.py +0 -231
  46. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +0 -113
  47. venv/Lib/site-packages/pip/_internal/commands/wheel.py +0 -181
  48. venv/Lib/site-packages/pip/_internal/configuration.py +0 -397
  49. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +0 -21
  50. venv/Lib/site-packages/pip/_internal/distributions/base.py +0 -55
  51. venv/Lib/site-packages/pip/_internal/distributions/installed.py +0 -33
  52. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +0 -165
  53. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +0 -44
  54. venv/Lib/site-packages/pip/_internal/exceptions.py +0 -881
  55. venv/Lib/site-packages/pip/_internal/index/__init__.py +0 -1
  56. venv/Lib/site-packages/pip/_internal/index/collector.py +0 -489
  57. venv/Lib/site-packages/pip/_internal/index/package_finder.py +0 -1059
  58. venv/Lib/site-packages/pip/_internal/index/sources.py +0 -287
  59. venv/Lib/site-packages/pip/_internal/locations/__init__.py +0 -441
  60. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +0 -173
  61. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +0 -215
  62. venv/Lib/site-packages/pip/_internal/locations/base.py +0 -82
  63. venv/Lib/site-packages/pip/_internal/main.py +0 -12
  64. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +0 -164
  65. venv/Lib/site-packages/pip/_internal/metadata/_json.py +0 -87
  66. venv/Lib/site-packages/pip/_internal/metadata/base.py +0 -685
  67. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
  68. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -87
  69. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -223
  70. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -143
  71. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +0 -298
  72. venv/Lib/site-packages/pip/_internal/models/__init__.py +0 -1
  73. venv/Lib/site-packages/pip/_internal/models/candidate.py +0 -25
  74. venv/Lib/site-packages/pip/_internal/models/direct_url.py +0 -227
  75. venv/Lib/site-packages/pip/_internal/models/format_control.py +0 -78
  76. venv/Lib/site-packages/pip/_internal/models/index.py +0 -28
  77. venv/Lib/site-packages/pip/_internal/models/installation_report.py +0 -57
  78. venv/Lib/site-packages/pip/_internal/models/link.py +0 -613
  79. venv/Lib/site-packages/pip/_internal/models/pylock.py +0 -188
  80. venv/Lib/site-packages/pip/_internal/models/scheme.py +0 -25
  81. venv/Lib/site-packages/pip/_internal/models/search_scope.py +0 -126
  82. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -53
  83. venv/Lib/site-packages/pip/_internal/models/target_python.py +0 -122
  84. venv/Lib/site-packages/pip/_internal/models/wheel.py +0 -141
  85. venv/Lib/site-packages/pip/_internal/network/__init__.py +0 -1
  86. venv/Lib/site-packages/pip/_internal/network/auth.py +0 -564
  87. venv/Lib/site-packages/pip/_internal/network/cache.py +0 -133
  88. venv/Lib/site-packages/pip/_internal/network/download.py +0 -342
  89. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +0 -213
  90. venv/Lib/site-packages/pip/_internal/network/session.py +0 -528
  91. venv/Lib/site-packages/pip/_internal/network/utils.py +0 -98
  92. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +0 -61
  93. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  94. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  95. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +0 -140
  96. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +0 -38
  97. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
  98. venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -73
  99. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +0 -38
  100. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -47
  101. venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -119
  102. venv/Lib/site-packages/pip/_internal/operations/check.py +0 -175
  103. venv/Lib/site-packages/pip/_internal/operations/freeze.py +0 -259
  104. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +0 -1
  105. venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -48
  106. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +0 -746
  107. venv/Lib/site-packages/pip/_internal/operations/prepare.py +0 -742
  108. venv/Lib/site-packages/pip/_internal/pyproject.py +0 -182
  109. venv/Lib/site-packages/pip/_internal/req/__init__.py +0 -105
  110. venv/Lib/site-packages/pip/_internal/req/constructors.py +0 -562
  111. venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +0 -75
  112. venv/Lib/site-packages/pip/_internal/req/req_file.py +0 -620
  113. venv/Lib/site-packages/pip/_internal/req/req_install.py +0 -937
  114. venv/Lib/site-packages/pip/_internal/req/req_set.py +0 -81
  115. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +0 -639
  116. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  117. venv/Lib/site-packages/pip/_internal/resolution/base.py +0 -20
  118. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  119. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -598
  120. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  121. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -142
  122. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -582
  123. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -814
  124. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -166
  125. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -276
  126. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -85
  127. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -247
  128. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -336
  129. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +0 -254
  130. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  131. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
  132. venv/Lib/site-packages/pip/_internal/utils/_log.py +0 -38
  133. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +0 -52
  134. venv/Lib/site-packages/pip/_internal/utils/compat.py +0 -85
  135. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -201
  136. venv/Lib/site-packages/pip/_internal/utils/datetime.py +0 -10
  137. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +0 -126
  138. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
  139. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +0 -81
  140. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +0 -88
  141. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +0 -152
  142. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +0 -24
  143. venv/Lib/site-packages/pip/_internal/utils/glibc.py +0 -102
  144. venv/Lib/site-packages/pip/_internal/utils/hashes.py +0 -150
  145. venv/Lib/site-packages/pip/_internal/utils/logging.py +0 -364
  146. venv/Lib/site-packages/pip/_internal/utils/misc.py +0 -765
  147. venv/Lib/site-packages/pip/_internal/utils/packaging.py +0 -44
  148. venv/Lib/site-packages/pip/_internal/utils/retry.py +0 -45
  149. venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +0 -149
  150. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +0 -248
  151. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +0 -294
  152. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +0 -337
  153. venv/Lib/site-packages/pip/_internal/utils/urls.py +0 -55
  154. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +0 -105
  155. venv/Lib/site-packages/pip/_internal/utils/wheel.py +0 -132
  156. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +0 -15
  157. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +0 -130
  158. venv/Lib/site-packages/pip/_internal/vcs/git.py +0 -571
  159. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -186
  160. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +0 -335
  161. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
  162. venv/Lib/site-packages/pip/_internal/wheel_builder.py +0 -334
  163. venv/Lib/site-packages/pip/_vendor/__init__.py +0 -117
  164. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -29
  165. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
  166. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -168
  167. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +0 -75
  168. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
  169. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -145
  170. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
  171. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -511
  172. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
  173. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -157
  174. venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  175. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
  176. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
  177. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +0 -4
  178. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +0 -12
  179. venv/Lib/site-packages/pip/_vendor/certifi/core.py +0 -83
  180. venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
  181. venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +0 -13
  182. venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +0 -65
  183. venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +0 -209
  184. venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +0 -59
  185. venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +0 -62
  186. venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +0 -9
  187. venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
  188. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +0 -33
  189. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +0 -1137
  190. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +0 -358
  191. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +0 -447
  192. venv/Lib/site-packages/pip/_vendor/distlib/util.py +0 -1984
  193. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +0 -54
  194. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +0 -4
  195. venv/Lib/site-packages/pip/_vendor/distro/distro.py +0 -1403
  196. venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
  197. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +0 -45
  198. venv/Lib/site-packages/pip/_vendor/idna/codec.py +0 -122
  199. venv/Lib/site-packages/pip/_vendor/idna/compat.py +0 -15
  200. venv/Lib/site-packages/pip/_vendor/idna/core.py +0 -437
  201. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +0 -4243
  202. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +0 -57
  203. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +0 -1
  204. venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
  205. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +0 -8681
  206. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
  207. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
  208. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +0 -170
  209. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +0 -929
  210. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +0 -15
  211. venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +0 -109
  212. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
  213. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
  214. venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +0 -353
  215. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +0 -61
  216. venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -195
  217. venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +0 -145
  218. venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +0 -759
  219. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +0 -362
  220. venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +0 -862
  221. venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
  222. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +0 -91
  223. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +0 -1019
  224. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -656
  225. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +0 -163
  226. venv/Lib/site-packages/pip/_vendor/packaging/version.py +0 -582
  227. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
  228. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +0 -631
  229. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
  230. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +0 -249
  231. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +0 -299
  232. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +0 -144
  233. venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  234. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +0 -272
  235. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +0 -21
  236. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
  237. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +0 -82
  238. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +0 -17
  239. venv/Lib/site-packages/pip/_vendor/pygments/console.py +0 -70
  240. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +0 -70
  241. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
  242. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +0 -129
  243. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
  244. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
  245. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +0 -963
  246. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
  247. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -602
  248. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1201
  249. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +0 -43
  250. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +0 -72
  251. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
  252. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +0 -104
  253. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
  254. venv/Lib/site-packages/pip/_vendor/pygments/style.py +0 -203
  255. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
  256. venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
  257. venv/Lib/site-packages/pip/_vendor/pygments/token.py +0 -214
  258. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +0 -153
  259. venv/Lib/site-packages/pip/_vendor/pygments/util.py +0 -324
  260. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -31
  261. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -410
  262. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -21
  263. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -389
  264. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  265. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +0 -179
  266. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +0 -14
  267. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
  268. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +0 -719
  269. venv/Lib/site-packages/pip/_vendor/requests/api.py +0 -157
  270. venv/Lib/site-packages/pip/_vendor/requests/auth.py +0 -314
  271. venv/Lib/site-packages/pip/_vendor/requests/certs.py +0 -17
  272. venv/Lib/site-packages/pip/_vendor/requests/compat.py +0 -90
  273. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +0 -561
  274. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +0 -151
  275. venv/Lib/site-packages/pip/_vendor/requests/help.py +0 -127
  276. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +0 -33
  277. venv/Lib/site-packages/pip/_vendor/requests/models.py +0 -1039
  278. venv/Lib/site-packages/pip/_vendor/requests/packages.py +0 -25
  279. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +0 -831
  280. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +0 -128
  281. venv/Lib/site-packages/pip/_vendor/requests/structures.py +0 -99
  282. venv/Lib/site-packages/pip/_vendor/requests/utils.py +0 -1086
  283. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +0 -27
  284. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +0 -196
  285. venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  286. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +0 -55
  287. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +0 -27
  288. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +0 -47
  289. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +0 -48
  290. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +0 -57
  291. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +0 -622
  292. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +0 -209
  293. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +0 -177
  294. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +0 -245
  295. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
  296. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
  297. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
  298. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +0 -76
  299. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +0 -10
  300. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +0 -24
  301. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +0 -268
  302. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +0 -94
  303. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +0 -43
  304. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +0 -69
  305. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +0 -309
  306. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +0 -17
  307. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +0 -153
  308. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +0 -482
  309. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +0 -16
  310. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +0 -19
  311. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +0 -661
  312. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +0 -71
  313. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
  314. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +0 -93
  315. venv/Lib/site-packages/pip/_vendor/rich/abc.py +0 -33
  316. venv/Lib/site-packages/pip/_vendor/rich/align.py +0 -306
  317. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +0 -241
  318. venv/Lib/site-packages/pip/_vendor/rich/bar.py +0 -93
  319. venv/Lib/site-packages/pip/_vendor/rich/box.py +0 -474
  320. venv/Lib/site-packages/pip/_vendor/rich/cells.py +0 -174
  321. venv/Lib/site-packages/pip/_vendor/rich/color.py +0 -621
  322. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
  323. venv/Lib/site-packages/pip/_vendor/rich/columns.py +0 -187
  324. venv/Lib/site-packages/pip/_vendor/rich/console.py +0 -2680
  325. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +0 -37
  326. venv/Lib/site-packages/pip/_vendor/rich/containers.py +0 -167
  327. venv/Lib/site-packages/pip/_vendor/rich/control.py +0 -219
  328. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +0 -193
  329. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +0 -39
  330. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +0 -91
  331. venv/Lib/site-packages/pip/_vendor/rich/errors.py +0 -34
  332. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
  333. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +0 -88
  334. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +0 -232
  335. venv/Lib/site-packages/pip/_vendor/rich/json.py +0 -139
  336. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +0 -101
  337. venv/Lib/site-packages/pip/_vendor/rich/layout.py +0 -442
  338. venv/Lib/site-packages/pip/_vendor/rich/live.py +0 -400
  339. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +0 -106
  340. venv/Lib/site-packages/pip/_vendor/rich/logging.py +0 -297
  341. venv/Lib/site-packages/pip/_vendor/rich/markup.py +0 -251
  342. venv/Lib/site-packages/pip/_vendor/rich/measure.py +0 -151
  343. venv/Lib/site-packages/pip/_vendor/rich/padding.py +0 -141
  344. venv/Lib/site-packages/pip/_vendor/rich/pager.py +0 -34
  345. venv/Lib/site-packages/pip/_vendor/rich/palette.py +0 -100
  346. venv/Lib/site-packages/pip/_vendor/rich/panel.py +0 -317
  347. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +0 -1016
  348. venv/Lib/site-packages/pip/_vendor/rich/progress.py +0 -1715
  349. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
  350. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +0 -400
  351. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +0 -42
  352. venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
  353. venv/Lib/site-packages/pip/_vendor/rich/region.py +0 -10
  354. venv/Lib/site-packages/pip/_vendor/rich/repr.py +0 -149
  355. venv/Lib/site-packages/pip/_vendor/rich/rule.py +0 -130
  356. venv/Lib/site-packages/pip/_vendor/rich/scope.py +0 -86
  357. venv/Lib/site-packages/pip/_vendor/rich/screen.py +0 -54
  358. venv/Lib/site-packages/pip/_vendor/rich/segment.py +0 -752
  359. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +0 -132
  360. venv/Lib/site-packages/pip/_vendor/rich/status.py +0 -131
  361. venv/Lib/site-packages/pip/_vendor/rich/style.py +0 -796
  362. venv/Lib/site-packages/pip/_vendor/rich/styled.py +0 -42
  363. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +0 -985
  364. venv/Lib/site-packages/pip/_vendor/rich/table.py +0 -1006
  365. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
  366. venv/Lib/site-packages/pip/_vendor/rich/text.py +0 -1361
  367. venv/Lib/site-packages/pip/_vendor/rich/theme.py +0 -115
  368. venv/Lib/site-packages/pip/_vendor/rich/themes.py +0 -5
  369. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +0 -899
  370. venv/Lib/site-packages/pip/_vendor/rich/tree.py +0 -257
  371. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +0 -8
  372. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +0 -770
  373. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +0 -112
  374. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +0 -10
  375. venv/Lib/site-packages/pip/_vendor/tomli/py.typed +0 -1
  376. venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +0 -4
  377. venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +0 -229
  378. venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +0 -1
  379. venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +0 -36
  380. venv/Lib/site-packages/pip/_vendor/truststore/_api.py +0 -333
  381. venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +0 -571
  382. venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
  383. venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
  384. venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +0 -567
  385. venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
  386. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
  387. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
  388. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +0 -2
  389. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +0 -572
  390. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
  391. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  392. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
  393. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  394. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
  395. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  396. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
  397. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
  398. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
  399. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
  400. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
  401. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
  402. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +0 -274
  403. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
  404. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  405. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  406. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
  407. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
  408. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
  409. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
  410. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +0 -191
  411. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +0 -879
  412. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
  413. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
  414. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
  415. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
  416. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
  417. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
  418. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
  419. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
  420. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
  421. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
  422. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
  423. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
  424. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
  425. venv/Lib/site-packages/pip/py.typed +0 -4
  426. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/WHEEL +0 -0
@@ -1,622 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import collections
4
- import itertools
5
- import operator
6
- from typing import TYPE_CHECKING, Generic
7
-
8
- from ..structs import (
9
- CT,
10
- KT,
11
- RT,
12
- DirectedGraph,
13
- IterableView,
14
- IteratorMapping,
15
- RequirementInformation,
16
- State,
17
- build_iter_view,
18
- )
19
- from .abstract import AbstractResolver, Result
20
- from .criterion import Criterion
21
- from .exceptions import (
22
- InconsistentCandidate,
23
- RequirementsConflicted,
24
- ResolutionImpossible,
25
- ResolutionTooDeep,
26
- ResolverException,
27
- )
28
-
29
- if TYPE_CHECKING:
30
- from collections.abc import Collection, Iterable, Mapping
31
-
32
- from ..providers import AbstractProvider, Preference
33
- from ..reporters import BaseReporter
34
-
35
- _OPTIMISTIC_BACKJUMPING_RATIO: float = 0.1
36
-
37
-
38
- def _build_result(state: State[RT, CT, KT]) -> Result[RT, CT, KT]:
39
- mapping = state.mapping
40
- all_keys: dict[int, KT | None] = {id(v): k for k, v in mapping.items()}
41
- all_keys[id(None)] = None
42
-
43
- graph: DirectedGraph[KT | None] = DirectedGraph()
44
- graph.add(None) # Sentinel as root dependencies' parent.
45
-
46
- connected: set[KT | None] = {None}
47
- for key, criterion in state.criteria.items():
48
- if not _has_route_to_root(state.criteria, key, all_keys, connected):
49
- continue
50
- if key not in graph:
51
- graph.add(key)
52
- for p in criterion.iter_parent():
53
- try:
54
- pkey = all_keys[id(p)]
55
- except KeyError:
56
- continue
57
- if pkey not in graph:
58
- graph.add(pkey)
59
- graph.connect(pkey, key)
60
-
61
- return Result(
62
- mapping={k: v for k, v in mapping.items() if k in connected},
63
- graph=graph,
64
- criteria=state.criteria,
65
- )
66
-
67
-
68
- class Resolution(Generic[RT, CT, KT]):
69
- """Stateful resolution object.
70
-
71
- This is designed as a one-off object that holds information to kick start
72
- the resolution process, and holds the results afterwards.
73
- """
74
-
75
- def __init__(
76
- self,
77
- provider: AbstractProvider[RT, CT, KT],
78
- reporter: BaseReporter[RT, CT, KT],
79
- ) -> None:
80
- self._p = provider
81
- self._r = reporter
82
- self._states: list[State[RT, CT, KT]] = []
83
-
84
- # Optimistic backjumping variables
85
- self._optimistic_backjumping_ratio = _OPTIMISTIC_BACKJUMPING_RATIO
86
- self._save_states: list[State[RT, CT, KT]] | None = None
87
- self._optimistic_start_round: int | None = None
88
-
89
- @property
90
- def state(self) -> State[RT, CT, KT]:
91
- try:
92
- return self._states[-1]
93
- except IndexError as e:
94
- raise AttributeError("state") from e
95
-
96
- def _push_new_state(self) -> None:
97
- """Push a new state into history.
98
-
99
- This new state will be used to hold resolution results of the next
100
- coming round.
101
- """
102
- base = self._states[-1]
103
- state = State(
104
- mapping=base.mapping.copy(),
105
- criteria=base.criteria.copy(),
106
- backtrack_causes=base.backtrack_causes[:],
107
- )
108
- self._states.append(state)
109
-
110
- def _add_to_criteria(
111
- self,
112
- criteria: dict[KT, Criterion[RT, CT]],
113
- requirement: RT,
114
- parent: CT | None,
115
- ) -> None:
116
- self._r.adding_requirement(requirement=requirement, parent=parent)
117
-
118
- identifier = self._p.identify(requirement_or_candidate=requirement)
119
- criterion = criteria.get(identifier)
120
- if criterion:
121
- incompatibilities = list(criterion.incompatibilities)
122
- else:
123
- incompatibilities = []
124
-
125
- matches = self._p.find_matches(
126
- identifier=identifier,
127
- requirements=IteratorMapping(
128
- criteria,
129
- operator.methodcaller("iter_requirement"),
130
- {identifier: [requirement]},
131
- ),
132
- incompatibilities=IteratorMapping(
133
- criteria,
134
- operator.attrgetter("incompatibilities"),
135
- {identifier: incompatibilities},
136
- ),
137
- )
138
-
139
- if criterion:
140
- information = list(criterion.information)
141
- information.append(RequirementInformation(requirement, parent))
142
- else:
143
- information = [RequirementInformation(requirement, parent)]
144
-
145
- criterion = Criterion(
146
- candidates=build_iter_view(matches),
147
- information=information,
148
- incompatibilities=incompatibilities,
149
- )
150
- if not criterion.candidates:
151
- raise RequirementsConflicted(criterion)
152
- criteria[identifier] = criterion
153
-
154
- def _remove_information_from_criteria(
155
- self, criteria: dict[KT, Criterion[RT, CT]], parents: Collection[KT]
156
- ) -> None:
157
- """Remove information from parents of criteria.
158
-
159
- Concretely, removes all values from each criterion's ``information``
160
- field that have one of ``parents`` as provider of the requirement.
161
-
162
- :param criteria: The criteria to update.
163
- :param parents: Identifiers for which to remove information from all criteria.
164
- """
165
- if not parents:
166
- return
167
- for key, criterion in criteria.items():
168
- criteria[key] = Criterion(
169
- criterion.candidates,
170
- [
171
- information
172
- for information in criterion.information
173
- if (
174
- information.parent is None
175
- or self._p.identify(information.parent) not in parents
176
- )
177
- ],
178
- criterion.incompatibilities,
179
- )
180
-
181
- def _get_preference(self, name: KT) -> Preference:
182
- return self._p.get_preference(
183
- identifier=name,
184
- resolutions=self.state.mapping,
185
- candidates=IteratorMapping(
186
- self.state.criteria,
187
- operator.attrgetter("candidates"),
188
- ),
189
- information=IteratorMapping(
190
- self.state.criteria,
191
- operator.attrgetter("information"),
192
- ),
193
- backtrack_causes=self.state.backtrack_causes,
194
- )
195
-
196
- def _is_current_pin_satisfying(
197
- self, name: KT, criterion: Criterion[RT, CT]
198
- ) -> bool:
199
- try:
200
- current_pin = self.state.mapping[name]
201
- except KeyError:
202
- return False
203
- return all(
204
- self._p.is_satisfied_by(requirement=r, candidate=current_pin)
205
- for r in criterion.iter_requirement()
206
- )
207
-
208
- def _get_updated_criteria(self, candidate: CT) -> dict[KT, Criterion[RT, CT]]:
209
- criteria = self.state.criteria.copy()
210
- for requirement in self._p.get_dependencies(candidate=candidate):
211
- self._add_to_criteria(criteria, requirement, parent=candidate)
212
- return criteria
213
-
214
- def _attempt_to_pin_criterion(self, name: KT) -> list[Criterion[RT, CT]]:
215
- criterion = self.state.criteria[name]
216
-
217
- causes: list[Criterion[RT, CT]] = []
218
- for candidate in criterion.candidates:
219
- try:
220
- criteria = self._get_updated_criteria(candidate)
221
- except RequirementsConflicted as e:
222
- self._r.rejecting_candidate(e.criterion, candidate)
223
- causes.append(e.criterion)
224
- continue
225
-
226
- # Check the newly-pinned candidate actually works. This should
227
- # always pass under normal circumstances, but in the case of a
228
- # faulty provider, we will raise an error to notify the implementer
229
- # to fix find_matches() and/or is_satisfied_by().
230
- satisfied = all(
231
- self._p.is_satisfied_by(requirement=r, candidate=candidate)
232
- for r in criterion.iter_requirement()
233
- )
234
- if not satisfied:
235
- raise InconsistentCandidate(candidate, criterion)
236
-
237
- self._r.pinning(candidate=candidate)
238
- self.state.criteria.update(criteria)
239
-
240
- # Put newly-pinned candidate at the end. This is essential because
241
- # backtracking looks at this mapping to get the last pin.
242
- self.state.mapping.pop(name, None)
243
- self.state.mapping[name] = candidate
244
-
245
- return []
246
-
247
- # All candidates tried, nothing works. This criterion is a dead
248
- # end, signal for backtracking.
249
- return causes
250
-
251
- def _patch_criteria(
252
- self, incompatibilities_from_broken: list[tuple[KT, list[CT]]]
253
- ) -> bool:
254
- # Create a new state from the last known-to-work one, and apply
255
- # the previously gathered incompatibility information.
256
- for k, incompatibilities in incompatibilities_from_broken:
257
- if not incompatibilities:
258
- continue
259
- try:
260
- criterion = self.state.criteria[k]
261
- except KeyError:
262
- continue
263
- matches = self._p.find_matches(
264
- identifier=k,
265
- requirements=IteratorMapping(
266
- self.state.criteria,
267
- operator.methodcaller("iter_requirement"),
268
- ),
269
- incompatibilities=IteratorMapping(
270
- self.state.criteria,
271
- operator.attrgetter("incompatibilities"),
272
- {k: incompatibilities},
273
- ),
274
- )
275
- candidates: IterableView[CT] = build_iter_view(matches)
276
- if not candidates:
277
- return False
278
- incompatibilities.extend(criterion.incompatibilities)
279
- self.state.criteria[k] = Criterion(
280
- candidates=candidates,
281
- information=list(criterion.information),
282
- incompatibilities=incompatibilities,
283
- )
284
- return True
285
-
286
- def _save_state(self) -> None:
287
- """Save states for potential rollback if optimistic backjumping fails."""
288
- if self._save_states is None:
289
- self._save_states = [
290
- State(
291
- mapping=s.mapping.copy(),
292
- criteria=s.criteria.copy(),
293
- backtrack_causes=s.backtrack_causes[:],
294
- )
295
- for s in self._states
296
- ]
297
-
298
- def _rollback_states(self) -> None:
299
- """Rollback states and disable optimistic backjumping."""
300
- self._optimistic_backjumping_ratio = 0.0
301
- if self._save_states:
302
- self._states = self._save_states
303
- self._save_states = None
304
-
305
- def _backjump(self, causes: list[RequirementInformation[RT, CT]]) -> bool:
306
- """Perform backjumping.
307
-
308
- When we enter here, the stack is like this::
309
-
310
- [ state Z ]
311
- [ state Y ]
312
- [ state X ]
313
- .... earlier states are irrelevant.
314
-
315
- 1. No pins worked for Z, so it does not have a pin.
316
- 2. We want to reset state Y to unpinned, and pin another candidate.
317
- 3. State X holds what state Y was before the pin, but does not
318
- have the incompatibility information gathered in state Y.
319
-
320
- Each iteration of the loop will:
321
-
322
- 1. Identify Z. The incompatibility is not always caused by the latest
323
- state. For example, given three requirements A, B and C, with
324
- dependencies A1, B1 and C1, where A1 and B1 are incompatible: the
325
- last state might be related to C, so we want to discard the
326
- previous state.
327
- 2. Discard Z.
328
- 3. Discard Y but remember its incompatibility information gathered
329
- previously, and the failure we're dealing with right now.
330
- 4. Push a new state Y' based on X, and apply the incompatibility
331
- information from Y to Y'.
332
- 5a. If this causes Y' to conflict, we need to backtrack again. Make Y'
333
- the new Z and go back to step 2.
334
- 5b. If the incompatibilities apply cleanly, end backtracking.
335
- """
336
- incompatible_reqs: Iterable[CT | RT] = itertools.chain(
337
- (c.parent for c in causes if c.parent is not None),
338
- (c.requirement for c in causes),
339
- )
340
- incompatible_deps = {self._p.identify(r) for r in incompatible_reqs}
341
- while len(self._states) >= 3:
342
- # Remove the state that triggered backtracking.
343
- del self._states[-1]
344
-
345
- # Optimistically backtrack to a state that caused the incompatibility
346
- broken_state = self.state
347
- while True:
348
- # Retrieve the last candidate pin and known incompatibilities.
349
- try:
350
- broken_state = self._states.pop()
351
- name, candidate = broken_state.mapping.popitem()
352
- except (IndexError, KeyError):
353
- raise ResolutionImpossible(causes) from None
354
-
355
- if (
356
- not self._optimistic_backjumping_ratio
357
- and name not in incompatible_deps
358
- ):
359
- # For safe backjumping only backjump if the current dependency
360
- # is not the same as the incompatible dependency
361
- break
362
-
363
- # On the first time a non-safe backjump is done the state
364
- # is saved so we can restore it later if the resolution fails
365
- if (
366
- self._optimistic_backjumping_ratio
367
- and self._save_states is None
368
- and name not in incompatible_deps
369
- ):
370
- self._save_state()
371
-
372
- # If the current dependencies and the incompatible dependencies
373
- # are overlapping then we have likely found a cause of the
374
- # incompatibility
375
- current_dependencies = {
376
- self._p.identify(d) for d in self._p.get_dependencies(candidate)
377
- }
378
- if not current_dependencies.isdisjoint(incompatible_deps):
379
- break
380
-
381
- # Fallback: We should not backtrack to the point where
382
- # broken_state.mapping is empty, so stop backtracking for
383
- # a chance for the resolution to recover
384
- if not broken_state.mapping:
385
- break
386
-
387
- incompatibilities_from_broken = [
388
- (k, list(v.incompatibilities)) for k, v in broken_state.criteria.items()
389
- ]
390
-
391
- # Also mark the newly known incompatibility.
392
- incompatibilities_from_broken.append((name, [candidate]))
393
-
394
- self._push_new_state()
395
- success = self._patch_criteria(incompatibilities_from_broken)
396
-
397
- # It works! Let's work on this new state.
398
- if success:
399
- return True
400
-
401
- # State does not work after applying known incompatibilities.
402
- # Try the still previous state.
403
-
404
- # No way to backtrack anymore.
405
- return False
406
-
407
- def _extract_causes(
408
- self, criteron: list[Criterion[RT, CT]]
409
- ) -> list[RequirementInformation[RT, CT]]:
410
- """Extract causes from list of criterion and deduplicate"""
411
- return list({id(i): i for c in criteron for i in c.information}.values())
412
-
413
- def resolve(self, requirements: Iterable[RT], max_rounds: int) -> State[RT, CT, KT]:
414
- if self._states:
415
- raise RuntimeError("already resolved")
416
-
417
- self._r.starting()
418
-
419
- # Initialize the root state.
420
- self._states = [
421
- State(
422
- mapping=collections.OrderedDict(),
423
- criteria={},
424
- backtrack_causes=[],
425
- )
426
- ]
427
- for r in requirements:
428
- try:
429
- self._add_to_criteria(self.state.criteria, r, parent=None)
430
- except RequirementsConflicted as e:
431
- raise ResolutionImpossible(e.criterion.information) from e
432
-
433
- # The root state is saved as a sentinel so the first ever pin can have
434
- # something to backtrack to if it fails. The root state is basically
435
- # pinning the virtual "root" package in the graph.
436
- self._push_new_state()
437
-
438
- # Variables for optimistic backjumping
439
- optimistic_rounds_cutoff: int | None = None
440
- optimistic_backjumping_start_round: int | None = None
441
-
442
- for round_index in range(max_rounds):
443
- self._r.starting_round(index=round_index)
444
-
445
- # Handle if optimistic backjumping has been running for too long
446
- if self._optimistic_backjumping_ratio and self._save_states is not None:
447
- if optimistic_backjumping_start_round is None:
448
- optimistic_backjumping_start_round = round_index
449
- optimistic_rounds_cutoff = int(
450
- (max_rounds - round_index) * self._optimistic_backjumping_ratio
451
- )
452
-
453
- if optimistic_rounds_cutoff <= 0:
454
- self._rollback_states()
455
- continue
456
- elif optimistic_rounds_cutoff is not None:
457
- if (
458
- round_index - optimistic_backjumping_start_round
459
- >= optimistic_rounds_cutoff
460
- ):
461
- self._rollback_states()
462
- continue
463
-
464
- unsatisfied_names = [
465
- key
466
- for key, criterion in self.state.criteria.items()
467
- if not self._is_current_pin_satisfying(key, criterion)
468
- ]
469
-
470
- # All criteria are accounted for. Nothing more to pin, we are done!
471
- if not unsatisfied_names:
472
- self._r.ending(state=self.state)
473
- return self.state
474
-
475
- # keep track of satisfied names to calculate diff after pinning
476
- satisfied_names = set(self.state.criteria.keys()) - set(unsatisfied_names)
477
-
478
- if len(unsatisfied_names) > 1:
479
- narrowed_unstatisfied_names = list(
480
- self._p.narrow_requirement_selection(
481
- identifiers=unsatisfied_names,
482
- resolutions=self.state.mapping,
483
- candidates=IteratorMapping(
484
- self.state.criteria,
485
- operator.attrgetter("candidates"),
486
- ),
487
- information=IteratorMapping(
488
- self.state.criteria,
489
- operator.attrgetter("information"),
490
- ),
491
- backtrack_causes=self.state.backtrack_causes,
492
- )
493
- )
494
- else:
495
- narrowed_unstatisfied_names = unsatisfied_names
496
-
497
- # If there are no unsatisfied names use unsatisfied names
498
- if not narrowed_unstatisfied_names:
499
- raise RuntimeError("narrow_requirement_selection returned 0 names")
500
-
501
- # If there is only 1 unsatisfied name skip calling self._get_preference
502
- if len(narrowed_unstatisfied_names) > 1:
503
- # Choose the most preferred unpinned criterion to try.
504
- name = min(narrowed_unstatisfied_names, key=self._get_preference)
505
- else:
506
- name = narrowed_unstatisfied_names[0]
507
-
508
- failure_criterion = self._attempt_to_pin_criterion(name)
509
-
510
- if failure_criterion:
511
- causes = self._extract_causes(failure_criterion)
512
- # Backjump if pinning fails. The backjump process puts us in
513
- # an unpinned state, so we can work on it in the next round.
514
- self._r.resolving_conflicts(causes=causes)
515
-
516
- try:
517
- success = self._backjump(causes)
518
- except ResolutionImpossible:
519
- if self._optimistic_backjumping_ratio and self._save_states:
520
- failed_optimistic_backjumping = True
521
- else:
522
- raise
523
- else:
524
- failed_optimistic_backjumping = bool(
525
- not success
526
- and self._optimistic_backjumping_ratio
527
- and self._save_states
528
- )
529
-
530
- if failed_optimistic_backjumping and self._save_states:
531
- self._rollback_states()
532
- else:
533
- self.state.backtrack_causes[:] = causes
534
-
535
- # Dead ends everywhere. Give up.
536
- if not success:
537
- raise ResolutionImpossible(self.state.backtrack_causes)
538
- else:
539
- # discard as information sources any invalidated names
540
- # (unsatisfied names that were previously satisfied)
541
- newly_unsatisfied_names = {
542
- key
543
- for key, criterion in self.state.criteria.items()
544
- if key in satisfied_names
545
- and not self._is_current_pin_satisfying(key, criterion)
546
- }
547
- self._remove_information_from_criteria(
548
- self.state.criteria, newly_unsatisfied_names
549
- )
550
- # Pinning was successful. Push a new state to do another pin.
551
- self._push_new_state()
552
-
553
- self._r.ending_round(index=round_index, state=self.state)
554
-
555
- raise ResolutionTooDeep(max_rounds)
556
-
557
-
558
- class Resolver(AbstractResolver[RT, CT, KT]):
559
- """The thing that performs the actual resolution work."""
560
-
561
- base_exception = ResolverException
562
-
563
- def resolve( # type: ignore[override]
564
- self,
565
- requirements: Iterable[RT],
566
- max_rounds: int = 100,
567
- ) -> Result[RT, CT, KT]:
568
- """Take a collection of constraints, spit out the resolution result.
569
-
570
- The return value is a representation to the final resolution result. It
571
- is a tuple subclass with three public members:
572
-
573
- * `mapping`: A dict of resolved candidates. Each key is an identifier
574
- of a requirement (as returned by the provider's `identify` method),
575
- and the value is the resolved candidate.
576
- * `graph`: A `DirectedGraph` instance representing the dependency tree.
577
- The vertices are keys of `mapping`, and each edge represents *why*
578
- a particular package is included. A special vertex `None` is
579
- included to represent parents of user-supplied requirements.
580
- * `criteria`: A dict of "criteria" that hold detailed information on
581
- how edges in the graph are derived. Each key is an identifier of a
582
- requirement, and the value is a `Criterion` instance.
583
-
584
- The following exceptions may be raised if a resolution cannot be found:
585
-
586
- * `ResolutionImpossible`: A resolution cannot be found for the given
587
- combination of requirements. The `causes` attribute of the
588
- exception is a list of (requirement, parent), giving the
589
- requirements that could not be satisfied.
590
- * `ResolutionTooDeep`: The dependency tree is too deeply nested and
591
- the resolver gave up. This is usually caused by a circular
592
- dependency, but you can try to resolve this by increasing the
593
- `max_rounds` argument.
594
- """
595
- resolution = Resolution(self.provider, self.reporter)
596
- state = resolution.resolve(requirements, max_rounds=max_rounds)
597
- return _build_result(state)
598
-
599
-
600
- def _has_route_to_root(
601
- criteria: Mapping[KT, Criterion[RT, CT]],
602
- key: KT | None,
603
- all_keys: dict[int, KT | None],
604
- connected: set[KT | None],
605
- ) -> bool:
606
- if key in connected:
607
- return True
608
- if key not in criteria:
609
- return False
610
- assert key is not None
611
- for p in criteria[key].iter_parent():
612
- try:
613
- pkey = all_keys[id(p)]
614
- except KeyError:
615
- continue
616
- if pkey in connected:
617
- connected.add(key)
618
- return True
619
- if _has_route_to_root(criteria, pkey, all_keys, connected):
620
- connected.add(key)
621
- return True
622
- return False