cli-ih 0.6.3__py3-none-any.whl → 0.6.3.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.
- cli_ih/asyncClient.py +13 -7
- cli_ih/client.py +13 -6
- {cli_ih-0.6.3.dist-info → cli_ih-0.6.3.1.dist-info}/METADATA +1 -1
- cli_ih-0.6.3.1.dist-info/RECORD +425 -0
- {cli_ih-0.6.3.dist-info → cli_ih-0.6.3.1.dist-info}/WHEEL +1 -1
- {cli_ih-0.6.3.dist-info → cli_ih-0.6.3.1.dist-info}/top_level.txt +1 -0
- venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +85 -0
- venv/Lib/site-packages/pip/__init__.py +13 -0
- venv/Lib/site-packages/pip/__main__.py +24 -0
- venv/Lib/site-packages/pip/__pip-runner__.py +50 -0
- venv/Lib/site-packages/pip/_internal/__init__.py +18 -0
- venv/Lib/site-packages/pip/_internal/build_env.py +349 -0
- venv/Lib/site-packages/pip/_internal/cache.py +291 -0
- venv/Lib/site-packages/pip/_internal/cli/__init__.py +3 -0
- venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +184 -0
- venv/Lib/site-packages/pip/_internal/cli/base_command.py +244 -0
- venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +1138 -0
- venv/Lib/site-packages/pip/_internal/cli/command_context.py +28 -0
- venv/Lib/site-packages/pip/_internal/cli/index_command.py +175 -0
- venv/Lib/site-packages/pip/_internal/cli/main.py +80 -0
- venv/Lib/site-packages/pip/_internal/cli/main_parser.py +134 -0
- venv/Lib/site-packages/pip/_internal/cli/parser.py +298 -0
- venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +151 -0
- venv/Lib/site-packages/pip/_internal/cli/req_command.py +351 -0
- venv/Lib/site-packages/pip/_internal/cli/spinners.py +235 -0
- venv/Lib/site-packages/pip/_internal/cli/status_codes.py +6 -0
- venv/Lib/site-packages/pip/_internal/commands/__init__.py +139 -0
- venv/Lib/site-packages/pip/_internal/commands/cache.py +231 -0
- venv/Lib/site-packages/pip/_internal/commands/check.py +66 -0
- venv/Lib/site-packages/pip/_internal/commands/completion.py +135 -0
- venv/Lib/site-packages/pip/_internal/commands/configuration.py +288 -0
- venv/Lib/site-packages/pip/_internal/commands/debug.py +203 -0
- venv/Lib/site-packages/pip/_internal/commands/download.py +145 -0
- venv/Lib/site-packages/pip/_internal/commands/freeze.py +107 -0
- venv/Lib/site-packages/pip/_internal/commands/hash.py +58 -0
- venv/Lib/site-packages/pip/_internal/commands/help.py +40 -0
- venv/Lib/site-packages/pip/_internal/commands/index.py +159 -0
- venv/Lib/site-packages/pip/_internal/commands/inspect.py +92 -0
- venv/Lib/site-packages/pip/_internal/commands/install.py +798 -0
- venv/Lib/site-packages/pip/_internal/commands/list.py +400 -0
- venv/Lib/site-packages/pip/_internal/commands/lock.py +170 -0
- venv/Lib/site-packages/pip/_internal/commands/search.py +178 -0
- venv/Lib/site-packages/pip/_internal/commands/show.py +231 -0
- venv/Lib/site-packages/pip/_internal/commands/uninstall.py +113 -0
- venv/Lib/site-packages/pip/_internal/commands/wheel.py +181 -0
- venv/Lib/site-packages/pip/_internal/configuration.py +397 -0
- venv/Lib/site-packages/pip/_internal/distributions/__init__.py +21 -0
- venv/Lib/site-packages/pip/_internal/distributions/base.py +55 -0
- venv/Lib/site-packages/pip/_internal/distributions/installed.py +33 -0
- venv/Lib/site-packages/pip/_internal/distributions/sdist.py +165 -0
- venv/Lib/site-packages/pip/_internal/distributions/wheel.py +44 -0
- venv/Lib/site-packages/pip/_internal/exceptions.py +881 -0
- venv/Lib/site-packages/pip/_internal/index/__init__.py +1 -0
- venv/Lib/site-packages/pip/_internal/index/collector.py +489 -0
- venv/Lib/site-packages/pip/_internal/index/package_finder.py +1059 -0
- venv/Lib/site-packages/pip/_internal/index/sources.py +287 -0
- venv/Lib/site-packages/pip/_internal/locations/__init__.py +441 -0
- venv/Lib/site-packages/pip/_internal/locations/_distutils.py +173 -0
- venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +215 -0
- venv/Lib/site-packages/pip/_internal/locations/base.py +82 -0
- venv/Lib/site-packages/pip/_internal/main.py +12 -0
- venv/Lib/site-packages/pip/_internal/metadata/__init__.py +164 -0
- venv/Lib/site-packages/pip/_internal/metadata/_json.py +87 -0
- venv/Lib/site-packages/pip/_internal/metadata/base.py +685 -0
- venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +6 -0
- venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +87 -0
- venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +223 -0
- venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +143 -0
- venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +298 -0
- venv/Lib/site-packages/pip/_internal/models/__init__.py +1 -0
- venv/Lib/site-packages/pip/_internal/models/candidate.py +25 -0
- venv/Lib/site-packages/pip/_internal/models/direct_url.py +227 -0
- venv/Lib/site-packages/pip/_internal/models/format_control.py +78 -0
- venv/Lib/site-packages/pip/_internal/models/index.py +28 -0
- venv/Lib/site-packages/pip/_internal/models/installation_report.py +57 -0
- venv/Lib/site-packages/pip/_internal/models/link.py +613 -0
- venv/Lib/site-packages/pip/_internal/models/pylock.py +188 -0
- venv/Lib/site-packages/pip/_internal/models/scheme.py +25 -0
- venv/Lib/site-packages/pip/_internal/models/search_scope.py +126 -0
- venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +53 -0
- venv/Lib/site-packages/pip/_internal/models/target_python.py +122 -0
- venv/Lib/site-packages/pip/_internal/models/wheel.py +141 -0
- venv/Lib/site-packages/pip/_internal/network/__init__.py +1 -0
- venv/Lib/site-packages/pip/_internal/network/auth.py +564 -0
- venv/Lib/site-packages/pip/_internal/network/cache.py +133 -0
- venv/Lib/site-packages/pip/_internal/network/download.py +342 -0
- venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +213 -0
- venv/Lib/site-packages/pip/_internal/network/session.py +528 -0
- venv/Lib/site-packages/pip/_internal/network/utils.py +98 -0
- venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +61 -0
- venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +140 -0
- venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +38 -0
- venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +41 -0
- venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +73 -0
- venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +38 -0
- venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +47 -0
- venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +119 -0
- venv/Lib/site-packages/pip/_internal/operations/check.py +175 -0
- venv/Lib/site-packages/pip/_internal/operations/freeze.py +259 -0
- venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +1 -0
- venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +48 -0
- venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +746 -0
- venv/Lib/site-packages/pip/_internal/operations/prepare.py +742 -0
- venv/Lib/site-packages/pip/_internal/pyproject.py +182 -0
- venv/Lib/site-packages/pip/_internal/req/__init__.py +105 -0
- venv/Lib/site-packages/pip/_internal/req/constructors.py +562 -0
- venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +75 -0
- venv/Lib/site-packages/pip/_internal/req/req_file.py +620 -0
- venv/Lib/site-packages/pip/_internal/req/req_install.py +937 -0
- venv/Lib/site-packages/pip/_internal/req/req_set.py +81 -0
- venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +639 -0
- venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/resolution/base.py +20 -0
- venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +598 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +142 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +582 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +814 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +166 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +276 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +85 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +247 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +336 -0
- venv/Lib/site-packages/pip/_internal/self_outdated_check.py +254 -0
- venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +109 -0
- venv/Lib/site-packages/pip/_internal/utils/_log.py +38 -0
- venv/Lib/site-packages/pip/_internal/utils/appdirs.py +52 -0
- venv/Lib/site-packages/pip/_internal/utils/compat.py +85 -0
- venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +201 -0
- venv/Lib/site-packages/pip/_internal/utils/datetime.py +10 -0
- venv/Lib/site-packages/pip/_internal/utils/deprecation.py +126 -0
- venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +87 -0
- venv/Lib/site-packages/pip/_internal/utils/egg_link.py +81 -0
- venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +88 -0
- venv/Lib/site-packages/pip/_internal/utils/filesystem.py +152 -0
- venv/Lib/site-packages/pip/_internal/utils/filetypes.py +24 -0
- venv/Lib/site-packages/pip/_internal/utils/glibc.py +102 -0
- venv/Lib/site-packages/pip/_internal/utils/hashes.py +150 -0
- venv/Lib/site-packages/pip/_internal/utils/logging.py +364 -0
- venv/Lib/site-packages/pip/_internal/utils/misc.py +765 -0
- venv/Lib/site-packages/pip/_internal/utils/packaging.py +44 -0
- venv/Lib/site-packages/pip/_internal/utils/retry.py +45 -0
- venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +149 -0
- venv/Lib/site-packages/pip/_internal/utils/subprocess.py +248 -0
- venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +294 -0
- venv/Lib/site-packages/pip/_internal/utils/unpacking.py +337 -0
- venv/Lib/site-packages/pip/_internal/utils/urls.py +55 -0
- venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +105 -0
- venv/Lib/site-packages/pip/_internal/utils/wheel.py +132 -0
- venv/Lib/site-packages/pip/_internal/vcs/__init__.py +15 -0
- venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +130 -0
- venv/Lib/site-packages/pip/_internal/vcs/git.py +571 -0
- venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +186 -0
- venv/Lib/site-packages/pip/_internal/vcs/subversion.py +335 -0
- venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +693 -0
- venv/Lib/site-packages/pip/_internal/wheel_builder.py +334 -0
- venv/Lib/site-packages/pip/_vendor/__init__.py +117 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +29 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +70 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +168 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +75 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +8 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +145 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +48 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +511 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +119 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +157 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +146 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +43 -0
- venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +4 -0
- venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +12 -0
- venv/Lib/site-packages/pip/_vendor/certifi/core.py +83 -0
- venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +13 -0
- venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +65 -0
- venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +209 -0
- venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +59 -0
- venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +62 -0
- venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +9 -0
- venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +33 -0
- venv/Lib/site-packages/pip/_vendor/distlib/compat.py +1137 -0
- venv/Lib/site-packages/pip/_vendor/distlib/resources.py +358 -0
- venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +447 -0
- venv/Lib/site-packages/pip/_vendor/distlib/util.py +1984 -0
- venv/Lib/site-packages/pip/_vendor/distro/__init__.py +54 -0
- venv/Lib/site-packages/pip/_vendor/distro/__main__.py +4 -0
- venv/Lib/site-packages/pip/_vendor/distro/distro.py +1403 -0
- venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/idna/__init__.py +45 -0
- venv/Lib/site-packages/pip/_vendor/idna/codec.py +122 -0
- venv/Lib/site-packages/pip/_vendor/idna/compat.py +15 -0
- venv/Lib/site-packages/pip/_vendor/idna/core.py +437 -0
- venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +4243 -0
- venv/Lib/site-packages/pip/_vendor/idna/intranges.py +57 -0
- venv/Lib/site-packages/pip/_vendor/idna/package_data.py +1 -0
- venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +8681 -0
- venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +55 -0
- venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +48 -0
- venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +170 -0
- venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +929 -0
- venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +15 -0
- venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +109 -0
- venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +262 -0
- venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +85 -0
- venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +353 -0
- venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +61 -0
- venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +195 -0
- venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +145 -0
- venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +759 -0
- venv/Lib/site-packages/pip/_vendor/packaging/markers.py +362 -0
- venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +862 -0
- venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +91 -0
- venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +1019 -0
- venv/Lib/site-packages/pip/_vendor/packaging/tags.py +656 -0
- venv/Lib/site-packages/pip/_vendor/packaging/utils.py +163 -0
- venv/Lib/site-packages/pip/_vendor/packaging/version.py +582 -0
- venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +3676 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +631 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +55 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +249 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +299 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +144 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +272 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +21 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +272 -0
- venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +82 -0
- venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +17 -0
- venv/Lib/site-packages/pip/_vendor/pygments/console.py +70 -0
- venv/Lib/site-packages/pip/_vendor/pygments/filter.py +70 -0
- venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +940 -0
- venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +129 -0
- venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +157 -0
- venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +23 -0
- venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +963 -0
- venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +362 -0
- venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +602 -0
- venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +1201 -0
- venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +43 -0
- venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +72 -0
- venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +91 -0
- venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +104 -0
- venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +247 -0
- venv/Lib/site-packages/pip/_vendor/pygments/style.py +203 -0
- venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +61 -0
- venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +54 -0
- venv/Lib/site-packages/pip/_vendor/pygments/token.py +214 -0
- venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +153 -0
- venv/Lib/site-packages/pip/_vendor/pygments/util.py +324 -0
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +31 -0
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +410 -0
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +21 -0
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +389 -0
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/requests/__init__.py +179 -0
- venv/Lib/site-packages/pip/_vendor/requests/__version__.py +14 -0
- venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +50 -0
- venv/Lib/site-packages/pip/_vendor/requests/adapters.py +719 -0
- venv/Lib/site-packages/pip/_vendor/requests/api.py +157 -0
- venv/Lib/site-packages/pip/_vendor/requests/auth.py +314 -0
- venv/Lib/site-packages/pip/_vendor/requests/certs.py +17 -0
- venv/Lib/site-packages/pip/_vendor/requests/compat.py +90 -0
- venv/Lib/site-packages/pip/_vendor/requests/cookies.py +561 -0
- venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +151 -0
- venv/Lib/site-packages/pip/_vendor/requests/help.py +127 -0
- venv/Lib/site-packages/pip/_vendor/requests/hooks.py +33 -0
- venv/Lib/site-packages/pip/_vendor/requests/models.py +1039 -0
- venv/Lib/site-packages/pip/_vendor/requests/packages.py +25 -0
- venv/Lib/site-packages/pip/_vendor/requests/sessions.py +831 -0
- venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +128 -0
- venv/Lib/site-packages/pip/_vendor/requests/structures.py +99 -0
- venv/Lib/site-packages/pip/_vendor/requests/utils.py +1086 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +27 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +196 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +55 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +27 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +47 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +48 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +57 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +622 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +209 -0
- venv/Lib/site-packages/pip/_vendor/rich/__init__.py +177 -0
- venv/Lib/site-packages/pip/_vendor/rich/__main__.py +245 -0
- venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +454 -0
- venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +3610 -0
- venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +32 -0
- venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +76 -0
- venv/Lib/site-packages/pip/_vendor/rich/_extension.py +10 -0
- venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +24 -0
- venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +268 -0
- venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +94 -0
- venv/Lib/site-packages/pip/_vendor/rich/_loop.py +43 -0
- venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +69 -0
- venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +309 -0
- venv/Lib/site-packages/pip/_vendor/rich/_pick.py +17 -0
- venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +153 -0
- venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +482 -0
- venv/Lib/site-packages/pip/_vendor/rich/_stack.py +16 -0
- venv/Lib/site-packages/pip/_vendor/rich/_timer.py +19 -0
- venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +661 -0
- venv/Lib/site-packages/pip/_vendor/rich/_windows.py +71 -0
- venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +56 -0
- venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +93 -0
- venv/Lib/site-packages/pip/_vendor/rich/abc.py +33 -0
- venv/Lib/site-packages/pip/_vendor/rich/align.py +306 -0
- venv/Lib/site-packages/pip/_vendor/rich/ansi.py +241 -0
- venv/Lib/site-packages/pip/_vendor/rich/bar.py +93 -0
- venv/Lib/site-packages/pip/_vendor/rich/box.py +474 -0
- venv/Lib/site-packages/pip/_vendor/rich/cells.py +174 -0
- venv/Lib/site-packages/pip/_vendor/rich/color.py +621 -0
- venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +38 -0
- venv/Lib/site-packages/pip/_vendor/rich/columns.py +187 -0
- venv/Lib/site-packages/pip/_vendor/rich/console.py +2680 -0
- venv/Lib/site-packages/pip/_vendor/rich/constrain.py +37 -0
- venv/Lib/site-packages/pip/_vendor/rich/containers.py +167 -0
- venv/Lib/site-packages/pip/_vendor/rich/control.py +219 -0
- venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +193 -0
- venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +39 -0
- venv/Lib/site-packages/pip/_vendor/rich/emoji.py +91 -0
- venv/Lib/site-packages/pip/_vendor/rich/errors.py +34 -0
- venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +57 -0
- venv/Lib/site-packages/pip/_vendor/rich/filesize.py +88 -0
- venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +232 -0
- venv/Lib/site-packages/pip/_vendor/rich/json.py +139 -0
- venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +101 -0
- venv/Lib/site-packages/pip/_vendor/rich/layout.py +442 -0
- venv/Lib/site-packages/pip/_vendor/rich/live.py +400 -0
- venv/Lib/site-packages/pip/_vendor/rich/live_render.py +106 -0
- venv/Lib/site-packages/pip/_vendor/rich/logging.py +297 -0
- venv/Lib/site-packages/pip/_vendor/rich/markup.py +251 -0
- venv/Lib/site-packages/pip/_vendor/rich/measure.py +151 -0
- venv/Lib/site-packages/pip/_vendor/rich/padding.py +141 -0
- venv/Lib/site-packages/pip/_vendor/rich/pager.py +34 -0
- venv/Lib/site-packages/pip/_vendor/rich/palette.py +100 -0
- venv/Lib/site-packages/pip/_vendor/rich/panel.py +317 -0
- venv/Lib/site-packages/pip/_vendor/rich/pretty.py +1016 -0
- venv/Lib/site-packages/pip/_vendor/rich/progress.py +1715 -0
- venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +223 -0
- venv/Lib/site-packages/pip/_vendor/rich/prompt.py +400 -0
- venv/Lib/site-packages/pip/_vendor/rich/protocol.py +42 -0
- venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/rich/region.py +10 -0
- venv/Lib/site-packages/pip/_vendor/rich/repr.py +149 -0
- venv/Lib/site-packages/pip/_vendor/rich/rule.py +130 -0
- venv/Lib/site-packages/pip/_vendor/rich/scope.py +86 -0
- venv/Lib/site-packages/pip/_vendor/rich/screen.py +54 -0
- venv/Lib/site-packages/pip/_vendor/rich/segment.py +752 -0
- venv/Lib/site-packages/pip/_vendor/rich/spinner.py +132 -0
- venv/Lib/site-packages/pip/_vendor/rich/status.py +131 -0
- venv/Lib/site-packages/pip/_vendor/rich/style.py +796 -0
- venv/Lib/site-packages/pip/_vendor/rich/styled.py +42 -0
- venv/Lib/site-packages/pip/_vendor/rich/syntax.py +985 -0
- venv/Lib/site-packages/pip/_vendor/rich/table.py +1006 -0
- venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +153 -0
- venv/Lib/site-packages/pip/_vendor/rich/text.py +1361 -0
- venv/Lib/site-packages/pip/_vendor/rich/theme.py +115 -0
- venv/Lib/site-packages/pip/_vendor/rich/themes.py +5 -0
- venv/Lib/site-packages/pip/_vendor/rich/traceback.py +899 -0
- venv/Lib/site-packages/pip/_vendor/rich/tree.py +257 -0
- venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +8 -0
- venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +770 -0
- venv/Lib/site-packages/pip/_vendor/tomli/_re.py +112 -0
- venv/Lib/site-packages/pip/_vendor/tomli/_types.py +10 -0
- venv/Lib/site-packages/pip/_vendor/tomli/py.typed +1 -0
- venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +4 -0
- venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +229 -0
- venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +1 -0
- venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +36 -0
- venv/Lib/site-packages/pip/_vendor/truststore/_api.py +333 -0
- venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +571 -0
- venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +66 -0
- venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +31 -0
- venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +567 -0
- venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +102 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +355 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +2 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +572 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +1140 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +36 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +519 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +397 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +314 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +130 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +518 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +920 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +216 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +323 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +274 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +98 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +51 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +155 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +1076 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +540 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/request.py +191 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/response.py +879 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +49 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +149 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +57 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +22 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +137 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +107 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +622 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +504 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +159 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +221 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +271 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +435 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +152 -0
- venv/Lib/site-packages/pip/py.typed +4 -0
- cli_ih-0.6.3.dist-info/RECORD +0 -8
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import calendar
|
|
7
|
+
import time
|
|
8
|
+
from datetime import datetime, timedelta, timezone
|
|
9
|
+
from email.utils import formatdate, parsedate, parsedate_tz
|
|
10
|
+
from typing import TYPE_CHECKING, Any, Mapping
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from pip._vendor.urllib3 import HTTPResponse
|
|
14
|
+
|
|
15
|
+
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def expire_after(delta: timedelta, date: datetime | None = None) -> datetime:
|
|
19
|
+
date = date or datetime.now(timezone.utc)
|
|
20
|
+
return date + delta
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def datetime_to_header(dt: datetime) -> str:
|
|
24
|
+
return formatdate(calendar.timegm(dt.timetuple()))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class BaseHeuristic:
|
|
28
|
+
def warning(self, response: HTTPResponse) -> str | None:
|
|
29
|
+
"""
|
|
30
|
+
Return a valid 1xx warning header value describing the cache
|
|
31
|
+
adjustments.
|
|
32
|
+
|
|
33
|
+
The response is provided too allow warnings like 113
|
|
34
|
+
http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need
|
|
35
|
+
to explicitly say response is over 24 hours old.
|
|
36
|
+
"""
|
|
37
|
+
return '110 - "Response is Stale"'
|
|
38
|
+
|
|
39
|
+
def update_headers(self, response: HTTPResponse) -> dict[str, str]:
|
|
40
|
+
"""Update the response headers with any new headers.
|
|
41
|
+
|
|
42
|
+
NOTE: This SHOULD always include some Warning header to
|
|
43
|
+
signify that the response was cached by the client, not
|
|
44
|
+
by way of the provided headers.
|
|
45
|
+
"""
|
|
46
|
+
return {}
|
|
47
|
+
|
|
48
|
+
def apply(self, response: HTTPResponse) -> HTTPResponse:
|
|
49
|
+
updated_headers = self.update_headers(response)
|
|
50
|
+
|
|
51
|
+
if updated_headers:
|
|
52
|
+
response.headers.update(updated_headers)
|
|
53
|
+
warning_header_value = self.warning(response)
|
|
54
|
+
if warning_header_value is not None:
|
|
55
|
+
response.headers.update({"Warning": warning_header_value})
|
|
56
|
+
|
|
57
|
+
return response
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class OneDayCache(BaseHeuristic):
|
|
61
|
+
"""
|
|
62
|
+
Cache the response by providing an expires 1 day in the
|
|
63
|
+
future.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
def update_headers(self, response: HTTPResponse) -> dict[str, str]:
|
|
67
|
+
headers = {}
|
|
68
|
+
|
|
69
|
+
if "expires" not in response.headers:
|
|
70
|
+
date = parsedate(response.headers["date"])
|
|
71
|
+
expires = expire_after(
|
|
72
|
+
timedelta(days=1),
|
|
73
|
+
date=datetime(*date[:6], tzinfo=timezone.utc), # type: ignore[index,misc]
|
|
74
|
+
)
|
|
75
|
+
headers["expires"] = datetime_to_header(expires)
|
|
76
|
+
headers["cache-control"] = "public"
|
|
77
|
+
return headers
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class ExpiresAfter(BaseHeuristic):
|
|
81
|
+
"""
|
|
82
|
+
Cache **all** requests for a defined time period.
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
def __init__(self, **kw: Any) -> None:
|
|
86
|
+
self.delta = timedelta(**kw)
|
|
87
|
+
|
|
88
|
+
def update_headers(self, response: HTTPResponse) -> dict[str, str]:
|
|
89
|
+
expires = expire_after(self.delta)
|
|
90
|
+
return {"expires": datetime_to_header(expires), "cache-control": "public"}
|
|
91
|
+
|
|
92
|
+
def warning(self, response: HTTPResponse) -> str | None:
|
|
93
|
+
tmpl = "110 - Automatically cached for %s. Response might be stale"
|
|
94
|
+
return tmpl % self.delta
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class LastModified(BaseHeuristic):
|
|
98
|
+
"""
|
|
99
|
+
If there is no Expires header already, fall back on Last-Modified
|
|
100
|
+
using the heuristic from
|
|
101
|
+
http://tools.ietf.org/html/rfc7234#section-4.2.2
|
|
102
|
+
to calculate a reasonable value.
|
|
103
|
+
|
|
104
|
+
Firefox also does something like this per
|
|
105
|
+
https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching_FAQ
|
|
106
|
+
http://lxr.mozilla.org/mozilla-release/source/netwerk/protocol/http/nsHttpResponseHead.cpp#397
|
|
107
|
+
Unlike mozilla we limit this to 24-hr.
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
cacheable_by_default_statuses = {
|
|
111
|
+
200,
|
|
112
|
+
203,
|
|
113
|
+
204,
|
|
114
|
+
206,
|
|
115
|
+
300,
|
|
116
|
+
301,
|
|
117
|
+
404,
|
|
118
|
+
405,
|
|
119
|
+
410,
|
|
120
|
+
414,
|
|
121
|
+
501,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
def update_headers(self, resp: HTTPResponse) -> dict[str, str]:
|
|
125
|
+
headers: Mapping[str, str] = resp.headers
|
|
126
|
+
|
|
127
|
+
if "expires" in headers:
|
|
128
|
+
return {}
|
|
129
|
+
|
|
130
|
+
if "cache-control" in headers and headers["cache-control"] != "public":
|
|
131
|
+
return {}
|
|
132
|
+
|
|
133
|
+
if resp.status not in self.cacheable_by_default_statuses:
|
|
134
|
+
return {}
|
|
135
|
+
|
|
136
|
+
if "date" not in headers or "last-modified" not in headers:
|
|
137
|
+
return {}
|
|
138
|
+
|
|
139
|
+
time_tuple = parsedate_tz(headers["date"])
|
|
140
|
+
assert time_tuple is not None
|
|
141
|
+
date = calendar.timegm(time_tuple[:6])
|
|
142
|
+
last_modified = parsedate(headers["last-modified"])
|
|
143
|
+
if last_modified is None:
|
|
144
|
+
return {}
|
|
145
|
+
|
|
146
|
+
now = time.time()
|
|
147
|
+
current_age = max(0, now - date)
|
|
148
|
+
delta = date - calendar.timegm(last_modified)
|
|
149
|
+
freshness_lifetime = max(0, min(delta / 10, 24 * 3600))
|
|
150
|
+
if freshness_lifetime <= current_age:
|
|
151
|
+
return {}
|
|
152
|
+
|
|
153
|
+
expires = date + freshness_lifetime
|
|
154
|
+
return {"expires": time.strftime(TIME_FMT, time.gmtime(expires))}
|
|
155
|
+
|
|
156
|
+
def warning(self, resp: HTTPResponse) -> str | None:
|
|
157
|
+
return None
|
|
File without changes
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import io
|
|
7
|
+
from typing import IO, TYPE_CHECKING, Any, Mapping, cast
|
|
8
|
+
|
|
9
|
+
from pip._vendor import msgpack
|
|
10
|
+
from pip._vendor.requests.structures import CaseInsensitiveDict
|
|
11
|
+
from pip._vendor.urllib3 import HTTPResponse
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from pip._vendor.requests import PreparedRequest
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Serializer:
|
|
18
|
+
serde_version = "4"
|
|
19
|
+
|
|
20
|
+
def dumps(
|
|
21
|
+
self,
|
|
22
|
+
request: PreparedRequest,
|
|
23
|
+
response: HTTPResponse,
|
|
24
|
+
body: bytes | None = None,
|
|
25
|
+
) -> bytes:
|
|
26
|
+
response_headers: CaseInsensitiveDict[str] = CaseInsensitiveDict(
|
|
27
|
+
response.headers
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if body is None:
|
|
31
|
+
# When a body isn't passed in, we'll read the response. We
|
|
32
|
+
# also update the response with a new file handler to be
|
|
33
|
+
# sure it acts as though it was never read.
|
|
34
|
+
body = response.read(decode_content=False)
|
|
35
|
+
response._fp = io.BytesIO(body) # type: ignore[assignment]
|
|
36
|
+
response.length_remaining = len(body)
|
|
37
|
+
|
|
38
|
+
data = {
|
|
39
|
+
"response": {
|
|
40
|
+
"body": body, # Empty bytestring if body is stored separately
|
|
41
|
+
"headers": {str(k): str(v) for k, v in response.headers.items()},
|
|
42
|
+
"status": response.status,
|
|
43
|
+
"version": response.version,
|
|
44
|
+
"reason": str(response.reason),
|
|
45
|
+
"decode_content": response.decode_content,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# Construct our vary headers
|
|
50
|
+
data["vary"] = {}
|
|
51
|
+
if "vary" in response_headers:
|
|
52
|
+
varied_headers = response_headers["vary"].split(",")
|
|
53
|
+
for header in varied_headers:
|
|
54
|
+
header = str(header).strip()
|
|
55
|
+
header_value = request.headers.get(header, None)
|
|
56
|
+
if header_value is not None:
|
|
57
|
+
header_value = str(header_value)
|
|
58
|
+
data["vary"][header] = header_value
|
|
59
|
+
|
|
60
|
+
return b",".join([f"cc={self.serde_version}".encode(), self.serialize(data)])
|
|
61
|
+
|
|
62
|
+
def serialize(self, data: dict[str, Any]) -> bytes:
|
|
63
|
+
return cast(bytes, msgpack.dumps(data, use_bin_type=True))
|
|
64
|
+
|
|
65
|
+
def loads(
|
|
66
|
+
self,
|
|
67
|
+
request: PreparedRequest,
|
|
68
|
+
data: bytes,
|
|
69
|
+
body_file: IO[bytes] | None = None,
|
|
70
|
+
) -> HTTPResponse | None:
|
|
71
|
+
# Short circuit if we've been given an empty set of data
|
|
72
|
+
if not data:
|
|
73
|
+
return None
|
|
74
|
+
|
|
75
|
+
# Previous versions of this library supported other serialization
|
|
76
|
+
# formats, but these have all been removed.
|
|
77
|
+
if not data.startswith(f"cc={self.serde_version},".encode()):
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
data = data[5:]
|
|
81
|
+
return self._loads_v4(request, data, body_file)
|
|
82
|
+
|
|
83
|
+
def prepare_response(
|
|
84
|
+
self,
|
|
85
|
+
request: PreparedRequest,
|
|
86
|
+
cached: Mapping[str, Any],
|
|
87
|
+
body_file: IO[bytes] | None = None,
|
|
88
|
+
) -> HTTPResponse | None:
|
|
89
|
+
"""Verify our vary headers match and construct a real urllib3
|
|
90
|
+
HTTPResponse object.
|
|
91
|
+
"""
|
|
92
|
+
# Special case the '*' Vary value as it means we cannot actually
|
|
93
|
+
# determine if the cached response is suitable for this request.
|
|
94
|
+
# This case is also handled in the controller code when creating
|
|
95
|
+
# a cache entry, but is left here for backwards compatibility.
|
|
96
|
+
if "*" in cached.get("vary", {}):
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
# Ensure that the Vary headers for the cached response match our
|
|
100
|
+
# request
|
|
101
|
+
for header, value in cached.get("vary", {}).items():
|
|
102
|
+
if request.headers.get(header, None) != value:
|
|
103
|
+
return None
|
|
104
|
+
|
|
105
|
+
body_raw = cached["response"].pop("body")
|
|
106
|
+
|
|
107
|
+
headers: CaseInsensitiveDict[str] = CaseInsensitiveDict(
|
|
108
|
+
data=cached["response"]["headers"]
|
|
109
|
+
)
|
|
110
|
+
if headers.get("transfer-encoding", "") == "chunked":
|
|
111
|
+
headers.pop("transfer-encoding")
|
|
112
|
+
|
|
113
|
+
cached["response"]["headers"] = headers
|
|
114
|
+
|
|
115
|
+
try:
|
|
116
|
+
body: IO[bytes]
|
|
117
|
+
if body_file is None:
|
|
118
|
+
body = io.BytesIO(body_raw)
|
|
119
|
+
else:
|
|
120
|
+
body = body_file
|
|
121
|
+
except TypeError:
|
|
122
|
+
# This can happen if cachecontrol serialized to v1 format (pickle)
|
|
123
|
+
# using Python 2. A Python 2 str(byte string) will be unpickled as
|
|
124
|
+
# a Python 3 str (unicode string), which will cause the above to
|
|
125
|
+
# fail with:
|
|
126
|
+
#
|
|
127
|
+
# TypeError: 'str' does not support the buffer interface
|
|
128
|
+
body = io.BytesIO(body_raw.encode("utf8"))
|
|
129
|
+
|
|
130
|
+
# Discard any `strict` parameter serialized by older version of cachecontrol.
|
|
131
|
+
cached["response"].pop("strict", None)
|
|
132
|
+
|
|
133
|
+
return HTTPResponse(body=body, preload_content=False, **cached["response"])
|
|
134
|
+
|
|
135
|
+
def _loads_v4(
|
|
136
|
+
self,
|
|
137
|
+
request: PreparedRequest,
|
|
138
|
+
data: bytes,
|
|
139
|
+
body_file: IO[bytes] | None = None,
|
|
140
|
+
) -> HTTPResponse | None:
|
|
141
|
+
try:
|
|
142
|
+
cached = msgpack.loads(data, raw=False)
|
|
143
|
+
except ValueError:
|
|
144
|
+
return None
|
|
145
|
+
|
|
146
|
+
return self.prepare_response(request, cached, body_file)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import TYPE_CHECKING, Collection
|
|
7
|
+
|
|
8
|
+
from pip._vendor.cachecontrol.adapter import CacheControlAdapter
|
|
9
|
+
from pip._vendor.cachecontrol.cache import DictCache
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from pip._vendor import requests
|
|
13
|
+
|
|
14
|
+
from pip._vendor.cachecontrol.cache import BaseCache
|
|
15
|
+
from pip._vendor.cachecontrol.controller import CacheController
|
|
16
|
+
from pip._vendor.cachecontrol.heuristics import BaseHeuristic
|
|
17
|
+
from pip._vendor.cachecontrol.serialize import Serializer
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def CacheControl(
|
|
21
|
+
sess: requests.Session,
|
|
22
|
+
cache: BaseCache | None = None,
|
|
23
|
+
cache_etags: bool = True,
|
|
24
|
+
serializer: Serializer | None = None,
|
|
25
|
+
heuristic: BaseHeuristic | None = None,
|
|
26
|
+
controller_class: type[CacheController] | None = None,
|
|
27
|
+
adapter_class: type[CacheControlAdapter] | None = None,
|
|
28
|
+
cacheable_methods: Collection[str] | None = None,
|
|
29
|
+
) -> requests.Session:
|
|
30
|
+
cache = DictCache() if cache is None else cache
|
|
31
|
+
adapter_class = adapter_class or CacheControlAdapter
|
|
32
|
+
adapter = adapter_class(
|
|
33
|
+
cache,
|
|
34
|
+
cache_etags=cache_etags,
|
|
35
|
+
serializer=serializer,
|
|
36
|
+
heuristic=heuristic,
|
|
37
|
+
controller_class=controller_class,
|
|
38
|
+
cacheable_methods=cacheable_methods,
|
|
39
|
+
)
|
|
40
|
+
sess.mount("http://", adapter)
|
|
41
|
+
sess.mount("https://", adapter)
|
|
42
|
+
|
|
43
|
+
return sess
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from pip._vendor.certifi import contents, where
|
|
4
|
+
|
|
5
|
+
parser = argparse.ArgumentParser()
|
|
6
|
+
parser.add_argument("-c", "--contents", action="store_true")
|
|
7
|
+
args = parser.parse_args()
|
|
8
|
+
|
|
9
|
+
if args.contents:
|
|
10
|
+
print(contents())
|
|
11
|
+
else:
|
|
12
|
+
print(where())
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""
|
|
2
|
+
certifi.py
|
|
3
|
+
~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
This module returns the installation location of cacert.pem or its contents.
|
|
6
|
+
"""
|
|
7
|
+
import sys
|
|
8
|
+
import atexit
|
|
9
|
+
|
|
10
|
+
def exit_cacert_ctx() -> None:
|
|
11
|
+
_CACERT_CTX.__exit__(None, None, None) # type: ignore[union-attr]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
if sys.version_info >= (3, 11):
|
|
15
|
+
|
|
16
|
+
from importlib.resources import as_file, files
|
|
17
|
+
|
|
18
|
+
_CACERT_CTX = None
|
|
19
|
+
_CACERT_PATH = None
|
|
20
|
+
|
|
21
|
+
def where() -> str:
|
|
22
|
+
# This is slightly terrible, but we want to delay extracting the file
|
|
23
|
+
# in cases where we're inside of a zipimport situation until someone
|
|
24
|
+
# actually calls where(), but we don't want to re-extract the file
|
|
25
|
+
# on every call of where(), so we'll do it once then store it in a
|
|
26
|
+
# global variable.
|
|
27
|
+
global _CACERT_CTX
|
|
28
|
+
global _CACERT_PATH
|
|
29
|
+
if _CACERT_PATH is None:
|
|
30
|
+
# This is slightly janky, the importlib.resources API wants you to
|
|
31
|
+
# manage the cleanup of this file, so it doesn't actually return a
|
|
32
|
+
# path, it returns a context manager that will give you the path
|
|
33
|
+
# when you enter it and will do any cleanup when you leave it. In
|
|
34
|
+
# the common case of not needing a temporary file, it will just
|
|
35
|
+
# return the file system location and the __exit__() is a no-op.
|
|
36
|
+
#
|
|
37
|
+
# We also have to hold onto the actual context manager, because
|
|
38
|
+
# it will do the cleanup whenever it gets garbage collected, so
|
|
39
|
+
# we will also store that at the global level as well.
|
|
40
|
+
_CACERT_CTX = as_file(files("pip._vendor.certifi").joinpath("cacert.pem"))
|
|
41
|
+
_CACERT_PATH = str(_CACERT_CTX.__enter__())
|
|
42
|
+
atexit.register(exit_cacert_ctx)
|
|
43
|
+
|
|
44
|
+
return _CACERT_PATH
|
|
45
|
+
|
|
46
|
+
def contents() -> str:
|
|
47
|
+
return files("pip._vendor.certifi").joinpath("cacert.pem").read_text(encoding="ascii")
|
|
48
|
+
|
|
49
|
+
else:
|
|
50
|
+
|
|
51
|
+
from importlib.resources import path as get_path, read_text
|
|
52
|
+
|
|
53
|
+
_CACERT_CTX = None
|
|
54
|
+
_CACERT_PATH = None
|
|
55
|
+
|
|
56
|
+
def where() -> str:
|
|
57
|
+
# This is slightly terrible, but we want to delay extracting the
|
|
58
|
+
# file in cases where we're inside of a zipimport situation until
|
|
59
|
+
# someone actually calls where(), but we don't want to re-extract
|
|
60
|
+
# the file on every call of where(), so we'll do it once then store
|
|
61
|
+
# it in a global variable.
|
|
62
|
+
global _CACERT_CTX
|
|
63
|
+
global _CACERT_PATH
|
|
64
|
+
if _CACERT_PATH is None:
|
|
65
|
+
# This is slightly janky, the importlib.resources API wants you
|
|
66
|
+
# to manage the cleanup of this file, so it doesn't actually
|
|
67
|
+
# return a path, it returns a context manager that will give
|
|
68
|
+
# you the path when you enter it and will do any cleanup when
|
|
69
|
+
# you leave it. In the common case of not needing a temporary
|
|
70
|
+
# file, it will just return the file system location and the
|
|
71
|
+
# __exit__() is a no-op.
|
|
72
|
+
#
|
|
73
|
+
# We also have to hold onto the actual context manager, because
|
|
74
|
+
# it will do the cleanup whenever it gets garbage collected, so
|
|
75
|
+
# we will also store that at the global level as well.
|
|
76
|
+
_CACERT_CTX = get_path("pip._vendor.certifi", "cacert.pem")
|
|
77
|
+
_CACERT_PATH = str(_CACERT_CTX.__enter__())
|
|
78
|
+
atexit.register(exit_cacert_ctx)
|
|
79
|
+
|
|
80
|
+
return _CACERT_PATH
|
|
81
|
+
|
|
82
|
+
def contents() -> str:
|
|
83
|
+
return read_text("pip._vendor.certifi", "cacert.pem", encoding="ascii")
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
from ._implementation import resolve
|
|
5
|
+
from ._toml_compat import tomllib
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def main() -> None:
|
|
9
|
+
if tomllib is None:
|
|
10
|
+
print(
|
|
11
|
+
"Usage error: dependency-groups CLI requires tomli or Python 3.11+",
|
|
12
|
+
file=sys.stderr,
|
|
13
|
+
)
|
|
14
|
+
raise SystemExit(2)
|
|
15
|
+
|
|
16
|
+
parser = argparse.ArgumentParser(
|
|
17
|
+
description=(
|
|
18
|
+
"A dependency-groups CLI. Prints out a resolved group, newline-delimited."
|
|
19
|
+
)
|
|
20
|
+
)
|
|
21
|
+
parser.add_argument(
|
|
22
|
+
"GROUP_NAME", nargs="*", help="The dependency group(s) to resolve."
|
|
23
|
+
)
|
|
24
|
+
parser.add_argument(
|
|
25
|
+
"-f",
|
|
26
|
+
"--pyproject-file",
|
|
27
|
+
default="pyproject.toml",
|
|
28
|
+
help="The pyproject.toml file. Defaults to trying in the current directory.",
|
|
29
|
+
)
|
|
30
|
+
parser.add_argument(
|
|
31
|
+
"-o",
|
|
32
|
+
"--output",
|
|
33
|
+
help="An output file. Defaults to stdout.",
|
|
34
|
+
)
|
|
35
|
+
parser.add_argument(
|
|
36
|
+
"-l",
|
|
37
|
+
"--list",
|
|
38
|
+
action="store_true",
|
|
39
|
+
help="List the available dependency groups",
|
|
40
|
+
)
|
|
41
|
+
args = parser.parse_args()
|
|
42
|
+
|
|
43
|
+
with open(args.pyproject_file, "rb") as fp:
|
|
44
|
+
pyproject = tomllib.load(fp)
|
|
45
|
+
|
|
46
|
+
dependency_groups_raw = pyproject.get("dependency-groups", {})
|
|
47
|
+
|
|
48
|
+
if args.list:
|
|
49
|
+
print(*dependency_groups_raw.keys())
|
|
50
|
+
return
|
|
51
|
+
if not args.GROUP_NAME:
|
|
52
|
+
print("A GROUP_NAME is required", file=sys.stderr)
|
|
53
|
+
raise SystemExit(3)
|
|
54
|
+
|
|
55
|
+
content = "\n".join(resolve(dependency_groups_raw, *args.GROUP_NAME))
|
|
56
|
+
|
|
57
|
+
if args.output is None or args.output == "-":
|
|
58
|
+
print(content)
|
|
59
|
+
else:
|
|
60
|
+
with open(args.output, "w", encoding="utf-8") as fp:
|
|
61
|
+
print(content, file=fp)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if __name__ == "__main__":
|
|
65
|
+
main()
|