Skip to content

Commit 8ef845c

Browse files
authored
Minor code smell refactoring, updating pipelines and description added. (#64)
1 parent 8cab4c1 commit 8ef845c

38 files changed

+113
-98
lines changed

azure-pipelines.yml

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
11
trigger:
2-
- master
3-
- dev
2+
- master
3+
- dev
4+
5+
schedules:
6+
- cron: "0 8 * * 1,3,5"
7+
displayName: Monday, Wednesday and Friday - 1 AM (PDT) build
8+
branches:
9+
include:
10+
- dev
11+
- master
12+
exclude:
13+
- release/*
14+
- releases/ancient/*
415

516
jobs:
6-
- job: Tests
7-
pool:
8-
vmImage: 'ubuntu-16.04'
9-
strategy:
10-
matrix:
11-
Python36:
12-
pythonVersion: '3.6'
13-
Python37:
14-
pythonVersion: '3.7'
15-
Python38:
16-
pythonVersion: '3.8'
17-
maxParallel: 3
18-
steps:
19-
- task: UsePythonVersion@0
20-
inputs:
21-
versionSpec: '$(pythonVersion)'
22-
addToPath: true
23-
- task: ShellScript@2
24-
inputs:
25-
disableAutoCwd: true
26-
scriptPath: .ci/build.sh
27-
displayName: 'Build'
28-
- bash: |
29-
chmod +x .ci/run_tests.sh
30-
.ci/run_tests.sh
31-
displayName: 'Run Tests'
32-
- task: PublishCodeCoverageResults@1
33-
inputs:
34-
codeCoverageTool: cobertura
35-
summaryFileLocation: coverage.xml
36-
- bash: |
37-
rm coverage.xml
38-
displayName: 'Clearing coverage.xml file'
17+
- job: Tests
18+
pool:
19+
vmImage: 'ubuntu-16.04'
20+
strategy:
21+
matrix:
22+
Python36:
23+
pythonVersion: '3.6'
24+
Python37:
25+
pythonVersion: '3.7'
26+
Python38:
27+
pythonVersion: '3.8'
28+
maxParallel: 3
29+
steps:
30+
- task: UsePythonVersion@0
31+
inputs:
32+
versionSpec: '$(pythonVersion)'
33+
addToPath: true
34+
- task: ShellScript@2
35+
inputs:
36+
disableAutoCwd: true
37+
scriptPath: .ci/build.sh
38+
displayName: 'Build'
39+
- bash: |
40+
chmod +x .ci/run_tests.sh
41+
.ci/run_tests.sh
42+
displayName: 'Run Tests'
43+
- task: PublishCodeCoverageResults@1
44+
inputs:
45+
codeCoverageTool: cobertura
46+
summaryFileLocation: coverage.xml
47+
- bash: |
48+
rm coverage.xml
49+
displayName: 'Clearing coverage.xml file'

azure/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
from pkgutil import extend_path
45
import typing
6+
57
__path__: typing.Iterable[str] = extend_path(__path__, __name__)

azure/functions/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
from ._abc import TimerRequest, InputStream, Context, Out # NoQA
45
from ._eventhub import EventHubEvent # NoQA
56
from ._eventgrid import EventGridEvent, EventGridOutputEvent # NoQA
@@ -12,6 +13,7 @@
1213
from ._servicebus import ServiceBusMessage # NoQA
1314
from ._durable_functions import OrchestrationContext # NoQA
1415
from .meta import get_binding_registry # NoQA
16+
1517
# Import binding implementations to register them
1618
from . import blob # NoQA
1719
from . import cosmosdb # NoQA

azure/functions/_abc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
import abc
45
import datetime
56
import io

azure/functions/_cosmosdb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
import collections
45
import json
56

azure/functions/_durable_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
from typing import Union
45
from . import _abc
56
from importlib import import_module
@@ -35,12 +36,11 @@ def _serialize_custom_object(obj):
3536
"function")
3637
# Encode to json using the object's `to_json`
3738
obj_type = type(obj)
38-
dict_obj = {
39+
return {
3940
"__class__": obj.__class__.__name__,
4041
"__module__": obj.__module__,
4142
"__data__": obj_type.to_json(obj)
4243
}
43-
return dict_obj
4444

4545

4646
def _deserialize_custom_object(obj: dict) -> object:

azure/functions/_eventgrid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
import datetime
45
import typing
56

azure/functions/_eventhub.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
import datetime
45
import typing
56

6-
from azure.functions import _abc as funcabc
7+
from azure.functions import _abc as func_abc
78
from azure.functions import meta
89

910

10-
class EventHubEvent(funcabc.EventHubEvent):
11+
class EventHubEvent(func_abc.EventHubEvent):
1112
"""A concrete implementation of Event Hub message type."""
1213

1314
def __init__(self, *,

azure/functions/_http.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
import collections.abc
45
import io
56
import json

azure/functions/_http_wsgi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
34
from typing import Callable, Dict, List, Optional, Any
45
from io import BytesIO, StringIO
56
from os import linesep

0 commit comments

Comments
 (0)