Skip to content

Commit

Permalink
Preparing nuspec file and pipeline changes for release (#966)
Browse files Browse the repository at this point in the history
The nuspec files needed correction for Python 3.10 generation.
Removed Tests section from azure-pipelines.yml as it wasn't required.
Removed Python 3.6 generation and the V3 builds.
Referencing the correct V4 nuspec.
Also removed the need to install azure-functions in the pack/scripts/nix_deps.sh as we now made it as a required installation in setup.py.
  • Loading branch information
vrdmr authored Feb 18, 2022
1 parent 65c30d8 commit 0d03a4d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 108 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ What's coming?

- [Durable Functions For Python](https://github.com/Azure/azure-functions-durable-python)

###Get Started
### Get Started

- [Create your first Python function](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-python)
- [Developer guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python)
Expand Down
122 changes: 17 additions & 105 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,17 @@ trigger:
- dev

variables:
DOTNET_VERSION: '3.1.405'
DOTNET_VERSION_5: '5.0.x'
DOTNET_VERSION_6: '6.x'
patchBuildNumberForDev: $(Build.BuildNumber)
PROD_V3_WORKER_PY : 'python/prodV3/worker.py'
PROD_V4_WORKER_PY : 'python/prodV4/worker.py'

jobs:
- job: Tests
pool:
name: '1ES-Hosted-AzFunc' #MMS2019TLS for Windows2019 or MMSUbuntu20.04TLS for ubuntu
demands:
- ImageOverride -equals MMSUbuntu20.04TLS
strategy:
matrix:
Python37:
pythonVersion: '3.7'
Python38:
pythonVersion: '3.8'
Python39:
pythonVersion: '3.9'
Python310:
pythonVersion: '3.10'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(pythonVersion)'
addToPath: true
- task: UseDotNet@2
displayName: 'Install dotnet'
inputs:
packageType: 'sdk'
version: $(DOTNET_VERSION)
- task: UseDotNet@2
displayName: 'Install DotNet 5.x'
inputs:
packageType: 'sdk'
version: $(DOTNET_VERSION_5)
- task: UseDotNet@2
displayName: 'Install DotNet 6.x'
inputs:
packageType: 'sdk'
version: $(DOTNET_VERSION_6)
- task: ShellScript@2
inputs:
disableAutoCwd: true
scriptPath: .ci/linux_devops_build.sh
displayName: 'Build'

- job: Build_WINDOWS_X64
dependsOn: 'Tests'
pool:
name: '1ES-Hosted-AzFunc' #MMS2019TLS for Windows2019 or MMSUbuntu20.04TLS for ubuntu
demands:
- ImageOverride -equals MMS2019TLS
strategy:
matrix:
Python36V3:
pythonVersion: '3.6'
workerPath: $(PROD_V3_WORKER_PY)
Python37V3:
pythonVersion: '3.7'
workerPath: $(PROD_V3_WORKER_PY)
Python38V3:
pythonVersion: '3.8'
workerPath: $(PROD_V3_WORKER_PY)
Python39V3:
pythonVersion: '3.9'
workerPath: $(PROD_V3_WORKER_PY)
Python37V4:
pythonVersion: '3.7'
workerPath: $(PROD_V4_WORKER_PY)
Expand All @@ -84,6 +26,9 @@ jobs:
Python39V4:
pythonVersion: '3.9'
workerPath: $(PROD_V4_WORKER_PY)
Python310V4:
pythonVersion: '3.10'
workerPath: $(PROD_V4_WORKER_PY)
steps:
- template: pack/templates/win_env_gen.yml
parameters:
Expand All @@ -92,22 +37,12 @@ jobs:
architecture: 'x64'
artifactName: '$(pythonVersion)_WINDOWS_X64'
- job: Build_WINDOWS_X86
dependsOn: 'Tests'
pool:
name: '1ES-Hosted-AzFunc' #MMS2019TLS for Windows2019 or MMSUbuntu20.04TLS for ubuntu
demands:
- ImageOverride -equals MMS2019TLS
strategy:
matrix:
Python37V3:
pythonVersion: '3.7'
workerPath: $(PROD_V3_WORKER_PY)
Python38V3:
pythonVersion: '3.8'
workerPath: $(PROD_V3_WORKER_PY)
Python39V3:
pythonVersion: '3.9'
workerPath: $(PROD_V3_WORKER_PY)
Python37V4:
pythonVersion: '3.7'
workerPath: $(PROD_V4_WORKER_PY)
Expand All @@ -117,6 +52,9 @@ jobs:
Python39V4:
pythonVersion: '3.9'
workerPath: $(PROD_V4_WORKER_PY)
Python310V4:
pythonVersion: '3.10'
workerPath: $(PROD_V4_WORKER_PY)
steps:
- template: pack/templates/win_env_gen.yml
parameters:
Expand All @@ -125,25 +63,12 @@ jobs:
architecture: 'x86'
artifactName: '$(pythonVersion)_WINDOWS_x86'
- job: Build_LINUX_X64
dependsOn: 'Tests'
pool:
name: '1ES-Hosted-AzFunc' # MMS2019TLS for Windows2019 or MMSUbuntu20.04TLS for ubuntu
demands:
- ImageOverride -equals MMSUbuntu20.04TLS
strategy:
matrix:
Python36V3:
pythonVersion: '3.6'
workerPath: $(PROD_V3_WORKER_PY)
Python37V3:
pythonVersion: '3.7'
workerPath: $(PROD_V3_WORKER_PY)
Python38V3:
pythonVersion: '3.8'
workerPath: $(PROD_V3_WORKER_PY)
Python39V3:
pythonVersion: '3.9'
workerPath: $(PROD_V3_WORKER_PY)
Python37V4:
pythonVersion: '3.7'
workerPath: $(PROD_V4_WORKER_PY)
Expand All @@ -153,30 +78,20 @@ jobs:
Python39V4:
pythonVersion: '3.9'
workerPath: $(PROD_V4_WORKER_PY)
Python310V4:
pythonVersion: '3.10'
workerPath: $(PROD_V4_WORKER_PY)
steps:
- template: pack/templates/nix_env_gen.yml
parameters:
pythonVersion: '$(pythonVersion)'
workerPath: '$(workerPath)'
artifactName: '$(pythonVersion)_LINUX_X64'
- job: Build_OSX_X64
dependsOn: 'Tests'
pool:
vmImage: 'macOS-10.15'
strategy:
matrix:
Python36V3:
pythonVersion: '3.6'
workerPath: $(PROD_V3_WORKER_PY)
Python37V3:
pythonVersion: '3.7'
workerPath: $(PROD_V3_WORKER_PY)
Python38V3:
pythonVersion: '3.8'
workerPath: $(PROD_V3_WORKER_PY)
Python39V3:
pythonVersion: '3.9'
workerPath: $(PROD_V3_WORKER_PY)
Python37V4:
pythonVersion: '3.7'
workerPath: $(PROD_V4_WORKER_PY)
Expand All @@ -186,6 +101,9 @@ jobs:
Python39V4:
pythonVersion: '3.9'
workerPath: $(PROD_V4_WORKER_PY)
Python310V4:
pythonVersion: '3.10'
workerPath: $(PROD_V4_WORKER_PY)
steps:
- template: pack/templates/nix_env_gen.yml
parameters:
Expand All @@ -197,21 +115,15 @@ jobs:
dependsOn: ['Build_WINDOWS_X64', 'Build_WINDOWS_X86', 'Build_LINUX_X64', 'Build_OSX_X64']
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
pool:
# vmImage: 'vs2017-win2016'
name: '1ES-Hosted-AzFunc' # MMS2019TLS for Windows2019 or MMSUbuntu20.04TLS for ubuntu
name: '1ES-Hosted-AzFunc'
demands:
- ImageOverride -equals MMSUbuntu20.04TLS
- ImageOverride -equals MMS2019TLS
steps:
- bash: |
echo "Releasing from $BUILD_SOURCEBRANCHNAME"
apt install jq
sudo apt-get install -y jq
if [[ $BUILD_SOURCEBRANCHNAME = 3\.* ]]
then
echo "Generating V3 Release Package for $BUILD_SOURCEBRANCHNAME"
NUSPEC="pack\Microsoft.Azure.Functions.V3.PythonWorker.nuspec"
WKVERSION="$BUILD_SOURCEBRANCHNAME"
elif [[ $BUILD_SOURCEBRANCHNAME = 4\.* ]]
if [[ $BUILD_SOURCEBRANCHNAME = 4\.* ]]
then
echo "Generating V4 Release Package for $BUILD_SOURCEBRANCHNAME"
NUSPEC="pack\Microsoft.Azure.Functions.V4.PythonWorker.nuspec"
Expand All @@ -226,7 +138,7 @@ jobs:
# this is only to test nuget related workflow because we are setting nuspec here
echo "Generating Integration Test Package for $BUILD_SOURCEBRANCHNAME for testing purpose"
LATEST_TAG=$(curl https://api.github.com/repos/Azure/azure-functions-python-worker/tags -s | jq '.[0].name' | sed 's/\"//g' | cut -d'.' -f-2)
NUSPEC="pack\Microsoft.Azure.Functions.V3.PythonWorker.nuspec"
NUSPEC="pack\Microsoft.Azure.Functions.V4.PythonWorker.nuspec"
# Only required for Integration Test. Version number contains date (e.g. 3.1.2.20211028-dev)
WKVERSION="3.$LATEST_TAG-$(BUILD_BUILDID)-TEST"
echo "No Matching Release Tag For $BUILD_SOURCEBRANCH"
Expand Down
8 changes: 7 additions & 1 deletion pack/Microsoft.Azure.Functions.V4.PythonWorker.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
<file src="..\3.9_WINDOWS_X86\**" target="tools\3.9\WINDOWS\X86" />
<file src="..\3.9_LINUX_X64\**" target="tools\3.9\LINUX\X64" />
<file src="..\3.9_OSX_X64\**" target="tools\3.9\OSX\X64" />
<file src="..\python\prodV3\worker.config.json" target="tools" />
<file src="..\3.10_WINDOWS_X64\**" target="tools\3.10\WINDOWS\X64" />
<file src="..\3.10_WINDOWS_X86\**" target="tools\3.10\WINDOWS\X86" />
<file src="..\3.10_LINUX_X64\**" target="tools\3.10\LINUX\X64" />
<file src="..\3.10_OSX_X64\**" target="tools\3.10\OSX\X64" />
<file src="..\python\prodV4\worker.config.json" target="tools" />
<file src="Microsoft.Azure.Functions.PythonWorker.targets" target="build" />
<file src="..\_manifest\manifest.json" target="SBOM\manifest.json" />
<file src="..\_manifest\spdx_2.2\manifest.spdx.json" target="SBOM\manifest.spdx.json" />
</files>
</package>
2 changes: 1 addition & 1 deletion pack/scripts/nix_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ python -m pip install --upgrade pip

python -m pip install .

python -m pip install . azure-functions --no-compile --target "$BUILD_SOURCESDIRECTORY/deps"
python -m pip install . --no-compile --target "$BUILD_SOURCESDIRECTORY/deps"

0 comments on commit 0d03a4d

Please sign in to comment.