Skip to content

Commit 3e00c90

Browse files
committed
Fixing UTs and E2E tests, setup.py changes, and v4 pipeline changes
1 parent 2f6c87e commit 3e00c90

File tree

10 files changed

+237
-129
lines changed

10 files changed

+237
-129
lines changed

azure-pipelines.yml

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: $(Date:yyyyMMdd).$(Rev:r)
33
trigger:
44
- release/2.*
55
- release/3.*
6+
- release/4.*
67
- dev
78

89
variables:
@@ -19,14 +20,14 @@ jobs:
1920
- ImageOverride -equals MMSUbuntu20.04TLS
2021
strategy:
2122
matrix:
22-
Python36:
23-
pythonVersion: '3.6'
2423
Python37:
2524
pythonVersion: '3.7'
2625
Python38:
2726
pythonVersion: '3.8'
2827
Python39:
2928
pythonVersion: '3.9'
29+
Python310:
30+
pythonVersion: '3.10'
3031
steps:
3132
- task: UsePythonVersion@0
3233
inputs:
@@ -61,12 +62,6 @@ jobs:
6162
- ImageOverride -equals MMS2019TLS
6263
strategy:
6364
matrix:
64-
Python36V2:
65-
pythonVersion: '3.6'
66-
workerPath: 'python/prodV2/worker.py'
67-
Python37V2:
68-
pythonVersion: '3.7'
69-
workerPath: 'python/prodV2/worker.py'
7065
Python36V3:
7166
pythonVersion: '3.6'
7267
workerPath: 'python/prodV3/worker.py'
@@ -79,6 +74,15 @@ jobs:
7974
Python39V3:
8075
pythonVersion: '3.9'
8176
workerPath: 'python/prodV3/worker.py'
77+
Python37V4:
78+
pythonVersion: '3.7'
79+
workerPath: 'python/prodV4/worker.py'
80+
Python38V4:
81+
pythonVersion: '3.8'
82+
workerPath: 'python/prodV4/worker.py'
83+
Python39V4:
84+
pythonVersion: '3.9'
85+
workerPath: 'python/prodV4/worker.py'
8286
steps:
8387
- template: pack/templates/win_env_gen.yml
8488
parameters:
@@ -94,9 +98,6 @@ jobs:
9498
- ImageOverride -equals MMS2019TLS
9599
strategy:
96100
matrix:
97-
Python37V2:
98-
pythonVersion: '3.7'
99-
workerPath: 'python/prodV2/worker.py'
100101
Python37V3:
101102
pythonVersion: '3.7'
102103
workerPath: 'python/prodV3/worker.py'
@@ -106,6 +107,15 @@ jobs:
106107
Python39V3:
107108
pythonVersion: '3.9'
108109
workerPath: 'python/prodV3/worker.py'
110+
Python37V4:
111+
pythonVersion: '3.7'
112+
workerPath: 'python/prodV4/worker.py'
113+
Python38V4:
114+
pythonVersion: '3.8'
115+
workerPath: 'python/prodV4/worker.py'
116+
Python39V4:
117+
pythonVersion: '3.9'
118+
workerPath: 'python/prodV4/worker.py'
109119
steps:
110120
- template: pack/templates/win_env_gen.yml
111121
parameters:
@@ -121,12 +131,6 @@ jobs:
121131
- ImageOverride -equals MMSUbuntu20.04TLS
122132
strategy:
123133
matrix:
124-
Python36V2:
125-
pythonVersion: '3.6'
126-
workerPath: 'python/prodV2/worker.py'
127-
Python37V2:
128-
pythonVersion: '3.7'
129-
workerPath: 'python/prodV2/worker.py'
130134
Python36V3:
131135
pythonVersion: '3.6'
132136
workerPath: 'python/prodV3/worker.py'
@@ -139,6 +143,15 @@ jobs:
139143
Python39V3:
140144
pythonVersion: '3.9'
141145
workerPath: 'python/prodV3/worker.py'
146+
Python37V4:
147+
pythonVersion: '3.7'
148+
workerPath: 'python/prodV4/worker.py'
149+
Python38V4:
150+
pythonVersion: '3.8'
151+
workerPath: 'python/prodV4/worker.py'
152+
Python39V4:
153+
pythonVersion: '3.9'
154+
workerPath: 'python/prodV4/worker.py'
142155
steps:
143156
- template: pack/templates/nix_env_gen.yml
144157
parameters:
@@ -151,12 +164,6 @@ jobs:
151164
vmImage: 'macOS-10.15'
152165
strategy:
153166
matrix:
154-
Python36V2:
155-
pythonVersion: '3.6'
156-
workerPath: 'python/prodV2/worker.py'
157-
Python37V2:
158-
pythonVersion: '3.7'
159-
workerPath: 'python/prodV2/worker.py'
160167
Python36V3:
161168
pythonVersion: '3.6'
162169
workerPath: 'python/prodV3/worker.py'
@@ -169,6 +176,15 @@ jobs:
169176
Python39V3:
170177
pythonVersion: '3.9'
171178
workerPath: 'python/prodV3/worker.py'
179+
Python37V4:
180+
pythonVersion: '3.7'
181+
workerPath: 'python/prodV4/worker.py'
182+
Python38V4:
183+
pythonVersion: '3.8'
184+
workerPath: 'python/prodV4/worker.py'
185+
Python39V4:
186+
pythonVersion: '3.9'
187+
workerPath: 'python/prodV4/worker.py'
172188
steps:
173189
- template: pack/templates/nix_env_gen.yml
174190
parameters:
@@ -199,13 +215,18 @@ jobs:
199215
echo "Generating V3 Release Package for $BUILD_SOURCEBRANCHNAME"
200216
NUSPEC="pack\Microsoft.Azure.Functions.V3.PythonWorker.nuspec"
201217
WKVERSION="$BUILD_SOURCEBRANCHNAME"
218+
elif [[ $BUILD_SOURCEBRANCHNAME = 4\.* ]]
219+
then
220+
echo "Generating V4 Release Package for $BUILD_SOURCEBRANCHNAME"
221+
NUSPEC="pack\Microsoft.Azure.Functions.V4.PythonWorker.nuspec"
222+
WKVERSION="$BUILD_SOURCEBRANCHNAME"
202223
elif [[ $BUILD_SOURCEBRANCHNAME = dev ]]
203224
then
204-
echo "Generating V3 Integration Test Package for $BUILD_SOURCEBRANCHNAME"
225+
echo "Generating V4 Integration Test Package for $BUILD_SOURCEBRANCHNAME"
205226
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)
206-
NUSPEC="pack\Microsoft.Azure.Functions.V3.PythonWorker.nuspec"
227+
NUSPEC="pack\Microsoft.Azure.Functions.V4.PythonWorker.nuspec"
207228
# Only required for Integration Test. Version number contains date (e.g. 3.1.2.20211028-dev)
208-
WKVERSION="3.$LATEST_TAG-$(patchBuildNumberForDev)"
229+
WKVERSION="$LATEST_TAG-$(patchBuildNumberForDev)"
209230
else
210231
echo "No Matching Release Tag For $BUILD_SOURCEBRANCH"
211232
fi

azure_functions_worker/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3-
4-
__version__ = '1.2.6'

azure_functions_worker/bindings/shared_memory_data_transfer/file_accessor_factory.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the MIT License.
33

44
import os
5+
import sys
56

67
from .file_accessor import DummyFileAccessor
78
from .file_accessor_unix import FileAccessorUnix
@@ -17,7 +18,7 @@ class FileAccessorFactory:
1718
"""
1819
@staticmethod
1920
def create_file_accessor():
20-
if not is_envvar_true(
21+
if sys.platform == "darwin" and not is_envvar_true(
2122
FUNCTIONS_WORKER_SHARED_MEMORY_DATA_TRANSFER_ENABLED):
2223
return DummyFileAccessor()
2324
elif os.name == 'nt':

azure_functions_worker/dispatcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import grpc
2020

21-
from . import __version__
2221
from . import bindings
2322
from . import constants
2423
from . import functions
@@ -38,6 +37,7 @@
3837
from .utils.dependency import DependencyManager
3938
from .utils.wrappers import disable_feature_by
4039
from .bindings.shared_memory_data_transfer import SharedMemoryManager
40+
from .version import VERSION
4141

4242
_TRUE = "true"
4343

@@ -261,7 +261,7 @@ async def _dispatch_grpc_request(self, request):
261261
async def _handle__worker_init_request(self, req):
262262
logger.info('Received WorkerInitRequest, '
263263
'python version %s, worker version %s, request ID %s',
264-
sys.version, __version__, self.request_id)
264+
sys.version, VERSION, self.request_id)
265265

266266
worker_init_request = req.worker_init_request
267267
host_capabilities = worker_init_request.capabilities

azure_functions_worker/version.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
VERSION = '4.0.0'
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
<id>Microsoft.Azure.Functions.PythonWorker</id>
5+
<version>1.1.0</version>
6+
<authors>Microsoft</authors>
7+
<owners>Microsoft</owners>
8+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
9+
<description>Microsoft Azure Functions Python Worker</description>
10+
<copyright>© .NET Foundation. All rights reserved.</copyright>
11+
</metadata>
12+
<files>
13+
<file src="..\3.7_WINDOWS_X64\**" target="tools\3.7\WINDOWS\X64" />
14+
<file src="..\3.7_WINDOWS_X86\**" target="tools\3.7\WINDOWS\X86" />
15+
<file src="..\3.7_LINUX_X64\**" target="tools\3.7\LINUX\X64" />
16+
<file src="..\3.7_OSX_X64\**" target="tools\3.7\OSX\X64" />
17+
<file src="..\3.8_WINDOWS_X64\**" target="tools\3.8\WINDOWS\X64" />
18+
<file src="..\3.8_WINDOWS_X86\**" target="tools\3.8\WINDOWS\X86" />
19+
<file src="..\3.8_LINUX_X64\**" target="tools\3.8\LINUX\X64" />
20+
<file src="..\3.8_OSX_X64\**" target="tools\3.8\OSX\X64" />
21+
<file src="..\3.9_WINDOWS_X64\**" target="tools\3.9\WINDOWS\X64" />
22+
<file src="..\3.9_WINDOWS_X86\**" target="tools\3.9\WINDOWS\X86" />
23+
<file src="..\3.9_LINUX_X64\**" target="tools\3.9\LINUX\X64" />
24+
<file src="..\3.9_OSX_X64\**" target="tools\3.9\OSX\X64" />
25+
<file src="..\python\prodV3\worker.config.json" target="tools" />
26+
<file src="Microsoft.Azure.Functions.PythonWorker.targets" target="build" />
27+
</files>
28+
</package>

0 commit comments

Comments
 (0)