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/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..f4dcbc07 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + 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" -