Skip to content

chore: Remove unused reload sdk app setting #1676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion azure_functions_worker/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
PYTHON_ISOLATE_WORKER_DEPENDENCIES_DEFAULT_310 = False
PYTHON_ENABLE_WORKER_EXTENSIONS_DEFAULT = False
PYTHON_ENABLE_WORKER_EXTENSIONS_DEFAULT_39 = True
PYTHON_EXTENSIONS_RELOAD_FUNCTIONS = "PYTHON_EXTENSIONS_RELOAD_FUNCTIONS"

# new programming model default script file name
PYTHON_SCRIPT_FILE_NAME = "PYTHON_SCRIPT_FILE_NAME"
Expand Down
23 changes: 1 addition & 22 deletions azure_functions_worker/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from typing import Callable, Optional

from azure_functions_worker.constants import (
CUSTOMER_PACKAGES_PATH,
PYTHON_EXTENSIONS_RELOAD_FUNCTIONS,
)
CUSTOMER_PACKAGES_PATH)


def is_true_like(setting: str) -> bool:
Expand Down Expand Up @@ -116,25 +114,6 @@ def get_sdk_from_sys_path() -> ModuleType:
ModuleType
The azure.functions that is loaded from the first sys.path entry
"""

if is_envvar_true(PYTHON_EXTENSIONS_RELOAD_FUNCTIONS):
backup_azure_functions = None
backup_azure = None

if 'azure.functions' in sys.modules:
backup_azure_functions = sys.modules.pop('azure.functions')
if 'azure' in sys.modules:
backup_azure = sys.modules.pop('azure')

module = importlib.import_module('azure.functions')

if backup_azure:
sys.modules['azure'] = backup_azure
if backup_azure_functions:
sys.modules['azure.functions'] = backup_azure_functions

return module

if CUSTOMER_PACKAGES_PATH not in sys.path:
sys.path.insert(0, CUSTOMER_PACKAGES_PATH)

Expand Down
10 changes: 0 additions & 10 deletions tests/unittests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import unittest
from unittest.mock import patch

from azure_functions_worker.constants import PYTHON_EXTENSIONS_RELOAD_FUNCTIONS
from azure_functions_worker.utils import common, wrappers

TEST_APP_SETTING_NAME = "TEST_APP_SETTING_NAME"
Expand Down Expand Up @@ -365,15 +364,6 @@ def test_get_sdk_dummy_version(self):
sdk_version = common.get_sdk_version(module)
self.assertNotEqual(sdk_version, 'dummy')

def test_get_sdk_dummy_version_with_flag_enabled(self):
"""Test if sdk version can get dummy sdk version
"""
os.environ[PYTHON_EXTENSIONS_RELOAD_FUNCTIONS] = '1'
sys.path.insert(0, self._dummy_sdk_sys_path)
module = common.get_sdk_from_sys_path()
sdk_version = common.get_sdk_version(module)
self.assertEqual(sdk_version, 'dummy')

def test_valid_script_file_name(self):
file_name = 'test.py'
common.validate_script_file_name(file_name)
Expand Down
Loading