Skip to content

Commit 2cf6817

Browse files
committed
Merge branch 'dev'
2 parents 042f934 + 0800b4d commit 2cf6817

File tree

131 files changed

+889
-123
lines changed

Some content is hidden

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

131 files changed

+889
-123
lines changed

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
ignore = E402,E731
2+
ignore = W503,E402,E731
33
exclude =
44
.git, __pycache__, build, dist, .eggs, .github, .local,
5-
Samples, azure/worker/protos/, docs/
5+
Samples, azure/functions_worker/protos/, docs/

README.md

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,60 @@
11
[![Build Status](https://travis-ci.org/Azure/azure-functions-python-worker.svg?branch=dev)](https://travis-ci.org/Azure/azure-functions-python-worker)
22
[![Build status](https://ci.appveyor.com/api/projects/status/github/azure/azure-functions-python-worker?svg=true&branch=dev)](https://ci.appveyor.com/project/appsvc/azure-functions-python-worker)
33

4-
This repository will host the Python language worker impelementation for Azure Functions. We'll also be using it to track work items related to first class Python support. Feel free to leave comments about any of the features/design patterns.
4+
This repository will host the Python language worker implementation for Azure Functions. We'll also be using it to track work items related to Python support. Please feel free to leave comments about any of the features and design patterns.
55

6-
# Getting Started
7-
#### Creating a Python Function : [Developer guide](https://pythondeveloperguide.azurewebsites.net/)
8-
#### Understanding how things work : [Python language worker](https://github.com/Azure/azure-functions-python-worker/wiki/Worker-Architecture)
6+
> :construction: The project is currently **work in progress**. Please **do not use in production** as we expect developments over time. :construction:
97
10-
# Disclaimer
11-
The project is currently in progress. Please expect the feature and design patterns to develop or change over time. If you have any feedback or requests, you can file an issue or add comments.
8+
# Overview
129

13-
# Contributing
10+
Python support for Functions is based on [Python3.6](https://www.python.org/downloads/release/python-360/), [Functions on Linux](https://blogs.msdn.microsoft.com/appserviceteam/2017/11/15/functions-on-linux-preview/) and the [V2 Runtime](https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions).
11+
12+
Here is the current status of Python in Azure Functions:
13+
14+
What's available?
15+
16+
- Develop using Functions Core Tools (CLI)
17+
- Publish your Python functions using a Linux App Service Plan
18+
- Triggers / Bindings : HTTP/Webhook, Blob, Queue, Timer and Cosmos DB
19+
- Publish a custom image to Azure
20+
21+
What's coming?
22+
23+
- Publish your Python functions using the consumption (serverless) plan
24+
- Build, test, debug and publish using Visual Studio Code
25+
- Triggers / Bindings : Event Grid, Event Hubs, IoT Hub
26+
27+
# Get Started
28+
29+
- [Build and publish using the Functions Core Tools](https://github.com/Azure/azure-functions-python-worker/wiki/Create-Function-(CLI))
30+
- [Python developer guide](https://pythondeveloperguide.azurewebsites.net/)
31+
- [Binding API reference](https://pythondeveloperguide.azurewebsites.net/api.html#azure-functions-reference)
32+
33+
# Give Feedback
34+
35+
Issues and feature requests are tracked in a variety of places. To report this feedback, please file an issue to the relevant respository below:
36+
37+
|Item|Description|Link|
38+
|----|-----|-----|
39+
| Python Worker | Programming Model, Triggers & Bindings |[File an Issue](https://github.com/Azure/azure-functions-python-worker/issues)|
40+
| Linux | Base Docker Images |[File an Issue](https://github.com/Azure/azure-functions-docker/issues)|
41+
| Runtime | Script Host & Language Extensibility |[File an Issue](https://github.com/Azure/azure-functions-host/issues)|
42+
| Core Tools | Command line interface for local development |[File an Issue](https://github.com/Azure/azure-functions-core-tools/issues)|
43+
| Portal | User Interface or Experience Issue |[File an Issue](https://github.com/azure/azure-functions-ux/issues)|
44+
| Templates | Code Issues with Creation Template |[File an Issue](https://github.com/Azure/azure-functions-templates/issues)|
45+
46+
# Contribute
1447

1548
This project welcomes contributions and suggestions. Most contributions require you to agree to a
1649
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
1750
the rights to use your contribution. For details, visit https://cla.microsoft.com.
1851

52+
Here are some pointers to get started:
53+
54+
- [Language worker architecture](https://github.com/Azure/azure-functions-python-worker/wiki/Worker-Architecture)
55+
- [Setting up the development environment](https://github.com/Azure/azure-functions-python-worker/wiki/Contributor-Guide)
56+
- [Adding support for a new binding](https://github.com/Azure/azure-functions-python-worker/wiki/Adding-support-for-a-new-binding-type)
57+
1958
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
2059
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
2160
provided by the bot. You will only need to do this once across all repos using our CLA.

azure/functions/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from ._abc import HttpRequest, TimerRequest, InputStream, Context, Out # NoQA
2+
from ._abc import EventHubEvent # NoQA
3+
from ._abc import EventGridEvent # NoQA
24
from ._cosmosdb import Document, DocumentList # NoQA
35
from ._http import HttpResponse # NoQA
46
from ._queue import QueueMessage # NoQA

azure/functions/_abc.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,44 @@ def pop_receipt(self) -> typing.Optional[str]:
199199
pass
200200

201201

202+
class EventGridEvent(abc.ABC):
203+
@property
204+
@abc.abstractmethod
205+
def id(self) -> str:
206+
pass
207+
208+
@abc.abstractmethod
209+
def get_json(self) -> typing.Any:
210+
pass
211+
212+
@property
213+
@abc.abstractmethod
214+
def topic(self) -> str:
215+
pass
216+
217+
@property
218+
@abc.abstractmethod
219+
def subject(self) -> str:
220+
pass
221+
222+
@property
223+
@abc.abstractmethod
224+
def event_type(self) -> str:
225+
pass
226+
227+
@property
228+
@abc.abstractmethod
229+
def event_time(self) -> datetime.datetime:
230+
pass
231+
232+
@property
233+
@abc.abstractmethod
234+
def data_version(self) -> str:
235+
pass
236+
237+
202238
class Document(abc.ABC):
239+
203240
@classmethod
204241
@abc.abstractmethod
205242
def from_json(cls, json_data: str) -> 'Document':
@@ -225,3 +262,30 @@ def to_json(self) -> str:
225262

226263
class DocumentList(abc.ABC):
227264
pass
265+
266+
267+
class EventHubEvent(abc.ABC):
268+
269+
@abc.abstractmethod
270+
def get_body(self) -> bytes:
271+
pass
272+
273+
@property
274+
@abc.abstractmethod
275+
def partition_key(self) -> typing.Optional[str]:
276+
pass
277+
278+
@property
279+
@abc.abstractmethod
280+
def sequence_number(self) -> typing.Optional[int]:
281+
pass
282+
283+
@property
284+
@abc.abstractmethod
285+
def enqueued_time(self) -> typing.Optional[datetime.datetime]:
286+
pass
287+
288+
@property
289+
@abc.abstractmethod
290+
def offset(self) -> typing.Optional[str]:
291+
pass

azure/functions/_cosmosdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def from_json(cls, json_data: str) -> 'Document':
2323
def from_dict(cls, dct: dict) -> 'Document':
2424
"""Create a Document from a dict object."""
2525
filtered = {k: v for k, v in dct.items() if k not in _SYSTEM_KEYS}
26-
return cls(filtered) # type: ignore
26+
return cls(filtered)
2727

2828
def to_json(self) -> str:
2929
"""Return the JSON representation of the document."""

azure/worker/bindings/__init__.py renamed to azure/functions_worker/bindings/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# to get them registered and available:
1010
from . import blob # NoQA
1111
from . import cosmosdb # NoQA
12+
from . import eventgrid # NoQA
13+
from . import eventhub # NoQA
1214
from . import http # NoQA
1315
from . import queue # NoQA
1416
from . import timer # NoQA
File renamed without changes.

0 commit comments

Comments
 (0)