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,140 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import contextlib
|
|
4
|
+
import hashlib
|
|
5
|
+
import logging
|
|
6
|
+
import os
|
|
7
|
+
from collections.abc import Generator
|
|
8
|
+
from types import TracebackType
|
|
9
|
+
|
|
10
|
+
from pip._internal.req.req_install import InstallRequirement
|
|
11
|
+
from pip._internal.utils.temp_dir import TempDirectory
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@contextlib.contextmanager
|
|
17
|
+
def update_env_context_manager(**changes: str) -> Generator[None, None, None]:
|
|
18
|
+
target = os.environ
|
|
19
|
+
|
|
20
|
+
# Save values from the target and change them.
|
|
21
|
+
non_existent_marker = object()
|
|
22
|
+
saved_values: dict[str, object | str] = {}
|
|
23
|
+
for name, new_value in changes.items():
|
|
24
|
+
try:
|
|
25
|
+
saved_values[name] = target[name]
|
|
26
|
+
except KeyError:
|
|
27
|
+
saved_values[name] = non_existent_marker
|
|
28
|
+
target[name] = new_value
|
|
29
|
+
|
|
30
|
+
try:
|
|
31
|
+
yield
|
|
32
|
+
finally:
|
|
33
|
+
# Restore original values in the target.
|
|
34
|
+
for name, original_value in saved_values.items():
|
|
35
|
+
if original_value is non_existent_marker:
|
|
36
|
+
del target[name]
|
|
37
|
+
else:
|
|
38
|
+
assert isinstance(original_value, str) # for mypy
|
|
39
|
+
target[name] = original_value
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@contextlib.contextmanager
|
|
43
|
+
def get_build_tracker() -> Generator[BuildTracker, None, None]:
|
|
44
|
+
root = os.environ.get("PIP_BUILD_TRACKER")
|
|
45
|
+
with contextlib.ExitStack() as ctx:
|
|
46
|
+
if root is None:
|
|
47
|
+
root = ctx.enter_context(TempDirectory(kind="build-tracker")).path
|
|
48
|
+
ctx.enter_context(update_env_context_manager(PIP_BUILD_TRACKER=root))
|
|
49
|
+
logger.debug("Initialized build tracking at %s", root)
|
|
50
|
+
|
|
51
|
+
with BuildTracker(root) as tracker:
|
|
52
|
+
yield tracker
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class TrackerId(str):
|
|
56
|
+
"""Uniquely identifying string provided to the build tracker."""
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class BuildTracker:
|
|
60
|
+
"""Ensure that an sdist cannot request itself as a setup requirement.
|
|
61
|
+
|
|
62
|
+
When an sdist is prepared, it identifies its setup requirements in the
|
|
63
|
+
context of ``BuildTracker.track()``. If a requirement shows up recursively, this
|
|
64
|
+
raises an exception.
|
|
65
|
+
|
|
66
|
+
This stops fork bombs embedded in malicious packages."""
|
|
67
|
+
|
|
68
|
+
def __init__(self, root: str) -> None:
|
|
69
|
+
self._root = root
|
|
70
|
+
self._entries: dict[TrackerId, InstallRequirement] = {}
|
|
71
|
+
logger.debug("Created build tracker: %s", self._root)
|
|
72
|
+
|
|
73
|
+
def __enter__(self) -> BuildTracker:
|
|
74
|
+
logger.debug("Entered build tracker: %s", self._root)
|
|
75
|
+
return self
|
|
76
|
+
|
|
77
|
+
def __exit__(
|
|
78
|
+
self,
|
|
79
|
+
exc_type: type[BaseException] | None,
|
|
80
|
+
exc_val: BaseException | None,
|
|
81
|
+
exc_tb: TracebackType | None,
|
|
82
|
+
) -> None:
|
|
83
|
+
self.cleanup()
|
|
84
|
+
|
|
85
|
+
def _entry_path(self, key: TrackerId) -> str:
|
|
86
|
+
hashed = hashlib.sha224(key.encode()).hexdigest()
|
|
87
|
+
return os.path.join(self._root, hashed)
|
|
88
|
+
|
|
89
|
+
def add(self, req: InstallRequirement, key: TrackerId) -> None:
|
|
90
|
+
"""Add an InstallRequirement to build tracking."""
|
|
91
|
+
|
|
92
|
+
# Get the file to write information about this requirement.
|
|
93
|
+
entry_path = self._entry_path(key)
|
|
94
|
+
|
|
95
|
+
# Try reading from the file. If it exists and can be read from, a build
|
|
96
|
+
# is already in progress, so a LookupError is raised.
|
|
97
|
+
try:
|
|
98
|
+
with open(entry_path) as fp:
|
|
99
|
+
contents = fp.read()
|
|
100
|
+
except FileNotFoundError:
|
|
101
|
+
pass
|
|
102
|
+
else:
|
|
103
|
+
message = f"{req.link} is already being built: {contents}"
|
|
104
|
+
raise LookupError(message)
|
|
105
|
+
|
|
106
|
+
# If we're here, req should really not be building already.
|
|
107
|
+
assert key not in self._entries
|
|
108
|
+
|
|
109
|
+
# Start tracking this requirement.
|
|
110
|
+
with open(entry_path, "w", encoding="utf-8") as fp:
|
|
111
|
+
fp.write(str(req))
|
|
112
|
+
self._entries[key] = req
|
|
113
|
+
|
|
114
|
+
logger.debug("Added %s to build tracker %r", req, self._root)
|
|
115
|
+
|
|
116
|
+
def remove(self, req: InstallRequirement, key: TrackerId) -> None:
|
|
117
|
+
"""Remove an InstallRequirement from build tracking."""
|
|
118
|
+
|
|
119
|
+
# Delete the created file and the corresponding entry.
|
|
120
|
+
os.unlink(self._entry_path(key))
|
|
121
|
+
del self._entries[key]
|
|
122
|
+
|
|
123
|
+
logger.debug("Removed %s from build tracker %r", req, self._root)
|
|
124
|
+
|
|
125
|
+
def cleanup(self) -> None:
|
|
126
|
+
for key, req in list(self._entries.items()):
|
|
127
|
+
self.remove(req, key)
|
|
128
|
+
|
|
129
|
+
logger.debug("Removed build tracker: %r", self._root)
|
|
130
|
+
|
|
131
|
+
@contextlib.contextmanager
|
|
132
|
+
def track(self, req: InstallRequirement, key: str) -> Generator[None, None, None]:
|
|
133
|
+
"""Ensure that `key` cannot install itself as a setup requirement.
|
|
134
|
+
|
|
135
|
+
:raises LookupError: If `key` was already provided in a parent invocation of
|
|
136
|
+
the context introduced by this method."""
|
|
137
|
+
tracker_id = TrackerId(key)
|
|
138
|
+
self.add(req, tracker_id)
|
|
139
|
+
yield
|
|
140
|
+
self.remove(req, tracker_id)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Metadata generation logic for source distributions."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from pip._vendor.pyproject_hooks import BuildBackendHookCaller
|
|
6
|
+
|
|
7
|
+
from pip._internal.build_env import BuildEnvironment
|
|
8
|
+
from pip._internal.exceptions import (
|
|
9
|
+
InstallationSubprocessError,
|
|
10
|
+
MetadataGenerationFailed,
|
|
11
|
+
)
|
|
12
|
+
from pip._internal.utils.subprocess import runner_with_spinner_message
|
|
13
|
+
from pip._internal.utils.temp_dir import TempDirectory
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def generate_metadata(
|
|
17
|
+
build_env: BuildEnvironment, backend: BuildBackendHookCaller, details: str
|
|
18
|
+
) -> str:
|
|
19
|
+
"""Generate metadata using mechanisms described in PEP 517.
|
|
20
|
+
|
|
21
|
+
Returns the generated metadata directory.
|
|
22
|
+
"""
|
|
23
|
+
metadata_tmpdir = TempDirectory(kind="modern-metadata", globally_managed=True)
|
|
24
|
+
|
|
25
|
+
metadata_dir = metadata_tmpdir.path
|
|
26
|
+
|
|
27
|
+
with build_env:
|
|
28
|
+
# Note that BuildBackendHookCaller implements a fallback for
|
|
29
|
+
# prepare_metadata_for_build_wheel, so we don't have to
|
|
30
|
+
# consider the possibility that this hook doesn't exist.
|
|
31
|
+
runner = runner_with_spinner_message("Preparing metadata (pyproject.toml)")
|
|
32
|
+
with backend.subprocess_runner(runner):
|
|
33
|
+
try:
|
|
34
|
+
distinfo_dir = backend.prepare_metadata_for_build_wheel(metadata_dir)
|
|
35
|
+
except InstallationSubprocessError as error:
|
|
36
|
+
raise MetadataGenerationFailed(package_details=details) from error
|
|
37
|
+
|
|
38
|
+
return os.path.join(metadata_dir, distinfo_dir)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Metadata generation logic for source distributions."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from pip._vendor.pyproject_hooks import BuildBackendHookCaller
|
|
6
|
+
|
|
7
|
+
from pip._internal.build_env import BuildEnvironment
|
|
8
|
+
from pip._internal.exceptions import (
|
|
9
|
+
InstallationSubprocessError,
|
|
10
|
+
MetadataGenerationFailed,
|
|
11
|
+
)
|
|
12
|
+
from pip._internal.utils.subprocess import runner_with_spinner_message
|
|
13
|
+
from pip._internal.utils.temp_dir import TempDirectory
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def generate_editable_metadata(
|
|
17
|
+
build_env: BuildEnvironment, backend: BuildBackendHookCaller, details: str
|
|
18
|
+
) -> str:
|
|
19
|
+
"""Generate metadata using mechanisms described in PEP 660.
|
|
20
|
+
|
|
21
|
+
Returns the generated metadata directory.
|
|
22
|
+
"""
|
|
23
|
+
metadata_tmpdir = TempDirectory(kind="modern-metadata", globally_managed=True)
|
|
24
|
+
|
|
25
|
+
metadata_dir = metadata_tmpdir.path
|
|
26
|
+
|
|
27
|
+
with build_env:
|
|
28
|
+
# Note that BuildBackendHookCaller implements a fallback for
|
|
29
|
+
# prepare_metadata_for_build_wheel/editable, so we don't have to
|
|
30
|
+
# consider the possibility that this hook doesn't exist.
|
|
31
|
+
runner = runner_with_spinner_message(
|
|
32
|
+
"Preparing editable metadata (pyproject.toml)"
|
|
33
|
+
)
|
|
34
|
+
with backend.subprocess_runner(runner):
|
|
35
|
+
try:
|
|
36
|
+
distinfo_dir = backend.prepare_metadata_for_build_editable(metadata_dir)
|
|
37
|
+
except InstallationSubprocessError as error:
|
|
38
|
+
raise MetadataGenerationFailed(package_details=details) from error
|
|
39
|
+
|
|
40
|
+
assert distinfo_dir is not None
|
|
41
|
+
return os.path.join(metadata_dir, distinfo_dir)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"""Metadata generation logic for legacy source distributions."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
from pip._internal.build_env import BuildEnvironment
|
|
7
|
+
from pip._internal.cli.spinners import open_spinner
|
|
8
|
+
from pip._internal.exceptions import (
|
|
9
|
+
InstallationError,
|
|
10
|
+
InstallationSubprocessError,
|
|
11
|
+
MetadataGenerationFailed,
|
|
12
|
+
)
|
|
13
|
+
from pip._internal.utils.setuptools_build import make_setuptools_egg_info_args
|
|
14
|
+
from pip._internal.utils.subprocess import call_subprocess
|
|
15
|
+
from pip._internal.utils.temp_dir import TempDirectory
|
|
16
|
+
|
|
17
|
+
logger = logging.getLogger(__name__)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _find_egg_info(directory: str) -> str:
|
|
21
|
+
"""Find an .egg-info subdirectory in `directory`."""
|
|
22
|
+
filenames = [f for f in os.listdir(directory) if f.endswith(".egg-info")]
|
|
23
|
+
|
|
24
|
+
if not filenames:
|
|
25
|
+
raise InstallationError(f"No .egg-info directory found in {directory}")
|
|
26
|
+
|
|
27
|
+
if len(filenames) > 1:
|
|
28
|
+
raise InstallationError(
|
|
29
|
+
f"More than one .egg-info directory found in {directory}"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return os.path.join(directory, filenames[0])
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def generate_metadata(
|
|
36
|
+
build_env: BuildEnvironment,
|
|
37
|
+
setup_py_path: str,
|
|
38
|
+
source_dir: str,
|
|
39
|
+
isolated: bool,
|
|
40
|
+
details: str,
|
|
41
|
+
) -> str:
|
|
42
|
+
"""Generate metadata using setup.py-based defacto mechanisms.
|
|
43
|
+
|
|
44
|
+
Returns the generated metadata directory.
|
|
45
|
+
"""
|
|
46
|
+
logger.debug(
|
|
47
|
+
"Running setup.py (path:%s) egg_info for package %s",
|
|
48
|
+
setup_py_path,
|
|
49
|
+
details,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
egg_info_dir = TempDirectory(kind="pip-egg-info", globally_managed=True).path
|
|
53
|
+
|
|
54
|
+
args = make_setuptools_egg_info_args(
|
|
55
|
+
setup_py_path,
|
|
56
|
+
egg_info_dir=egg_info_dir,
|
|
57
|
+
no_user_config=isolated,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
with build_env:
|
|
61
|
+
with open_spinner("Preparing metadata (setup.py)") as spinner:
|
|
62
|
+
try:
|
|
63
|
+
call_subprocess(
|
|
64
|
+
args,
|
|
65
|
+
cwd=source_dir,
|
|
66
|
+
command_desc="python setup.py egg_info",
|
|
67
|
+
spinner=spinner,
|
|
68
|
+
)
|
|
69
|
+
except InstallationSubprocessError as error:
|
|
70
|
+
raise MetadataGenerationFailed(package_details=details) from error
|
|
71
|
+
|
|
72
|
+
# Return the .egg-info directory.
|
|
73
|
+
return _find_egg_info(egg_info_dir)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
from pip._vendor.pyproject_hooks import BuildBackendHookCaller
|
|
7
|
+
|
|
8
|
+
from pip._internal.utils.subprocess import runner_with_spinner_message
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def build_wheel_pep517(
|
|
14
|
+
name: str,
|
|
15
|
+
backend: BuildBackendHookCaller,
|
|
16
|
+
metadata_directory: str,
|
|
17
|
+
tempd: str,
|
|
18
|
+
) -> str | None:
|
|
19
|
+
"""Build one InstallRequirement using the PEP 517 build process.
|
|
20
|
+
|
|
21
|
+
Returns path to wheel if successfully built. Otherwise, returns None.
|
|
22
|
+
"""
|
|
23
|
+
assert metadata_directory is not None
|
|
24
|
+
try:
|
|
25
|
+
logger.debug("Destination directory: %s", tempd)
|
|
26
|
+
|
|
27
|
+
runner = runner_with_spinner_message(
|
|
28
|
+
f"Building wheel for {name} (pyproject.toml)"
|
|
29
|
+
)
|
|
30
|
+
with backend.subprocess_runner(runner):
|
|
31
|
+
wheel_name = backend.build_wheel(
|
|
32
|
+
tempd,
|
|
33
|
+
metadata_directory=metadata_directory,
|
|
34
|
+
)
|
|
35
|
+
except Exception:
|
|
36
|
+
logger.error("Failed building wheel for %s", name)
|
|
37
|
+
return None
|
|
38
|
+
return os.path.join(tempd, wheel_name)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
from pip._vendor.pyproject_hooks import BuildBackendHookCaller, HookMissing
|
|
7
|
+
|
|
8
|
+
from pip._internal.utils.subprocess import runner_with_spinner_message
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def build_wheel_editable(
|
|
14
|
+
name: str,
|
|
15
|
+
backend: BuildBackendHookCaller,
|
|
16
|
+
metadata_directory: str,
|
|
17
|
+
tempd: str,
|
|
18
|
+
) -> str | None:
|
|
19
|
+
"""Build one InstallRequirement using the PEP 660 build process.
|
|
20
|
+
|
|
21
|
+
Returns path to wheel if successfully built. Otherwise, returns None.
|
|
22
|
+
"""
|
|
23
|
+
assert metadata_directory is not None
|
|
24
|
+
try:
|
|
25
|
+
logger.debug("Destination directory: %s", tempd)
|
|
26
|
+
|
|
27
|
+
runner = runner_with_spinner_message(
|
|
28
|
+
f"Building editable for {name} (pyproject.toml)"
|
|
29
|
+
)
|
|
30
|
+
with backend.subprocess_runner(runner):
|
|
31
|
+
try:
|
|
32
|
+
wheel_name = backend.build_editable(
|
|
33
|
+
tempd,
|
|
34
|
+
metadata_directory=metadata_directory,
|
|
35
|
+
)
|
|
36
|
+
except HookMissing as e:
|
|
37
|
+
logger.error(
|
|
38
|
+
"Cannot build editable %s because the build "
|
|
39
|
+
"backend does not have the %s hook",
|
|
40
|
+
name,
|
|
41
|
+
e,
|
|
42
|
+
)
|
|
43
|
+
return None
|
|
44
|
+
except Exception:
|
|
45
|
+
logger.error("Failed building editable for %s", name)
|
|
46
|
+
return None
|
|
47
|
+
return os.path.join(tempd, wheel_name)
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os.path
|
|
5
|
+
|
|
6
|
+
from pip._internal.cli.spinners import open_spinner
|
|
7
|
+
from pip._internal.utils.deprecation import deprecated
|
|
8
|
+
from pip._internal.utils.setuptools_build import make_setuptools_bdist_wheel_args
|
|
9
|
+
from pip._internal.utils.subprocess import call_subprocess, format_command_args
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger(__name__)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def format_command_result(
|
|
15
|
+
command_args: list[str],
|
|
16
|
+
command_output: str,
|
|
17
|
+
) -> str:
|
|
18
|
+
"""Format command information for logging."""
|
|
19
|
+
command_desc = format_command_args(command_args)
|
|
20
|
+
text = f"Command arguments: {command_desc}\n"
|
|
21
|
+
|
|
22
|
+
if not command_output:
|
|
23
|
+
text += "Command output: None"
|
|
24
|
+
elif logger.getEffectiveLevel() > logging.DEBUG:
|
|
25
|
+
text += "Command output: [use --verbose to show]"
|
|
26
|
+
else:
|
|
27
|
+
if not command_output.endswith("\n"):
|
|
28
|
+
command_output += "\n"
|
|
29
|
+
text += f"Command output:\n{command_output}"
|
|
30
|
+
|
|
31
|
+
return text
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def get_legacy_build_wheel_path(
|
|
35
|
+
names: list[str],
|
|
36
|
+
temp_dir: str,
|
|
37
|
+
name: str,
|
|
38
|
+
command_args: list[str],
|
|
39
|
+
command_output: str,
|
|
40
|
+
) -> str | None:
|
|
41
|
+
"""Return the path to the wheel in the temporary build directory."""
|
|
42
|
+
# Sort for determinism.
|
|
43
|
+
names = sorted(names)
|
|
44
|
+
if not names:
|
|
45
|
+
msg = f"Legacy build of wheel for {name!r} created no files.\n"
|
|
46
|
+
msg += format_command_result(command_args, command_output)
|
|
47
|
+
logger.warning(msg)
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
if len(names) > 1:
|
|
51
|
+
msg = (
|
|
52
|
+
f"Legacy build of wheel for {name!r} created more than one file.\n"
|
|
53
|
+
f"Filenames (choosing first): {names}\n"
|
|
54
|
+
)
|
|
55
|
+
msg += format_command_result(command_args, command_output)
|
|
56
|
+
logger.warning(msg)
|
|
57
|
+
|
|
58
|
+
return os.path.join(temp_dir, names[0])
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def build_wheel_legacy(
|
|
62
|
+
name: str,
|
|
63
|
+
setup_py_path: str,
|
|
64
|
+
source_dir: str,
|
|
65
|
+
global_options: list[str],
|
|
66
|
+
build_options: list[str],
|
|
67
|
+
tempd: str,
|
|
68
|
+
) -> str | None:
|
|
69
|
+
"""Build one unpacked package using the "legacy" build process.
|
|
70
|
+
|
|
71
|
+
Returns path to wheel if successfully built. Otherwise, returns None.
|
|
72
|
+
"""
|
|
73
|
+
deprecated(
|
|
74
|
+
reason=(
|
|
75
|
+
f"Building {name!r} using the legacy setup.py bdist_wheel mechanism, "
|
|
76
|
+
"which will be removed in a future version."
|
|
77
|
+
),
|
|
78
|
+
replacement=(
|
|
79
|
+
"to use the standardized build interface by "
|
|
80
|
+
"setting the `--use-pep517` option, "
|
|
81
|
+
"(possibly combined with `--no-build-isolation`), "
|
|
82
|
+
f"or adding a `pyproject.toml` file to the source tree of {name!r}"
|
|
83
|
+
),
|
|
84
|
+
gone_in="25.3",
|
|
85
|
+
issue=6334,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
wheel_args = make_setuptools_bdist_wheel_args(
|
|
89
|
+
setup_py_path,
|
|
90
|
+
global_options=global_options,
|
|
91
|
+
build_options=build_options,
|
|
92
|
+
destination_dir=tempd,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
spin_message = f"Building wheel for {name} (setup.py)"
|
|
96
|
+
with open_spinner(spin_message) as spinner:
|
|
97
|
+
logger.debug("Destination directory: %s", tempd)
|
|
98
|
+
|
|
99
|
+
try:
|
|
100
|
+
output = call_subprocess(
|
|
101
|
+
wheel_args,
|
|
102
|
+
command_desc="python setup.py bdist_wheel",
|
|
103
|
+
cwd=source_dir,
|
|
104
|
+
spinner=spinner,
|
|
105
|
+
)
|
|
106
|
+
except Exception:
|
|
107
|
+
spinner.finish("error")
|
|
108
|
+
logger.error("Failed building wheel for %s", name)
|
|
109
|
+
return None
|
|
110
|
+
|
|
111
|
+
names = os.listdir(tempd)
|
|
112
|
+
wheel_path = get_legacy_build_wheel_path(
|
|
113
|
+
names=names,
|
|
114
|
+
temp_dir=tempd,
|
|
115
|
+
name=name,
|
|
116
|
+
command_args=wheel_args,
|
|
117
|
+
command_output=output,
|
|
118
|
+
)
|
|
119
|
+
return wheel_path
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"""Validation of dependencies of packages"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from collections.abc import Generator, Iterable
|
|
7
|
+
from contextlib import suppress
|
|
8
|
+
from email.parser import Parser
|
|
9
|
+
from functools import reduce
|
|
10
|
+
from typing import (
|
|
11
|
+
Callable,
|
|
12
|
+
NamedTuple,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
from pip._vendor.packaging.requirements import Requirement
|
|
16
|
+
from pip._vendor.packaging.tags import Tag, parse_tag
|
|
17
|
+
from pip._vendor.packaging.utils import NormalizedName, canonicalize_name
|
|
18
|
+
from pip._vendor.packaging.version import Version
|
|
19
|
+
|
|
20
|
+
from pip._internal.distributions import make_distribution_for_install_requirement
|
|
21
|
+
from pip._internal.metadata import get_default_environment
|
|
22
|
+
from pip._internal.metadata.base import BaseDistribution
|
|
23
|
+
from pip._internal.req.req_install import InstallRequirement
|
|
24
|
+
|
|
25
|
+
logger = logging.getLogger(__name__)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class PackageDetails(NamedTuple):
|
|
29
|
+
version: Version
|
|
30
|
+
dependencies: list[Requirement]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# Shorthands
|
|
34
|
+
PackageSet = dict[NormalizedName, PackageDetails]
|
|
35
|
+
Missing = tuple[NormalizedName, Requirement]
|
|
36
|
+
Conflicting = tuple[NormalizedName, Version, Requirement]
|
|
37
|
+
|
|
38
|
+
MissingDict = dict[NormalizedName, list[Missing]]
|
|
39
|
+
ConflictingDict = dict[NormalizedName, list[Conflicting]]
|
|
40
|
+
CheckResult = tuple[MissingDict, ConflictingDict]
|
|
41
|
+
ConflictDetails = tuple[PackageSet, CheckResult]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def create_package_set_from_installed() -> tuple[PackageSet, bool]:
|
|
45
|
+
"""Converts a list of distributions into a PackageSet."""
|
|
46
|
+
package_set = {}
|
|
47
|
+
problems = False
|
|
48
|
+
env = get_default_environment()
|
|
49
|
+
for dist in env.iter_installed_distributions(local_only=False, skip=()):
|
|
50
|
+
name = dist.canonical_name
|
|
51
|
+
try:
|
|
52
|
+
dependencies = list(dist.iter_dependencies())
|
|
53
|
+
package_set[name] = PackageDetails(dist.version, dependencies)
|
|
54
|
+
except (OSError, ValueError) as e:
|
|
55
|
+
# Don't crash on unreadable or broken metadata.
|
|
56
|
+
logger.warning("Error parsing dependencies of %s: %s", name, e)
|
|
57
|
+
problems = True
|
|
58
|
+
return package_set, problems
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def check_package_set(
|
|
62
|
+
package_set: PackageSet, should_ignore: Callable[[str], bool] | None = None
|
|
63
|
+
) -> CheckResult:
|
|
64
|
+
"""Check if a package set is consistent
|
|
65
|
+
|
|
66
|
+
If should_ignore is passed, it should be a callable that takes a
|
|
67
|
+
package name and returns a boolean.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
missing = {}
|
|
71
|
+
conflicting = {}
|
|
72
|
+
|
|
73
|
+
for package_name, package_detail in package_set.items():
|
|
74
|
+
# Info about dependencies of package_name
|
|
75
|
+
missing_deps: set[Missing] = set()
|
|
76
|
+
conflicting_deps: set[Conflicting] = set()
|
|
77
|
+
|
|
78
|
+
if should_ignore and should_ignore(package_name):
|
|
79
|
+
continue
|
|
80
|
+
|
|
81
|
+
for req in package_detail.dependencies:
|
|
82
|
+
name = canonicalize_name(req.name)
|
|
83
|
+
|
|
84
|
+
# Check if it's missing
|
|
85
|
+
if name not in package_set:
|
|
86
|
+
missed = True
|
|
87
|
+
if req.marker is not None:
|
|
88
|
+
missed = req.marker.evaluate({"extra": ""})
|
|
89
|
+
if missed:
|
|
90
|
+
missing_deps.add((name, req))
|
|
91
|
+
continue
|
|
92
|
+
|
|
93
|
+
# Check if there's a conflict
|
|
94
|
+
version = package_set[name].version
|
|
95
|
+
if not req.specifier.contains(version, prereleases=True):
|
|
96
|
+
conflicting_deps.add((name, version, req))
|
|
97
|
+
|
|
98
|
+
if missing_deps:
|
|
99
|
+
missing[package_name] = sorted(missing_deps, key=str)
|
|
100
|
+
if conflicting_deps:
|
|
101
|
+
conflicting[package_name] = sorted(conflicting_deps, key=str)
|
|
102
|
+
|
|
103
|
+
return missing, conflicting
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def check_install_conflicts(to_install: list[InstallRequirement]) -> ConflictDetails:
|
|
107
|
+
"""For checking if the dependency graph would be consistent after \
|
|
108
|
+
installing given requirements
|
|
109
|
+
"""
|
|
110
|
+
# Start from the current state
|
|
111
|
+
package_set, _ = create_package_set_from_installed()
|
|
112
|
+
# Install packages
|
|
113
|
+
would_be_installed = _simulate_installation_of(to_install, package_set)
|
|
114
|
+
|
|
115
|
+
# Only warn about directly-dependent packages; create a whitelist of them
|
|
116
|
+
whitelist = _create_whitelist(would_be_installed, package_set)
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
package_set,
|
|
120
|
+
check_package_set(
|
|
121
|
+
package_set, should_ignore=lambda name: name not in whitelist
|
|
122
|
+
),
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def check_unsupported(
|
|
127
|
+
packages: Iterable[BaseDistribution],
|
|
128
|
+
supported_tags: Iterable[Tag],
|
|
129
|
+
) -> Generator[BaseDistribution, None, None]:
|
|
130
|
+
for p in packages:
|
|
131
|
+
with suppress(FileNotFoundError):
|
|
132
|
+
wheel_file = p.read_text("WHEEL")
|
|
133
|
+
wheel_tags: frozenset[Tag] = reduce(
|
|
134
|
+
frozenset.union,
|
|
135
|
+
map(parse_tag, Parser().parsestr(wheel_file).get_all("Tag", [])),
|
|
136
|
+
frozenset(),
|
|
137
|
+
)
|
|
138
|
+
if wheel_tags.isdisjoint(supported_tags):
|
|
139
|
+
yield p
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _simulate_installation_of(
|
|
143
|
+
to_install: list[InstallRequirement], package_set: PackageSet
|
|
144
|
+
) -> set[NormalizedName]:
|
|
145
|
+
"""Computes the version of packages after installing to_install."""
|
|
146
|
+
# Keep track of packages that were installed
|
|
147
|
+
installed = set()
|
|
148
|
+
|
|
149
|
+
# Modify it as installing requirement_set would (assuming no errors)
|
|
150
|
+
for inst_req in to_install:
|
|
151
|
+
abstract_dist = make_distribution_for_install_requirement(inst_req)
|
|
152
|
+
dist = abstract_dist.get_metadata_distribution()
|
|
153
|
+
name = dist.canonical_name
|
|
154
|
+
package_set[name] = PackageDetails(dist.version, list(dist.iter_dependencies()))
|
|
155
|
+
|
|
156
|
+
installed.add(name)
|
|
157
|
+
|
|
158
|
+
return installed
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def _create_whitelist(
|
|
162
|
+
would_be_installed: set[NormalizedName], package_set: PackageSet
|
|
163
|
+
) -> set[NormalizedName]:
|
|
164
|
+
packages_affected = set(would_be_installed)
|
|
165
|
+
|
|
166
|
+
for package_name in package_set:
|
|
167
|
+
if package_name in packages_affected:
|
|
168
|
+
continue
|
|
169
|
+
|
|
170
|
+
for req in package_set[package_name].dependencies:
|
|
171
|
+
if canonicalize_name(req.name) in packages_affected:
|
|
172
|
+
packages_affected.add(package_name)
|
|
173
|
+
break
|
|
174
|
+
|
|
175
|
+
return packages_affected
|