Skip to content

Commit 8763568

Browse files
authored
Merge branch 'dev' into vameru/implicit-output-binding-return
2 parents adbc388 + 42f67cc commit 8763568

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

azure_functions_worker/constants.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3-
import os
4-
import pathlib
53
import sys
64

75
# Capabilities
@@ -54,6 +52,4 @@
5452
RETRY_POLICY = "retry_policy"
5553

5654
# Paths
57-
CUSTOMER_PACKAGES_PATH = os.path.join(pathlib.Path.home(),
58-
pathlib.Path(
59-
"site/wwwroot/.python_packages"))
55+
CUSTOMER_PACKAGES_PATH = "/home/site/wwwroot/.python_packages/lib/site-packages"

azure_functions_worker/dispatcher.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ async def _handle__worker_init_request(self, request):
295295
import azure.functions # NoQA
296296

297297
if CUSTOMER_PACKAGES_PATH not in sys.path:
298-
logger.warning("Customer packages not in sys path. "
299-
"This should never happen! ")
298+
logger.warning("Customer packages not in sys path.")
300299

301300
# loading bindings registry and saving results to a static
302301
# dictionary which will be later used in the invocation request

python/prodV4/worker.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import os
2+
import pathlib
23
import sys
34

4-
from pathlib import Path
5-
65
# User packages
7-
PKGS_PATH = "site/wwwroot/.python_packages"
6+
PKGS_PATH = "/home/site/wwwroot/.python_packages"
87
VENV_PKGS_PATH = "site/wwwroot/worker_venv"
98

109
PKGS = "lib/site-packages"
@@ -36,12 +35,10 @@ def determine_user_pkg_paths():
3635
"""
3736
minor_version = sys.version_info[1]
3837

39-
home = Path.home()
40-
pkgs_path = os.path.join(home, PKGS_PATH)
4138
usr_packages_path = []
4239

4340
if minor_version in (7, 8, 9, 10, 11):
44-
usr_packages_path.append(os.path.join(pkgs_path, PKGS))
41+
usr_packages_path.append(os.path.join(PKGS_PATH, PKGS))
4542
else:
4643
raise RuntimeError(f'Unsupported Python version: 3.{minor_version}')
4744

@@ -50,7 +47,7 @@ def determine_user_pkg_paths():
5047

5148
if __name__ == '__main__':
5249
# worker.py lives in the same directory as azure_functions_worker
53-
func_worker_dir = str(Path(__file__).absolute().parent)
50+
func_worker_dir = str(pathlib.Path(__file__).absolute().parent)
5451
env = os.environ
5552

5653
# Setting up python path for all environments to prioritize

0 commit comments

Comments
 (0)