Python 与源码安装
本页由仓库原文构建生成。技术正文保留原文;版本要求、授权与限制以正文为准。
Preferred registry entry: Watt (1.6.7+).
python -m pip install "sap-watt>=1.6.7,<2" provides sap-watt and pins the
same-version sap-adt-cli core. Existing sap-adt calls/configuration remain
valid. In an environment containing both, update sap-watt rather than the
pinned core independently. Optional keystore, file and all extras remain
available. New branding does not change write/execution/debugging consent.
For developers and contributors. The general guide (channels, diagnostics matrix, version compatibility) is runtime-setup.md.
From a checkout
Section titled “From a checkout”python3 -m venv .venv.venv/bin/pip install -e ..venv/bin/sap-adt --versionpip install -e . gives sap-adt plus all commands; python -m sap_adt
works from an installed (also editable) package.
From a built artifact
Section titled “From a built artifact”python -m build # dist/sap_adt_cli-<ver>-py3-none-any.whl + .tar.gzpython tools/build_watt.py # dist/sap_watt-<ver> wheel + sdistpython -m pip install dist/sap_adt_cli-<ver>-py3-none-any.whlpython -m pip install dist/sap_watt-<ver>-py3-none-any.whl # optional new entryThe wheel carries the same implementation as the frozen runtime; both read
the version from package metadata, and none of them installs dependencies at
run time. Missing optional backends (keyring, cryptography) degrade the
keystore selection — sap-adt credentials doctor shows what is available.
Explicit updates (CLI 1.6.0+)
Section titled “Explicit updates (CLI 1.6.0+)”sap-adt update --check checks the newest stable release in the installed
major. For a recognized registry pip install, sap-adt update previews and
confirms an upgrade using that same Python interpreter; user installs keep
--user. pipx main packages use their owning pipx environment. --yes
explicitly approves automation; --major allows crossing major versions.
Completion requires a version readback.
Editable and direct-URL/wheel-file installs are not replaced with registry
packages: update the original source/artifact instead. Externally managed
Python is not bypassed. Unknown installers get guidance rather than a guessed
pip command. No SAP configuration/keystore is read or changed, and there is
no automatic rollback of pip/pipx operations.
Proxied networks
Section titled “Proxied networks”Python update checks now honor PIP_PROXY, then the current interpreter’s
pip configuration (install.proxy before global.proxy, including
PIP_CONFIG_FILE). Only these proxy keys are queried; full pip configuration
and registry credentials are not printed. Configuration resolution runs in
a separate process with a 10-second limit.
Without a pip proxy, Requests retains its normal environment/system proxy
discovery and direct-connection behavior. Frozen standalone checks do not
try to run pip. Proxy credentials are not included in error messages, and
TLS verification remains enabled; use REQUESTS_CA_BUNDLE when metadata
checks need a corporate CA. Package installation still uses pip/pipx’s own
network and certificate settings. These behaviors require CLI 1.6.0 or newer.
Failed installations and updates
Section titled “Failed installations and updates”Initial python -m pip install failures are reported by pip itself; see the
diagnostics matrix for proxy, CA,
permissions, disk and externally-managed Python remedies.
The updater classifies proxy authentication, TLS, connectivity,
permissions/file locks, disk space and unsupported tool/version failures.
Its error envelope includes a specific hint without dumping package-manager
output or credentials. A potentially modifying failure remains exit 3:
inspect first, then use the printed exact-version repair and verification
commands only if needed. Repairs retain the same interpreter, --user
scope or owning pipx environment/PIPX_HOME; none is run automatically.
Tests (local only)
Section titled “Tests (local only)”python -m unittest discover -s tests -vpython tests/check_contract.pynode --test packaging/npm/test/*.test.js