Skip to content

Commit cd3e1e4

Browse files
committed
Formatting and Typo changes
1 parent ece82af commit cd3e1e4

File tree

4 files changed

+47
-59
lines changed

4 files changed

+47
-59
lines changed

.github/workflows/ut_ci_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: true
2222
matrix:
23-
python-version: [ 3.6, 3.7, 3.8, 3.9, "3.10" ]
23+
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
2424
steps:
2525
- uses: actions/checkout@v2
2626
- name: Set up Python ${{ matrix.python-version }}

azure_functions_worker/testutils.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ def popen_webhost(*, stdout, stderr, script_root=FUNCS_PATH, port=None):
767767
hostexe_args = []
768768

769769
# If we want to use core-tools
770-
coretools_exe = "" # os.environ.get('CORE_TOOLS_EXE_PATH')
770+
coretools_exe = os.environ.get('CORE_TOOLS_EXE_PATH')
771771
if coretools_exe:
772772
coretools_exe = coretools_exe.strip()
773773
if pathlib.Path(coretools_exe).exists():
@@ -905,17 +905,15 @@ def start_webhost(*, script_dir=None, stdout=None):
905905
r = requests.get(health_check_endpoint,
906906
params={'code': 'testFunctionKey'})
907907
# Give the host a bit more time to settle
908-
time.sleep(5)
908+
time.sleep(2)
909909

910910
if 200 <= r.status_code < 300:
911911
# Give the host a bit more time to settle
912912
time.sleep(1)
913913
break
914914
else:
915-
print(
916-
f'Failed to ping {health_check_endpoint}, status code: '
917-
f'{r.status_code}',
918-
flush=True)
915+
print(f'Failed to ping {health_check_endpoint}, status code: '
916+
f'{r.status_code}', flush=True)
919917
except requests.exceptions.ConnectionError:
920918
pass
921919
time.sleep(1)

setup.py

Lines changed: 37 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,60 +28,50 @@
2828

2929
# Extensions necessary for non-core bindings.
3030
AZURE_EXTENSIONS = """\
31+
<?xml version="1.0" encoding="UTF-8"?>
3132
<Project Sdk="Microsoft.NET.Sdk">
32-
<PropertyGroup>
33-
<TargetFramework>netcoreapp3.1</TargetFramework>
34-
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
35-
<WarningsAsErrors></WarningsAsErrors>
36-
<DefaultItemExcludes>**</DefaultItemExcludes>
37-
</PropertyGroup>
38-
<ItemGroup>
39-
<PackageReference
40-
Include="Microsoft.NET.Sdk.Functions"
41-
Version="4.0.1"
42-
/>
43-
<PackageReference
44-
Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB"
45-
Version="3.0.10"
46-
/>
47-
<PackageReference
48-
Include="Microsoft.Azure.WebJobs.Extensions.EventHubs"
49-
Version="5.0.0"
50-
/>
51-
<PackageReference
52-
Include="Microsoft.Azure.WebJobs.Extensions.EventGrid"
53-
Version="3.1.0"
54-
/>
55-
<PackageReference
56-
Include="Microsoft.Azure.WebJobs.Extensions.Storage"
57-
Version="4.0.5"
58-
/>
59-
<PackageReference
60-
Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus"
61-
Version="4.2.1"
62-
/>
63-
<PackageReference
64-
Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator"
65-
Version="1.1.3" />
66-
</ItemGroup>
33+
<PropertyGroup>
34+
<TargetFramework>netcoreapp3.1</TargetFramework>
35+
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
36+
<WarningsAsErrors />
37+
<DefaultItemExcludes>**</DefaultItemExcludes>
38+
</PropertyGroup>
39+
<ItemGroup>
40+
<PackageReference Include="Microsoft.NET.Sdk.Functions"
41+
Version="4.0.1" />
42+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB"
43+
Version="3.0.10" />
44+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs"
45+
Version="5.0.0" />
46+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid"
47+
Version="3.1.0" />
48+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage"
49+
Version="4.0.5" />
50+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus"
51+
Version="4.2.1" />
52+
<PackageReference
53+
Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator"
54+
Version="1.1.3" />
55+
</ItemGroup>
6756
</Project>
6857
"""
6958

7059

7160
NUGET_CONFIG = """\
72-
<?xml version="1.0" encoding="utf-8"?>
61+
<?xml version="1.0" encoding="UTF-8"?>
7362
<configuration>
74-
<packageSources>
75-
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
76-
<add key="azure_app_service"
77-
value="https://www.myget.org/F/azure-appservice/api/v2" />
78-
<add key="azure_app_service_staging"
79-
value="https://www.myget.org/F/azure-appservice-staging/api/v2" />
80-
<add key="buildTools"
81-
value="https://www.myget.org/F/30de4ee06dd54956a82013fa17a3accb/" />
82-
<add key="AspNetVNext"
83-
value="https://www.myget.org/F/aspnetcore-dev/api/v3/index.json" />
84-
</packageSources>
63+
<packageSources>
64+
<add key="nuget.org"
65+
value="https://www.nuget.org/api/v2/" />
66+
<add key="azure_app_service"
67+
value="https://www.myget.org/F/azure-appservice/api/v2" />
68+
<add key="azure_app_service_staging"
69+
value="https://www.myget.org/F/azure-appservice-staging/api/v2" />
70+
<add key="buildTools"
71+
value="https://www.myget.org/F/30de4ee06dd54956a82013fa17a3accb/" />
72+
<add key="AspNetVNext"
73+
value="https://www.myget.org/F/aspnetcore-dev/api/v3/index.json" />
74+
</packageSources>
8575
</configuration>
8676
"""
8777

tests/unittests/test_utilities_dependency.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_initialize_in_linux_dedicated(self):
9898
def test_initialize_in_windows_core_tools(self):
9999
os.environ['AzureWebJobsScriptRoot'] = 'C:\\FunctionApp'
100100
sys.path.extend([
101-
'C:\\Users\\hazeng\\AppData\\Roaming\\npm\\'
101+
'C:\\Users\\user\\AppData\\Roaming\\npm\\'
102102
'node_modules\\azure-functions-core-tools\\bin\\'
103103
'workers\\python\\3.6\\WINDOWS\\X64',
104104
'C:\\FunctionApp\\.venv38\\lib\\site-packages',
@@ -115,7 +115,7 @@ def test_initialize_in_windows_core_tools(self):
115115
)
116116
self.assertEqual(
117117
DependencyManager.worker_deps_path,
118-
'C:\\Users\\hazeng\\AppData\\Roaming\\npm\\node_modules\\'
118+
'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\'
119119
'azure-functions-core-tools\\bin\\workers\\python\\3.6\\WINDOWS'
120120
'\\X64'
121121
)
@@ -183,12 +183,12 @@ def test_get_worker_deps_path_with_no_worker_sys_path(self):
183183

184184
def test_get_worker_deps_path_from_windows_core_tools(self):
185185
# Test for Windows Core Tools Environment
186-
sys.path.append('C:\\Users\\hazeng\\AppData\\Roaming\\npm\\'
186+
sys.path.append('C:\\Users\\user\\AppData\\Roaming\\npm\\'
187187
'node_modules\\azure-functions-core-tools\\bin\\'
188188
'workers\\python\\3.6\\WINDOWS\\X64')
189189
result = DependencyManager._get_worker_deps_path()
190190
self.assertEqual(result,
191-
'C:\\Users\\hazeng\\AppData\\Roaming\\npm\\'
191+
'C:\\Users\\user\\AppData\\Roaming\\npm\\'
192192
'node_modules\\azure-functions-core-tools\\bin\\'
193193
'workers\\python\\3.6\\WINDOWS\\X64')
194194

@@ -267,7 +267,7 @@ def test_add_to_sys_path_disallow_module_resolution_from_namespace(self):
267267

268268
def test_add_to_sys_path_allow_resolution_from_import_statement(self):
269269
"""The standard Python import mechanism allows deriving a specific
270-
module in a import statement, e.g.
270+
module in an import statement, e.g.
271271
272272
from azure import functions # OK
273273
"""

0 commit comments

Comments
 (0)