Skip to content

api: Remove cloudevents dependency#3150

Open
nuclearcat wants to merge 1 commit into
kernelci:mainfrom
nuclearcat:remove-cloudevents
Open

api: Remove cloudevents dependency#3150
nuclearcat wants to merge 1 commit into
kernelci:mainfrom
nuclearcat:remove-cloudevents

Conversation

@nuclearcat

Copy link
Copy Markdown
Member

The cloudevents library was only used to parse the Pub/Sub event JSON envelope and read its "data" field. The envelope is a plain CloudEvents 1.0 JSON object, so parse it with json.loads() and return the parsed dict from receive_event() and pop_event() instead of a CloudEvent instance. The wire format is unchanged.

This drops the cloudevents dependency, which would otherwise require Python 3.10+ and code changes with the 2.x major update.

The cloudevents library was only used to parse the Pub/Sub event
JSON envelope and read its "data" field. The envelope is a plain
CloudEvents 1.0 JSON object, so parse it with json.loads() and
return the parsed dict from receive_event() and pop_event()
instead of a CloudEvent instance. The wire format is unchanged.

This drops the cloudevents dependency, which would otherwise
require Python 3.10+ and code changes with the 2.x major update.

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant