Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions eng/pack/Microsoft.Azure.Functions.V4.PythonWorker.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
<copyright>© .NET Foundation. All rights reserved.</copyright>
</metadata>
<files>
<file src="..\..\3.7_WINDOWS_X64\**" target="tools\3.7\WINDOWS\X64" />
<file src="..\..\3.7_WINDOWS_X86\**" target="tools\3.7\WINDOWS\X86" />
<file src="..\..\3.7_LINUX_X64\**" target="tools\3.7\LINUX\X64" />
<file src="..\..\3.7_OSX_X64\**" target="tools\3.7\OSX\X64" />
<file src="..\..\3.8_WINDOWS_X64\**" target="tools\3.8\WINDOWS\X64" />
<file src="..\..\3.8_WINDOWS_X86\**" target="tools\3.8\WINDOWS\X86" />
<file src="..\..\3.8_LINUX_X64\**" target="tools\3.8\LINUX\X64" />
<file src="..\..\3.8_OSX_X64\**" target="tools\3.8\OSX\X64" />
<file src="..\..\3.9_WINDOWS_X64\**" target="tools\3.9\WINDOWS\X64" />
<file src="..\..\3.9_WINDOWS_X86\**" target="tools\3.9\WINDOWS\X86" />
<file src="..\..\3.9_LINUX_X64\**" target="tools\3.9\LINUX\X64" />
Expand Down
9 changes: 1 addition & 8 deletions eng/pack/templates/macos_64_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ steps:
cd workers
pip-audit -r requirements.txt
displayName: 'Run vulnerability scan'
condition: ne(variables['pythonVersion'], '3.7')
- task: CopyFiles@2
inputs:
contents: '$(workerPath)'
Expand Down Expand Up @@ -106,6 +105,7 @@ steps:
$expected = @(
".artifactignore",
"azure",
"azurefunctions",
"azure_functions_worker",
"azure_functions_worker/protos/FunctionRpc_pb2.py",
"azure_functions_worker/protos/FunctionRpc_pb2_grpc.py",
Expand All @@ -124,13 +124,6 @@ steps:
"werkzeug",
"worker.py"
)
# Add azurefunctions/ conditionally
if ("$(minorVersion)" -ne "7") {
Write-Host "Including azurefunctions/ in expected list (minorVersion=$(minorVersion))"
$expected += "azurefunctions"
} else {
Write-Host "Skipping azurefunctions/ (minorVersion=7)"
}
$missing = @()
Expand Down
9 changes: 1 addition & 8 deletions eng/pack/templates/nix_arm64_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ steps:
cd workers
pip-audit -r requirements.txt
displayName: 'Run vulnerability scan'
condition: ne(variables['pythonVersion'], '3.7')
- task: CopyFiles@2
inputs:
contents: '$(workerPath)'
Expand Down Expand Up @@ -112,6 +111,7 @@ steps:
$expected = @(
".artifactignore",
"azure",
"azurefunctions",
"azure_functions_worker",
"azure_functions_worker/protos/FunctionRpc_pb2.py",
"azure_functions_worker/protos/FunctionRpc_pb2_grpc.py",
Expand All @@ -130,13 +130,6 @@ steps:
"werkzeug",
"worker.py"
)
# Add azurefunctions/ conditionally
if ("$(minorVersion)" -ne "7") {
Write-Host "Including azurefunctions/ in expected list (minorVersion=$(minorVersion))"
$expected += "azurefunctions"
} else {
Write-Host "Skipping azurefunctions/ (minorVersion=7)"
}

$missing = @()

Expand Down
9 changes: 1 addition & 8 deletions eng/pack/templates/nix_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ steps:
cd workers
pip-audit -r requirements.txt
displayName: 'Run vulnerability scan'
condition: ne(variables['pythonVersion'], '3.7')
- task: CopyFiles@2
inputs:
contents: '$(workerPath)'
Expand Down Expand Up @@ -107,6 +106,7 @@ steps:
".artifactignore",
"azure",
"azure_functions_worker",
"azurefunctions",
"azure_functions_worker/protos/FunctionRpc_pb2.py",
"azure_functions_worker/protos/FunctionRpc_pb2_grpc.py",
"azure_functions_worker/protos/_src",
Expand All @@ -124,13 +124,6 @@ steps:
"werkzeug",
"worker.py"
)
# Add azurefunctions/ conditionally
if ("$(minorVersion)" -ne "7") {
Write-Host "Including azurefunctions/ in expected list (minorVersion=$(minorVersion))"
$expected += "azurefunctions"
} else {
Write-Host "Skipping azurefunctions/ (minorVersion=7)"
}

$missing = @()

Expand Down
9 changes: 1 addition & 8 deletions eng/pack/templates/win_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ steps:
cd workers
pip-audit -r requirements.txt
displayName: 'Run vulnerability scan'
condition: ne(variables['pythonVersion'], '3.7')
- task: CopyFiles@2
inputs:
contents: '$(workerPath)'
Expand Down Expand Up @@ -105,6 +104,7 @@ steps:
$expected = @(
".artifactignore",
"azure",
"azurefunctions",
"azure_functions_worker",
"azure_functions_worker/protos/FunctionRpc_pb2.py",
"azure_functions_worker/protos/FunctionRpc_pb2_grpc.py",
Expand All @@ -123,13 +123,6 @@ steps:
"werkzeug",
"worker.py"
)
# Add azurefunctions/ conditionally
if ("$(minorVersion)" -ne "7") {
Write-Host "Including azurefunctions/ in expected list (minorVersion=$(minorVersion))"
$expected += "azurefunctions"
} else {
Write-Host "Skipping azurefunctions/ (minorVersion=7)"
}

$missing = @()

Expand Down
15 changes: 6 additions & 9 deletions eng/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ python -m pip install -e runtimes/v1
python -m pip install -U azure-functions --pre
python -m pip install -U -e $2/[dev]

if [[ $1 != "3.7" ]]; then
python -m pip install --pre -U -e $2/[test-http-v2]
fi
if [[ $1 != "3.7" && $1 != "3.8" ]]; then
python -m pip install --pre -U -e $2/[test-deferred-bindings]
python -m pip install --pre -U -e $2/[test-http-v2]
python -m pip install --pre -U -e $2/[test-deferred-bindings]

SERVICEBUS_DIR="./servicebus_dir"
python -m pip install --pre -U --target "$SERVICEBUS_DIR" azurefunctions-extensions-bindings-servicebus==1.0.0b2
python -c "import sys; sys.path.insert(0, '$SERVICEBUS_DIR'); import azurefunctions.extensions.bindings.servicebus as sb; print('servicebus version:', sb.__version__)"

SERVICEBUS_DIR="./servicebus_dir"
python -m pip install --pre -U --target "$SERVICEBUS_DIR" azurefunctions-extensions-bindings-servicebus==1.0.0b2
python -c "import sys; sys.path.insert(0, '$SERVICEBUS_DIR'); import azurefunctions.extensions.bindings.servicebus as sb; print('servicebus version:', sb.__version__)"
fi
12 changes: 4 additions & 8 deletions eng/scripts/test-extensions.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#!/bin/bash

python -m pip install --upgrade pip
if [[ $2 != "3.7" ]]; then
python -m pip install -e $1/PythonExtensionArtifact/$3
python -m pip install --pre -e workers/[test-http-v2]
fi
if [[ $2 != "3.7" && $2 != "3.8" ]]; then
python -m pip install -e $1/PythonExtensionArtifact/$3
python -m pip install --pre -U -e workers/[test-deferred-bindings]
fi

python -m pip install -e $1/PythonExtensionArtifact/$3
python -m pip install --pre -e workers/[test-http-v2]
python -m pip install --pre -U -e workers/[test-deferred-bindings]

python -m pip install -U -e workers/[dev]
8 changes: 2 additions & 6 deletions eng/scripts/test-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ python -m pip install --upgrade pip
python -m pip install -e $1/PythonSdkArtifact
python -m pip install -e workers/[dev]

if [[ $2 != "3.7" ]]; then
python -m pip install --pre -U -e workers/[test-http-v2]
fi
if [[ $2 != "3.7" && $2 != "3.8" ]]; then
python -m pip install --pre -U -e workers/[test-deferred-bindings]
fi
python -m pip install --pre -U -e workers/[test-http-v2]
python -m pip install --pre -U -e workers/[test-deferred-bindings]
24 changes: 0 additions & 24 deletions eng/templates/official/jobs/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ jobs:
os: windows
strategy:
matrix:
Python37V4:
pythonVersion: '3.7'
normalizedPythonVersion: '3.7'
Python38V4:
pythonVersion: '3.8'
normalizedPythonVersion: '3.8'
Python39V4:
pythonVersion: '3.9'
normalizedPythonVersion: '3.9'
Expand Down Expand Up @@ -52,12 +46,6 @@ jobs:
os: windows
strategy:
matrix:
Python37V4:
pythonVersion: '3.7'
normalizedPythonVersion: '3.7'
Python38V4:
pythonVersion: '3.8'
normalizedPythonVersion: '3.8'
Python39V4:
pythonVersion: '3.9'
normalizedPythonVersion: '3.9'
Expand Down Expand Up @@ -97,12 +85,6 @@ jobs:
os: linux
strategy:
matrix:
Python37V4:
pythonVersion: '3.7'
normalizedPythonVersion: '3.7'
Python38V4:
pythonVersion: '3.8'
normalizedPythonVersion: '3.8'
Python39V4:
pythonVersion: '3.9'
normalizedPythonVersion: '3.9'
Expand Down Expand Up @@ -141,12 +123,6 @@ jobs:
os: macOS
strategy:
matrix:
Python37V4:
pythonVersion: '3.7'
normalizedPythonVersion: '3.7'
Python38V4:
pythonVersion: '3.8'
normalizedPythonVersion: '3.8'
Python39V4:
pythonVersion: '3.9'
normalizedPythonVersion: '3.9'
Expand Down
12 changes: 6 additions & 6 deletions eng/templates/official/jobs/publish-library-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ jobs:
dependsOn: ['CheckGitHubRelease']
displayName: 'PyPI Package'
steps:
- script: |
echo "##vso[task.setvariable variable=BranchName]refs/heads/${{ parameters.BRANCH_NAME }}/$(NewLibraryVersion)"
displayName: 'Set branch variable'
- powershell: |
Write-Host "##vso[task.setvariable variable=BranchName]refs/heads/${{ parameters.BRANCH_NAME }}/$(NewWorkerVersion)"
displayName: "Set branch variable"
- powershell: |
Write-Host "BranchName: $(BranchName)"
displayName: 'Display BranchName variable'
Expand All @@ -74,13 +74,13 @@ jobs:
branchName: '$(BranchName)'
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
targetPath: '$(Pipeline.Workspace)/PythonWorkerArtifact'
targetPath: 'PythonRuntimeArtifact'
- task: UsePythonVersion@0
displayName: 'Use Python 3.13'
inputs:
versionSpec: 3.13
- powershell: |
$newLibraryVersion = "$(NewLibraryVersion)"
$newLibraryVersion = "$(NewWorkerVersion)"
$pypiToken = "$(PypiToken)"

# Setup local Python environment
Expand All @@ -89,7 +89,7 @@ jobs:
pip install twine

# Publish artifacts to PyPi
twine upload --repository-url https://upload.pypi.org/legacy/ --username "__token__" --password "$pypiToken" PythonRuntimeArtifact/${{ parameters.PROJECT_DIRECTORY }}/dist/*
twine upload --repository-url https://upload.pypi.org/legacy/ --username "__token__" --password "$pypiToken" PythonRuntimeArtifact/${{ parameters.PROJECT_NAME }}/${{ parameters.PROJECT_DIRECTORY }}/dist/*
Start-Sleep -Seconds 3

# Checking if the new version is uploaded
Expand Down
8 changes: 1 addition & 7 deletions eng/templates/official/jobs/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ jobs:
allowFailedBuilds: true
targetPath: '$(Pipeline.Workspace)/PythonWorkerArtifact'


- job: "CheckNugetPackageContent"
dependsOn: ['PublishNuget']
displayName: '(Manual) Check Nuget Package Content'
Expand Down Expand Up @@ -120,11 +119,7 @@ jobs:

# Modify Python Worker Version in eng\build\python.props
Write-Host "Replacing eng\build\python.props"
((Get-Content eng\build\Workers.Python.props) -replace "PythonWorker`" Version=`"(\d)+.(\d)+.(\d)+.?(\d)*`"","PythonWorker`" Version=`"$newWorkerVersion`"" -join "`n") +"`n" | Set-Content -NoNewline eng\build\Workers.Python.props

# Modify Python Worker Version in test\WebJobs.Script.Tests\WebJobs.Script.Tests.csproj
Write-Host "Replacing test\WebJobs.Script.Tests\WebJobs.Script.Tests.csproj"
((Get-Content test\WebJobs.Script.Tests\WebJobs.Script.Tests.csproj) -replace "PythonWorker`" Version=`"(\d)+.(\d)+.(\d)+.?(\d)*`"","PythonWorker`" Version=`"$newWorkerVersion`"" -join "`n") + "`n" | Set-Content -NoNewline test\WebJobs.Script.Tests\WebJobs.Script.Tests.csproj
((Get-Content eng\build\Workers.Python.props) -replace "PythonWorker`" VersionOverride=`"(\d)+.(\d)+.(\d)+.?(\d)*`"","PythonWorker`" VersionOverride=`"$newWorkerVersion`"" -join "`n") +"`n" | Set-Content -NoNewline eng\build\Workers.Python.props

# Modify release_notes.md
Write-Host "Adding a new entry in release_notes.md"
Expand All @@ -134,7 +129,6 @@ jobs:
# Commit Python Version
Write-Host "Pushing $newBranch to host repo"
git add eng\build\Workers.Python.props
git add test\WebJobs.Script.Tests\WebJobs.Script.Tests.csproj
git add release_notes.md
git commit -m "Update Python Worker Version to $newWorkerVersion"
git push origin $newBranch
Expand Down
2 changes: 1 addition & 1 deletion eng/templates/shared/github-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ steps:
{
# Modify Runtime Version in workers/pyproject.toml
Write-Host "Replacing Runtime version in worker's pyproject.toml"
((Get-Content workers/pyproject.toml) -replace '"${{ parameters.PROJECT_NAME }}==[^";]+', "`"${{ parameters.PROJECT_NAME }}==$newLibraryVersion") -join "`n" | Set-Content -NoNewline workers/pyproject.toml
((Get-Content workers/pyproject.toml) -replace '"${{ parameters.PROJECT_NAME }}==[^";]+', "`"${{ parameters.PROJECT_NAME }}==$newWorkerVersion") -join "`n" | Set-Content -NoNewline workers/pyproject.toml

# Change $versionFile version
Write-Host "Change version number in version.py to $newWorkerVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from .tracecontext import TraceContext


_invocation_id_local = threading.local()


class Context:
def __init__(self,
func_name: str,
Expand Down Expand Up @@ -66,4 +69,4 @@ def get_context(invoc_request, name: str,

return Context(
name, directory, invoc_request.invocation_id,
threading.local(), trace_context, retry_context)
_invocation_id_local, trace_context, retry_context)
5 changes: 4 additions & 1 deletion runtimes/v2/azure_functions_runtime/bindings/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
from .tracecontext import TraceContext


_invocation_id_local = threading.local()


class Context:
def __init__(self,
func_name: str,
Expand Down Expand Up @@ -63,4 +66,4 @@ def get_context(invoc_request, name: str,

return Context(
name, directory, invoc_request.invocation_id,
threading.local(), trace_context, retry_context)
_invocation_id_local, trace_context, retry_context)
Loading
Loading