From b29ef723417ded6160b052a4624f699960c8e8f1 Mon Sep 17 00:00:00 2001 From: Fabio Cavalcante Date: Fri, 31 Jul 2026 10:09:48 -0700 Subject: [PATCH 1/3] Route dependency restores through CFS Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6f06eb55-0d68-4a60-90b2-c2205857238e --- .devcontainer/setup.sh | 5 +++-- .github/workflows/durable_python_action.yml | 3 +++ .github/workflows/validate.yml | 3 +++ CONTRIBUTING.md | 12 ++++++++++-- MANIFEST.in | 4 +++- NuGet.config | 12 ++++++++++++ azure-pipelines-release.yml | 5 +++++ azure-pipelines.yml | 11 ++++++++++- eng/templates/build.yml | 10 ++++++++++ noxfile.py | 16 +++++++++++++++- scripts/sample_deploy.sh | 19 ++++++++++++------- 11 files changed, 86 insertions(+), 14 deletions(-) create mode 100644 NuGet.config diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 3f7f8030..ff27f7ef 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash -pip install -r requirements.txt - +export PIP_INDEX_URL="https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/pypi/simple/" +unset PIP_EXTRA_INDEX_URL +pip install -r requirements.txt diff --git a/.github/workflows/durable_python_action.yml b/.github/workflows/durable_python_action.yml index 3336326d..989c6825 100644 --- a/.github/workflows/durable_python_action.yml +++ b/.github/workflows/durable_python_action.yml @@ -5,6 +5,9 @@ on: branches: - master +env: + PIP_INDEX_URL: https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/pypi/simple/ + jobs: build: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c17c702c..edc3c134 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,6 +10,9 @@ on: - main - dev +env: + PIP_INDEX_URL: https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/pypi/simple/ + jobs: validate: runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9bccaefe..2a1af3b8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,6 +56,15 @@ The general flow for making a change to the library is: ## Development Setup +Repository development dependency installs use the Central Feed Service: + +```bash +export PIP_INDEX_URL="https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/pypi/simple/" +unset PIP_EXTRA_INDEX_URL +``` + +The repository `NuGet.config` routes .NET package restores through the corresponding CFS feed. + ### Visual Studio Code Extensions The following extensions should be installed if using Visual Studio Code for debugging: @@ -119,7 +128,7 @@ Note: Conda based environments are not yet supported in Azure Functions. 6. For debugging, install the code using an editable pip install like this, in the VS Code Terminal: ``` -pip install -e $REPOSITORY_ROOT/ +pip install -e "$REPOSITORY_ROOT/" ``` where REPOSITORY_ROOT is the root folder of the azure-functions-durable-python repository @@ -186,4 +195,3 @@ This project uses a combination of Azure DevOps and GitHub Actions for CI/CD. ### Requesting a release - If you need a release into PyPI, request it by raising an issue and tagging @anthonychu or @davidmrdavid - diff --git a/MANIFEST.in b/MANIFEST.in index 82301549..26e30b7e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,3 @@ -include ./_manifest/* \ No newline at end of file +include ./_manifest/* +exclude NuGet.config +global-exclude .npmrc pip.conf pip.ini diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 00000000..93c7dc77 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml index 1e3da8eb..5e51db1f 100644 --- a/azure-pipelines-release.yml +++ b/azure-pipelines-release.yml @@ -15,6 +15,11 @@ jobs: demands: - ImageOverride -equals MMSUbuntu20.04TLS steps: + - task: PipAuthenticate@1 + displayName: "Authenticate to CFS PyPI feed" + inputs: + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: '3.10' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 526bd657..e45467ad 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,11 @@ stages: demands: - ImageOverride -equals MMSUbuntu20.04TLS steps: + - task: PipAuthenticate@1 + displayName: 'Authenticate to CFS PyPI feed' + inputs: + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' @@ -85,6 +90,11 @@ stages: demands: - ImageOverride -equals MMSUbuntu20.04TLS steps: + - task: PipAuthenticate@1 + displayName: 'Authenticate to CFS PyPI feed' + inputs: + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: '3.13' @@ -99,4 +109,3 @@ stages: pytest --ignore=samples-v2 displayName: 'pytest' - diff --git a/eng/templates/build.yml b/eng/templates/build.yml index 28aae81a..bb728fa1 100644 --- a/eng/templates/build.yml +++ b/eng/templates/build.yml @@ -10,6 +10,11 @@ jobs: sbomPackageName: 'Durable Functions Python' steps: + - task: PipAuthenticate@1 + displayName: 'Authenticate to CFS PyPI feed' + inputs: + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: '3.10' @@ -57,6 +62,11 @@ jobs: # TODO: change the override to 'azure-functions>=2.2.0' once 2.2.0 GA # ships, and drop the explicit install step. steps: + - task: PipAuthenticate@1 + displayName: 'Authenticate to CFS PyPI feed' + inputs: + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: '3.13' diff --git a/noxfile.py b/noxfile.py index 9b961fff..6ec68b75 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,5 +1,10 @@ import nox +CFS_PYPI_INDEX = ( + "https://pkgs.dev.azure.com/azfunc/public/" + "_packaging/upstream-public/pypi/simple/" +) + # Mirror the supported range exercised by CI (.github/workflows/validate.yml). # nox automatically skips interpreters that aren't installed locally. SUPPORTED_PYTHONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] @@ -10,8 +15,14 @@ CANONICAL_PYTHON = "3.10" +def use_cfs(session): + session.env["PIP_INDEX_URL"] = CFS_PYPI_INDEX + session.env.pop("PIP_EXTRA_INDEX_URL", None) + + @nox.session(python=SUPPORTED_PYTHONS) def tests(session): + use_cfs(session) # same as pip install -r -requirements.txt session.install("-r", "requirements.txt") session.install("pytest") @@ -20,17 +31,20 @@ def tests(session): @nox.session(python=CANONICAL_PYTHON) def lint(session): + use_cfs(session) session.install("flake8") session.install("flake8-docstrings") session.run("flake8", "./azure/") @nox.session(python=SUPPORTED_PYTHONS) def typecheck(session): + use_cfs(session) session.install("-r", "requirements.txt") session.install("mypy") session.run("mypy", "./azure/") @nox.session(python=CANONICAL_PYTHON) def autopep(session): + use_cfs(session) session.install("-r", "requirements.txt") - session.run("autopep8", "--in-place --aggressive --aggressive --recursive \"./azure/\"") \ No newline at end of file + session.run("autopep8", "--in-place --aggressive --aggressive --recursive \"./azure/\"") diff --git a/scripts/sample_deploy.sh b/scripts/sample_deploy.sh index 975ddb70..7fcca24e 100755 --- a/scripts/sample_deploy.sh +++ b/scripts/sample_deploy.sh @@ -1,4 +1,9 @@ - #!/bin/bash +#!/bin/bash + +REPOSITORY_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +CFS_PYPI_INDEX="https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/pypi/simple/" +export PIP_INDEX_URL="$CFS_PYPI_INDEX" +unset PIP_EXTRA_INDEX_URL echo "Checking for prerequisites..." if ! type npm > /dev/null; then @@ -21,21 +26,21 @@ echo "Pre-requisites satisfied..." echo "Creating sample folders..." DIRECTORY=/tmp/df_test if [ ! -d "$DIRECTORY" ]; then - mkdir /tmp/df_test + mkdir "$DIRECTORY" else - rm -rf /tmp/df_test/* + rm -rf "$DIRECTORY"/* fi SAMPLE=function_chaining -cp -r ../samples/$SAMPLE $DIRECTORY/ -cd $DIRECTORY/$SAMPLE +cp -r "$REPOSITORY_ROOT/samples/$SAMPLE" "$DIRECTORY/" +cp "$REPOSITORY_ROOT/NuGet.config" "$DIRECTORY/NuGet.config" +cd "$DIRECTORY/$SAMPLE" python -m venv env source env/bin/activate echo "Provide local path to azure-functions-durable-python clone:" read lib_path -pip install $lib_path/azure-functions-durable-python +pip install "$lib_path/azure-functions-durable-python" func init . func extensions install echo "Done" - From 72b8432e523146dac73efb65f7cbd7210c51842b Mon Sep 17 00:00:00 2001 From: Fabio Cavalcante Date: Fri, 31 Jul 2026 10:41:56 -0700 Subject: [PATCH 2/3] Preserve unauthenticated GitHub validation CFS requires Azure Artifacts credentials for uncached packages, but fork pull request workflows cannot access repository secrets. Keep GitHub validation on its existing public index while Azure Pipelines and repository tooling use authenticated CFS. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6f06eb55-0d68-4a60-90b2-c2205857238e --- .github/workflows/durable_python_action.yml | 3 --- .github/workflows/validate.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/durable_python_action.yml b/.github/workflows/durable_python_action.yml index 989c6825..3336326d 100644 --- a/.github/workflows/durable_python_action.yml +++ b/.github/workflows/durable_python_action.yml @@ -5,9 +5,6 @@ on: branches: - master -env: - PIP_INDEX_URL: https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/pypi/simple/ - jobs: build: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index edc3c134..c17c702c 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,9 +10,6 @@ on: - main - dev -env: - PIP_INDEX_URL: https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/pypi/simple/ - jobs: validate: runs-on: ubuntu-latest From a9c865393f7db765a42943cde092a4e3ddbd7390 Mon Sep 17 00:00:00 2001 From: Fabio Cavalcante Date: Fri, 31 Jul 2026 16:07:53 -0700 Subject: [PATCH 3/3] Remove redundant package source mapping Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6f06eb55-0d68-4a60-90b2-c2205857238e --- NuGet.config | 5 ----- 1 file changed, 5 deletions(-) diff --git a/NuGet.config b/NuGet.config index 93c7dc77..f4dcbc07 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,9 +4,4 @@ - - - - -