From c503bc77f22f53815bff3318d0dc7b3e98a95a3c Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Thu, 19 Mar 2026 14:38:51 -0500 Subject: [PATCH 1/3] prep release for v2 --- eng/ci/library-release.yml | 22 ++++++++- .../official/jobs/publish-release.yml | 46 +++++++++++++++---- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/eng/ci/library-release.yml b/eng/ci/library-release.yml index 278f85af..d8063926 100644 --- a/eng/ci/library-release.yml +++ b/eng/ci/library-release.yml @@ -16,6 +16,26 @@ extends: os: windows stages: - - stage: Release + - stage: ReleaseV1 + displayName: 'Release v1.x' jobs: - template: /eng/templates/official/jobs/publish-release.yml@self + parameters: + libraryVersion: $(NewLibraryVersionV1) + pythonVersionRequirement: '>=3.10' + pythonClassifiers: | + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12' + + - stage: ReleaseV2 + displayName: 'Release v2.x' + dependsOn: ReleaseV1 + jobs: + - template: /eng/templates/official/jobs/publish-release.yml@self + parameters: + libraryVersion: $(NewLibraryVersionV2) + pythonVersionRequirement: '>=3.13' + pythonClassifiers: | + 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14' diff --git a/eng/templates/official/jobs/publish-release.yml b/eng/templates/official/jobs/publish-release.yml index 12638d00..f9709f06 100644 --- a/eng/templates/official/jobs/publish-release.yml +++ b/eng/templates/official/jobs/publish-release.yml @@ -1,3 +1,11 @@ +parameters: + - name: libraryVersion + type: string + - name: pythonVersionRequirement + type: string + - name: pythonClassifiers + type: string + jobs: - job: "CreateReleaseBranch" @@ -9,7 +17,11 @@ jobs: steps: - powershell: | $githubToken = "$(GithubPat)" - $newLibraryVersion = "$(NewLibraryVersion)" + $newLibraryVersion = "${{ parameters.libraryVersion }}" + $pythonVersionRequirement = "${{ parameters.pythonVersionRequirement }}" + $pythonClassifiers = @" + ${{ parameters.pythonClassifiers }} + "@ if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') { # Create GitHub credential @@ -24,6 +36,20 @@ jobs: Write-Host "Change version number in azure/functions/__init__.py to $newLibraryVersion" ((Get-Content azure/functions/__init__.py) -replace "__version__ = '(\d)+.(\d)+.*'", "__version__ = '$newLibraryVersion'" -join "`n") + "`n" | Set-Content -NoNewline azure/functions/__init__.py git add azure/functions/__init__.py + + # Update pyproject.toml with Python version requirement + Write-Host "Updating pyproject.toml with Python version requirement: $pythonVersionRequirement" + $content = Get-Content pyproject.toml -Raw + $content = $content -replace 'requires-python = ">=[\d\.]+"', "requires-python = `"$pythonVersionRequirement`"" + + # Update Python classifiers + Write-Host "Updating Python classifiers in pyproject.toml" + $classifiersPattern = "(?s)('Programming Language :: Python :: \d\.\d+',\s*)+" + $content = $content -replace $classifiersPattern, "$pythonClassifiers,`n " + + $content | Set-Content -NoNewline pyproject.toml + git add pyproject.toml + git commit -m "build: update Python Library Version to $newLibraryVersion" # Create release branch release/X.Y.Z @@ -46,9 +72,9 @@ jobs: inputs: notifyUsers: '' # No email notifications sent instructions: | - 1. Check if the https://github.com/Azure/azure-functions-python-library/tree/release/$(NewLibraryVersion) build succeeds and passes all unit tests. - 2. If not, modify the release/$(NewLibraryVersion) branch. - 3. Ensure release/$(NewLibraryVersion) branch contains all necessary changes. + 1. Check if the https://github.com/Azure/azure-functions-python-library/tree/release/${{ parameters.libraryVersion }} build succeeds and passes all unit tests. + 2. If not, modify the release/${{ parameters.libraryVersion }} branch. + 3. Ensure release/${{ parameters.libraryVersion }} branch contains all necessary changes. - job: "CreateReleaseTag" dependsOn: ['CheckReleaseBranch'] @@ -56,7 +82,7 @@ jobs: steps: - powershell: | $githubToken = "$(GithubPat)" - $newLibraryVersion = "$(NewLibraryVersion)" + $newLibraryVersion = "${{ parameters.libraryVersion }}" if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') { # Create GitHub credential @@ -83,7 +109,7 @@ jobs: - pwsh: | $githubUser = "$(GithubUser)" $githubToken = "$(GithubPat)" - $newLibraryVersion = "$(NewLibraryVersion)" + $newLibraryVersion = "${{ parameters.libraryVersion }}" if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') { # Create GitHub credential @@ -126,7 +152,7 @@ jobs: - pwsh: | $githubUser = "$(GithubUser)" $githubToken = "$(GithubPat)" - $newLibraryVersion = "$(NewLibraryVersion)" + $newLibraryVersion = "${{ parameters.libraryVersion }}" $newBranch = "sdk/$newLibraryVersion" if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') { @@ -145,7 +171,7 @@ jobs: # Modify SDK Version in pyproject.toml Write-Host "Replacing SDK version in worker's pyproject.toml" - ((Get-Content workers/pyproject.toml) -replace '"azure-functions==[\d\.a-z]+; python_version >= ''3\.10''"','"azure-functions==$(NewLibraryVersion); python_version >= ''3.10''"' -join "`n") + "`n" | Set-Content -NoNewline workers/pyproject.toml + ((Get-Content workers/pyproject.toml) -replace '"azure-functions==[\d\.a-z]+; python_version >= ''3\.10''"','"azure-functions==${{ parameters.libraryVersion }}; python_version >= ''3.10''"' -join "`n") + "`n" | Set-Content -NoNewline workers/pyproject.toml # Commit Python Version Write-Host "Pushing $newBranch to azure-functions-python-worker repo" @@ -204,7 +230,7 @@ jobs: inputs: versionSpec: 3.11 - pwsh: | - $newLibraryVersion = "$(NewLibraryVersion)" + $newLibraryVersion = "${{ parameters.libraryVersion }}" $pypiToken = "$(PypiToken)" # Setup local Python environment @@ -233,7 +259,7 @@ jobs: steps: - powershell: | $githubToken = "$(GithubPat)" - $newLibraryVersion = "$(newLibraryVersion)" + $newLibraryVersion = "${{ parameters.libraryVersion }}" if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') { # Create GitHub credential From 046f3a538549630f7b978a9e1cab7012cbaf31e2 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Thu, 19 Mar 2026 14:49:07 -0500 Subject: [PATCH 2/3] fix worker PR step --- eng/templates/official/jobs/publish-release.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/eng/templates/official/jobs/publish-release.yml b/eng/templates/official/jobs/publish-release.yml index f9709f06..47590cdb 100644 --- a/eng/templates/official/jobs/publish-release.yml +++ b/eng/templates/official/jobs/publish-release.yml @@ -153,6 +153,7 @@ jobs: $githubUser = "$(GithubUser)" $githubToken = "$(GithubPat)" $newLibraryVersion = "${{ parameters.libraryVersion }}" + $pythonVersionRequirement = "${{ parameters.pythonVersionRequirement }}" $newBranch = "sdk/$newLibraryVersion" if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') { @@ -169,9 +170,18 @@ jobs: Set-Location "azure-functions-python-worker" git checkout -b $newBranch "origin/dev" - # Modify SDK Version in pyproject.toml - Write-Host "Replacing SDK version in worker's pyproject.toml" - ((Get-Content workers/pyproject.toml) -replace '"azure-functions==[\d\.a-z]+; python_version >= ''3\.10''"','"azure-functions==${{ parameters.libraryVersion }}; python_version >= ''3.10''"' -join "`n") + "`n" | Set-Content -NoNewline workers/pyproject.toml + # Modify SDK Version in pyproject.toml based on Python version requirement + Write-Host "Replacing SDK version in worker's pyproject.toml for Python requirement: $pythonVersionRequirement" + + if ($pythonVersionRequirement -match '>=3\.13') { + # Update version for Python 3.13+ + Write-Host "Updating azure-functions version for Python 3.13+" + ((Get-Content workers/pyproject.toml) -replace '"azure-functions==[\d\.a-z]+; python_version >= ''3\.13''"','"azure-functions==$newLibraryVersion; python_version >= ''3.13''"' -join "`n") + "`n" | Set-Content -NoNewline workers/pyproject.toml + } else { + # Update version for Python 3.10-3.12 + Write-Host "Updating azure-functions version for Python 3.10-3.12" + ((Get-Content workers/pyproject.toml) -replace '"azure-functions==[\d\.a-z]+; python_version >= ''3\.10'' and python_version < ''3\.13''"','"azure-functions==$newLibraryVersion; python_version >= ''3.10'' and python_version < ''3.13''"' -join "`n") + "`n" | Set-Content -NoNewline workers/pyproject.toml + } # Commit Python Version Write-Host "Pushing $newBranch to azure-functions-python-worker repo" From cb5e119420dc014930be00435ad4054dbf8c1d96 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Fri, 20 Mar 2026 11:49:17 -0500 Subject: [PATCH 3/3] feedback + support single release --- eng/ci/library-release.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/eng/ci/library-release.yml b/eng/ci/library-release.yml index d8063926..528f8041 100644 --- a/eng/ci/library-release.yml +++ b/eng/ci/library-release.yml @@ -1,5 +1,15 @@ pr: none +parameters: + - name: V1LibraryRelease + displayName: 'v1.x Library Release (3.10 - 3.12)' + type: boolean + default: false + - name: V2LibraryRelease + displayName: 'v2.x Library Release (3.13+)' + type: boolean + default: false + resources: repositories: - repository: 1es @@ -22,15 +32,17 @@ extends: - template: /eng/templates/official/jobs/publish-release.yml@self parameters: libraryVersion: $(NewLibraryVersionV1) - pythonVersionRequirement: '>=3.10' + pythonVersionRequirement: '>=3.10,<3.13' pythonClassifiers: | 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12' + condition: eq(${{ parameters.V1LibraryRelease }}, True) - stage: ReleaseV2 displayName: 'Release v2.x' dependsOn: ReleaseV1 + condition: and(eq(${{ parameters.V2LibraryRelease }}, True), in(dependencies.ReleaseV1.result, 'Succeeded', 'Skipped')) jobs: - template: /eng/templates/official/jobs/publish-release.yml@self parameters: @@ -38,4 +50,4 @@ extends: pythonVersionRequirement: '>=3.13' pythonClassifiers: | 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: 3.14' + 'Programming Language :: Python :: 3.14' \ No newline at end of file