Skip to content

Commit 5e64e3f

Browse files
release: v1.6.0 (#189)
* chore: bump version. Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs: Update changelog with the release Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs: Use new `conversion` module over deprecated APIs. Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * docs: Also sort imports in README Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs: cleanup README and refereance latest Flask Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8a88ffe commit 5e64e3f

File tree

7 files changed

+29
-16
lines changed

7 files changed

+29
-16
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [1.6.0] — 2022-08-17
910
### Added
1011
- A new `CloudEvent` optional `pydantic` model class is available in the
1112
`cloudevents.pydantic.event` module. The new model enables the integration of
@@ -141,6 +142,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
141142
### Added
142143
- Initial release
143144

145+
[1.6.0]: https://github.com/cloudevents/sdk-python/compare/1.5.0...1.6.0
144146
[1.5.0]: https://github.com/cloudevents/sdk-python/compare/1.4.0...1.5.0
145147
[1.4.0]: https://github.com/cloudevents/sdk-python/compare/1.3.0...1.4.0
146148
[1.3.0]: https://github.com/cloudevents/sdk-python/compare/1.2.0...1.3.0

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ This SDK current supports the following versions of CloudEvents:
1414

1515
## Python SDK
1616

17-
Package **cloudevents** provides primitives to work with CloudEvents specification: https://github.com/cloudevents/spec.
17+
Package **cloudevents** provides primitives to work with CloudEvents specification:
18+
https://github.com/cloudevents/spec.
1819

1920
### Installing
2021

@@ -32,7 +33,8 @@ Below we will provide samples on how to send cloudevents using the popular
3233
### Binary HTTP CloudEvent
3334

3435
```python
35-
from cloudevents.http import CloudEvent, to_binary
36+
from cloudevents.http import CloudEvent
37+
from cloudevents.conversion import to_binary
3638
import requests
3739

3840
# Create a CloudEvent
@@ -54,7 +56,8 @@ requests.post("<some-url>", data=body, headers=headers)
5456
### Structured HTTP CloudEvent
5557

5658
```python
57-
from cloudevents.http import CloudEvent, to_structured
59+
from cloudevents.conversion import to_structured
60+
from cloudevents.http import CloudEvent
5861
import requests
5962

6063
# Create a CloudEvent
@@ -73,12 +76,13 @@ headers, body = to_structured(event)
7376
requests.post("<some-url>", data=body, headers=headers)
7477
```
7578

76-
You can find a complete example of turning a CloudEvent into a HTTP request [in the samples directory](samples/http-json-cloudevents/client.py).
79+
You can find a complete example of turning a CloudEvent into a HTTP request
80+
[in the samples' directory](samples/http-json-cloudevents/client.py).
7781

7882
## Receiving CloudEvents
7983

8084
The code below shows how to consume a cloudevent using the popular python web framework
81-
[flask](https://flask.palletsprojects.com/en/1.1.x/quickstart/):
85+
[flask](https://flask.palletsprojects.com/en/2.2.x/quickstart/):
8286

8387
```python
8488
from flask import Flask, request
@@ -107,15 +111,18 @@ if __name__ == "__main__":
107111
app.run(port=3000)
108112
```
109113

110-
You can find a complete example of turning a CloudEvent into a HTTP request [in the samples directory](samples/http-json-cloudevents/json_sample_server.py).
114+
You can find a complete example of turning a CloudEvent into a HTTP request
115+
[in the samples' directory](samples/http-json-cloudevents/json_sample_server.py).
111116

112117
## SDK versioning
113118

114-
The goal of this package is to provide support for all released versions of CloudEvents, ideally while maintaining
115-
the same API. It will use semantic versioning with following rules:
119+
The goal of this package is to provide support for all released versions of CloudEvents,
120+
ideally while maintaining the same API. It will use semantic versioning
121+
with following rules:
116122

117123
- MAJOR version increments when backwards incompatible changes is introduced.
118-
- MINOR version increments when backwards compatible feature is introduced INCLUDING support for new CloudEvents version.
124+
- MINOR version increments when backwards compatible feature is introduced
125+
INCLUDING support for new CloudEvents version.
119126
- PATCH version increments when a backwards compatible bug fix is introduced.
120127

121128
## Community
@@ -144,8 +151,8 @@ information.
144151

145152
## Maintenance
146153

147-
We use [black][black] and [isort][isort] for autoformatting. We set up a [tox][tox] environment
148-
to reformat the codebase.
154+
We use [black][black] and [isort][isort] for autoformatting. We set up a [tox][tox]
155+
environment to reformat the codebase.
149156

150157
e.g.
151158

cloudevents/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
__version__ = "1.5.0"
15+
__version__ = "1.6.0"

samples/http-image-cloudevents/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
import requests
1818

19-
from cloudevents.http import CloudEvent, to_binary, to_structured
19+
from cloudevents.conversion import to_binary, to_structured
20+
from cloudevents.http import CloudEvent
2021

2122
resp = requests.get(
2223
"https://raw.githubusercontent.com/cncf/artwork/master/projects/cloudevents/horizontal/color/cloudevents-horizontal-color.png" # noqa

samples/http-image-cloudevents/image_sample_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
from image_sample_server import app
2222
from PIL import Image
2323

24-
from cloudevents.http import CloudEvent, from_http, to_binary, to_structured
24+
from cloudevents.conversion import to_binary, to_structured
25+
from cloudevents.http import CloudEvent, from_http
2526

2627
image_fileobj = io.BytesIO(image_bytes)
2728
image_expected_shape = (1880, 363)

samples/http-json-cloudevents/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
import requests
1818

19-
from cloudevents.http import CloudEvent, to_binary, to_structured
19+
from cloudevents.conversion import to_binary, to_structured
20+
from cloudevents.http import CloudEvent
2021

2122

2223
def send_binary_cloud_event(url):

samples/http-json-cloudevents/json_sample_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
import pytest
1616
from json_sample_server import app
1717

18-
from cloudevents.http import CloudEvent, to_binary, to_structured
18+
from cloudevents.conversion import to_binary, to_structured
19+
from cloudevents.http import CloudEvent
1920

2021

2122
@pytest.fixture

0 commit comments

Comments
 (0)