diff --git a/.ado/ci.yml b/.ado/ci.yml index b6b8707b..67fee63a 100644 --- a/.ado/ci.yml +++ b/.ado/ci.yml @@ -17,6 +17,14 @@ variables: value: none # Disable usage telemetry for internal test pipelines - name: PYTEST_MAX_PARALLEL_TESTS value: "auto" + # Azure Artifacts feed (with a PyPI upstream source) that pip restores from, so the + # build does not connect directly to public pypi.org / files.pythonhosted.org (CFS). + # Project-scoped: "/". + - name: PipFeed + value: "AzureQuantum/azure-quantum" + # Stop pip from contacting pypi.org for its "is there a newer pip?" self-check. + - name: PIP_DISABLE_PIP_VERSION_CHECK + value: "1" jobs: - job: "Build_Azure_Quantum_Python" @@ -30,6 +38,12 @@ jobs: versionSpec: "3.11" displayName: Set Python version + - task: PipAuthenticate@1 + displayName: Authenticate pip to Azure Artifacts feed + inputs: + artifactFeeds: $(PipFeed) + onlyAddExtraIndex: false + - script: | pip install wheel displayName: Install wheel @@ -59,6 +73,12 @@ jobs: versionSpec: "3.11" displayName: Set Python version + - task: PipAuthenticate@1 + displayName: Authenticate pip to Azure Artifacts feed + inputs: + artifactFeeds: $(PipFeed) + onlyAddExtraIndex: false + - script: | python -m pip install --upgrade pip pip install pytest pytest-azurepipelines pytest-cov pytest-xdist tox diff --git a/.ado/publish.yml b/.ado/publish.yml index 5914f451..63112b6c 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -44,6 +44,10 @@ variables: value: "auto" - name: PipFeed value: "AzureQuantum/azure-quantum" + # Stop pip from contacting pypi.org for its "is there a newer pip?" self-check. + # This version check ignores PIP_INDEX_URL and is a common lingering CFS offender. + - name: PIP_DISABLE_PIP_VERSION_CHECK + value: "1" resources: repositories: @@ -140,6 +144,7 @@ extends: - script: | cd $(Build.SourcesDirectory)/azure-quantum + python -c "import os, urllib.parse as u; h = u.urlsplit(os.environ.get('PIP_INDEX_URL', '')).hostname or '(unset -> default pypi.org)'; print('pip index host:', h)" tox -e py311-qiskit1,py311-qiskit2 displayName: Run Qiskit matrix tests diff --git a/azure-quantum/tox.ini b/azure-quantum/tox.ini index f17477b5..46835443 100644 --- a/azure-quantum/tox.ini +++ b/azure-quantum/tox.ini @@ -13,6 +13,13 @@ basepython = passenv = PIP_INDEX_URL PIP_EXTRA_INDEX_URL +# Explicitly re-assert the feed index inside each isolated environment. Relying on +# passenv alone proved unreliable (tox's inner pip fell back to pypi.org). The +# fallback keeps local dev working when PIP_INDEX_URL is unset. Also disable pip's +# pypi.org version self-check, which ignores the index URL. +setenv = + PIP_INDEX_URL = {env:PIP_INDEX_URL:https://pypi.org/simple} + PIP_DISABLE_PIP_VERSION_CHECK = 1 allowlist_externals = pytest deps = qiskit1: qiskit<2