1 Commits
Author SHA1 Message Date
hoywu 5b5b3e2f99 feat(setup): auto-detect available PyPI mirror for Linux install scripts
Linux one-click-start.sh and setup_backend_linux.sh previously installed
dependencies from the default PyPI source, which is often slow or blocked
in mainland China. Mirror the Windows pipeline's PyPI mirror behaviour by
probing well-known mirrors and falling back to the official source.

- New scripts/pypi_mirror.sh: ordered list of Tsinghua / Aliyun / USTC /
  Tencent / pypi.org; pypi_mirror_probe checks each with curl or wget
  (3s timeout); pypi_mirror_select returns the first reachable URL;
  ensure_pypi_mirror_pip_args sets PIP_ARGS=("-i" <url>) only when the
  caller has not already supplied --pip-arg. Reusable via 'source'.
- one-click-start.sh sources pypi_mirror.sh and calls
  ensure_pypi_mirror_pip_args before invoking the backend installer, so a
  bare one-click-start.sh on a CN host picks the fastest mirror.
- scripts/setup_backend_linux.sh does the same for direct invocations
  (e.g. ./scripts/setup_backend_linux.sh), with the same skip-if-pip-arg-
  set semantics. Header comment updated to document the behaviour.

Users who pass --pip-arg keep full control; everyone else gets a working
mirror automatically and the install no longer wedges on pypi.org.
2026-06-24 20:53:24 +08:00