Skip to content

Commit 3eccfc2

Browse files
authored
Merge branch 'dev' into hallvictoria/blob-eg-source
2 parents 665ac90 + bbc683e commit 3eccfc2

File tree

224 files changed

+1458
-1049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+1458
-1049
lines changed

.artifactignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
_manifest\**
2+
bcde-output\**
3+
Experiment_PipReport_**
4+
GovCompDisc_Log_**
5+
GovCompDisc_Manifest_**
6+
GovCompDisc_Metadata_**
7+
ScanTelemetry_**

.ci/e2e_integration_test/start-e2e.ps1

+3-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ Write-Host "Preparing E2E integration tests..." -ForegroundColor Green
8989
Write-Host "-----------------------------------------------------------------------------`n" -ForegroundColor Green
9090
python -m pip install -U pip
9191
python -m pip install -U -e .[dev]
92-
python setup.py build
93-
python setup.py extension
92+
cd tests
93+
python -m invoke -c test_setup build-protos
94+
python -m invoke -c test_setup extensions
9495
Write-Host "-----------------------------------------------------------------------------`n" -ForegroundColor Green
9596
Write-Host "-----------------------------------------------------------------------------`n" -ForegroundColor Green
9697
Write-Host "-----------------------------------------------------------------------------`n" -ForegroundColor Green

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
// "forwardPorts": [],
4747

4848
// Use 'postCreateCommand' to run commands after the container is created.
49-
"postCreateCommand": "sudo python -m pip install -U pip && sudo python -m pip install -U -e .[dev] && sudo python setup.py webhost",
49+
"postCreateCommand": "sudo python -m pip install -U pip && sudo python -m pip install -U -e .[dev] && cd tests && sudo python -m invoke -c test_setup webhost",
5050

5151
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
5252
"remoteUser": "vscode",

.github/Scripts/deferred-bindings-e2e-tests.sh

-2
This file was deleted.

.github/Scripts/e2e-tests.sh

-2
This file was deleted.

.github/Scripts/fwpc-e2e-tests.sh

-2
This file was deleted.

.github/linters/tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exclude =
3232
venv*,
3333
scripts
3434

35-
max-line-length = 80
35+
max-line-length = 88
3636

3737
per-file-ignores =
3838
# import not used

.isort.cfg

-2
This file was deleted.

azure_functions_worker/_thirdparty/typing_inspect.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111

1212
# NOTE: This module must support Python 2.7 in addition to Python 3.x
1313

14-
import sys
1514
import collections.abc
16-
from typing import (
17-
Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias
18-
)
15+
import sys
16+
from typing import Callable, ClassVar, Generic, Tuple, TypeVar, Union, _GenericAlias
1917

2018
NEW_39_TYPING = sys.version_info[:3] >= (3, 9, 0) # PEP 560
2119
if NEW_39_TYPING:

azure_functions_worker/bindings/__init__.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3-
from .tracecontext import TraceContext
4-
from .retrycontext import RetryContext
3+
from .retrycontext import RetryContext # isort: skip
4+
from .tracecontext import TraceContext # isort: skip
55
from .context import Context
6-
from .meta import check_input_type_annotation
7-
from .meta import check_output_type_annotation
8-
from .meta import has_implicit_output
9-
from .meta import is_trigger_binding, load_binding_registry
10-
from .meta import from_incoming_proto, to_outgoing_proto, \
11-
to_outgoing_param_binding, check_deferred_bindings_enabled, \
12-
get_deferred_raw_bindings
6+
from .meta import (
7+
check_deferred_bindings_enabled,
8+
check_input_type_annotation,
9+
check_output_type_annotation,
10+
from_incoming_proto,
11+
get_deferred_raw_bindings,
12+
has_implicit_output,
13+
is_trigger_binding,
14+
load_binding_registry,
15+
to_outgoing_param_binding,
16+
to_outgoing_proto,
17+
)
1318
from .out import Out
1419

15-
1620
__all__ = (
1721
'Out', 'Context',
1822
'is_trigger_binding',

azure_functions_worker/bindings/context.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import threading
44
from typing import Type
55

6-
from . import TraceContext
7-
from . import RetryContext
6+
from . import RetryContext, TraceContext
87

98

109
class Context:

azure_functions_worker/bindings/datumdef.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3-
import logging
4-
from typing import Any, Optional
53
import json
4+
import logging
5+
from typing import Any, List, Optional
6+
67
from .. import protos
78
from ..logging import logger
8-
from typing import List
9+
910
try:
1011
from http.cookies import SimpleCookie
1112
except ImportError:
1213
from Cookie import SimpleCookie
14+
1315
from dateutil import parser
1416
from dateutil.parser import ParserError
15-
from .nullable_converters import to_nullable_bool, to_nullable_string, \
16-
to_nullable_double, to_nullable_timestamp
17+
18+
from .nullable_converters import (
19+
to_nullable_bool,
20+
to_nullable_double,
21+
to_nullable_string,
22+
to_nullable_timestamp,
23+
)
1724

1825

1926
class Datum:

azure_functions_worker/bindings/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33
import typing
4+
from typing import Any, Optional
45

56
from . import datumdef
6-
from typing import Any, Optional
77

88

99
class GenericBinding:

azure_functions_worker/bindings/meta.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
import sys
55
import typing
66

7-
87
from .. import protos
9-
from . import datumdef
10-
from . import generic
11-
12-
from .shared_memory_data_transfer import SharedMemoryManager
8+
from ..constants import (
9+
BASE_EXT_SUPPORTED_PY_MINOR_VERSION,
10+
CUSTOMER_PACKAGES_PATH,
11+
HTTP,
12+
HTTP_TRIGGER,
13+
)
1314
from ..http_v2 import HttpV2Registry
14-
from ..constants import CUSTOMER_PACKAGES_PATH, HTTP, HTTP_TRIGGER, \
15-
BASE_EXT_SUPPORTED_PY_MINOR_VERSION
1615
from ..logging import logger
17-
16+
from . import datumdef, generic
17+
from .shared_memory_data_transfer import SharedMemoryManager
1818

1919
PB_TYPE = 'rpc_data'
2020
PB_TYPE_DATA = 'data'

azure_functions_worker/bindings/shared_memory_data_transfer/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
https://github.com/Azure/azure-functions-host/issues/6791
1313
"""
1414

15-
from .file_accessor_factory import FileAccessorFactory
1615
from .file_accessor import FileAccessor
16+
from .file_accessor_factory import FileAccessorFactory
1717
from .shared_memory_constants import SharedMemoryConstants
1818
from .shared_memory_exception import SharedMemoryException
19-
from .shared_memory_map import SharedMemoryMap
2019
from .shared_memory_manager import SharedMemoryManager
20+
from .shared_memory_map import SharedMemoryMap
2121

2222
__all__ = (
2323
'FileAccessorFactory', 'FileAccessor', 'SharedMemoryConstants',

azure_functions_worker/bindings/shared_memory_data_transfer/file_accessor.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import mmap
55
from abc import ABCMeta, abstractmethod
66
from typing import Optional
7+
78
from .shared_memory_constants import SharedMemoryConstants as consts
89

910

azure_functions_worker/bindings/shared_memory_data_transfer/file_accessor_factory.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import os
55
import sys
66

7+
from ...constants import FUNCTIONS_WORKER_SHARED_MEMORY_DATA_TRANSFER_ENABLED
8+
from ...utils.common import is_envvar_true
79
from .file_accessor import DummyFileAccessor
810
from .file_accessor_unix import FileAccessorUnix
911
from .file_accessor_windows import FileAccessorWindows
10-
from ...constants import FUNCTIONS_WORKER_SHARED_MEMORY_DATA_TRANSFER_ENABLED
11-
from ...utils.common import is_envvar_true
1212

1313

1414
class FileAccessorFactory:

azure_functions_worker/bindings/shared_memory_data_transfer/file_accessor_unix.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4-
from azure_functions_worker import constants
5-
import os
64
import mmap
7-
from typing import Optional, List
5+
import os
86
from io import BufferedRandom
7+
from typing import List, Optional
8+
9+
from azure_functions_worker import constants
10+
11+
from ...logging import logger
12+
from ...utils.common import get_app_setting
13+
from .file_accessor import FileAccessor
914
from .shared_memory_constants import SharedMemoryConstants as consts
1015
from .shared_memory_exception import SharedMemoryException
11-
from .file_accessor import FileAccessor
12-
from ...utils.common import get_app_setting
13-
from ...logging import logger
1416

1517

1618
class FileAccessorUnix(FileAccessor):

azure_functions_worker/bindings/shared_memory_data_transfer/file_accessor_windows.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
import mmap
55
from typing import Optional
6-
from .shared_memory_exception import SharedMemoryException
7-
from .file_accessor import FileAccessor
6+
87
from ...logging import logger
8+
from .file_accessor import FileAccessor
9+
from .shared_memory_exception import SharedMemoryException
910

1011

1112
class FileAccessorWindows(FileAccessor):

azure_functions_worker/bindings/shared_memory_data_transfer/shared_memory_manager.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33

44
import uuid
55
from typing import Dict, Optional
6-
from .shared_memory_constants import SharedMemoryConstants as consts
7-
from .file_accessor_factory import FileAccessorFactory
8-
from .shared_memory_metadata import SharedMemoryMetadata
9-
from .shared_memory_map import SharedMemoryMap
10-
from ..datumdef import Datum
6+
7+
from ...constants import FUNCTIONS_WORKER_SHARED_MEMORY_DATA_TRANSFER_ENABLED
118
from ...logging import logger
129
from ...utils.common import is_envvar_true
13-
from ...constants import FUNCTIONS_WORKER_SHARED_MEMORY_DATA_TRANSFER_ENABLED
10+
from ..datumdef import Datum
11+
from .file_accessor_factory import FileAccessorFactory
12+
from .shared_memory_constants import SharedMemoryConstants as consts
13+
from .shared_memory_map import SharedMemoryMap
14+
from .shared_memory_metadata import SharedMemoryMetadata
1415

1516

1617
class SharedMemoryManager:

azure_functions_worker/bindings/shared_memory_data_transfer/shared_memory_map.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
import struct
77
import sys
88
from typing import Optional
9+
10+
from ...logging import logger
11+
from .file_accessor import FileAccessor
912
from .shared_memory_constants import SharedMemoryConstants as consts
1013
from .shared_memory_exception import SharedMemoryException
11-
from .file_accessor import FileAccessor
12-
from ...logging import logger
1314

1415

1516
class SharedMemoryMap:

azure_functions_worker/constants.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,15 @@
8181
# Base extension supported Python minor version
8282
BASE_EXT_SUPPORTED_PY_MINOR_VERSION = 8
8383

84+
# Appsetting to turn on OpenTelemetry support/features
85+
# Includes turning on Azure monitor distro to send telemetry to AppInsights
8486
PYTHON_ENABLE_OPENTELEMETRY = "PYTHON_ENABLE_OPENTELEMETRY"
85-
PYTHON_ENABLE_OPENTELEMETRY_DEFAULT = True
87+
PYTHON_ENABLE_OPENTELEMETRY_DEFAULT = False
88+
89+
# Appsetting to specify root logger name of logger to collect telemetry for
90+
# Used by Azure monitor distro
91+
PYTHON_AZURE_MONITOR_LOGGER_NAME = "PYTHON_AZURE_MONITOR_LOGGER_NAME"
92+
PYTHON_AZURE_MONITOR_LOGGER_NAME_DEFAULT = ""
93+
94+
# Appsetting to specify AppInsights connection string
95+
APPLICATIONINSIGHTS_CONNECTION_STRING = "APPLICATIONINSIGHTS_CONNECTION_STRING"

0 commit comments

Comments
 (0)