1+ parameters :
2+ - name : libraryVersion
3+ type : string
4+ - name : pythonVersionRequirement
5+ type : string
6+ - name : pythonClassifiers
7+ type : string
8+
19jobs :
210
311- job : " CreateReleaseBranch"
917 steps :
1018 - powershell : |
1119 $githubToken = "$(GithubPat)"
12- $newLibraryVersion = "$(NewLibraryVersion)"
20+ $newLibraryVersion = "${{ parameters.libraryVersion }}"
21+ $pythonVersionRequirement = "${{ parameters.pythonVersionRequirement }}"
22+ $pythonClassifiers = @"
23+ ${{ parameters.pythonClassifiers }}
24+ "@
1325
1426 if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') {
1527 # Create GitHub credential
2436 Write-Host "Change version number in azure/functions/__init__.py to $newLibraryVersion"
2537 ((Get-Content azure/functions/__init__.py) -replace "__version__ = '(\d)+.(\d)+.*'", "__version__ = '$newLibraryVersion'" -join "`n") + "`n" | Set-Content -NoNewline azure/functions/__init__.py
2638 git add azure/functions/__init__.py
39+
40+ # Update pyproject.toml with Python version requirement
41+ Write-Host "Updating pyproject.toml with Python version requirement: $pythonVersionRequirement"
42+ $content = Get-Content pyproject.toml -Raw
43+ $content = $content -replace 'requires-python = ">=[\d\.]+"', "requires-python = `"$pythonVersionRequirement`""
44+
45+ # Update Python classifiers
46+ Write-Host "Updating Python classifiers in pyproject.toml"
47+ $classifiersPattern = "(?s)('Programming Language :: Python :: \d\.\d+',\s*)+"
48+ $content = $content -replace $classifiersPattern, "$pythonClassifiers,`n "
49+
50+ $content | Set-Content -NoNewline pyproject.toml
51+ git add pyproject.toml
52+
2753 git commit -m "build: update Python Library Version to $newLibraryVersion"
2854
2955 # Create release branch release/X.Y.Z
@@ -46,17 +72,17 @@ jobs:
4672 inputs :
4773 notifyUsers : ' ' # No email notifications sent
4874 instructions : |
49- 1. Check if the https://github.com/Azure/azure-functions-python-library/tree/release/$(NewLibraryVersion) build succeeds and passes all unit tests.
50- 2. If not, modify the release/$(NewLibraryVersion) branch.
51- 3. Ensure release/$(NewLibraryVersion) branch contains all necessary changes.
75+ 1. Check if the https://github.com/Azure/azure-functions-python-library/tree/release/${{ parameters.libraryVersion }} build succeeds and passes all unit tests.
76+ 2. If not, modify the release/${{ parameters.libraryVersion }} branch.
77+ 3. Ensure release/${{ parameters.libraryVersion }} branch contains all necessary changes.
5278
5379 - job : " CreateReleaseTag"
5480 dependsOn : ['CheckReleaseBranch']
5581 displayName : ' Create Release Tag'
5682 steps :
5783 - powershell : |
5884 $githubToken = "$(GithubPat)"
59- $newLibraryVersion = "$(NewLibraryVersion) "
85+ $newLibraryVersion = "${{ parameters.libraryVersion }} "
6086
6187 if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') {
6288 # Create GitHub credential
83109 - pwsh : |
84110 $githubUser = "$(GithubUser)"
85111 $githubToken = "$(GithubPat)"
86- $newLibraryVersion = "$(NewLibraryVersion) "
112+ $newLibraryVersion = "${{ parameters.libraryVersion }} "
87113
88114 if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') {
89115 # Create GitHub credential
@@ -126,7 +152,7 @@ jobs:
126152 - pwsh : |
127153 $githubUser = "$(GithubUser)"
128154 $githubToken = "$(GithubPat)"
129- $newLibraryVersion = "$(NewLibraryVersion) "
155+ $newLibraryVersion = "${{ parameters.libraryVersion }} "
130156 $newBranch = "sdk/$newLibraryVersion"
131157
132158 if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') {
@@ -145,7 +171,7 @@ jobs:
145171
146172 # Modify SDK Version in pyproject.toml
147173 Write-Host "Replacing SDK version in worker's pyproject.toml"
148- ((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
174+ ((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
149175
150176 # Commit Python Version
151177 Write-Host "Pushing $newBranch to azure-functions-python-worker repo"
@@ -204,7 +230,7 @@ jobs:
204230 inputs :
205231 versionSpec : 3.11
206232 - pwsh : |
207- $newLibraryVersion = "$(NewLibraryVersion) "
233+ $newLibraryVersion = "${{ parameters.libraryVersion }} "
208234 $pypiToken = "$(PypiToken)"
209235
210236 # Setup local Python environment
@@ -233,7 +259,7 @@ jobs:
233259 steps :
234260 - powershell : |
235261 $githubToken = "$(GithubPat)"
236- $newLibraryVersion = "$(newLibraryVersion) "
262+ $newLibraryVersion = "${{ parameters.libraryVersion }} "
237263
238264 if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') {
239265 # Create GitHub credential
0 commit comments