shortcutxl 0.3.76 → 0.3.78
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.
- package/BINARY-INVENTORY.json +813 -813
- package/CHANGELOG.md +14 -0
- package/dist/ai/models.d.ts +10 -6
- package/dist/ai/models.generated.d.ts +72 -0
- package/dist/ai/models.generated.js +33 -0
- package/dist/ai/models.js +36 -13
- package/dist/ai/providers/anthropic.d.ts +4 -2
- package/dist/ai/providers/anthropic.js +59 -29
- package/dist/ai/providers/azure-openai-responses.d.ts +2 -1
- package/dist/ai/providers/azure-openai-responses.js +4 -20
- package/dist/ai/providers/google-vertex.d.ts +8 -2
- package/dist/ai/providers/google-vertex.js +66 -54
- package/dist/ai/providers/google.js +15 -48
- package/dist/ai/providers/openai-completions.d.ts +4 -1
- package/dist/ai/providers/openai-completions.js +26 -10
- package/dist/ai/providers/openai-reasoning.d.ts +5 -0
- package/dist/ai/providers/openai-reasoning.js +13 -0
- package/dist/ai/providers/openai-responses-shared.js +1 -1
- package/dist/ai/providers/openai-responses.d.ts +6 -2
- package/dist/ai/providers/openai-responses.js +28 -23
- package/dist/ai/providers/simple-options.d.ts +2 -3
- package/dist/ai/providers/simple-options.js +4 -6
- package/dist/ai/types.d.ts +19 -2
- package/dist/app/agent-session-runtime-adapter.js +7 -6
- package/dist/app/agent-session.d.ts +0 -15
- package/dist/app/agent-session.js +0 -37
- package/dist/app/approvals/approval-errors.d.ts +15 -0
- package/dist/app/approvals/approval-errors.js +14 -0
- package/dist/app/approvals/runtime-approval-gates.d.ts +1 -2
- package/dist/app/approvals/tool-approval.d.ts +1 -0
- package/dist/app/approvals/tool-approval.js +11 -23
- package/dist/app/approvals/types.d.ts +0 -14
- package/dist/app/approvals/types.js +0 -2
- package/dist/app/background/tool-summaries.js +0 -2
- package/dist/app/extensions/slash-commands.js +1 -3
- package/dist/app/local/tools/execute-code/executor.d.ts +1 -1
- package/dist/app/local/tools/execute-code/executor.js +20 -10
- package/dist/app/local/tools/execute-code/tool.js +21 -2
- package/dist/app/modes/action/agent.js +4 -5
- package/dist/app/modes/ask/agent.js +4 -6
- package/dist/app/modes/index.js +20 -10
- package/dist/app/modes/installation/agent.js +4 -5
- package/dist/app/modes/manage/agent.js +3 -4
- package/dist/app/modes/manage/prompt.js +1 -2
- package/dist/app/modes/metadata.d.ts +31 -0
- package/dist/app/modes/metadata.js +35 -0
- package/dist/app/modes/plan/agent.js +5 -8
- package/dist/app/modes/plan/prompt.js +3 -3
- package/dist/app/permissions/runtime-approval-flow.d.ts +1 -5
- package/dist/app/permissions/runtime-approval-flow.js +0 -28
- package/dist/app/permissions/tool-gates.d.ts +2 -3
- package/dist/app/permissions/tool-gates.js +3 -81
- package/dist/app/prompts/com-api.js +1 -1
- package/dist/app/prompts/shared-guidelines.js +7 -3
- package/dist/app/providers/google-vertex-gateway.js +4 -51
- package/dist/app/providers/model-registry.d.ts +1 -0
- package/dist/app/providers/model-registry.js +39 -0
- package/dist/app/providers/model-resolver.js +10 -7
- package/dist/app/providers/register-shortcut-provider.js +6 -6
- package/dist/app/providers/shortcut-api-v2-transport.js +4 -0
- package/dist/app/providers/shortcut-llm-proxy-client.d.ts +2 -2
- package/dist/app/providers/shortcut-llm-proxy-client.js +1 -0
- package/dist/app/resources/package-manager.js +2 -123
- package/dist/app/resources/resource-patterns.d.ts +9 -0
- package/dist/app/resources/resource-patterns.js +120 -0
- package/dist/app/session/forked-agent.d.ts +2 -2
- package/dist/app/session/model-manager.js +3 -2
- package/dist/app/session/session-lifecycle.js +3 -2
- package/dist/app/session/session-models.d.ts +2 -0
- package/dist/app/session/session-models.js +14 -6
- package/dist/app/settings-manager.d.ts +3 -3
- package/dist/app/shared/tools/execute-code/mog.d.ts +3 -1
- package/dist/app/shared/tools/execute-code/mog.js +18 -2
- package/dist/app/tools/bash.js +3 -3
- package/dist/app/tools/execute-code/index.d.ts +1 -0
- package/dist/app/tools/execute-code/index.js +3 -1
- package/dist/app/tools/find-ignore-files.d.ts +3 -0
- package/dist/app/tools/find-ignore-files.js +33 -0
- package/dist/app/tools/find.js +2 -21
- package/dist/app/tools/llm-analysis.js +0 -2
- package/dist/app/tools/refresh-context.d.ts +1 -1
- package/dist/app/tools/session-settings/update-session-settings.js +2 -2
- package/dist/app/tools/switch-mode.js +2 -2
- package/dist/app/tools/take-screenshot.js +0 -2
- package/dist/app/tools/task/runner.js +1 -2
- package/dist/app/tools/task/task.d.ts +1 -3
- package/dist/app/tools/task/task.js +20 -40
- package/dist/app/tools/web-search.js +12 -2
- package/dist/autocomplete/core.d.ts +33 -0
- package/dist/autocomplete/core.js +113 -0
- package/dist/{tui → autocomplete}/fuzzy.d.ts +0 -1
- package/dist/{tui → autocomplete}/fuzzy.js +0 -1
- package/dist/{tui/autocomplete.d.ts → autocomplete/index.d.ts} +0 -1
- package/dist/{tui/autocomplete.js → autocomplete/index.js} +62 -158
- package/dist/cli/args.js +1 -1
- package/dist/cli/list-models.js +1 -1
- package/dist/cli.js +26227 -30480
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +0 -3
- package/dist/contracts/agent-session-store.d.ts +1 -1
- package/dist/contracts/agent-settings.d.ts +1 -0
- package/dist/contracts/agent-settings.js +2 -1
- package/dist/contracts/model-call.d.ts +1 -2
- package/dist/contracts/model-call.js +1 -2
- package/dist/contracts/model-stream.d.ts +1 -0
- package/dist/contracts/model-stream.js +1 -0
- package/dist/contracts/wire.d.ts +10 -7
- package/dist/contracts/wire.js +8 -0
- package/dist/core/agent-engine.js +1 -1
- package/dist/core/core-types.d.ts +1 -21
- package/dist/core/defaults.d.ts +1 -1
- package/dist/core/defaults.js +9 -1
- package/dist/core/prompts/agent-guidelines.d.ts +4 -5
- package/dist/core/prompts/agent-guidelines.js +28 -42
- package/dist/core/session-schema.d.ts +1 -1
- package/dist/embedded-agent/ai-invoke.d.ts +1 -2
- package/dist/embedded-agent/ai-invoke.js +2 -70
- package/dist/embedded-agent/anthropic-messages-transport.d.ts +4 -20
- package/dist/embedded-agent/anthropic-messages-transport.js +23 -786
- package/dist/embedded-agent/bootstrap.js +2 -2
- package/dist/embedded-agent/compose.js +8 -7
- package/dist/embedded-agent/gateway-base-url.d.ts +3 -0
- package/dist/embedded-agent/gateway-base-url.js +35 -0
- package/dist/embedded-agent/google-vertex-transport.d.ts +2 -11
- package/dist/embedded-agent/google-vertex-transport.js +20 -117
- package/dist/embedded-agent/host-runtime-options.d.ts +0 -8
- package/dist/embedded-agent/host-runtime-options.js +10 -2
- package/dist/embedded-agent/host-tools/invoke-llm/contract.d.ts +2 -2
- package/dist/embedded-agent/host-tools/invoke-llm/contract.js +4 -2
- package/dist/embedded-agent/host-tools/sandbox-llm/contract.d.ts +8 -3
- package/dist/embedded-agent/host-tools/sandbox-llm/contract.js +12 -8
- package/dist/embedded-agent/host-tools/sandbox-llm/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/sandbox-llm/index.js +1 -1
- package/dist/embedded-agent/host-tools/shared/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/shared/index.js +1 -1
- package/dist/embedded-agent/host-tools/shared/llm-stream-error.d.ts +7 -0
- package/dist/embedded-agent/host-tools/shared/llm-stream-error.js +10 -0
- package/dist/embedded-agent/host-tools/take-screenshot/contract.d.ts +0 -2
- package/dist/embedded-agent/host-tools/take-screenshot/contract.js +1 -3
- package/dist/embedded-agent/host-tools/take-screenshot/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/take-screenshot/index.js +1 -1
- package/dist/embedded-agent/host-tools/task/agents/clone.js +1 -2
- package/dist/embedded-agent/host-tools/task/contract.js +1 -1
- package/dist/embedded-agent/index.d.ts +3 -4
- package/dist/embedded-agent/index.js +2 -3
- package/dist/embedded-agent/model-selection.d.ts +0 -6
- package/dist/embedded-agent/model-selection.js +15 -8
- package/dist/embedded-agent/openai-completions-transport.d.ts +2 -11
- package/dist/embedded-agent/openai-completions-transport.js +20 -120
- package/dist/embedded-agent/openai-responses-transport.d.ts +2 -11
- package/dist/embedded-agent/openai-responses-transport.js +15 -170
- package/dist/embedded-agent/prompt/build.js +1 -2
- package/dist/embedded-agent/prompt/sections.d.ts +1 -1
- package/dist/embedded-agent/prompt/sections.js +2 -0
- package/dist/embedded-agent/provider-native-request.d.ts +29 -0
- package/dist/embedded-agent/provider-native-request.js +65 -0
- package/dist/embedded-agent/run-stats.d.ts +1 -1
- package/dist/embedded-agent/stream.d.ts +10 -96
- package/dist/embedded-agent/stream.js +31 -556
- package/dist/embedded-agent/suggestions.d.ts +1 -1
- package/dist/embedded-agent/suggestions.js +1 -1
- package/dist/embedded-agent/worker-bridge/host-client.d.ts +7 -0
- package/dist/embedded-agent/worker-bridge/host-client.js +15 -0
- package/dist/embedded-agent/worker-bridge/worker-port.js +17 -1
- package/dist/main.js +18 -14
- package/dist/rpc/index.d.ts +1 -1
- package/dist/rpc/rpc-approval-gates.js +1 -2
- package/dist/rpc/rpc-host.d.ts +4 -0
- package/dist/rpc/rpc-host.js +13 -24
- package/dist/rpc/rpc-types.d.ts +6 -17
- package/dist/shared/platform/open.d.ts +4 -1
- package/dist/shared/platform/open.js +14 -2
- package/dist/shell/approvals/runtime-approval-gates.js +1 -3
- package/dist/shell/components/selectors/model-selector.js +2 -1
- package/dist/shell/components/selectors/session-selector-search.js +1 -1
- package/dist/shell/components/selectors/thinking-selector.js +7 -6
- package/dist/shell/index.d.ts +0 -1
- package/dist/shell/index.js +0 -1
- package/dist/shell/interactive/interactive-mode-options.d.ts +10 -0
- package/dist/shell/interactive/interactive-mode.d.ts +6 -12
- package/dist/shell/interactive/interactive-mode.js +39 -158
- package/dist/shell/interactive/slash-commands.d.ts +0 -34
- package/dist/shell/interactive/slash-commands.js +0 -2
- package/dist/shell/links/local-file-link-input.d.ts +15 -0
- package/dist/shell/links/local-file-link-input.js +38 -0
- package/dist/shell/links/local-file-link.d.ts +7 -0
- package/dist/shell/links/local-file-link.js +35 -0
- package/dist/shell/links/local-file-opener.d.ts +16 -0
- package/dist/shell/links/local-file-opener.js +90 -0
- package/dist/shell/session-client.d.ts +0 -1
- package/dist/shell/session-client.js +0 -6
- package/dist/shell/status/update-check-scheduler.d.ts +30 -0
- package/dist/shell/status/update-check-scheduler.js +71 -0
- package/dist/shell/status/update-reminder-controller.d.ts +22 -0
- package/dist/shell/status/update-reminder-controller.js +40 -0
- package/dist/shell/status/update-reminder.d.ts +6 -0
- package/dist/shell/status/update-reminder.js +4 -0
- package/dist/shell/theme/dark.json +1 -2
- package/dist/shell/theme/light.json +1 -2
- package/dist/shell/theme/runtime.d.ts +2 -3
- package/dist/shell/theme/runtime.js +2 -6
- package/dist/shell/theme/theme-schema.json +1 -6
- package/dist/shortcut-model-catalog.d.ts +7 -2
- package/dist/shortcut-model-catalog.js +134 -10
- package/dist/startup/update-manager.d.ts +6 -6
- package/dist/startup/update-manager.js +23 -38
- package/dist/startup/update-prompt.d.ts +1 -0
- package/dist/startup/update-prompt.js +2 -2
- package/dist/tui/components/editor.d.ts +1 -1
- package/dist/tui/components/editor.js +1 -1
- package/dist/tui/components/markdown.js +15 -6
- package/dist/tui/components/settings-list.js +1 -1
- package/dist/tui/editor-component.d.ts +1 -1
- package/dist/tui/index.d.ts +7 -8
- package/dist/tui/index.js +7 -6
- package/dist/tui/tui.d.ts +2 -0
- package/dist/tui/tui.js +16 -1
- package/dist/tui/utils.d.ts +7 -0
- package/dist/tui/utils.js +58 -8
- package/native-app/main/index.js +3200 -48
- package/native-app/main/{photon_rs-SoVDgheu.js → photon_rs-XkYyYTVA.js} +2 -2
- package/native-app/package.json +1 -1
- package/native-app/preload/index.cjs +2 -0
- package/native-app/renderer/assets/{index-CFc-oZuS.js → index-B4jz6epR.js} +825 -155
- package/native-app/renderer/assets/{index-OhGE0UY4.css → index-C__g36ft.css} +412 -162
- package/native-app/renderer/assets/shortcutagent-DxFsGSkw.png +0 -0
- package/native-app/renderer/index.html +2 -2
- package/package.json +17 -3
- package/skills/add-custom-model/SKILL.md +52 -0
- package/user-docs/dist/index.html +1 -1
- package/user-docs/dist/shortcutxl-docs.pdf +0 -0
- package/xll/ShortcutXL.xll +0 -0
- package/xll/modules/shortcut_xl/_managed.py +26 -7
- package/xll/modules/shortcut_xl/_tracking.py +141 -251
- package/xll/modules/shortcut_xl/api/__init__.py +60 -0
- package/xll/modules/shortcut_xl/api/workbook.py +9 -1
- package/xll/modules/shortcut_xl/api/worksheet.py +4 -1
- package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/idna-3.18.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/pip/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/build_env/__init__.py +25 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/base.py +103 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/installer.py +333 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/noop.py +42 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/venv.py +145 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/virtual.py +139 -0
- package/xll/python/Lib/site-packages/pip/_internal/cache.py +4 -1
- package/xll/python/Lib/site-packages/pip/_internal/cli/autocompletion.py +4 -1
- package/xll/python/Lib/site-packages/pip/_internal/cli/base_command.py +11 -14
- package/xll/python/Lib/site-packages/pip/_internal/cli/cmdoptions.py +133 -22
- package/xll/python/Lib/site-packages/pip/_internal/cli/index_command.py +11 -6
- package/xll/python/Lib/site-packages/pip/_internal/cli/main.py +2 -1
- package/xll/python/Lib/site-packages/pip/_internal/cli/main_parser.py +1 -2
- package/xll/python/Lib/site-packages/pip/_internal/cli/parser.py +10 -2
- package/xll/python/Lib/site-packages/pip/_internal/cli/progress_bars.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/cli/req_command.py +57 -25
- package/xll/python/Lib/site-packages/pip/_internal/cli/status_codes.py +1 -0
- package/xll/python/Lib/site-packages/pip/_internal/commands/cache.py +7 -6
- package/xll/python/Lib/site-packages/pip/_internal/commands/configuration.py +2 -1
- package/xll/python/Lib/site-packages/pip/_internal/commands/debug.py +4 -5
- package/xll/python/Lib/site-packages/pip/_internal/commands/download.py +4 -0
- package/xll/python/Lib/site-packages/pip/_internal/commands/freeze.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/commands/index.py +10 -3
- package/xll/python/Lib/site-packages/pip/_internal/commands/inspect.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/commands/install.py +6 -6
- package/xll/python/Lib/site-packages/pip/_internal/commands/list.py +11 -6
- package/xll/python/Lib/site-packages/pip/_internal/commands/lock.py +4 -6
- package/xll/python/Lib/site-packages/pip/_internal/commands/show.py +14 -8
- package/xll/python/Lib/site-packages/pip/_internal/commands/wheel.py +7 -1
- package/xll/python/Lib/site-packages/pip/_internal/configuration.py +2 -3
- package/xll/python/Lib/site-packages/pip/_internal/distributions/base.py +5 -3
- package/xll/python/Lib/site-packages/pip/_internal/distributions/installed.py +3 -2
- package/xll/python/Lib/site-packages/pip/_internal/distributions/sdist.py +45 -20
- package/xll/python/Lib/site-packages/pip/_internal/distributions/wheel.py +3 -2
- package/xll/python/Lib/site-packages/pip/_internal/exceptions.py +174 -0
- package/xll/python/Lib/site-packages/pip/_internal/index/collector.py +70 -48
- package/xll/python/Lib/site-packages/pip/_internal/index/package_finder.py +46 -7
- package/xll/python/Lib/site-packages/pip/_internal/index/sources.py +1 -2
- package/xll/python/Lib/site-packages/pip/_internal/locations/_sysconfig.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/locations/base.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/metadata/base.py +10 -5
- package/xll/python/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +8 -3
- package/xll/python/Lib/site-packages/pip/_internal/models/candidate.py +5 -1
- package/xll/python/Lib/site-packages/pip/_internal/models/link.py +53 -13
- package/xll/python/Lib/site-packages/pip/_internal/network/auth.py +38 -21
- package/xll/python/Lib/site-packages/pip/_internal/network/cache.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/network/download.py +58 -11
- package/xll/python/Lib/site-packages/pip/_internal/network/session.py +35 -40
- package/xll/python/Lib/site-packages/pip/_internal/network/utils.py +109 -1
- package/xll/python/Lib/site-packages/pip/_internal/operations/check.py +2 -3
- package/xll/python/Lib/site-packages/pip/_internal/operations/install/wheel.py +23 -18
- package/xll/python/Lib/site-packages/pip/_internal/operations/prepare.py +152 -7
- package/xll/python/Lib/site-packages/pip/_internal/req/__init__.py +2 -0
- package/xll/python/Lib/site-packages/pip/_internal/req/constructors.py +54 -69
- package/xll/python/Lib/site-packages/pip/_internal/req/req_file.py +6 -6
- package/xll/python/Lib/site-packages/pip/_internal/req/req_install.py +25 -21
- package/xll/python/Lib/site-packages/pip/_internal/req/req_uninstall.py +13 -8
- package/xll/python/Lib/site-packages/pip/_internal/resolution/base.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -1
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +39 -52
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +3 -3
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +3 -0
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +9 -0
- package/xll/python/Lib/site-packages/pip/_internal/utils/compat.py +15 -9
- package/xll/python/Lib/site-packages/pip/_internal/utils/deprecation.py +6 -1
- package/xll/python/Lib/site-packages/pip/_internal/utils/filesystem.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/utils/logging.py +11 -3
- package/xll/python/Lib/site-packages/pip/_internal/utils/misc.py +48 -4
- package/xll/python/Lib/site-packages/pip/_internal/utils/pylock.py +18 -2
- package/xll/python/Lib/site-packages/pip/_internal/utils/retry.py +2 -1
- package/xll/python/Lib/site-packages/pip/_internal/utils/subprocess.py +4 -3
- package/xll/python/Lib/site-packages/pip/_internal/utils/temp_dir.py +1 -2
- package/xll/python/Lib/site-packages/pip/_internal/utils/unpacking.py +30 -4
- package/xll/python/Lib/site-packages/pip/_internal/utils/urls.py +5 -2
- package/xll/python/Lib/site-packages/pip/_internal/utils/virtualenv.py +2 -36
- package/xll/python/Lib/site-packages/pip/_internal/vcs/git.py +8 -5
- package/xll/python/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +1 -2
- package/xll/python/Lib/site-packages/pip/_internal/wheel_builder.py +5 -1
- package/xll/python/Lib/site-packages/pip/_vendor/bom.cdx.json +231 -0
- package/xll/python/Lib/site-packages/pip/_vendor/certifi/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/certifi/cacert.pem +0 -631
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/compat.py +34 -64
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/resources.py +28 -14
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/scripts.py +7 -3
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/util.py +48 -11
- package/xll/python/Lib/site-packages/pip/_vendor/idna/LICENSE.md +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/idna/__main__.py +6 -0
- package/xll/python/Lib/site-packages/pip/_vendor/idna/cli.py +128 -0
- package/xll/python/Lib/site-packages/pip/_vendor/idna/codec.py +50 -13
- package/xll/python/Lib/site-packages/pip/_vendor/idna/compat.py +26 -0
- package/xll/python/Lib/site-packages/pip/_vendor/idna/core.py +352 -141
- package/xll/python/Lib/site-packages/pip/_vendor/idna/idnadata.py +571 -2983
- package/xll/python/Lib/site-packages/pip/_vendor/idna/intranges.py +5 -7
- package/xll/python/Lib/site-packages/pip/_vendor/idna/package_data.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/idna/uts46data.py +16887 -8832
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +352 -66
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +11 -0
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/_xdg.py +171 -0
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/android.py +92 -41
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/api.py +213 -49
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/macos.py +128 -51
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/unix.py +176 -127
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/version.py +8 -18
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/windows.py +185 -68
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/__init__.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/__main__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/console.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/filter.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +10 -8
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/formatter.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexer.py +7 -5
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +9 -8
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +35 -32
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/modeline.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/plugin.py +3 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/regexopt.py +13 -2
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/scanner.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/style.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/token.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/unistring.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/util.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/requests/__init__.py +52 -16
- package/xll/python/Lib/site-packages/pip/_vendor/requests/__version__.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/requests/_types.py +183 -0
- package/xll/python/Lib/site-packages/pip/_vendor/requests/adapters.py +101 -50
- package/xll/python/Lib/site-packages/pip/_vendor/requests/api.py +31 -8
- package/xll/python/Lib/site-packages/pip/_vendor/requests/auth.py +80 -40
- package/xll/python/Lib/site-packages/pip/_vendor/requests/compat.py +9 -3
- package/xll/python/Lib/site-packages/pip/_vendor/requests/cookies.py +143 -79
- package/xll/python/Lib/site-packages/pip/_vendor/requests/exceptions.py +15 -5
- package/xll/python/Lib/site-packages/pip/_vendor/requests/help.py +13 -10
- package/xll/python/Lib/site-packages/pip/_vendor/requests/hooks.py +23 -9
- package/xll/python/Lib/site-packages/pip/_vendor/requests/models.py +265 -126
- package/xll/python/Lib/site-packages/pip/_vendor/requests/py.typed +0 -0
- package/xll/python/Lib/site-packages/pip/_vendor/requests/sessions.py +164 -78
- package/xll/python/Lib/site-packages/pip/_vendor/requests/status_codes.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/requests/structures.py +51 -20
- package/xll/python/Lib/site-packages/pip/_vendor/requests/utils.py +161 -89
- package/xll/python/Lib/site-packages/pip/_vendor/tomli/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/tomli/_parser.py +9 -4
- package/xll/python/Lib/site-packages/pip/_vendor/tomli/_re.py +13 -9
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_base_connection.py +3 -1
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -1
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_version.py +8 -18
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/connection.py +4 -4
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +23 -10
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/emscripten/response.py +5 -1
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +7 -8
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/fields.py +14 -14
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +8 -6
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/response.py +35 -22
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +8 -0
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +11 -61
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +5 -11
- package/xll/python/Lib/site-packages/pip/_vendor/vendor.txt +8 -8
- package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/METADATA +3 -2
- package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/RECORD +208 -188
- package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/AUTHORS.txt +20 -0
- package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/idna/LICENSE.md +1 -1
- package/xll/python/Lib/site-packages/pywin32-311.dist-info/RECORD +2 -2
- package/xll/python/Scripts/httpx.exe +0 -0
- package/xll/python/Scripts/idna.exe +0 -0
- package/xll/python/Scripts/pip.exe +0 -0
- package/xll/python/Scripts/pip3.13.exe +0 -0
- package/xll/python/Scripts/pip3.exe +0 -0
- package/xll/python/Scripts/pywin32_postinstall.exe +0 -0
- package/xll/python/Scripts/pywin32_testall.exe +0 -0
- package/dist/app/collab/awareness.d.ts +0 -32
- package/dist/app/collab/awareness.js +0 -52
- package/dist/app/collab/collab-client.d.ts +0 -37
- package/dist/app/collab/collab-client.js +0 -208
- package/dist/app/collab/collab-manager.d.ts +0 -91
- package/dist/app/collab/collab-manager.js +0 -218
- package/dist/app/collab/collab-sync.d.ts +0 -62
- package/dist/app/collab/collab-sync.js +0 -215
- package/dist/app/collab/index.d.ts +0 -9
- package/dist/app/collab/index.js +0 -6
- package/dist/app/collab/super-fight.d.ts +0 -90
- package/dist/app/collab/super-fight.js +0 -310
- package/dist/app/collab/sync-bridge.d.ts +0 -35
- package/dist/app/collab/sync-bridge.js +0 -109
- package/dist/app/collab/types.d.ts +0 -75
- package/dist/app/collab/types.js +0 -5
- package/dist/embedded-agent/ai-content.d.ts +0 -52
- package/dist/embedded-agent/ai-content.js +0 -101
- package/dist/embedded-agent/host-tools/shared/llm-stream.d.ts +0 -31
- package/dist/embedded-agent/host-tools/shared/llm-stream.js +0 -136
- package/dist/embedded-agent/model-call-orchestrator.d.ts +0 -22
- package/dist/embedded-agent/model-call-orchestrator.js +0 -22
- package/dist/embedded-agent/stream-errors.d.ts +0 -10
- package/dist/embedded-agent/stream-errors.js +0 -73
- package/dist/embedded-agent/stream-message-state.d.ts +0 -14
- package/dist/embedded-agent/stream-message-state.js +0 -271
- package/dist/embedded-agent/stream-sse.d.ts +0 -78
- package/dist/embedded-agent/stream-sse.js +0 -73
- package/dist/shell/approvals/task-spawn-approval.d.ts +0 -20
- package/dist/shell/approvals/task-spawn-approval.js +0 -93
- package/dist/shell/interactive/collab-command.d.ts +0 -9
- package/dist/shell/interactive/collab-command.js +0 -115
- package/dist/shell/interactive/super-fight-ui.d.ts +0 -80
- package/dist/shell/interactive/super-fight-ui.js +0 -484
- package/dist/shell/status/collab-status.d.ts +0 -18
- package/dist/shell/status/collab-status.js +0 -46
- package/xll/python/Lib/site-packages/pip/_internal/build_env.py +0 -606
- /package/dist/{tui → autocomplete}/skill-autocomplete.js +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/INSTALLER +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/REQUESTED +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/WHEEL +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/entry_points.txt +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/LICENSE.txt +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/cachecontrol/LICENSE.txt +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/certifi/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/distlib/LICENSE.txt +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/distro/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/msgpack/COPYING +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE.APACHE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE.BSD +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/pkg_resources/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/platformdirs/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/pygments/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/pyproject_hooks/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/requests/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/resolvelib/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/rich/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/tomli/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/tomli_w/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/truststore/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/urllib3/LICENSE.txt +0 -0
|
@@ -22,8 +22,6 @@ from collections.abc import Generator, Mapping, Sequence
|
|
|
22
22
|
from typing import (
|
|
23
23
|
TYPE_CHECKING,
|
|
24
24
|
Any,
|
|
25
|
-
Optional,
|
|
26
|
-
Union,
|
|
27
25
|
)
|
|
28
26
|
|
|
29
27
|
from pip._vendor import requests, urllib3
|
|
@@ -36,27 +34,33 @@ from pip._vendor.urllib3.connectionpool import ConnectionPool
|
|
|
36
34
|
from pip._vendor.urllib3.exceptions import InsecureRequestWarning
|
|
37
35
|
|
|
38
36
|
from pip import __version__
|
|
37
|
+
from pip._internal.exceptions import SSLMissingError
|
|
39
38
|
from pip._internal.metadata import get_default_environment
|
|
40
39
|
from pip._internal.models.link import Link
|
|
41
40
|
from pip._internal.network.auth import MultiDomainBasicAuth
|
|
42
41
|
from pip._internal.network.cache import SafeFileCache
|
|
42
|
+
from pip._internal.network.utils import raise_connection_error
|
|
43
43
|
|
|
44
44
|
# Import ssl from compat so the initial import occurs in only one place.
|
|
45
45
|
from pip._internal.utils.compat import has_tls
|
|
46
46
|
from pip._internal.utils.glibc import libc_ver
|
|
47
|
-
from pip._internal.utils.misc import
|
|
47
|
+
from pip._internal.utils.misc import (
|
|
48
|
+
build_url_from_netloc,
|
|
49
|
+
looks_like_ci,
|
|
50
|
+
parse_netloc,
|
|
51
|
+
redact_auth_from_url,
|
|
52
|
+
)
|
|
48
53
|
from pip._internal.utils.urls import url_to_path
|
|
49
54
|
|
|
50
55
|
if TYPE_CHECKING:
|
|
51
56
|
from ssl import SSLContext
|
|
52
57
|
|
|
53
58
|
from pip._vendor.urllib3 import ProxyManager
|
|
54
|
-
from pip._vendor.urllib3.poolmanager import PoolManager
|
|
55
59
|
|
|
56
60
|
|
|
57
61
|
logger = logging.getLogger(__name__)
|
|
58
62
|
|
|
59
|
-
SecureOrigin = tuple[str, str,
|
|
63
|
+
SecureOrigin = tuple[str, str, int | str | None]
|
|
60
64
|
|
|
61
65
|
|
|
62
66
|
# Ignore warning raised when using --trusted-host.
|
|
@@ -76,35 +80,6 @@ SECURE_ORIGINS: list[SecureOrigin] = [
|
|
|
76
80
|
]
|
|
77
81
|
|
|
78
82
|
|
|
79
|
-
# These are environment variables present when running under various
|
|
80
|
-
# CI systems. For each variable, some CI systems that use the variable
|
|
81
|
-
# are indicated. The collection was chosen so that for each of a number
|
|
82
|
-
# of popular systems, at least one of the environment variables is used.
|
|
83
|
-
# This list is used to provide some indication of and lower bound for
|
|
84
|
-
# CI traffic to PyPI. Thus, it is okay if the list is not comprehensive.
|
|
85
|
-
# For more background, see: https://github.com/pypa/pip/issues/5499
|
|
86
|
-
CI_ENVIRONMENT_VARIABLES = (
|
|
87
|
-
# Azure Pipelines
|
|
88
|
-
"BUILD_BUILDID",
|
|
89
|
-
# Jenkins
|
|
90
|
-
"BUILD_ID",
|
|
91
|
-
# AppVeyor, CircleCI, Codeship, Gitlab CI, Shippable, Travis CI
|
|
92
|
-
"CI",
|
|
93
|
-
# Explicit environment variable.
|
|
94
|
-
"PIP_IS_CI",
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
def looks_like_ci() -> bool:
|
|
99
|
-
"""
|
|
100
|
-
Return whether it looks like pip is running under CI.
|
|
101
|
-
"""
|
|
102
|
-
# We don't use the method of checking for a tty (e.g. using isatty())
|
|
103
|
-
# because some CI systems mimic a tty (e.g. Travis CI). Thus that
|
|
104
|
-
# method doesn't provide definitive information in either direction.
|
|
105
|
-
return any(name in os.environ for name in CI_ENVIRONMENT_VARIABLES)
|
|
106
|
-
|
|
107
|
-
|
|
108
83
|
@functools.lru_cache(maxsize=1)
|
|
109
84
|
def user_agent() -> str:
|
|
110
85
|
"""
|
|
@@ -212,7 +187,7 @@ class LocalFSAdapter(BaseAdapter):
|
|
|
212
187
|
self,
|
|
213
188
|
request: PreparedRequest,
|
|
214
189
|
stream: bool = False,
|
|
215
|
-
timeout: float | tuple[float, float
|
|
190
|
+
timeout: float | tuple[float | None, float | None] | None = None,
|
|
216
191
|
verify: bool | str = True,
|
|
217
192
|
cert: bytes | str | tuple[bytes | str, bytes | str] | None = None,
|
|
218
193
|
proxies: Mapping[str, str] | None = None,
|
|
@@ -275,10 +250,10 @@ class _SSLContextAdapterMixin:
|
|
|
275
250
|
maxsize: int,
|
|
276
251
|
block: bool = DEFAULT_POOLBLOCK,
|
|
277
252
|
**pool_kwargs: Any,
|
|
278
|
-
) ->
|
|
253
|
+
) -> None:
|
|
279
254
|
if self._ssl_context is not None:
|
|
280
255
|
pool_kwargs.setdefault("ssl_context", self._ssl_context)
|
|
281
|
-
|
|
256
|
+
super().init_poolmanager( # type: ignore[misc]
|
|
282
257
|
connections=connections,
|
|
283
258
|
maxsize=maxsize,
|
|
284
259
|
block=block,
|
|
@@ -290,7 +265,12 @@ class _SSLContextAdapterMixin:
|
|
|
290
265
|
# context here too. https://github.com/pypa/pip/issues/13288
|
|
291
266
|
if self._ssl_context is not None:
|
|
292
267
|
proxy_kwargs.setdefault("ssl_context", self._ssl_context)
|
|
293
|
-
|
|
268
|
+
# For HTTPS proxies, urllib3 also opens a separate TLS connection
|
|
269
|
+
# to the proxy itself (before tunnelling to the destination) and
|
|
270
|
+
# uses "proxy_ssl_context" for that handshake.
|
|
271
|
+
# https://github.com/pypa/pip/issues/13465
|
|
272
|
+
proxy_kwargs.setdefault("proxy_ssl_context", self._ssl_context)
|
|
273
|
+
return super().proxy_manager_for(proxy, **proxy_kwargs) # type: ignore[misc]
|
|
294
274
|
|
|
295
275
|
|
|
296
276
|
class HTTPAdapter(_SSLContextAdapterMixin, _BaseHTTPAdapter):
|
|
@@ -335,6 +315,7 @@ class PipSession(requests.Session):
|
|
|
335
315
|
trusted_hosts: Sequence[str] = (),
|
|
336
316
|
index_urls: list[str] | None = None,
|
|
337
317
|
ssl_context: SSLContext | None = None,
|
|
318
|
+
refresh_package: set[str] | None = None,
|
|
338
319
|
**kwargs: Any,
|
|
339
320
|
) -> None:
|
|
340
321
|
"""
|
|
@@ -346,7 +327,10 @@ class PipSession(requests.Session):
|
|
|
346
327
|
# Namespace the attribute with "pip_" just in case to prevent
|
|
347
328
|
# possible conflicts with the base class.
|
|
348
329
|
self.pip_trusted_origins: list[tuple[str, int | None]] = []
|
|
349
|
-
|
|
330
|
+
# "" disables proxying; None means no --proxy was given.
|
|
331
|
+
self.pip_proxy: str | None = None
|
|
332
|
+
self.pip_no_proxy_env = False
|
|
333
|
+
self.refresh_package: set[str] = refresh_package or set()
|
|
350
334
|
|
|
351
335
|
# Attach our User Agent to the request
|
|
352
336
|
self.headers["User-Agent"] = user_agent()
|
|
@@ -534,4 +518,15 @@ class PipSession(requests.Session):
|
|
|
534
518
|
kwargs.setdefault("proxies", self.proxies)
|
|
535
519
|
|
|
536
520
|
# Dispatch the actual request
|
|
537
|
-
|
|
521
|
+
try:
|
|
522
|
+
return super().request(method, url, *args, **kwargs)
|
|
523
|
+
except (requests.ConnectionError, requests.Timeout) as e:
|
|
524
|
+
request = getattr(e, "request", None)
|
|
525
|
+
failed_url = getattr(request, "url", None) or url
|
|
526
|
+
raise_connection_error(e, url=failed_url, timeout=kwargs["timeout"])
|
|
527
|
+
except ImportError as e:
|
|
528
|
+
if "ssl" in str(e).lower():
|
|
529
|
+
# Unfortunately, if this TLS error was the result of a redirect from
|
|
530
|
+
# a HTTP to a HTTPS url, we don't know what the final url was.
|
|
531
|
+
raise SSLMissingError(redact_auth_from_url(url))
|
|
532
|
+
raise
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
from collections.abc import Generator
|
|
2
|
+
from typing import Literal, NoReturn, TypeAlias, cast
|
|
3
|
+
from urllib.parse import urlsplit
|
|
2
4
|
|
|
5
|
+
from pip._vendor import requests, urllib3
|
|
3
6
|
from pip._vendor.requests.models import Response
|
|
7
|
+
from pip._vendor.urllib3.exceptions import TimeoutStateError
|
|
4
8
|
|
|
5
|
-
from pip._internal.exceptions import
|
|
9
|
+
from pip._internal.exceptions import (
|
|
10
|
+
ConnectionFailedError,
|
|
11
|
+
ConnectionTimeoutError,
|
|
12
|
+
NetworkConnectionError,
|
|
13
|
+
ProxyConnectionError,
|
|
14
|
+
SSLVerificationError,
|
|
15
|
+
)
|
|
16
|
+
from pip._internal.utils.misc import redact_auth_from_url
|
|
17
|
+
|
|
18
|
+
TimeoutValue: TypeAlias = (
|
|
19
|
+
float | tuple[float | None, float | None] | urllib3.util.Timeout | None
|
|
20
|
+
)
|
|
6
21
|
|
|
7
22
|
# The following comments and HTTP headers were originally added by
|
|
8
23
|
# Donald Stufft in git commit 22c562429a61bb77172039e480873fb239dd8c03.
|
|
@@ -96,3 +111,96 @@ def response_chunks(
|
|
|
96
111
|
if not chunk:
|
|
97
112
|
break
|
|
98
113
|
yield chunk
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def _parse_timeout(timeout: TimeoutValue, kind: Literal["connect", "read"]) -> float:
|
|
117
|
+
connect_timeout: float | None
|
|
118
|
+
read_timeout: float | None
|
|
119
|
+
if isinstance(timeout, tuple):
|
|
120
|
+
connect_timeout, read_timeout = timeout
|
|
121
|
+
elif isinstance(timeout, urllib3.util.Timeout):
|
|
122
|
+
connect_timeout = cast(float | None, timeout.connect_timeout)
|
|
123
|
+
try:
|
|
124
|
+
read_timeout = timeout.read_timeout
|
|
125
|
+
except TimeoutStateError:
|
|
126
|
+
read_timeout = None
|
|
127
|
+
else:
|
|
128
|
+
connect_timeout = read_timeout = timeout
|
|
129
|
+
|
|
130
|
+
if kind == "connect":
|
|
131
|
+
assert connect_timeout is not None
|
|
132
|
+
return connect_timeout
|
|
133
|
+
else:
|
|
134
|
+
assert read_timeout is not None
|
|
135
|
+
return read_timeout
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def _raise_timeout_error(
|
|
139
|
+
reason: urllib3.exceptions.TimeoutError,
|
|
140
|
+
url: str,
|
|
141
|
+
host: str,
|
|
142
|
+
timeout: TimeoutValue,
|
|
143
|
+
) -> NoReturn:
|
|
144
|
+
if isinstance(reason, urllib3.exceptions.ConnectTimeoutError):
|
|
145
|
+
raise ConnectionTimeoutError(
|
|
146
|
+
url, host, kind="connect", timeout=_parse_timeout(timeout, "connect")
|
|
147
|
+
)
|
|
148
|
+
else:
|
|
149
|
+
raise ConnectionTimeoutError(
|
|
150
|
+
url, host, kind="read", timeout=_parse_timeout(timeout, "read")
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def raise_connection_error(
|
|
155
|
+
error: requests.ConnectionError | requests.Timeout,
|
|
156
|
+
*,
|
|
157
|
+
url: str,
|
|
158
|
+
timeout: TimeoutValue,
|
|
159
|
+
) -> NoReturn:
|
|
160
|
+
"""Raise a specific error for a given connection error, if possible.
|
|
161
|
+
|
|
162
|
+
Note: requests.ConnectionError is the parent class of
|
|
163
|
+
requests.ProxyError, requests.SSLError, and requests.ConnectTimeout
|
|
164
|
+
so these errors are also handled here.
|
|
165
|
+
"""
|
|
166
|
+
url = redact_auth_from_url(url)
|
|
167
|
+
raw_hostname = urlsplit(url).hostname or urlsplit(url).netloc
|
|
168
|
+
reason = error.args[0] if error.args else error
|
|
169
|
+
|
|
170
|
+
# NewConnectionError is a subclass of TimeoutError for some reason...
|
|
171
|
+
if isinstance(reason, urllib3.exceptions.TimeoutError) and not isinstance(
|
|
172
|
+
reason, urllib3.exceptions.NewConnectionError
|
|
173
|
+
):
|
|
174
|
+
# A bare timeout error can occur during non-streamed responses. Don't
|
|
175
|
+
# ask me how.
|
|
176
|
+
_raise_timeout_error(reason, url, raw_hostname, timeout)
|
|
177
|
+
if isinstance(reason, urllib3.exceptions.SSLError):
|
|
178
|
+
# A bare SSL error can occur during non-streamed responses, after the
|
|
179
|
+
# initial connection and TLS handshake have completed.
|
|
180
|
+
raise SSLVerificationError(url, raw_hostname, reason)
|
|
181
|
+
|
|
182
|
+
# At this point, all errors should be wrapped in MaxRetryError.
|
|
183
|
+
if not isinstance(reason, urllib3.exceptions.MaxRetryError):
|
|
184
|
+
raise ConnectionFailedError(url, raw_hostname, reason)
|
|
185
|
+
|
|
186
|
+
max_retry_error = reason
|
|
187
|
+
assert isinstance(max_retry_error.pool, urllib3.connectionpool.HTTPConnectionPool)
|
|
188
|
+
host = max_retry_error.pool.host
|
|
189
|
+
proxy = max_retry_error.pool.proxy
|
|
190
|
+
# Narrow the reason further to the specific error from the last retry.
|
|
191
|
+
reason = max_retry_error.reason
|
|
192
|
+
|
|
193
|
+
if isinstance(reason, urllib3.exceptions.SSLError):
|
|
194
|
+
raise SSLVerificationError(url, host, reason)
|
|
195
|
+
if isinstance(reason, urllib3.exceptions.TimeoutError) and not isinstance(
|
|
196
|
+
reason, urllib3.exceptions.NewConnectionError
|
|
197
|
+
):
|
|
198
|
+
_raise_timeout_error(reason, url, host, timeout)
|
|
199
|
+
if isinstance(reason, urllib3.exceptions.ProxyError):
|
|
200
|
+
assert proxy is not None
|
|
201
|
+
raise ProxyConnectionError(url, redact_auth_from_url(str(proxy)), reason)
|
|
202
|
+
|
|
203
|
+
# Unknown error, give up and raise a generic error.
|
|
204
|
+
raise ConnectionFailedError(
|
|
205
|
+
url, host, reason if isinstance(reason, Exception) else max_retry_error
|
|
206
|
+
)
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
|
-
from collections.abc import Generator, Iterable
|
|
6
|
+
from collections.abc import Callable, Generator, Iterable
|
|
7
7
|
from contextlib import suppress
|
|
8
8
|
from email.parser import Parser
|
|
9
9
|
from functools import reduce
|
|
10
10
|
from typing import (
|
|
11
|
-
Callable,
|
|
12
11
|
NamedTuple,
|
|
13
12
|
)
|
|
14
13
|
|
|
@@ -168,7 +167,7 @@ def _create_whitelist(
|
|
|
168
167
|
continue
|
|
169
168
|
|
|
170
169
|
for req in package_set[package_name].dependencies:
|
|
171
|
-
if canonicalize_name(req.name) in
|
|
170
|
+
if canonicalize_name(req.name) in would_be_installed:
|
|
172
171
|
packages_affected.add(package_name)
|
|
173
172
|
break
|
|
174
173
|
|
|
@@ -15,17 +15,16 @@ import sys
|
|
|
15
15
|
import textwrap
|
|
16
16
|
import warnings
|
|
17
17
|
from base64 import urlsafe_b64encode
|
|
18
|
-
from collections.abc import Generator, Iterable, Iterator, Sequence
|
|
18
|
+
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
|
|
19
19
|
from email.message import Message
|
|
20
20
|
from itertools import chain, filterfalse, starmap
|
|
21
|
+
from pathlib import Path
|
|
21
22
|
from typing import (
|
|
22
23
|
IO,
|
|
23
24
|
Any,
|
|
24
25
|
BinaryIO,
|
|
25
|
-
Callable,
|
|
26
26
|
NewType,
|
|
27
27
|
Protocol,
|
|
28
|
-
Union,
|
|
29
28
|
cast,
|
|
30
29
|
)
|
|
31
30
|
from zipfile import ZipFile, ZipInfo
|
|
@@ -66,7 +65,7 @@ class File(Protocol):
|
|
|
66
65
|
logger = logging.getLogger(__name__)
|
|
67
66
|
|
|
68
67
|
RecordPath = NewType("RecordPath", str)
|
|
69
|
-
InstalledCSVRow = tuple[RecordPath, str,
|
|
68
|
+
InstalledCSVRow = tuple[RecordPath, str, int | str]
|
|
70
69
|
|
|
71
70
|
|
|
72
71
|
def rehash(path: str, blocksize: int = 1 << 20) -> tuple[str, str]:
|
|
@@ -127,26 +126,24 @@ def message_about_scripts_not_on_PATH(scripts: Sequence[str]) -> str | None:
|
|
|
127
126
|
return None
|
|
128
127
|
|
|
129
128
|
# Group scripts by the path they were installed in
|
|
130
|
-
grouped_by_dir: dict[
|
|
129
|
+
grouped_by_dir: dict[Path, set[str]] = collections.defaultdict(set)
|
|
131
130
|
for destfile in scripts:
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
dest_path = Path(destfile)
|
|
132
|
+
parent_dir = dest_path.parent.resolve()
|
|
133
|
+
script_name = dest_path.name
|
|
134
134
|
grouped_by_dir[parent_dir].add(script_name)
|
|
135
135
|
|
|
136
136
|
# We don't want to warn for directories that are on PATH.
|
|
137
137
|
not_warn_dirs = [
|
|
138
|
-
|
|
139
|
-
for i in os.environ.get("PATH", "").split(os.pathsep)
|
|
138
|
+
Path(i).resolve() for i in os.environ.get("PATH", "").split(os.pathsep)
|
|
140
139
|
]
|
|
141
140
|
# If an executable sits with sys.executable, we don't warn for it.
|
|
142
141
|
# This covers the case of venv invocations without activating the venv.
|
|
143
|
-
not_warn_dirs.append(
|
|
144
|
-
|
|
145
|
-
)
|
|
146
|
-
warn_for: dict[str, set[str]] = {
|
|
142
|
+
not_warn_dirs.append(Path(sys.executable).parent.resolve())
|
|
143
|
+
warn_for: dict[Path, set[str]] = {
|
|
147
144
|
parent_dir: scripts
|
|
148
145
|
for parent_dir, scripts in grouped_by_dir.items()
|
|
149
|
-
if
|
|
146
|
+
if parent_dir not in not_warn_dirs
|
|
150
147
|
}
|
|
151
148
|
if not warn_for:
|
|
152
149
|
return None
|
|
@@ -420,15 +417,13 @@ def _raise_for_invalid_entrypoint(specification: str, scripts_dir: str) -> None:
|
|
|
420
417
|
class PipScriptMaker(ScriptMaker):
|
|
421
418
|
# Override distlib's default script template with one that
|
|
422
419
|
# doesn't import `re` module, allowing scripts to load faster.
|
|
423
|
-
script_template = textwrap.dedent(
|
|
424
|
-
"""\
|
|
420
|
+
script_template = textwrap.dedent("""\
|
|
425
421
|
import sys
|
|
426
422
|
from %(module)s import %(import_name)s
|
|
427
423
|
if __name__ == '__main__':
|
|
428
424
|
sys.argv[0] = sys.argv[0].removesuffix('.exe')
|
|
429
425
|
sys.exit(%(func)s())
|
|
430
|
-
"""
|
|
431
|
-
)
|
|
426
|
+
""")
|
|
432
427
|
|
|
433
428
|
def make(
|
|
434
429
|
self, specification: str, options: dict[str, Any] | None = None
|
|
@@ -446,6 +441,7 @@ def _install_wheel( # noqa: C901, PLR0915 function is too long
|
|
|
446
441
|
warn_script_location: bool = True,
|
|
447
442
|
direct_url: DirectUrl | None = None,
|
|
448
443
|
requested: bool = False,
|
|
444
|
+
script_executable: str | None = None,
|
|
449
445
|
) -> None:
|
|
450
446
|
"""Install a wheel.
|
|
451
447
|
|
|
@@ -457,6 +453,7 @@ def _install_wheel( # noqa: C901, PLR0915 function is too long
|
|
|
457
453
|
:param pycompile: Whether to byte-compile installed Python files
|
|
458
454
|
:param warn_script_location: Whether to check that scripts are installed
|
|
459
455
|
into a directory on PATH
|
|
456
|
+
:param script_executable: Python executable to use for console scripts
|
|
460
457
|
:raises UnsupportedWheel:
|
|
461
458
|
* when the directory holds an unpacked wheel with incompatible
|
|
462
459
|
Wheel-Version
|
|
@@ -645,6 +642,12 @@ def _install_wheel( # noqa: C901, PLR0915 function is too long
|
|
|
645
642
|
|
|
646
643
|
maker = PipScriptMaker(None, scheme.scripts)
|
|
647
644
|
|
|
645
|
+
# Embed the target environment's interpreter in console-script launchers
|
|
646
|
+
# rather than the one running pip, so an in-process install into another
|
|
647
|
+
# environment (e.g. a venv build environment) produces working launchers.
|
|
648
|
+
if script_executable is not None:
|
|
649
|
+
maker.executable = script_executable # type: ignore # it's untyped in distlib
|
|
650
|
+
|
|
648
651
|
# Ensure old scripts are overwritten.
|
|
649
652
|
# See https://github.com/pypa/pip/issues/1800
|
|
650
653
|
maker.clobber = True
|
|
@@ -744,6 +747,7 @@ def install_wheel(
|
|
|
744
747
|
warn_script_location: bool = True,
|
|
745
748
|
direct_url: DirectUrl | None = None,
|
|
746
749
|
requested: bool = False,
|
|
750
|
+
script_executable: str | None = None,
|
|
747
751
|
) -> None:
|
|
748
752
|
with ZipFile(wheel_path, allowZip64=True) as z:
|
|
749
753
|
with req_error_context(req_description):
|
|
@@ -756,4 +760,5 @@ def install_wheel(
|
|
|
756
760
|
warn_script_location=warn_script_location,
|
|
757
761
|
direct_url=direct_url,
|
|
758
762
|
requested=requested,
|
|
763
|
+
script_executable=script_executable,
|
|
759
764
|
)
|
|
@@ -12,9 +12,10 @@ from dataclasses import dataclass
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from typing import TYPE_CHECKING
|
|
14
14
|
|
|
15
|
+
from pip._vendor.packaging.requirements import InvalidRequirement
|
|
15
16
|
from pip._vendor.packaging.utils import canonicalize_name
|
|
16
17
|
|
|
17
|
-
from pip._internal.build_env import BuildEnvironmentInstaller
|
|
18
|
+
from pip._internal.build_env import BuildEnvironmentInstaller, BuildIsolationMode
|
|
18
19
|
from pip._internal.distributions import make_distribution_for_install_requirement
|
|
19
20
|
from pip._internal.distributions.installed import InstalledDistribution
|
|
20
21
|
from pip._internal.exceptions import (
|
|
@@ -23,13 +24,15 @@ from pip._internal.exceptions import (
|
|
|
23
24
|
HashUnpinned,
|
|
24
25
|
InstallationError,
|
|
25
26
|
MetadataInconsistent,
|
|
27
|
+
MetadataInvalid,
|
|
26
28
|
NetworkConnectionError,
|
|
29
|
+
SidecarMetadataInconsistent,
|
|
27
30
|
VcsHashUnsupported,
|
|
28
31
|
)
|
|
29
32
|
from pip._internal.index.package_finder import PackageFinder
|
|
30
33
|
from pip._internal.metadata import BaseDistribution, get_metadata_distribution
|
|
31
34
|
from pip._internal.models.direct_url import ArchiveInfo, DirectUrl
|
|
32
|
-
from pip._internal.models.link import Link
|
|
35
|
+
from pip._internal.models.link import Link, join_within_directory
|
|
33
36
|
from pip._internal.models.wheel import Wheel
|
|
34
37
|
from pip._internal.network.download import Downloader
|
|
35
38
|
from pip._internal.network.lazy_wheel import (
|
|
@@ -52,6 +55,7 @@ from pip._internal.utils.misc import (
|
|
|
52
55
|
hide_url,
|
|
53
56
|
redact_auth_from_requirement,
|
|
54
57
|
)
|
|
58
|
+
from pip._internal.utils.packaging import get_requirement
|
|
55
59
|
from pip._internal.utils.temp_dir import TempDirectory
|
|
56
60
|
from pip._internal.utils.unpacking import unpack_file
|
|
57
61
|
from pip._internal.vcs import vcs
|
|
@@ -66,8 +70,9 @@ def _get_prepared_distribution(
|
|
|
66
70
|
req: InstallRequirement,
|
|
67
71
|
build_tracker: BuildTracker,
|
|
68
72
|
build_env_installer: BuildEnvironmentInstaller,
|
|
69
|
-
build_isolation:
|
|
73
|
+
build_isolation: BuildIsolationMode,
|
|
70
74
|
check_build_deps: bool,
|
|
75
|
+
allow_editables: bool,
|
|
71
76
|
) -> BaseDistribution:
|
|
72
77
|
"""Prepare a distribution for installation."""
|
|
73
78
|
abstract_dist = make_distribution_for_install_requirement(req)
|
|
@@ -75,7 +80,7 @@ def _get_prepared_distribution(
|
|
|
75
80
|
if tracker_id is not None:
|
|
76
81
|
with build_tracker.track(req, tracker_id):
|
|
77
82
|
abstract_dist.prepare_distribution_metadata(
|
|
78
|
-
build_env_installer, build_isolation, check_build_deps
|
|
83
|
+
build_env_installer, build_isolation, check_build_deps, allow_editables
|
|
79
84
|
)
|
|
80
85
|
return abstract_dist.get_metadata_distribution()
|
|
81
86
|
|
|
@@ -201,7 +206,7 @@ def _check_download_dir(
|
|
|
201
206
|
"""Check download_dir for previously downloaded file with correct hash
|
|
202
207
|
If a correct file is found return its path else None
|
|
203
208
|
"""
|
|
204
|
-
download_path =
|
|
209
|
+
download_path = join_within_directory(download_dir, link.filename)
|
|
205
210
|
|
|
206
211
|
if not os.path.exists(download_path):
|
|
207
212
|
return None
|
|
@@ -222,6 +227,118 @@ def _check_download_dir(
|
|
|
222
227
|
return download_path
|
|
223
228
|
|
|
224
229
|
|
|
230
|
+
def _canonicalize_requirement(raw: str) -> str:
|
|
231
|
+
"""Return a normalized form of a PEP 508 requirement string.
|
|
232
|
+
|
|
233
|
+
Used to compare ``Requires-Dist`` entries from two sources of metadata
|
|
234
|
+
for the same distribution without being confused by superficial
|
|
235
|
+
differences in name casing, extra casing, or extras ordering. May raise
|
|
236
|
+
``InvalidRequirement`` if ``raw`` is not a valid PEP 508 string.
|
|
237
|
+
|
|
238
|
+
TODO: once https://github.com/pypa/packaging/pull/1278 is released and
|
|
239
|
+
vendored, ``Requirement.__eq__`` will canonicalize requested extras and
|
|
240
|
+
this manual normalization can be dropped in favour of comparing
|
|
241
|
+
``Requirement`` objects directly.
|
|
242
|
+
"""
|
|
243
|
+
parsed = get_requirement(raw)
|
|
244
|
+
parts: list[str] = [canonicalize_name(parsed.name)]
|
|
245
|
+
if parsed.extras:
|
|
246
|
+
normalized_extras = sorted(canonicalize_name(e) for e in parsed.extras)
|
|
247
|
+
parts.append(f"[{','.join(normalized_extras)}]")
|
|
248
|
+
if parsed.specifier:
|
|
249
|
+
parts.append(str(parsed.specifier))
|
|
250
|
+
if parsed.url:
|
|
251
|
+
parts.append(f" @ {parsed.url}")
|
|
252
|
+
if parsed.marker:
|
|
253
|
+
parts.append(f"; {parsed.marker}")
|
|
254
|
+
return "".join(parts)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def _canonical_requires(
|
|
258
|
+
req: InstallRequirement, dist: BaseDistribution, source: str
|
|
259
|
+
) -> frozenset[str]:
|
|
260
|
+
"""Return the canonicalized ``Requires-Dist`` entries of ``dist``.
|
|
261
|
+
|
|
262
|
+
``source`` describes which metadata file ``dist`` was parsed from, for
|
|
263
|
+
use in error messages.
|
|
264
|
+
"""
|
|
265
|
+
canonical: set[str] = set()
|
|
266
|
+
for raw in dist.iter_raw_dependencies():
|
|
267
|
+
try:
|
|
268
|
+
# strip() because a folded metadata header may be returned
|
|
269
|
+
# with a leading newline; iter_dependencies() strips for the
|
|
270
|
+
# same reason.
|
|
271
|
+
canonical.add(_canonicalize_requirement(raw.strip()))
|
|
272
|
+
except InvalidRequirement as e:
|
|
273
|
+
raise MetadataInvalid(req, f"Requires-Dist in {source}: {e}")
|
|
274
|
+
return frozenset(canonical)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def _check_sidecar_matches_wheel(
|
|
278
|
+
req: InstallRequirement,
|
|
279
|
+
sidecar_dist: BaseDistribution,
|
|
280
|
+
wheel_dist: BaseDistribution,
|
|
281
|
+
) -> None:
|
|
282
|
+
"""Check that a .metadata-based distribution matches the wheel's METADATA.
|
|
283
|
+
|
|
284
|
+
Compare ``Name``, ``Version``, ``Requires-Dist``, ``Requires-Python``
|
|
285
|
+
and ``Provides-Extra`` between the two and abort the install on any
|
|
286
|
+
mismatch as PEP 658 requires the metadata files "MUST be identical".
|
|
287
|
+
|
|
288
|
+
While the PEP doesn't mandate that consumers enforce the identical
|
|
289
|
+
requirement, it's good nonetheless to check to prevent confusing
|
|
290
|
+
behaviour when an index misbehaves.
|
|
291
|
+
|
|
292
|
+
Also note for name and version, pip usually rejects wheels if they're
|
|
293
|
+
inconsistent already. Checking them again here is purely defensive.
|
|
294
|
+
"""
|
|
295
|
+
|
|
296
|
+
sidecar_name = canonicalize_name(sidecar_dist.raw_name)
|
|
297
|
+
wheel_name = canonicalize_name(wheel_dist.raw_name)
|
|
298
|
+
if sidecar_name != wheel_name:
|
|
299
|
+
raise SidecarMetadataInconsistent(req, "Name", sidecar_name, wheel_name)
|
|
300
|
+
|
|
301
|
+
if sidecar_dist.version != wheel_dist.version:
|
|
302
|
+
raise SidecarMetadataInconsistent(
|
|
303
|
+
req,
|
|
304
|
+
"Version",
|
|
305
|
+
str(sidecar_dist.version),
|
|
306
|
+
str(wheel_dist.version),
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
# For multi-use fields, only report the symmetric difference to avoid
|
|
310
|
+
# unnecessarily flagging matching values.
|
|
311
|
+
sidecar_requires = _canonical_requires(
|
|
312
|
+
req, sidecar_dist, "the PEP 658 .metadata file"
|
|
313
|
+
)
|
|
314
|
+
wheel_requires = _canonical_requires(req, wheel_dist, "the wheel's METADATA")
|
|
315
|
+
if sidecar_requires != wheel_requires:
|
|
316
|
+
raise SidecarMetadataInconsistent(
|
|
317
|
+
req,
|
|
318
|
+
"Requires-Dist",
|
|
319
|
+
", ".join(sorted(sidecar_requires - wheel_requires)),
|
|
320
|
+
", ".join(sorted(wheel_requires - sidecar_requires)),
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
if sidecar_dist.requires_python != wheel_dist.requires_python:
|
|
324
|
+
raise SidecarMetadataInconsistent(
|
|
325
|
+
req,
|
|
326
|
+
"Requires-Python",
|
|
327
|
+
str(sidecar_dist.requires_python),
|
|
328
|
+
str(wheel_dist.requires_python),
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
sidecar_extras = frozenset(sidecar_dist.iter_provided_extras())
|
|
332
|
+
wheel_extras = frozenset(wheel_dist.iter_provided_extras())
|
|
333
|
+
if sidecar_extras != wheel_extras:
|
|
334
|
+
raise SidecarMetadataInconsistent(
|
|
335
|
+
req,
|
|
336
|
+
"Provides-Extra",
|
|
337
|
+
", ".join(sorted(sidecar_extras - wheel_extras)),
|
|
338
|
+
", ".join(sorted(wheel_extras - sidecar_extras)),
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
|
|
225
342
|
class RequirementPreparer:
|
|
226
343
|
"""Prepares a Requirement"""
|
|
227
344
|
|
|
@@ -231,7 +348,7 @@ class RequirementPreparer:
|
|
|
231
348
|
build_dir: str,
|
|
232
349
|
download_dir: str | None,
|
|
233
350
|
src_dir: str,
|
|
234
|
-
build_isolation:
|
|
351
|
+
build_isolation: BuildIsolationMode,
|
|
235
352
|
build_isolation_installer: BuildEnvironmentInstaller,
|
|
236
353
|
check_build_deps: bool,
|
|
237
354
|
build_tracker: BuildTracker,
|
|
@@ -243,6 +360,7 @@ class RequirementPreparer:
|
|
|
243
360
|
lazy_wheel: bool,
|
|
244
361
|
verbosity: int,
|
|
245
362
|
legacy_resolver: bool,
|
|
363
|
+
allow_editables: bool,
|
|
246
364
|
) -> None:
|
|
247
365
|
super().__init__()
|
|
248
366
|
|
|
@@ -285,6 +403,10 @@ class RequirementPreparer:
|
|
|
285
403
|
# Previous "header" printed for a link-based InstallRequirement
|
|
286
404
|
self._previous_requirement_header = ("", "")
|
|
287
405
|
|
|
406
|
+
# Do we allow preparing editable wheels?
|
|
407
|
+
# When using pip wheel, editables must still produce regular wheels
|
|
408
|
+
self.allow_editables = allow_editables
|
|
409
|
+
|
|
288
410
|
def _log_preparing_link(self, req: InstallRequirement) -> None:
|
|
289
411
|
"""Provide context for the requirement being prepared."""
|
|
290
412
|
if req.link.is_file and not req.is_wheel_from_cache:
|
|
@@ -664,7 +786,29 @@ class RequirementPreparer:
|
|
|
664
786
|
self.build_env_installer,
|
|
665
787
|
self.build_isolation,
|
|
666
788
|
self.check_build_deps,
|
|
789
|
+
self.allow_editables,
|
|
667
790
|
)
|
|
791
|
+
|
|
792
|
+
# If a PEP 658 .metadata file was used, check that fields relevant for
|
|
793
|
+
# dependency resolution match with the wheel's METADATA file.
|
|
794
|
+
#
|
|
795
|
+
# NOTE: PEP 658 also permits .metadata files for source distributions,
|
|
796
|
+
# but PyPI doesn't serve such files. In addition, an sdist's metadata
|
|
797
|
+
# is generated at build time and may legitimately differ from what the
|
|
798
|
+
# index declared, so it's been decided to skip this check for sdists.
|
|
799
|
+
# This can change later if needed.
|
|
800
|
+
#
|
|
801
|
+
# TODO: this is a hack for checking whether a distribution is metadata-
|
|
802
|
+
# only or not. If/when we refactor distributions to delineate between
|
|
803
|
+
# metadata-only and concrete distributions, clean this up.
|
|
804
|
+
if (
|
|
805
|
+
link.is_wheel
|
|
806
|
+
and req._distribution is not None
|
|
807
|
+
and req._distribution is not dist
|
|
808
|
+
and link.metadata_link() is not None
|
|
809
|
+
):
|
|
810
|
+
_check_sidecar_matches_wheel(req, req._distribution, dist)
|
|
811
|
+
|
|
668
812
|
return dist
|
|
669
813
|
|
|
670
814
|
def save_linked_requirement(self, req: InstallRequirement) -> None:
|
|
@@ -687,7 +831,7 @@ class RequirementPreparer:
|
|
|
687
831
|
# No distribution was downloaded for this requirement.
|
|
688
832
|
return
|
|
689
833
|
|
|
690
|
-
download_location =
|
|
834
|
+
download_location = join_within_directory(self.download_dir, link.filename)
|
|
691
835
|
if not os.path.exists(download_location):
|
|
692
836
|
shutil.copy(req.local_file_path, download_location)
|
|
693
837
|
download_path = display_path(download_location)
|
|
@@ -720,6 +864,7 @@ class RequirementPreparer:
|
|
|
720
864
|
self.build_env_installer,
|
|
721
865
|
self.build_isolation,
|
|
722
866
|
self.check_build_deps,
|
|
867
|
+
self.allow_editables,
|
|
723
868
|
)
|
|
724
869
|
|
|
725
870
|
req.check_if_exists(self.use_user_site)
|
|
@@ -44,6 +44,7 @@ def install_given_reqs(
|
|
|
44
44
|
use_user_site: bool,
|
|
45
45
|
pycompile: bool,
|
|
46
46
|
progress_bar: BarType,
|
|
47
|
+
script_executable: str | None = None,
|
|
47
48
|
) -> list[InstallationResult]:
|
|
48
49
|
"""
|
|
49
50
|
Install everything in the given list.
|
|
@@ -88,6 +89,7 @@ def install_given_reqs(
|
|
|
88
89
|
warn_script_location=warn_script_location,
|
|
89
90
|
use_user_site=use_user_site,
|
|
90
91
|
pycompile=pycompile,
|
|
92
|
+
script_executable=script_executable,
|
|
91
93
|
)
|
|
92
94
|
except Exception:
|
|
93
95
|
# if install did not succeed, rollback previous uninstall
|