cli-ih 0.6.2.1__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 +51 -21
- cli_ih/client.py +14 -7
- {cli_ih-0.6.2.1.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.2.1.dist-info → cli_ih-0.6.3.1.dist-info}/WHEEL +1 -1
- {cli_ih-0.6.2.1.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.2.1.dist-info/RECORD +0 -8
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import itertools
|
|
4
|
+
from collections import namedtuple
|
|
5
|
+
from typing import (
|
|
6
|
+
TYPE_CHECKING,
|
|
7
|
+
Callable,
|
|
8
|
+
Generic,
|
|
9
|
+
Iterable,
|
|
10
|
+
Iterator,
|
|
11
|
+
Mapping,
|
|
12
|
+
NamedTuple,
|
|
13
|
+
Sequence,
|
|
14
|
+
TypeVar,
|
|
15
|
+
Union,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
KT = TypeVar("KT") # Identifier.
|
|
19
|
+
RT = TypeVar("RT") # Requirement.
|
|
20
|
+
CT = TypeVar("CT") # Candidate.
|
|
21
|
+
|
|
22
|
+
Matches = Union[Iterable[CT], Callable[[], Iterable[CT]]]
|
|
23
|
+
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
from .resolvers.criterion import Criterion
|
|
26
|
+
|
|
27
|
+
class RequirementInformation(NamedTuple, Generic[RT, CT]):
|
|
28
|
+
requirement: RT
|
|
29
|
+
parent: CT | None
|
|
30
|
+
|
|
31
|
+
class State(NamedTuple, Generic[RT, CT, KT]):
|
|
32
|
+
"""Resolution state in a round."""
|
|
33
|
+
|
|
34
|
+
mapping: dict[KT, CT]
|
|
35
|
+
criteria: dict[KT, Criterion[RT, CT]]
|
|
36
|
+
backtrack_causes: list[RequirementInformation[RT, CT]]
|
|
37
|
+
|
|
38
|
+
else:
|
|
39
|
+
RequirementInformation = namedtuple(
|
|
40
|
+
"RequirementInformation", ["requirement", "parent"]
|
|
41
|
+
)
|
|
42
|
+
State = namedtuple("State", ["mapping", "criteria", "backtrack_causes"])
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class DirectedGraph(Generic[KT]):
|
|
46
|
+
"""A graph structure with directed edges."""
|
|
47
|
+
|
|
48
|
+
def __init__(self) -> None:
|
|
49
|
+
self._vertices: set[KT] = set()
|
|
50
|
+
self._forwards: dict[KT, set[KT]] = {} # <key> -> Set[<key>]
|
|
51
|
+
self._backwards: dict[KT, set[KT]] = {} # <key> -> Set[<key>]
|
|
52
|
+
|
|
53
|
+
def __iter__(self) -> Iterator[KT]:
|
|
54
|
+
return iter(self._vertices)
|
|
55
|
+
|
|
56
|
+
def __len__(self) -> int:
|
|
57
|
+
return len(self._vertices)
|
|
58
|
+
|
|
59
|
+
def __contains__(self, key: KT) -> bool:
|
|
60
|
+
return key in self._vertices
|
|
61
|
+
|
|
62
|
+
def copy(self) -> DirectedGraph[KT]:
|
|
63
|
+
"""Return a shallow copy of this graph."""
|
|
64
|
+
other = type(self)()
|
|
65
|
+
other._vertices = set(self._vertices)
|
|
66
|
+
other._forwards = {k: set(v) for k, v in self._forwards.items()}
|
|
67
|
+
other._backwards = {k: set(v) for k, v in self._backwards.items()}
|
|
68
|
+
return other
|
|
69
|
+
|
|
70
|
+
def add(self, key: KT) -> None:
|
|
71
|
+
"""Add a new vertex to the graph."""
|
|
72
|
+
if key in self._vertices:
|
|
73
|
+
raise ValueError("vertex exists")
|
|
74
|
+
self._vertices.add(key)
|
|
75
|
+
self._forwards[key] = set()
|
|
76
|
+
self._backwards[key] = set()
|
|
77
|
+
|
|
78
|
+
def remove(self, key: KT) -> None:
|
|
79
|
+
"""Remove a vertex from the graph, disconnecting all edges from/to it."""
|
|
80
|
+
self._vertices.remove(key)
|
|
81
|
+
for f in self._forwards.pop(key):
|
|
82
|
+
self._backwards[f].remove(key)
|
|
83
|
+
for t in self._backwards.pop(key):
|
|
84
|
+
self._forwards[t].remove(key)
|
|
85
|
+
|
|
86
|
+
def connected(self, f: KT, t: KT) -> bool:
|
|
87
|
+
return f in self._backwards[t] and t in self._forwards[f]
|
|
88
|
+
|
|
89
|
+
def connect(self, f: KT, t: KT) -> None:
|
|
90
|
+
"""Connect two existing vertices.
|
|
91
|
+
|
|
92
|
+
Nothing happens if the vertices are already connected.
|
|
93
|
+
"""
|
|
94
|
+
if t not in self._vertices:
|
|
95
|
+
raise KeyError(t)
|
|
96
|
+
self._forwards[f].add(t)
|
|
97
|
+
self._backwards[t].add(f)
|
|
98
|
+
|
|
99
|
+
def iter_edges(self) -> Iterator[tuple[KT, KT]]:
|
|
100
|
+
for f, children in self._forwards.items():
|
|
101
|
+
for t in children:
|
|
102
|
+
yield f, t
|
|
103
|
+
|
|
104
|
+
def iter_children(self, key: KT) -> Iterator[KT]:
|
|
105
|
+
return iter(self._forwards[key])
|
|
106
|
+
|
|
107
|
+
def iter_parents(self, key: KT) -> Iterator[KT]:
|
|
108
|
+
return iter(self._backwards[key])
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class IteratorMapping(Mapping[KT, Iterator[CT]], Generic[RT, CT, KT]):
|
|
112
|
+
def __init__(
|
|
113
|
+
self,
|
|
114
|
+
mapping: Mapping[KT, RT],
|
|
115
|
+
accessor: Callable[[RT], Iterable[CT]],
|
|
116
|
+
appends: Mapping[KT, Iterable[CT]] | None = None,
|
|
117
|
+
) -> None:
|
|
118
|
+
self._mapping = mapping
|
|
119
|
+
self._accessor = accessor
|
|
120
|
+
self._appends: Mapping[KT, Iterable[CT]] = appends or {}
|
|
121
|
+
|
|
122
|
+
def __repr__(self) -> str:
|
|
123
|
+
return "IteratorMapping({!r}, {!r}, {!r})".format(
|
|
124
|
+
self._mapping,
|
|
125
|
+
self._accessor,
|
|
126
|
+
self._appends,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
def __bool__(self) -> bool:
|
|
130
|
+
return bool(self._mapping or self._appends)
|
|
131
|
+
|
|
132
|
+
def __contains__(self, key: object) -> bool:
|
|
133
|
+
return key in self._mapping or key in self._appends
|
|
134
|
+
|
|
135
|
+
def __getitem__(self, k: KT) -> Iterator[CT]:
|
|
136
|
+
try:
|
|
137
|
+
v = self._mapping[k]
|
|
138
|
+
except KeyError:
|
|
139
|
+
return iter(self._appends[k])
|
|
140
|
+
return itertools.chain(self._accessor(v), self._appends.get(k, ()))
|
|
141
|
+
|
|
142
|
+
def __iter__(self) -> Iterator[KT]:
|
|
143
|
+
more = (k for k in self._appends if k not in self._mapping)
|
|
144
|
+
return itertools.chain(self._mapping, more)
|
|
145
|
+
|
|
146
|
+
def __len__(self) -> int:
|
|
147
|
+
more = sum(1 for k in self._appends if k not in self._mapping)
|
|
148
|
+
return len(self._mapping) + more
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class _FactoryIterableView(Iterable[RT]):
|
|
152
|
+
"""Wrap an iterator factory returned by `find_matches()`.
|
|
153
|
+
|
|
154
|
+
Calling `iter()` on this class would invoke the underlying iterator
|
|
155
|
+
factory, making it a "collection with ordering" that can be iterated
|
|
156
|
+
through multiple times, but lacks random access methods presented in
|
|
157
|
+
built-in Python sequence types.
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
def __init__(self, factory: Callable[[], Iterable[RT]]) -> None:
|
|
161
|
+
self._factory = factory
|
|
162
|
+
self._iterable: Iterable[RT] | None = None
|
|
163
|
+
|
|
164
|
+
def __repr__(self) -> str:
|
|
165
|
+
return f"{type(self).__name__}({list(self)})"
|
|
166
|
+
|
|
167
|
+
def __bool__(self) -> bool:
|
|
168
|
+
try:
|
|
169
|
+
next(iter(self))
|
|
170
|
+
except StopIteration:
|
|
171
|
+
return False
|
|
172
|
+
return True
|
|
173
|
+
|
|
174
|
+
def __iter__(self) -> Iterator[RT]:
|
|
175
|
+
iterable = self._factory() if self._iterable is None else self._iterable
|
|
176
|
+
self._iterable, current = itertools.tee(iterable)
|
|
177
|
+
return current
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class _SequenceIterableView(Iterable[RT]):
|
|
181
|
+
"""Wrap an iterable returned by find_matches().
|
|
182
|
+
|
|
183
|
+
This is essentially just a proxy to the underlying sequence that provides
|
|
184
|
+
the same interface as `_FactoryIterableView`.
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
def __init__(self, sequence: Sequence[RT]):
|
|
188
|
+
self._sequence = sequence
|
|
189
|
+
|
|
190
|
+
def __repr__(self) -> str:
|
|
191
|
+
return f"{type(self).__name__}({self._sequence})"
|
|
192
|
+
|
|
193
|
+
def __bool__(self) -> bool:
|
|
194
|
+
return bool(self._sequence)
|
|
195
|
+
|
|
196
|
+
def __iter__(self) -> Iterator[RT]:
|
|
197
|
+
return iter(self._sequence)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def build_iter_view(matches: Matches[CT]) -> Iterable[CT]:
|
|
201
|
+
"""Build an iterable view from the value returned by `find_matches()`."""
|
|
202
|
+
if callable(matches):
|
|
203
|
+
return _FactoryIterableView(matches)
|
|
204
|
+
if not isinstance(matches, Sequence):
|
|
205
|
+
matches = list(matches)
|
|
206
|
+
return _SequenceIterableView(matches)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
IterableView = Iterable
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"""Rich text and beautiful formatting in the terminal."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from typing import IO, TYPE_CHECKING, Any, Callable, Optional, Union
|
|
5
|
+
|
|
6
|
+
from ._extension import load_ipython_extension # noqa: F401
|
|
7
|
+
|
|
8
|
+
__all__ = ["get_console", "reconfigure", "print", "inspect", "print_json"]
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from .console import Console
|
|
12
|
+
|
|
13
|
+
# Global console used by alternative print
|
|
14
|
+
_console: Optional["Console"] = None
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
_IMPORT_CWD = os.path.abspath(os.getcwd())
|
|
18
|
+
except FileNotFoundError:
|
|
19
|
+
# Can happen if the cwd has been deleted
|
|
20
|
+
_IMPORT_CWD = ""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def get_console() -> "Console":
|
|
24
|
+
"""Get a global :class:`~rich.console.Console` instance. This function is used when Rich requires a Console,
|
|
25
|
+
and hasn't been explicitly given one.
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
Console: A console instance.
|
|
29
|
+
"""
|
|
30
|
+
global _console
|
|
31
|
+
if _console is None:
|
|
32
|
+
from .console import Console
|
|
33
|
+
|
|
34
|
+
_console = Console()
|
|
35
|
+
|
|
36
|
+
return _console
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def reconfigure(*args: Any, **kwargs: Any) -> None:
|
|
40
|
+
"""Reconfigures the global console by replacing it with another.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
*args (Any): Positional arguments for the replacement :class:`~rich.console.Console`.
|
|
44
|
+
**kwargs (Any): Keyword arguments for the replacement :class:`~rich.console.Console`.
|
|
45
|
+
"""
|
|
46
|
+
from pip._vendor.rich.console import Console
|
|
47
|
+
|
|
48
|
+
new_console = Console(*args, **kwargs)
|
|
49
|
+
_console = get_console()
|
|
50
|
+
_console.__dict__ = new_console.__dict__
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def print(
|
|
54
|
+
*objects: Any,
|
|
55
|
+
sep: str = " ",
|
|
56
|
+
end: str = "\n",
|
|
57
|
+
file: Optional[IO[str]] = None,
|
|
58
|
+
flush: bool = False,
|
|
59
|
+
) -> None:
|
|
60
|
+
r"""Print object(s) supplied via positional arguments.
|
|
61
|
+
This function has an identical signature to the built-in print.
|
|
62
|
+
For more advanced features, see the :class:`~rich.console.Console` class.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
sep (str, optional): Separator between printed objects. Defaults to " ".
|
|
66
|
+
end (str, optional): Character to write at end of output. Defaults to "\\n".
|
|
67
|
+
file (IO[str], optional): File to write to, or None for stdout. Defaults to None.
|
|
68
|
+
flush (bool, optional): Has no effect as Rich always flushes output. Defaults to False.
|
|
69
|
+
|
|
70
|
+
"""
|
|
71
|
+
from .console import Console
|
|
72
|
+
|
|
73
|
+
write_console = get_console() if file is None else Console(file=file)
|
|
74
|
+
return write_console.print(*objects, sep=sep, end=end)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def print_json(
|
|
78
|
+
json: Optional[str] = None,
|
|
79
|
+
*,
|
|
80
|
+
data: Any = None,
|
|
81
|
+
indent: Union[None, int, str] = 2,
|
|
82
|
+
highlight: bool = True,
|
|
83
|
+
skip_keys: bool = False,
|
|
84
|
+
ensure_ascii: bool = False,
|
|
85
|
+
check_circular: bool = True,
|
|
86
|
+
allow_nan: bool = True,
|
|
87
|
+
default: Optional[Callable[[Any], Any]] = None,
|
|
88
|
+
sort_keys: bool = False,
|
|
89
|
+
) -> None:
|
|
90
|
+
"""Pretty prints JSON. Output will be valid JSON.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
json (str): A string containing JSON.
|
|
94
|
+
data (Any): If json is not supplied, then encode this data.
|
|
95
|
+
indent (int, optional): Number of spaces to indent. Defaults to 2.
|
|
96
|
+
highlight (bool, optional): Enable highlighting of output: Defaults to True.
|
|
97
|
+
skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
|
|
98
|
+
ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
|
|
99
|
+
check_circular (bool, optional): Check for circular references. Defaults to True.
|
|
100
|
+
allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
|
|
101
|
+
default (Callable, optional): A callable that converts values that can not be encoded
|
|
102
|
+
in to something that can be JSON encoded. Defaults to None.
|
|
103
|
+
sort_keys (bool, optional): Sort dictionary keys. Defaults to False.
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
get_console().print_json(
|
|
107
|
+
json,
|
|
108
|
+
data=data,
|
|
109
|
+
indent=indent,
|
|
110
|
+
highlight=highlight,
|
|
111
|
+
skip_keys=skip_keys,
|
|
112
|
+
ensure_ascii=ensure_ascii,
|
|
113
|
+
check_circular=check_circular,
|
|
114
|
+
allow_nan=allow_nan,
|
|
115
|
+
default=default,
|
|
116
|
+
sort_keys=sort_keys,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def inspect(
|
|
121
|
+
obj: Any,
|
|
122
|
+
*,
|
|
123
|
+
console: Optional["Console"] = None,
|
|
124
|
+
title: Optional[str] = None,
|
|
125
|
+
help: bool = False,
|
|
126
|
+
methods: bool = False,
|
|
127
|
+
docs: bool = True,
|
|
128
|
+
private: bool = False,
|
|
129
|
+
dunder: bool = False,
|
|
130
|
+
sort: bool = True,
|
|
131
|
+
all: bool = False,
|
|
132
|
+
value: bool = True,
|
|
133
|
+
) -> None:
|
|
134
|
+
"""Inspect any Python object.
|
|
135
|
+
|
|
136
|
+
* inspect(<OBJECT>) to see summarized info.
|
|
137
|
+
* inspect(<OBJECT>, methods=True) to see methods.
|
|
138
|
+
* inspect(<OBJECT>, help=True) to see full (non-abbreviated) help.
|
|
139
|
+
* inspect(<OBJECT>, private=True) to see private attributes (single underscore).
|
|
140
|
+
* inspect(<OBJECT>, dunder=True) to see attributes beginning with double underscore.
|
|
141
|
+
* inspect(<OBJECT>, all=True) to see all attributes.
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
obj (Any): An object to inspect.
|
|
145
|
+
title (str, optional): Title to display over inspect result, or None use type. Defaults to None.
|
|
146
|
+
help (bool, optional): Show full help text rather than just first paragraph. Defaults to False.
|
|
147
|
+
methods (bool, optional): Enable inspection of callables. Defaults to False.
|
|
148
|
+
docs (bool, optional): Also render doc strings. Defaults to True.
|
|
149
|
+
private (bool, optional): Show private attributes (beginning with underscore). Defaults to False.
|
|
150
|
+
dunder (bool, optional): Show attributes starting with double underscore. Defaults to False.
|
|
151
|
+
sort (bool, optional): Sort attributes alphabetically. Defaults to True.
|
|
152
|
+
all (bool, optional): Show all attributes. Defaults to False.
|
|
153
|
+
value (bool, optional): Pretty print value. Defaults to True.
|
|
154
|
+
"""
|
|
155
|
+
_console = console or get_console()
|
|
156
|
+
from pip._vendor.rich._inspect import Inspect
|
|
157
|
+
|
|
158
|
+
# Special case for inspect(inspect)
|
|
159
|
+
is_inspect = obj is inspect
|
|
160
|
+
|
|
161
|
+
_inspect = Inspect(
|
|
162
|
+
obj,
|
|
163
|
+
title=title,
|
|
164
|
+
help=is_inspect or help,
|
|
165
|
+
methods=is_inspect or methods,
|
|
166
|
+
docs=is_inspect or docs,
|
|
167
|
+
private=private,
|
|
168
|
+
dunder=dunder,
|
|
169
|
+
sort=sort,
|
|
170
|
+
all=all,
|
|
171
|
+
value=value,
|
|
172
|
+
)
|
|
173
|
+
_console.print(_inspect)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
if __name__ == "__main__": # pragma: no cover
|
|
177
|
+
print("Hello, **World**")
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import colorsys
|
|
2
|
+
import io
|
|
3
|
+
from time import process_time
|
|
4
|
+
|
|
5
|
+
from pip._vendor.rich import box
|
|
6
|
+
from pip._vendor.rich.color import Color
|
|
7
|
+
from pip._vendor.rich.console import Console, ConsoleOptions, Group, RenderableType, RenderResult
|
|
8
|
+
from pip._vendor.rich.markdown import Markdown
|
|
9
|
+
from pip._vendor.rich.measure import Measurement
|
|
10
|
+
from pip._vendor.rich.pretty import Pretty
|
|
11
|
+
from pip._vendor.rich.segment import Segment
|
|
12
|
+
from pip._vendor.rich.style import Style
|
|
13
|
+
from pip._vendor.rich.syntax import Syntax
|
|
14
|
+
from pip._vendor.rich.table import Table
|
|
15
|
+
from pip._vendor.rich.text import Text
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ColorBox:
|
|
19
|
+
def __rich_console__(
|
|
20
|
+
self, console: Console, options: ConsoleOptions
|
|
21
|
+
) -> RenderResult:
|
|
22
|
+
for y in range(0, 5):
|
|
23
|
+
for x in range(options.max_width):
|
|
24
|
+
h = x / options.max_width
|
|
25
|
+
l = 0.1 + ((y / 5) * 0.7)
|
|
26
|
+
r1, g1, b1 = colorsys.hls_to_rgb(h, l, 1.0)
|
|
27
|
+
r2, g2, b2 = colorsys.hls_to_rgb(h, l + 0.7 / 10, 1.0)
|
|
28
|
+
bgcolor = Color.from_rgb(r1 * 255, g1 * 255, b1 * 255)
|
|
29
|
+
color = Color.from_rgb(r2 * 255, g2 * 255, b2 * 255)
|
|
30
|
+
yield Segment("▄", Style(color=color, bgcolor=bgcolor))
|
|
31
|
+
yield Segment.line()
|
|
32
|
+
|
|
33
|
+
def __rich_measure__(
|
|
34
|
+
self, console: "Console", options: ConsoleOptions
|
|
35
|
+
) -> Measurement:
|
|
36
|
+
return Measurement(1, options.max_width)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def make_test_card() -> Table:
|
|
40
|
+
"""Get a renderable that demonstrates a number of features."""
|
|
41
|
+
table = Table.grid(padding=1, pad_edge=True)
|
|
42
|
+
table.title = "Rich features"
|
|
43
|
+
table.add_column("Feature", no_wrap=True, justify="center", style="bold red")
|
|
44
|
+
table.add_column("Demonstration")
|
|
45
|
+
|
|
46
|
+
color_table = Table(
|
|
47
|
+
box=None,
|
|
48
|
+
expand=False,
|
|
49
|
+
show_header=False,
|
|
50
|
+
show_edge=False,
|
|
51
|
+
pad_edge=False,
|
|
52
|
+
)
|
|
53
|
+
color_table.add_row(
|
|
54
|
+
(
|
|
55
|
+
"✓ [bold green]4-bit color[/]\n"
|
|
56
|
+
"✓ [bold blue]8-bit color[/]\n"
|
|
57
|
+
"✓ [bold magenta]Truecolor (16.7 million)[/]\n"
|
|
58
|
+
"✓ [bold yellow]Dumb terminals[/]\n"
|
|
59
|
+
"✓ [bold cyan]Automatic color conversion"
|
|
60
|
+
),
|
|
61
|
+
ColorBox(),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
table.add_row("Colors", color_table)
|
|
65
|
+
|
|
66
|
+
table.add_row(
|
|
67
|
+
"Styles",
|
|
68
|
+
"All ansi styles: [bold]bold[/], [dim]dim[/], [italic]italic[/italic], [underline]underline[/], [strike]strikethrough[/], [reverse]reverse[/], and even [blink]blink[/].",
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque in metus sed sapien ultricies pretium a at justo. Maecenas luctus velit et auctor maximus."
|
|
72
|
+
lorem_table = Table.grid(padding=1, collapse_padding=True)
|
|
73
|
+
lorem_table.pad_edge = False
|
|
74
|
+
lorem_table.add_row(
|
|
75
|
+
Text(lorem, justify="left", style="green"),
|
|
76
|
+
Text(lorem, justify="center", style="yellow"),
|
|
77
|
+
Text(lorem, justify="right", style="blue"),
|
|
78
|
+
Text(lorem, justify="full", style="red"),
|
|
79
|
+
)
|
|
80
|
+
table.add_row(
|
|
81
|
+
"Text",
|
|
82
|
+
Group(
|
|
83
|
+
Text.from_markup(
|
|
84
|
+
"""Word wrap text. Justify [green]left[/], [yellow]center[/], [blue]right[/] or [red]full[/].\n"""
|
|
85
|
+
),
|
|
86
|
+
lorem_table,
|
|
87
|
+
),
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
def comparison(renderable1: RenderableType, renderable2: RenderableType) -> Table:
|
|
91
|
+
table = Table(show_header=False, pad_edge=False, box=None, expand=True)
|
|
92
|
+
table.add_column("1", ratio=1)
|
|
93
|
+
table.add_column("2", ratio=1)
|
|
94
|
+
table.add_row(renderable1, renderable2)
|
|
95
|
+
return table
|
|
96
|
+
|
|
97
|
+
table.add_row(
|
|
98
|
+
"Asian\nlanguage\nsupport",
|
|
99
|
+
":flag_for_china: 该库支持中文,日文和韩文文本!\n:flag_for_japan: ライブラリは中国語、日本語、韓国語のテキストをサポートしています\n:flag_for_south_korea: 이 라이브러리는 중국어, 일본어 및 한국어 텍스트를 지원합니다",
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
markup_example = (
|
|
103
|
+
"[bold magenta]Rich[/] supports a simple [i]bbcode[/i]-like [b]markup[/b] for [yellow]color[/], [underline]style[/], and emoji! "
|
|
104
|
+
":+1: :apple: :ant: :bear: :baguette_bread: :bus: "
|
|
105
|
+
)
|
|
106
|
+
table.add_row("Markup", markup_example)
|
|
107
|
+
|
|
108
|
+
example_table = Table(
|
|
109
|
+
show_edge=False,
|
|
110
|
+
show_header=True,
|
|
111
|
+
expand=False,
|
|
112
|
+
row_styles=["none", "dim"],
|
|
113
|
+
box=box.SIMPLE,
|
|
114
|
+
)
|
|
115
|
+
example_table.add_column("[green]Date", style="green", no_wrap=True)
|
|
116
|
+
example_table.add_column("[blue]Title", style="blue")
|
|
117
|
+
example_table.add_column(
|
|
118
|
+
"[cyan]Production Budget",
|
|
119
|
+
style="cyan",
|
|
120
|
+
justify="right",
|
|
121
|
+
no_wrap=True,
|
|
122
|
+
)
|
|
123
|
+
example_table.add_column(
|
|
124
|
+
"[magenta]Box Office",
|
|
125
|
+
style="magenta",
|
|
126
|
+
justify="right",
|
|
127
|
+
no_wrap=True,
|
|
128
|
+
)
|
|
129
|
+
example_table.add_row(
|
|
130
|
+
"Dec 20, 2019",
|
|
131
|
+
"Star Wars: The Rise of Skywalker",
|
|
132
|
+
"$275,000,000",
|
|
133
|
+
"$375,126,118",
|
|
134
|
+
)
|
|
135
|
+
example_table.add_row(
|
|
136
|
+
"May 25, 2018",
|
|
137
|
+
"[b]Solo[/]: A Star Wars Story",
|
|
138
|
+
"$275,000,000",
|
|
139
|
+
"$393,151,347",
|
|
140
|
+
)
|
|
141
|
+
example_table.add_row(
|
|
142
|
+
"Dec 15, 2017",
|
|
143
|
+
"Star Wars Ep. VIII: The Last Jedi",
|
|
144
|
+
"$262,000,000",
|
|
145
|
+
"[bold]$1,332,539,889[/bold]",
|
|
146
|
+
)
|
|
147
|
+
example_table.add_row(
|
|
148
|
+
"May 19, 1999",
|
|
149
|
+
"Star Wars Ep. [b]I[/b]: [i]The phantom Menace",
|
|
150
|
+
"$115,000,000",
|
|
151
|
+
"$1,027,044,677",
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
table.add_row("Tables", example_table)
|
|
155
|
+
|
|
156
|
+
code = '''\
|
|
157
|
+
def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
|
|
158
|
+
"""Iterate and generate a tuple with a flag for last value."""
|
|
159
|
+
iter_values = iter(values)
|
|
160
|
+
try:
|
|
161
|
+
previous_value = next(iter_values)
|
|
162
|
+
except StopIteration:
|
|
163
|
+
return
|
|
164
|
+
for value in iter_values:
|
|
165
|
+
yield False, previous_value
|
|
166
|
+
previous_value = value
|
|
167
|
+
yield True, previous_value'''
|
|
168
|
+
|
|
169
|
+
pretty_data = {
|
|
170
|
+
"foo": [
|
|
171
|
+
3.1427,
|
|
172
|
+
(
|
|
173
|
+
"Paul Atreides",
|
|
174
|
+
"Vladimir Harkonnen",
|
|
175
|
+
"Thufir Hawat",
|
|
176
|
+
),
|
|
177
|
+
],
|
|
178
|
+
"atomic": (False, True, None),
|
|
179
|
+
}
|
|
180
|
+
table.add_row(
|
|
181
|
+
"Syntax\nhighlighting\n&\npretty\nprinting",
|
|
182
|
+
comparison(
|
|
183
|
+
Syntax(code, "python3", line_numbers=True, indent_guides=True),
|
|
184
|
+
Pretty(pretty_data, indent_guides=True),
|
|
185
|
+
),
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
markdown_example = """\
|
|
189
|
+
# Markdown
|
|
190
|
+
|
|
191
|
+
Supports much of the *markdown* __syntax__!
|
|
192
|
+
|
|
193
|
+
- Headers
|
|
194
|
+
- Basic formatting: **bold**, *italic*, `code`
|
|
195
|
+
- Block quotes
|
|
196
|
+
- Lists, and more...
|
|
197
|
+
"""
|
|
198
|
+
table.add_row(
|
|
199
|
+
"Markdown", comparison("[cyan]" + markdown_example, Markdown(markdown_example))
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
table.add_row(
|
|
203
|
+
"+more!",
|
|
204
|
+
"""Progress bars, columns, styled logging handler, tracebacks, etc...""",
|
|
205
|
+
)
|
|
206
|
+
return table
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
if __name__ == "__main__": # pragma: no cover
|
|
210
|
+
from pip._vendor.rich.panel import Panel
|
|
211
|
+
|
|
212
|
+
console = Console(
|
|
213
|
+
file=io.StringIO(),
|
|
214
|
+
force_terminal=True,
|
|
215
|
+
)
|
|
216
|
+
test_card = make_test_card()
|
|
217
|
+
|
|
218
|
+
# Print once to warm cache
|
|
219
|
+
start = process_time()
|
|
220
|
+
console.print(test_card)
|
|
221
|
+
pre_cache_taken = round((process_time() - start) * 1000.0, 1)
|
|
222
|
+
|
|
223
|
+
console.file = io.StringIO()
|
|
224
|
+
|
|
225
|
+
start = process_time()
|
|
226
|
+
console.print(test_card)
|
|
227
|
+
taken = round((process_time() - start) * 1000.0, 1)
|
|
228
|
+
|
|
229
|
+
c = Console(record=True)
|
|
230
|
+
c.print(test_card)
|
|
231
|
+
|
|
232
|
+
console = Console()
|
|
233
|
+
console.print(f"[dim]rendered in [not dim]{pre_cache_taken}ms[/] (cold cache)")
|
|
234
|
+
console.print(f"[dim]rendered in [not dim]{taken}ms[/] (warm cache)")
|
|
235
|
+
console.print()
|
|
236
|
+
console.print(
|
|
237
|
+
Panel.fit(
|
|
238
|
+
"[b magenta]Hope you enjoy using Rich![/]\n\n"
|
|
239
|
+
"Please consider sponsoring me if you get value from my work.\n\n"
|
|
240
|
+
"Even the price of a ☕ can brighten my day!\n\n"
|
|
241
|
+
"https://github.com/sponsors/willmcgugan",
|
|
242
|
+
border_style="red",
|
|
243
|
+
title="Help ensure Rich is maintained",
|
|
244
|
+
)
|
|
245
|
+
)
|