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,178 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import shutil
|
|
5
|
+
import sys
|
|
6
|
+
import textwrap
|
|
7
|
+
import xmlrpc.client
|
|
8
|
+
from collections import OrderedDict
|
|
9
|
+
from optparse import Values
|
|
10
|
+
from typing import TypedDict
|
|
11
|
+
|
|
12
|
+
from pip._vendor.packaging.version import parse as parse_version
|
|
13
|
+
|
|
14
|
+
from pip._internal.cli.base_command import Command
|
|
15
|
+
from pip._internal.cli.req_command import SessionCommandMixin
|
|
16
|
+
from pip._internal.cli.status_codes import NO_MATCHES_FOUND, SUCCESS
|
|
17
|
+
from pip._internal.exceptions import CommandError
|
|
18
|
+
from pip._internal.metadata import get_default_environment
|
|
19
|
+
from pip._internal.metadata.base import BaseDistribution
|
|
20
|
+
from pip._internal.models.index import PyPI
|
|
21
|
+
from pip._internal.network.xmlrpc import PipXmlrpcTransport
|
|
22
|
+
from pip._internal.utils.logging import indent_log
|
|
23
|
+
from pip._internal.utils.misc import write_output
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class TransformedHit(TypedDict):
|
|
27
|
+
name: str
|
|
28
|
+
summary: str
|
|
29
|
+
versions: list[str]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
logger = logging.getLogger(__name__)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class SearchCommand(Command, SessionCommandMixin):
|
|
36
|
+
"""Search for PyPI packages whose name or summary contains <query>."""
|
|
37
|
+
|
|
38
|
+
usage = """
|
|
39
|
+
%prog [options] <query>"""
|
|
40
|
+
ignore_require_venv = True
|
|
41
|
+
|
|
42
|
+
def add_options(self) -> None:
|
|
43
|
+
self.cmd_opts.add_option(
|
|
44
|
+
"-i",
|
|
45
|
+
"--index",
|
|
46
|
+
dest="index",
|
|
47
|
+
metavar="URL",
|
|
48
|
+
default=PyPI.pypi_url,
|
|
49
|
+
help="Base URL of Python Package Index (default %default)",
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
self.parser.insert_option_group(0, self.cmd_opts)
|
|
53
|
+
|
|
54
|
+
def run(self, options: Values, args: list[str]) -> int:
|
|
55
|
+
if not args:
|
|
56
|
+
raise CommandError("Missing required argument (search query).")
|
|
57
|
+
query = args
|
|
58
|
+
pypi_hits = self.search(query, options)
|
|
59
|
+
hits = transform_hits(pypi_hits)
|
|
60
|
+
|
|
61
|
+
terminal_width = None
|
|
62
|
+
if sys.stdout.isatty():
|
|
63
|
+
terminal_width = shutil.get_terminal_size()[0]
|
|
64
|
+
|
|
65
|
+
print_results(hits, terminal_width=terminal_width)
|
|
66
|
+
if pypi_hits:
|
|
67
|
+
return SUCCESS
|
|
68
|
+
return NO_MATCHES_FOUND
|
|
69
|
+
|
|
70
|
+
def search(self, query: list[str], options: Values) -> list[dict[str, str]]:
|
|
71
|
+
index_url = options.index
|
|
72
|
+
|
|
73
|
+
session = self.get_default_session(options)
|
|
74
|
+
|
|
75
|
+
transport = PipXmlrpcTransport(index_url, session)
|
|
76
|
+
pypi = xmlrpc.client.ServerProxy(index_url, transport)
|
|
77
|
+
try:
|
|
78
|
+
hits = pypi.search({"name": query, "summary": query}, "or")
|
|
79
|
+
except xmlrpc.client.Fault as fault:
|
|
80
|
+
message = (
|
|
81
|
+
f"XMLRPC request failed [code: {fault.faultCode}]\n{fault.faultString}"
|
|
82
|
+
)
|
|
83
|
+
raise CommandError(message)
|
|
84
|
+
assert isinstance(hits, list)
|
|
85
|
+
return hits
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def transform_hits(hits: list[dict[str, str]]) -> list[TransformedHit]:
|
|
89
|
+
"""
|
|
90
|
+
The list from pypi is really a list of versions. We want a list of
|
|
91
|
+
packages with the list of versions stored inline. This converts the
|
|
92
|
+
list from pypi into one we can use.
|
|
93
|
+
"""
|
|
94
|
+
packages: dict[str, TransformedHit] = OrderedDict()
|
|
95
|
+
for hit in hits:
|
|
96
|
+
name = hit["name"]
|
|
97
|
+
summary = hit["summary"]
|
|
98
|
+
version = hit["version"]
|
|
99
|
+
|
|
100
|
+
if name not in packages.keys():
|
|
101
|
+
packages[name] = {
|
|
102
|
+
"name": name,
|
|
103
|
+
"summary": summary,
|
|
104
|
+
"versions": [version],
|
|
105
|
+
}
|
|
106
|
+
else:
|
|
107
|
+
packages[name]["versions"].append(version)
|
|
108
|
+
|
|
109
|
+
# if this is the highest version, replace summary and score
|
|
110
|
+
if version == highest_version(packages[name]["versions"]):
|
|
111
|
+
packages[name]["summary"] = summary
|
|
112
|
+
|
|
113
|
+
return list(packages.values())
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def print_dist_installation_info(latest: str, dist: BaseDistribution | None) -> None:
|
|
117
|
+
if dist is not None:
|
|
118
|
+
with indent_log():
|
|
119
|
+
if dist.version == latest:
|
|
120
|
+
write_output("INSTALLED: %s (latest)", dist.version)
|
|
121
|
+
else:
|
|
122
|
+
write_output("INSTALLED: %s", dist.version)
|
|
123
|
+
if parse_version(latest).pre:
|
|
124
|
+
write_output(
|
|
125
|
+
"LATEST: %s (pre-release; install"
|
|
126
|
+
" with `pip install --pre`)",
|
|
127
|
+
latest,
|
|
128
|
+
)
|
|
129
|
+
else:
|
|
130
|
+
write_output("LATEST: %s", latest)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def get_installed_distribution(name: str) -> BaseDistribution | None:
|
|
134
|
+
env = get_default_environment()
|
|
135
|
+
return env.get_distribution(name)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def print_results(
|
|
139
|
+
hits: list[TransformedHit],
|
|
140
|
+
name_column_width: int | None = None,
|
|
141
|
+
terminal_width: int | None = None,
|
|
142
|
+
) -> None:
|
|
143
|
+
if not hits:
|
|
144
|
+
return
|
|
145
|
+
if name_column_width is None:
|
|
146
|
+
name_column_width = (
|
|
147
|
+
max(
|
|
148
|
+
[
|
|
149
|
+
len(hit["name"]) + len(highest_version(hit.get("versions", ["-"])))
|
|
150
|
+
for hit in hits
|
|
151
|
+
]
|
|
152
|
+
)
|
|
153
|
+
+ 4
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
for hit in hits:
|
|
157
|
+
name = hit["name"]
|
|
158
|
+
summary = hit["summary"] or ""
|
|
159
|
+
latest = highest_version(hit.get("versions", ["-"]))
|
|
160
|
+
if terminal_width is not None:
|
|
161
|
+
target_width = terminal_width - name_column_width - 5
|
|
162
|
+
if target_width > 10:
|
|
163
|
+
# wrap and indent summary to fit terminal
|
|
164
|
+
summary_lines = textwrap.wrap(summary, target_width)
|
|
165
|
+
summary = ("\n" + " " * (name_column_width + 3)).join(summary_lines)
|
|
166
|
+
|
|
167
|
+
name_latest = f"{name} ({latest})"
|
|
168
|
+
line = f"{name_latest:{name_column_width}} - {summary}"
|
|
169
|
+
try:
|
|
170
|
+
write_output(line)
|
|
171
|
+
dist = get_installed_distribution(name)
|
|
172
|
+
print_dist_installation_info(latest, dist)
|
|
173
|
+
except UnicodeEncodeError:
|
|
174
|
+
pass
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def highest_version(versions: list[str]) -> str:
|
|
178
|
+
return max(versions, key=parse_version)
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import string
|
|
5
|
+
from collections.abc import Generator, Iterable, Iterator
|
|
6
|
+
from optparse import Values
|
|
7
|
+
from typing import NamedTuple
|
|
8
|
+
|
|
9
|
+
from pip._vendor.packaging.requirements import InvalidRequirement
|
|
10
|
+
from pip._vendor.packaging.utils import canonicalize_name
|
|
11
|
+
|
|
12
|
+
from pip._internal.cli.base_command import Command
|
|
13
|
+
from pip._internal.cli.status_codes import ERROR, SUCCESS
|
|
14
|
+
from pip._internal.metadata import BaseDistribution, get_default_environment
|
|
15
|
+
from pip._internal.utils.misc import write_output
|
|
16
|
+
|
|
17
|
+
logger = logging.getLogger(__name__)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def normalize_project_url_label(label: str) -> str:
|
|
21
|
+
# This logic is from PEP 753 (Well-known Project URLs in Metadata).
|
|
22
|
+
chars_to_remove = string.punctuation + string.whitespace
|
|
23
|
+
removal_map = str.maketrans("", "", chars_to_remove)
|
|
24
|
+
return label.translate(removal_map).lower()
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ShowCommand(Command):
|
|
28
|
+
"""
|
|
29
|
+
Show information about one or more installed packages.
|
|
30
|
+
|
|
31
|
+
The output is in RFC-compliant mail header format.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
usage = """
|
|
35
|
+
%prog [options] <package> ..."""
|
|
36
|
+
ignore_require_venv = True
|
|
37
|
+
|
|
38
|
+
def add_options(self) -> None:
|
|
39
|
+
self.cmd_opts.add_option(
|
|
40
|
+
"-f",
|
|
41
|
+
"--files",
|
|
42
|
+
dest="files",
|
|
43
|
+
action="store_true",
|
|
44
|
+
default=False,
|
|
45
|
+
help="Show the full list of installed files for each package.",
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
self.parser.insert_option_group(0, self.cmd_opts)
|
|
49
|
+
|
|
50
|
+
def run(self, options: Values, args: list[str]) -> int:
|
|
51
|
+
if not args:
|
|
52
|
+
logger.warning("ERROR: Please provide a package name or names.")
|
|
53
|
+
return ERROR
|
|
54
|
+
query = args
|
|
55
|
+
|
|
56
|
+
results = search_packages_info(query)
|
|
57
|
+
if not print_results(
|
|
58
|
+
results, list_files=options.files, verbose=options.verbose
|
|
59
|
+
):
|
|
60
|
+
return ERROR
|
|
61
|
+
return SUCCESS
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class _PackageInfo(NamedTuple):
|
|
65
|
+
name: str
|
|
66
|
+
version: str
|
|
67
|
+
location: str
|
|
68
|
+
editable_project_location: str | None
|
|
69
|
+
requires: list[str]
|
|
70
|
+
required_by: list[str]
|
|
71
|
+
installer: str
|
|
72
|
+
metadata_version: str
|
|
73
|
+
classifiers: list[str]
|
|
74
|
+
summary: str
|
|
75
|
+
homepage: str
|
|
76
|
+
project_urls: list[str]
|
|
77
|
+
author: str
|
|
78
|
+
author_email: str
|
|
79
|
+
license: str
|
|
80
|
+
license_expression: str
|
|
81
|
+
entry_points: list[str]
|
|
82
|
+
files: list[str] | None
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def search_packages_info(query: list[str]) -> Generator[_PackageInfo, None, None]:
|
|
86
|
+
"""
|
|
87
|
+
Gather details from installed distributions. Print distribution name,
|
|
88
|
+
version, location, and installed files. Installed files requires a
|
|
89
|
+
pip generated 'installed-files.txt' in the distributions '.egg-info'
|
|
90
|
+
directory.
|
|
91
|
+
"""
|
|
92
|
+
env = get_default_environment()
|
|
93
|
+
|
|
94
|
+
installed = {dist.canonical_name: dist for dist in env.iter_all_distributions()}
|
|
95
|
+
query_names = [canonicalize_name(name) for name in query]
|
|
96
|
+
missing = sorted(
|
|
97
|
+
[name for name, pkg in zip(query, query_names) if pkg not in installed]
|
|
98
|
+
)
|
|
99
|
+
if missing:
|
|
100
|
+
logger.warning("Package(s) not found: %s", ", ".join(missing))
|
|
101
|
+
|
|
102
|
+
def _get_requiring_packages(current_dist: BaseDistribution) -> Iterator[str]:
|
|
103
|
+
return (
|
|
104
|
+
dist.metadata["Name"] or "UNKNOWN"
|
|
105
|
+
for dist in installed.values()
|
|
106
|
+
if current_dist.canonical_name
|
|
107
|
+
in {canonicalize_name(d.name) for d in dist.iter_dependencies()}
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
for query_name in query_names:
|
|
111
|
+
try:
|
|
112
|
+
dist = installed[query_name]
|
|
113
|
+
except KeyError:
|
|
114
|
+
continue
|
|
115
|
+
|
|
116
|
+
try:
|
|
117
|
+
requires = sorted(
|
|
118
|
+
# Avoid duplicates in requirements (e.g. due to environment markers).
|
|
119
|
+
{req.name for req in dist.iter_dependencies()},
|
|
120
|
+
key=str.lower,
|
|
121
|
+
)
|
|
122
|
+
except InvalidRequirement:
|
|
123
|
+
requires = sorted(dist.iter_raw_dependencies(), key=str.lower)
|
|
124
|
+
|
|
125
|
+
try:
|
|
126
|
+
required_by = sorted(_get_requiring_packages(dist), key=str.lower)
|
|
127
|
+
except InvalidRequirement:
|
|
128
|
+
required_by = ["#N/A"]
|
|
129
|
+
|
|
130
|
+
try:
|
|
131
|
+
entry_points_text = dist.read_text("entry_points.txt")
|
|
132
|
+
entry_points = entry_points_text.splitlines(keepends=False)
|
|
133
|
+
except FileNotFoundError:
|
|
134
|
+
entry_points = []
|
|
135
|
+
|
|
136
|
+
files_iter = dist.iter_declared_entries()
|
|
137
|
+
if files_iter is None:
|
|
138
|
+
files: list[str] | None = None
|
|
139
|
+
else:
|
|
140
|
+
files = sorted(files_iter)
|
|
141
|
+
|
|
142
|
+
metadata = dist.metadata
|
|
143
|
+
|
|
144
|
+
project_urls = metadata.get_all("Project-URL", [])
|
|
145
|
+
homepage = metadata.get("Home-page", "")
|
|
146
|
+
if not homepage:
|
|
147
|
+
# It's common that there is a "homepage" Project-URL, but Home-page
|
|
148
|
+
# remains unset (especially as PEP 621 doesn't surface the field).
|
|
149
|
+
for url in project_urls:
|
|
150
|
+
url_label, url = url.split(",", maxsplit=1)
|
|
151
|
+
normalized_label = normalize_project_url_label(url_label)
|
|
152
|
+
if normalized_label == "homepage":
|
|
153
|
+
homepage = url.strip()
|
|
154
|
+
break
|
|
155
|
+
|
|
156
|
+
yield _PackageInfo(
|
|
157
|
+
name=dist.raw_name,
|
|
158
|
+
version=dist.raw_version,
|
|
159
|
+
location=dist.location or "",
|
|
160
|
+
editable_project_location=dist.editable_project_location,
|
|
161
|
+
requires=requires,
|
|
162
|
+
required_by=required_by,
|
|
163
|
+
installer=dist.installer,
|
|
164
|
+
metadata_version=dist.metadata_version or "",
|
|
165
|
+
classifiers=metadata.get_all("Classifier", []),
|
|
166
|
+
summary=metadata.get("Summary", ""),
|
|
167
|
+
homepage=homepage,
|
|
168
|
+
project_urls=project_urls,
|
|
169
|
+
author=metadata.get("Author", ""),
|
|
170
|
+
author_email=metadata.get("Author-email", ""),
|
|
171
|
+
license=metadata.get("License", ""),
|
|
172
|
+
license_expression=metadata.get("License-Expression", ""),
|
|
173
|
+
entry_points=entry_points,
|
|
174
|
+
files=files,
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def print_results(
|
|
179
|
+
distributions: Iterable[_PackageInfo],
|
|
180
|
+
list_files: bool,
|
|
181
|
+
verbose: bool,
|
|
182
|
+
) -> bool:
|
|
183
|
+
"""
|
|
184
|
+
Print the information from installed distributions found.
|
|
185
|
+
"""
|
|
186
|
+
results_printed = False
|
|
187
|
+
for i, dist in enumerate(distributions):
|
|
188
|
+
results_printed = True
|
|
189
|
+
if i > 0:
|
|
190
|
+
write_output("---")
|
|
191
|
+
|
|
192
|
+
metadata_version_tuple = tuple(map(int, dist.metadata_version.split(".")))
|
|
193
|
+
|
|
194
|
+
write_output("Name: %s", dist.name)
|
|
195
|
+
write_output("Version: %s", dist.version)
|
|
196
|
+
write_output("Summary: %s", dist.summary)
|
|
197
|
+
write_output("Home-page: %s", dist.homepage)
|
|
198
|
+
write_output("Author: %s", dist.author)
|
|
199
|
+
write_output("Author-email: %s", dist.author_email)
|
|
200
|
+
if metadata_version_tuple >= (2, 4) and dist.license_expression:
|
|
201
|
+
write_output("License-Expression: %s", dist.license_expression)
|
|
202
|
+
else:
|
|
203
|
+
write_output("License: %s", dist.license)
|
|
204
|
+
write_output("Location: %s", dist.location)
|
|
205
|
+
if dist.editable_project_location is not None:
|
|
206
|
+
write_output(
|
|
207
|
+
"Editable project location: %s", dist.editable_project_location
|
|
208
|
+
)
|
|
209
|
+
write_output("Requires: %s", ", ".join(dist.requires))
|
|
210
|
+
write_output("Required-by: %s", ", ".join(dist.required_by))
|
|
211
|
+
|
|
212
|
+
if verbose:
|
|
213
|
+
write_output("Metadata-Version: %s", dist.metadata_version)
|
|
214
|
+
write_output("Installer: %s", dist.installer)
|
|
215
|
+
write_output("Classifiers:")
|
|
216
|
+
for classifier in dist.classifiers:
|
|
217
|
+
write_output(" %s", classifier)
|
|
218
|
+
write_output("Entry-points:")
|
|
219
|
+
for entry in dist.entry_points:
|
|
220
|
+
write_output(" %s", entry.strip())
|
|
221
|
+
write_output("Project-URLs:")
|
|
222
|
+
for project_url in dist.project_urls:
|
|
223
|
+
write_output(" %s", project_url)
|
|
224
|
+
if list_files:
|
|
225
|
+
write_output("Files:")
|
|
226
|
+
if dist.files is None:
|
|
227
|
+
write_output("Cannot locate RECORD or installed-files.txt")
|
|
228
|
+
else:
|
|
229
|
+
for line in dist.files:
|
|
230
|
+
write_output(" %s", line.strip())
|
|
231
|
+
return results_printed
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from optparse import Values
|
|
3
|
+
|
|
4
|
+
from pip._vendor.packaging.utils import canonicalize_name
|
|
5
|
+
|
|
6
|
+
from pip._internal.cli import cmdoptions
|
|
7
|
+
from pip._internal.cli.base_command import Command
|
|
8
|
+
from pip._internal.cli.index_command import SessionCommandMixin
|
|
9
|
+
from pip._internal.cli.status_codes import SUCCESS
|
|
10
|
+
from pip._internal.exceptions import InstallationError
|
|
11
|
+
from pip._internal.req import parse_requirements
|
|
12
|
+
from pip._internal.req.constructors import (
|
|
13
|
+
install_req_from_line,
|
|
14
|
+
install_req_from_parsed_requirement,
|
|
15
|
+
)
|
|
16
|
+
from pip._internal.utils.misc import (
|
|
17
|
+
check_externally_managed,
|
|
18
|
+
protect_pip_from_modification_on_windows,
|
|
19
|
+
warn_if_run_as_root,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
logger = logging.getLogger(__name__)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class UninstallCommand(Command, SessionCommandMixin):
|
|
26
|
+
"""
|
|
27
|
+
Uninstall packages.
|
|
28
|
+
|
|
29
|
+
pip is able to uninstall most installed packages. Known exceptions are:
|
|
30
|
+
|
|
31
|
+
- Pure distutils packages installed with ``python setup.py install``, which
|
|
32
|
+
leave behind no metadata to determine what files were installed.
|
|
33
|
+
- Script wrappers installed by ``python setup.py develop``.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
usage = """
|
|
37
|
+
%prog [options] <package> ...
|
|
38
|
+
%prog [options] -r <requirements file> ..."""
|
|
39
|
+
|
|
40
|
+
def add_options(self) -> None:
|
|
41
|
+
self.cmd_opts.add_option(
|
|
42
|
+
"-r",
|
|
43
|
+
"--requirement",
|
|
44
|
+
dest="requirements",
|
|
45
|
+
action="append",
|
|
46
|
+
default=[],
|
|
47
|
+
metavar="file",
|
|
48
|
+
help=(
|
|
49
|
+
"Uninstall all the packages listed in the given requirements "
|
|
50
|
+
"file. This option can be used multiple times."
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
self.cmd_opts.add_option(
|
|
54
|
+
"-y",
|
|
55
|
+
"--yes",
|
|
56
|
+
dest="yes",
|
|
57
|
+
action="store_true",
|
|
58
|
+
help="Don't ask for confirmation of uninstall deletions.",
|
|
59
|
+
)
|
|
60
|
+
self.cmd_opts.add_option(cmdoptions.root_user_action())
|
|
61
|
+
self.cmd_opts.add_option(cmdoptions.override_externally_managed())
|
|
62
|
+
self.parser.insert_option_group(0, self.cmd_opts)
|
|
63
|
+
|
|
64
|
+
def run(self, options: Values, args: list[str]) -> int:
|
|
65
|
+
session = self.get_default_session(options)
|
|
66
|
+
|
|
67
|
+
reqs_to_uninstall = {}
|
|
68
|
+
for name in args:
|
|
69
|
+
req = install_req_from_line(
|
|
70
|
+
name,
|
|
71
|
+
isolated=options.isolated_mode,
|
|
72
|
+
)
|
|
73
|
+
if req.name:
|
|
74
|
+
reqs_to_uninstall[canonicalize_name(req.name)] = req
|
|
75
|
+
else:
|
|
76
|
+
logger.warning(
|
|
77
|
+
"Invalid requirement: %r ignored -"
|
|
78
|
+
" the uninstall command expects named"
|
|
79
|
+
" requirements.",
|
|
80
|
+
name,
|
|
81
|
+
)
|
|
82
|
+
for filename in options.requirements:
|
|
83
|
+
for parsed_req in parse_requirements(
|
|
84
|
+
filename, options=options, session=session
|
|
85
|
+
):
|
|
86
|
+
req = install_req_from_parsed_requirement(
|
|
87
|
+
parsed_req, isolated=options.isolated_mode
|
|
88
|
+
)
|
|
89
|
+
if req.name:
|
|
90
|
+
reqs_to_uninstall[canonicalize_name(req.name)] = req
|
|
91
|
+
if not reqs_to_uninstall:
|
|
92
|
+
raise InstallationError(
|
|
93
|
+
f"You must give at least one requirement to {self.name} (see "
|
|
94
|
+
f'"pip help {self.name}")'
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
if not options.override_externally_managed:
|
|
98
|
+
check_externally_managed()
|
|
99
|
+
|
|
100
|
+
protect_pip_from_modification_on_windows(
|
|
101
|
+
modifying_pip="pip" in reqs_to_uninstall
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
for req in reqs_to_uninstall.values():
|
|
105
|
+
uninstall_pathset = req.uninstall(
|
|
106
|
+
auto_confirm=options.yes,
|
|
107
|
+
verbose=self.verbosity > 0,
|
|
108
|
+
)
|
|
109
|
+
if uninstall_pathset:
|
|
110
|
+
uninstall_pathset.commit()
|
|
111
|
+
if options.root_user_action == "warn":
|
|
112
|
+
warn_if_run_as_root()
|
|
113
|
+
return SUCCESS
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
4
|
+
from optparse import Values
|
|
5
|
+
|
|
6
|
+
from pip._internal.cache import WheelCache
|
|
7
|
+
from pip._internal.cli import cmdoptions
|
|
8
|
+
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
|
|
9
|
+
from pip._internal.cli.status_codes import SUCCESS
|
|
10
|
+
from pip._internal.exceptions import CommandError
|
|
11
|
+
from pip._internal.operations.build.build_tracker import get_build_tracker
|
|
12
|
+
from pip._internal.req.req_install import (
|
|
13
|
+
InstallRequirement,
|
|
14
|
+
check_legacy_setup_py_options,
|
|
15
|
+
)
|
|
16
|
+
from pip._internal.utils.misc import ensure_dir, normalize_path
|
|
17
|
+
from pip._internal.utils.temp_dir import TempDirectory
|
|
18
|
+
from pip._internal.wheel_builder import build
|
|
19
|
+
|
|
20
|
+
logger = logging.getLogger(__name__)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class WheelCommand(RequirementCommand):
|
|
24
|
+
"""
|
|
25
|
+
Build Wheel archives for your requirements and dependencies.
|
|
26
|
+
|
|
27
|
+
Wheel is a built-package format, and offers the advantage of not
|
|
28
|
+
recompiling your software during every install. For more details, see the
|
|
29
|
+
wheel docs: https://wheel.readthedocs.io/en/latest/
|
|
30
|
+
|
|
31
|
+
'pip wheel' uses the build system interface as described here:
|
|
32
|
+
https://pip.pypa.io/en/stable/reference/build-system/
|
|
33
|
+
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
usage = """
|
|
37
|
+
%prog [options] <requirement specifier> ...
|
|
38
|
+
%prog [options] -r <requirements file> ...
|
|
39
|
+
%prog [options] [-e] <vcs project url> ...
|
|
40
|
+
%prog [options] [-e] <local project path> ...
|
|
41
|
+
%prog [options] <archive url/path> ..."""
|
|
42
|
+
|
|
43
|
+
def add_options(self) -> None:
|
|
44
|
+
self.cmd_opts.add_option(
|
|
45
|
+
"-w",
|
|
46
|
+
"--wheel-dir",
|
|
47
|
+
dest="wheel_dir",
|
|
48
|
+
metavar="dir",
|
|
49
|
+
default=os.curdir,
|
|
50
|
+
help=(
|
|
51
|
+
"Build wheels into <dir>, where the default is the "
|
|
52
|
+
"current working directory."
|
|
53
|
+
),
|
|
54
|
+
)
|
|
55
|
+
self.cmd_opts.add_option(cmdoptions.no_binary())
|
|
56
|
+
self.cmd_opts.add_option(cmdoptions.only_binary())
|
|
57
|
+
self.cmd_opts.add_option(cmdoptions.prefer_binary())
|
|
58
|
+
self.cmd_opts.add_option(cmdoptions.no_build_isolation())
|
|
59
|
+
self.cmd_opts.add_option(cmdoptions.use_pep517())
|
|
60
|
+
self.cmd_opts.add_option(cmdoptions.no_use_pep517())
|
|
61
|
+
self.cmd_opts.add_option(cmdoptions.check_build_deps())
|
|
62
|
+
self.cmd_opts.add_option(cmdoptions.constraints())
|
|
63
|
+
self.cmd_opts.add_option(cmdoptions.editable())
|
|
64
|
+
self.cmd_opts.add_option(cmdoptions.requirements())
|
|
65
|
+
self.cmd_opts.add_option(cmdoptions.src())
|
|
66
|
+
self.cmd_opts.add_option(cmdoptions.ignore_requires_python())
|
|
67
|
+
self.cmd_opts.add_option(cmdoptions.no_deps())
|
|
68
|
+
self.cmd_opts.add_option(cmdoptions.progress_bar())
|
|
69
|
+
|
|
70
|
+
self.cmd_opts.add_option(
|
|
71
|
+
"--no-verify",
|
|
72
|
+
dest="no_verify",
|
|
73
|
+
action="store_true",
|
|
74
|
+
default=False,
|
|
75
|
+
help="Don't verify if built wheel is valid.",
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
self.cmd_opts.add_option(cmdoptions.config_settings())
|
|
79
|
+
self.cmd_opts.add_option(cmdoptions.build_options())
|
|
80
|
+
self.cmd_opts.add_option(cmdoptions.global_options())
|
|
81
|
+
|
|
82
|
+
self.cmd_opts.add_option(
|
|
83
|
+
"--pre",
|
|
84
|
+
action="store_true",
|
|
85
|
+
default=False,
|
|
86
|
+
help=(
|
|
87
|
+
"Include pre-release and development versions. By default, "
|
|
88
|
+
"pip only finds stable versions."
|
|
89
|
+
),
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
self.cmd_opts.add_option(cmdoptions.require_hashes())
|
|
93
|
+
|
|
94
|
+
index_opts = cmdoptions.make_option_group(
|
|
95
|
+
cmdoptions.index_group,
|
|
96
|
+
self.parser,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
self.parser.insert_option_group(0, index_opts)
|
|
100
|
+
self.parser.insert_option_group(0, self.cmd_opts)
|
|
101
|
+
|
|
102
|
+
@with_cleanup
|
|
103
|
+
def run(self, options: Values, args: list[str]) -> int:
|
|
104
|
+
session = self.get_default_session(options)
|
|
105
|
+
|
|
106
|
+
finder = self._build_package_finder(options, session)
|
|
107
|
+
|
|
108
|
+
options.wheel_dir = normalize_path(options.wheel_dir)
|
|
109
|
+
ensure_dir(options.wheel_dir)
|
|
110
|
+
|
|
111
|
+
build_tracker = self.enter_context(get_build_tracker())
|
|
112
|
+
|
|
113
|
+
directory = TempDirectory(
|
|
114
|
+
delete=not options.no_clean,
|
|
115
|
+
kind="wheel",
|
|
116
|
+
globally_managed=True,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
reqs = self.get_requirements(args, options, finder, session)
|
|
120
|
+
check_legacy_setup_py_options(options, reqs)
|
|
121
|
+
|
|
122
|
+
wheel_cache = WheelCache(options.cache_dir)
|
|
123
|
+
|
|
124
|
+
preparer = self.make_requirement_preparer(
|
|
125
|
+
temp_build_dir=directory,
|
|
126
|
+
options=options,
|
|
127
|
+
build_tracker=build_tracker,
|
|
128
|
+
session=session,
|
|
129
|
+
finder=finder,
|
|
130
|
+
download_dir=options.wheel_dir,
|
|
131
|
+
use_user_site=False,
|
|
132
|
+
verbosity=self.verbosity,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
resolver = self.make_resolver(
|
|
136
|
+
preparer=preparer,
|
|
137
|
+
finder=finder,
|
|
138
|
+
options=options,
|
|
139
|
+
wheel_cache=wheel_cache,
|
|
140
|
+
ignore_requires_python=options.ignore_requires_python,
|
|
141
|
+
use_pep517=options.use_pep517,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
self.trace_basic_info(finder)
|
|
145
|
+
|
|
146
|
+
requirement_set = resolver.resolve(reqs, check_supported_wheels=True)
|
|
147
|
+
|
|
148
|
+
reqs_to_build: list[InstallRequirement] = []
|
|
149
|
+
for req in requirement_set.requirements.values():
|
|
150
|
+
if req.is_wheel:
|
|
151
|
+
preparer.save_linked_requirement(req)
|
|
152
|
+
else:
|
|
153
|
+
reqs_to_build.append(req)
|
|
154
|
+
|
|
155
|
+
preparer.prepare_linked_requirements_more(requirement_set.requirements.values())
|
|
156
|
+
|
|
157
|
+
# build wheels
|
|
158
|
+
build_successes, build_failures = build(
|
|
159
|
+
reqs_to_build,
|
|
160
|
+
wheel_cache=wheel_cache,
|
|
161
|
+
verify=(not options.no_verify),
|
|
162
|
+
build_options=options.build_options or [],
|
|
163
|
+
global_options=options.global_options or [],
|
|
164
|
+
)
|
|
165
|
+
for req in build_successes:
|
|
166
|
+
assert req.link and req.link.is_wheel
|
|
167
|
+
assert req.local_file_path
|
|
168
|
+
# copy from cache to target directory
|
|
169
|
+
try:
|
|
170
|
+
shutil.copy(req.local_file_path, options.wheel_dir)
|
|
171
|
+
except OSError as e:
|
|
172
|
+
logger.warning(
|
|
173
|
+
"Building wheel for %s failed: %s",
|
|
174
|
+
req.name,
|
|
175
|
+
e,
|
|
176
|
+
)
|
|
177
|
+
build_failures.append(req)
|
|
178
|
+
if len(build_failures) != 0:
|
|
179
|
+
raise CommandError("Failed to build one or more wheels")
|
|
180
|
+
|
|
181
|
+
return SUCCESS
|