From dcb6dc44292d94958d925cd466a404d99e60f865 Mon Sep 17 00:00:00 2001 From: nanxun Date: Wed, 12 Aug 2026 15:28:06 +0800 Subject: [PATCH] fix(ci): route all pip installs through mirror --- Jenkinsfile | 2 ++ tests/test_fnos_dependency_script.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 731a3d8..0e97771 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,6 +30,8 @@ pipeline { DOCKER_CONFIG = "${WORKSPACE}/.ci/docker" NPM_CONFIG_CACHE = "${WORKSPACE}/.ci/npm-cache" PIP_CACHE_DIR = "${WORKSPACE}/.ci/pip-cache" + PIP_INDEX_URL = 'https://pypi.tuna.tsinghua.edu.cn/simple' + PIP_DEFAULT_TIMEOUT = '60' IMAGEFIND_WHEEL_CACHE = "${WORKSPACE}/.ci/wheelhouse-python312" IMAGEFIND_DEPENDENCY_TMPDIR = "${WORKSPACE}/.ci/dependency-tmp" IMAGEFIND_VERIFY_TMPDIR = "${WORKSPACE}/.ci/fnos-verify" diff --git a/tests/test_fnos_dependency_script.py b/tests/test_fnos_dependency_script.py index 09ab4e2..2723186 100644 --- a/tests/test_fnos_dependency_script.py +++ b/tests/test_fnos_dependency_script.py @@ -6,3 +6,9 @@ def test_fnos_dependency_download_uses_fast_configurable_index() -> None: assert "PIP_INDEX_URL=${PIP_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple}" in script assert '--index-url "$PIP_INDEX_URL"' in script assert '--timeout "$PIP_TIMEOUT" --retries 4' in script + + +def test_jenkins_uses_fast_index_for_every_pip_stage() -> None: + pipeline = (Path(__file__).parents[1] / "Jenkinsfile").read_text() + assert "PIP_INDEX_URL = 'https://pypi.tuna.tsinghua.edu.cn/simple'" in pipeline + assert "PIP_DEFAULT_TIMEOUT = '60'" in pipeline