Skip to content

Commit f01ea13

Browse files
vrdmrgavin-aguiar
andauthored
style: Isortifying the repo and adding pyproject.toml (#1526)
* style: Isortifying the repo and adding pyproject.toml * Sorting tests imports * Fixing the line length to 88 * Updating PyProject.toml * Updating PyProject.toml * Addressed comments on pyproject * Updated dependencies to the 3.7 supported versions --------- Co-authored-by: gavin-aguiar <[email protected]> Co-authored-by: gavin-aguiar <[email protected]>
1 parent 97cb71f commit f01ea13

File tree

176 files changed

+685
-402
lines changed

Some content is hidden

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

176 files changed

+685
-402
lines changed

.github/linters/tox.ini

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 2 deletions
This file was deleted.

azure_functions_worker/_thirdparty/typing_inspect.py

Lines changed: 2 additions & 4 deletions
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

Lines changed: 14 additions & 10 deletions
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 12 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 8 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 0 deletions
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

0 commit comments

Comments
 (0)