diff --git a/eng/pipelines/templates/stages/python-analyze-weekly.yml b/eng/pipelines/templates/stages/python-analyze-weekly.yml index 06976f300a98..d736f8a2382b 100644 --- a/eng/pipelines/templates/stages/python-analyze-weekly.yml +++ b/eng/pipelines/templates/stages/python-analyze-weekly.yml @@ -28,16 +28,16 @@ stages: os: linux steps: - - task: UsePythonVersion@0 - displayName: 'Use Python 3.10' - inputs: + - template: /eng/pipelines/templates/steps/use-python-version.yml + parameters: versionSpec: '3.10' # Authenticate pip to the configured Azure DevOps feed before installs. - - template: /eng/pipelines/templates/steps/auth-dev-feed.yml + - template: /eng/common/pipelines/templates/steps/python-auth-dev-feed.yml parameters: DevFeedName: ${{ parameters.DevFeedName }} EnableTwineAuth: false + DisableAdditionalIndexes : true - script: | python -m pip install -r eng/ci_tools.txt @@ -102,9 +102,8 @@ stages: GH_TOKEN: $(GH_TOKEN) SYSTEM_ACCESSTOKEN: $(System.AccessToken) - - task: UsePythonVersion@0 - displayName: 'Use Python 3.13 for docs generation' - inputs: + - template: /eng/pipelines/templates/steps/use-python-version.yml + parameters: versionSpec: '3.13' - script: | diff --git a/eng/tools/azure-sdk-tools/ci_tools/variables.py b/eng/tools/azure-sdk-tools/ci_tools/variables.py index 5732d3deb9f0..5a1d4dd658a9 100644 --- a/eng/tools/azure-sdk-tools/ci_tools/variables.py +++ b/eng/tools/azure-sdk-tools/ci_tools/variables.py @@ -102,7 +102,6 @@ def in_analyze_weekly() -> int: "VIRTUALENV_WHEEL": "0.45.1", "VIRTUALENV_PIP": "24.0", "VIRTUALENV_SETUPTOOLS": "75.3.2", - "PIP_EXTRA_INDEX_URL": "https://pypi.python.org/simple", # I haven't spent much time looking to see if a variable exists when invoking uv run. there might be one already that we can depend # on for get_pip_command adjustment. "IN_UV": "1", diff --git a/eng/tools/azure-sdk-tools/tests/test_variables.py b/eng/tools/azure-sdk-tools/tests/test_variables.py new file mode 100644 index 000000000000..a18582056a96 --- /dev/null +++ b/eng/tools/azure-sdk-tools/tests/test_variables.py @@ -0,0 +1,20 @@ +import os + +from ci_tools.variables import set_envvar_defaults + + +def test_set_envvar_defaults_does_not_add_public_pypi_extra_index(monkeypatch): + monkeypatch.delenv("PIP_EXTRA_INDEX_URL", raising=False) + + set_envvar_defaults() + + assert "PIP_EXTRA_INDEX_URL" not in os.environ + + +def test_set_envvar_defaults_preserves_explicit_extra_index(monkeypatch): + extra_index = "https://contoso.example/simple" + monkeypatch.setenv("PIP_EXTRA_INDEX_URL", extra_index) + + set_envvar_defaults() + + assert os.environ["PIP_EXTRA_INDEX_URL"] == extra_index \ No newline at end of file