Skip to content

Commit dc8d564

Browse files
Remove reload extension app setting (#1676)
Co-authored-by: hallvictoria <[email protected]>
1 parent 6b74a8b commit dc8d564

File tree

3 files changed

+1
-33
lines changed

3 files changed

+1
-33
lines changed

azure_functions_worker/constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
PYTHON_ISOLATE_WORKER_DEPENDENCIES_DEFAULT_310 = False
4747
PYTHON_ENABLE_WORKER_EXTENSIONS_DEFAULT = False
4848
PYTHON_ENABLE_WORKER_EXTENSIONS_DEFAULT_39 = True
49-
PYTHON_EXTENSIONS_RELOAD_FUNCTIONS = "PYTHON_EXTENSIONS_RELOAD_FUNCTIONS"
5049

5150
# new programming model default script file name
5251
PYTHON_SCRIPT_FILE_NAME = "PYTHON_SCRIPT_FILE_NAME"

azure_functions_worker/utils/common.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
from typing import Callable, Optional
99

1010
from azure_functions_worker.constants import (
11-
CUSTOMER_PACKAGES_PATH,
12-
PYTHON_EXTENSIONS_RELOAD_FUNCTIONS,
13-
)
11+
CUSTOMER_PACKAGES_PATH)
1412

1513

1614
def is_true_like(setting: str) -> bool:
@@ -116,25 +114,6 @@ def get_sdk_from_sys_path() -> ModuleType:
116114
ModuleType
117115
The azure.functions that is loaded from the first sys.path entry
118116
"""
119-
120-
if is_envvar_true(PYTHON_EXTENSIONS_RELOAD_FUNCTIONS):
121-
backup_azure_functions = None
122-
backup_azure = None
123-
124-
if 'azure.functions' in sys.modules:
125-
backup_azure_functions = sys.modules.pop('azure.functions')
126-
if 'azure' in sys.modules:
127-
backup_azure = sys.modules.pop('azure')
128-
129-
module = importlib.import_module('azure.functions')
130-
131-
if backup_azure:
132-
sys.modules['azure'] = backup_azure
133-
if backup_azure_functions:
134-
sys.modules['azure.functions'] = backup_azure_functions
135-
136-
return module
137-
138117
if CUSTOMER_PACKAGES_PATH not in sys.path:
139118
sys.path.insert(0, CUSTOMER_PACKAGES_PATH)
140119

tests/unittests/test_utilities.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import unittest
88
from unittest.mock import patch
99

10-
from azure_functions_worker.constants import PYTHON_EXTENSIONS_RELOAD_FUNCTIONS
1110
from azure_functions_worker.utils import common, wrappers
1211

1312
TEST_APP_SETTING_NAME = "TEST_APP_SETTING_NAME"
@@ -365,15 +364,6 @@ def test_get_sdk_dummy_version(self):
365364
sdk_version = common.get_sdk_version(module)
366365
self.assertNotEqual(sdk_version, 'dummy')
367366

368-
def test_get_sdk_dummy_version_with_flag_enabled(self):
369-
"""Test if sdk version can get dummy sdk version
370-
"""
371-
os.environ[PYTHON_EXTENSIONS_RELOAD_FUNCTIONS] = '1'
372-
sys.path.insert(0, self._dummy_sdk_sys_path)
373-
module = common.get_sdk_from_sys_path()
374-
sdk_version = common.get_sdk_version(module)
375-
self.assertEqual(sdk_version, 'dummy')
376-
377367
def test_valid_script_file_name(self):
378368
file_name = 'test.py'
379369
common.validate_script_file_name(file_name)

0 commit comments

Comments
 (0)