Skip to content

Commit

Permalink
fix master merge conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Curtis Mason <cumason@google.com>
  • Loading branch information
Curtis Mason committed Jun 23, 2020
2 parents 8083a26 + e027fa3 commit 172a878
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 403 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Expected Behavior


## Actual Behavior


## Steps to Reproduce the Problem

1.
2.
3.

## Specifications

- Platform:
- Python Version:
11 changes: 6 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
- Link to issue this resolves
Fixes #<issuelink>

- What I did
## Changes

- How I did it

- How to verify it
## One line description for the changelog

- One line description for the changelog

- [ ] Tests pass
- [ ] Appropriate changes to README are included in PR
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ This SDK is still considered a work in progress, therefore things might (and
will) break with every update.

This SDK current supports the following versions of CloudEvents:

- v1.0
- v0.3
- v0.2
- v0.1

## Python SDK

Expand Down Expand Up @@ -116,7 +115,6 @@ In this topic you'd find various example how to integrate an SDK with various HT

One of popular framework is [`requests`](http://docs.python-requests.org/en/master/).


#### CloudEvent to request

The code below shows how integrate both libraries in order to convert a CloudEvent into an HTTP request:
Expand Down Expand Up @@ -155,27 +153,29 @@ Complete example of turning a CloudEvent into a request you can find [here](samp
#### Request to CloudEvent

The code below shows how integrate both libraries in order to create a CloudEvent from an HTTP request:

```python
response = requests.get(url)
response.raise_for_status()
headers = response.headers
data = io.BytesIO(response.content)
event = v02.Event()
event = v1.Event()
http_marshaller = marshaller.NewDefaultHTTPMarshaller()
event = http_marshaller.FromRequest(
event, headers, data, json.load)

```
Complete example of turning a CloudEvent into a request you can find [here](samples/python-requests/request_to_cloudevent.py).

Complete example of turning a CloudEvent into a request you can find [here](samples/python-requests/request_to_cloudevent.py).

## SDK versioning

The goal of this package is to provide support for all released versions of CloudEvents, ideally while maintaining
the same API. It will use semantic versioning with following rules:
* MAJOR version increments when backwards incompatible changes is introduced.
* MINOR version increments when backwards compatible feature is introduced INCLUDING support for new CloudEvents version.
* PATCH version increments when a backwards compatible bug fix is introduced.

- MAJOR version increments when backwards incompatible changes is introduced.
- MINOR version increments when backwards compatible feature is introduced INCLUDING support for new CloudEvents version.
- PATCH version increments when a backwards compatible bug fix is introduced.

## Community

Expand Down
4 changes: 2 additions & 2 deletions cloudevents/sdk/converters/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
from cloudevents.sdk import exceptions
from cloudevents.sdk.converters import base
from cloudevents.sdk.event import base as event_base
from cloudevents.sdk.event import v02, v03, v1
from cloudevents.sdk.event import v03, v1


class BinaryHTTPCloudEventConverter(base.Converter):

TYPE = "binary"
SUPPORTED_VERSIONS = [v02.Event, v03.Event, v1.Event]
SUPPORTED_VERSIONS = [v03.Event, v1.Event]

def can_read(self, content_type: str) -> bool:
return True
Expand Down
137 changes: 0 additions & 137 deletions cloudevents/sdk/event/v01.py

This file was deleted.

88 changes: 0 additions & 88 deletions cloudevents/sdk/event/v02.py

This file was deleted.

18 changes: 1 addition & 17 deletions cloudevents/tests/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.

from cloudevents.sdk.event import v02, v03, v1
from cloudevents.sdk.event import v03, v1

contentType = "application/json"
ce_type = "word.found.exclamation"
Expand All @@ -22,14 +22,6 @@
body = '{"name":"john"}'

headers = {
v02.Event: {
"ce-specversion": "1.0",
"ce-type": ce_type,
"ce-id": ce_id,
"ce-time": eventTime,
"ce-source": source,
"Content-Type": contentType,
},
v03.Event: {
"ce-specversion": "1.0",
"ce-type": ce_type,
Expand All @@ -49,14 +41,6 @@
}

json_ce = {
v02.Event: {
"specversion": "1.0",
"type": ce_type,
"id": ce_id,
"time": eventTime,
"source": source,
"contenttype": contentType,
},
v03.Event: {
"specversion": "1.0",
"type": ce_type,
Expand Down
Loading

0 comments on commit 172a878

Please sign in to comment.