Skip to content

Commit 87d390f

Browse files
committed
feat: pydantic
Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> Squashed commit of the following: commit f7cdffc2c124d1f2a4517588364b818795bc729d Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 22:32:27 2022 +0300 docs: canonical representation Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f0bffb4118d2936fa2f7ff759d218f706168fd61 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 22:04:33 2022 +0300 docs: remove duplicate deprecated module warnings Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit a9bc2cee634503d41ee257c039817fca0de164d8 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 22:02:54 2022 +0300 docs: fix grammar Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit 8b4f3db9e2c23c3d1ba68c0b3b1f0ea55e2972f5 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Aug 12 15:43:02 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 685e43d77d23e20f9f8272aefe29405d3249ef68 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:35:59 2022 +0300 test: exclude import testing Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f69bcd2759df7fc3ea16421947316191832fcfcb Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:33:48 2022 +0300 docs: simplify specversion documentation Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6199278600d60ab3f36dd45f93e8cc3ca03f88b5 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:33:14 2022 +0300 docs: specversion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 44de28b6d2ce9ae4c0cfff47967a86d9e2da36af Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:30:45 2022 +0300 refactor: optimize imports Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 4a6be338cc29e86cde7c2ce224d5b0127e142af9 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:29:28 2022 +0300 refactor: optimize imports Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 8615073ee4617895c41e097bdc4ecb868f8d0eb5 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:24:03 2022 +0300 refactor: remove anyt Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f03d23b39b2a8554321c9b71cc2a988a7c26d1f6 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:22:15 2022 +0300 feat: import is_binary and is_structured from converts module Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit b920645df88676a74341ba32ec4dd914855b5aa2 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:21:49 2022 +0300 style: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 0dbd63e713cb26fc951c205ad740f166d76df84d Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:18:50 2022 +0300 docs: cleanup license Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9fdef9480af3e3af277af6df4ea7ccff6a98a02a Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:41:52 2022 +0300 build: fixate python version Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit de47cc8412984cf22a75044ef63daa1c23cb4b18 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Aug 12 15:23:31 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 7be086530bd19748867a221313a221284b1679bb Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:23:24 2022 +0300 docs: improve best effort serialization docs Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit a55d60676e15ce83867be9f8c72f44d03d559773 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:22:49 2022 +0300 docs: fix grammar Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit 4d68ec402dbe3e4bac08fcdf821e07b49b321541 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:22:36 2022 +0300 docs: remove uneeded spacing Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit 9b3537e89f2bd3cabab21373266fc7c3f113afcf Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Aug 12 15:17:32 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 49635fe180b9ebdf49d77536869ee2d3601c8324 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:15:37 2022 +0300 docs: incompatible arguments error Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 909b72e612cbabe0bbf104a36df8d98b475bff30 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 18:14:24 2022 +0300 docs: pydantic not installed exception Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 141f9090f490757dec6453aa22f207329a616877 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Aug 12 13:57:31 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit d487124a648bd9b6bdb50f81794f2fff63e01016 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 12 16:56:46 2022 +0300 build: pin pydantic version on python 3.6 Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit a46feba840f99c5a86575d7df074798126b66ef3 Merge: 21368b5 47818a9 Author: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> Date: Thu Aug 11 12:28:57 2022 +0300 Merge branch 'main' into feature/pydantic commit 21368b5e123664810a03f19f06d3255be79b9e2e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Wed Aug 10 20:26:52 2022 +0300 feat: raise indicative error on non-installed pydantic feature Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 65745f351856b82fc9e0781307cb2d597bea7f26 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Wed Aug 10 20:26:36 2022 +0300 feat: pydantic feature not installed exception Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit ab218e7568d9c9ed51e74edfc30f2f820d9eb4cf Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Aug 8 22:10:56 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit a026d319daa39fad7621affb1deeef6b6d7793e1 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 01:10:16 2022 +0300 fix: test int correctly Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit c49afe41c071be8f6052b6198b419bb57609e26c Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 01:08:57 2022 +0300 test: incompatible types Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit fb74ae39a255adf0f23fe4d0920d902aedf8dd11 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Aug 8 21:38:12 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 9300c005a6647704601a48b92e591e371c2f3737 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:37:05 2022 +0300 test: backwards compatability with calling Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 15ccc350b5d8154dd3bce1af9de2a2fa9a803996 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:25:53 2022 +0300 test: test is structured backwards compatability Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit bfe441866a4a9371516114214f19649d445756ef Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:24:42 2022 +0300 test: improve is binary test Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit aa9a69dd1690d3f02a9fb7932a23756874548702 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:13:51 2022 +0300 stlye: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit fb81f310124a7711a3145df0a69282441f7c1e7c Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:13:00 2022 +0300 fix: remove code duplication Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 650dd1634cd3df74d56cd35faac0528067245832 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:11:56 2022 +0300 docs: explain why dependency what it is Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit b2780791314e46a918848de2aae9e778927a5441 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:10:15 2022 +0300 build: explicitly specify pydantic version Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 29e13ca9a67f39eefaad6ed1ca82317927ad8123 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:05:54 2022 +0300 docs: update example Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 42a4f016e5377041ba60bf631f4c413793fcf188 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Aug 9 00:04:59 2022 +0300 docs: init function Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e01c2b707473cf7fe1c56124d97cbd95da3ef10e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:58:10 2022 +0300 docs: explain why we ignore the data Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 5ddadf4e5bd158a93bdd1a2037a66e629c530126 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:53:32 2022 +0300 refactor: use custom exception type Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 8889abbcd233d4a244ccae4a3b56c42a1e31b24a Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:51:38 2022 +0300 feat: incompatible arguments error Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit a4dda34d41338cd80b3b821c9c3f5c5f5bcd5d2f Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:46:41 2022 +0300 refactor: use value error instead of assertion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 61f68a5f5c3ff81b46c05204af67a6fcf5a1f873 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Aug 8 20:43:10 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 1630fc36dbf161d8a0767a332f88606cd66bc394 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:41:37 2022 +0300 feat: add examples to field values Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e019c42194b8f07f45e84d49f8e463ff3c6a6faa Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:38:37 2022 +0300 fix: example data Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9b48f6e7270eb253cce7b8d24561f608a717c911 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:04:48 2022 +0300 docs: improve pydantic cloudevent base class Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6605fa822540e0291da221fba128dc7db9c54e8b Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:04:22 2022 +0300 style: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 39a3ba22c0bde0c5dba919ead1f3ba82f09df033 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 23:02:47 2022 +0300 docs: dumps and loads funcions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6d59e2902ed46cc1cdca8886e2f615d85a1b629b Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:46:17 2022 +0300 fix: pydantic dumps bugs Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 614496f5875b35e0e103a9b4f3df7e6a4a53c7cb Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:39:15 2022 +0300 Revert "refactor: make best effort serialize to json public" This reverts commit cdf7e2ebb5c92c9a7d362a5d6b2fb16aab0461a3. Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit cdf7e2ebb5c92c9a7d362a5d6b2fb16aab0461a3 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:35:31 2022 +0300 refactor: make best effort serialize to json public Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 75aa8436c3e6bd1865b326c5168c4e2e8ba4be27 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:33:49 2022 +0300 feat: add args and kwargs to best effort serialize to json Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e74ae8149280cbe7d56f11d1458af8bec5a9e37e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:32:14 2022 +0300 test: pydantic json event regression bug Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9f2e0c6e962b55f8a0683ee936b8a443ddb533c3 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:23:46 2022 +0300 perf: use http event for ce_json_* functions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 8af3ed1c48b278b14cdd127ba06c1f653bd3c4ba Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:20:01 2022 +0300 refactor: _best_effort_serialize_to_json type information also includes docs Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 20a4e0a1fabbd6d59d371d7340d93d1c01f732b0 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:13:35 2022 +0300 refactor: rename marshaller functions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9d7da629b64d84b0e99fffe306680ec023b1c39b Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:06:20 2022 +0300 fix: bad type information Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit b3f5bbc573baea1127c1390b1291956f43fba183 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:05:03 2022 +0300 docs: add module deprecation comments Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6882ada4f2dec848c521eda3e41f72290b80748d Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:04:03 2022 +0300 docs: add module deprecation comments Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 53e6dec5c1ab8161049ad185b5fedc82090c670f Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:03:32 2022 +0300 docs: add module deprecation comments Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 169d024cfb2372003b93e7ac33c409aef5f06759 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:02:44 2022 +0300 docs: add module deprecation comments Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 3d4b0c94d7182ac444cabf85b3ccda23c7afa813 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 22:01:42 2022 +0300 refactor: use deprecation function Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 5c39cc0add47806e5bffb6550f2a762c484672ba Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 21:59:54 2022 +0300 refactor: use deprecation functions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 064e2e8cef0c0cb41c837bfb018c037a2f83185b Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 21:57:17 2022 +0300 refactor: use deprecation functions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6ea1e54f8ea13b3a520e83991c9b129ef47b272e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 21:54:44 2022 +0300 refactor: deprecation functions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 71a06b6179b8d7142f4bd5c7690c2119d4448cb5 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 21:46:18 2022 +0300 docs: default time selection algorithm Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 3fcd085ff4ab6ec289f7c5f80ff369e03784c20e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 21:46:04 2022 +0300 docs: default id selection algorithm Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 3fdef87ef11d36945b527ad083409b895d249993 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 21:41:24 2022 +0300 docs: license Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 363679837cc7153b5cfdcb9b4aefa16d21e2c9fa Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Aug 8 21:32:39 2022 +0300 docs: improve documentation Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 53d1931387bb0b565cb1e76f5ddd5b25b0fdf002 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:21:45 2022 +0300 docs: conversion documentation Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 050ed7536b8797ae9f752715006bdc9d59d9b767 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:19:37 2022 +0300 docs: fix line length Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit bd70199a02551490f4533e773d7434af22daa711 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:15:05 2022 +0300 refactor: add best_effort suffix for clerefication Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 14ed5616b25a0fcf4498a5b6347865327cf66762 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:14:18 2022 +0300 docs: encode_attribute value Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6baf7d0726aed09b1394b8e4b36bbecafafa82d9 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:09:10 2022 +0300 refactor: move attributes to variable Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 3a77b1e446973d43e46db58e421323a11dde26f6 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun Aug 7 20:10:03 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 8ab108ac7221fdf1561965d37f21264558cb53da Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:09:54 2022 +0300 docs: _json_or_string Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit 4778c109543b7419fd443e436e32eb2d8ced4f1a Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun Aug 7 20:06:11 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 4809c75578e6b1058a69368fc8066a9056161b7a Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:06:03 2022 +0300 docs: from_dict better description Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit a538834fc5b49c34246c27637dd68afe1895a06b Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun Aug 7 20:04:20 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit f1d09a2dd2f1922b1226d31d6fefb6b9bdbc1d68 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:04:11 2022 +0300 docs: is_structured better description Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit 4cf7559aec29d77d4aa4bb29dd7b705a4e01ad56 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun Aug 7 20:01:56 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 1efab9149991adf2afa42bcd8a38d62c932827e0 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 23:01:48 2022 +0300 docs: is_binary Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit 8e44b2462226e24fe28837758a808b68c73a91ec Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun Aug 7 19:32:36 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit f9956d4d2d9935ee4e1a5f0f96bbd87a25044120 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Aug 7 22:32:27 2022 +0300 docs: canonical representation Co-authored-by: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> commit 42578aff4d07c2e4fc5030c57077b96c72eee3a7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Aug 6 15:11:45 2022 +0300 fix: circular dependency Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6b90af97f077d1cfae9912754092b0b6354a3a5b Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat Aug 6 12:01:59 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 789fb64fcff83593ba3c73104f2a08620b26962e Merge: 4e60121 785bfe7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Aug 6 15:02:07 2022 +0300 Merge branch 'main' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> # Conflicts: # cloudevents/abstract/event.py # cloudevents/conversion.py # cloudevents/http/event.py # cloudevents/http/http_methods.py # cloudevents/http/json_methods.py commit 4e60121514f31fdc538ae45a9ca00c2651334e4d Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Aug 5 14:18:33 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 58c18f2237efc8765a12d7183a5889739cb7f9e7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 5 17:14:39 2022 +0300 refactor: convert get_data and get_attributes to private member Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit c1e9105dea7ce9ea1a715d8583c32bfdc55afe2f Merge: d73311e 96c41a1 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 5 17:12:59 2022 +0300 Merge branch 'feature/abstract-cloudevent' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 96c41a15ca3df5be526e2836bce69a27b90402de Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 5 17:11:12 2022 +0300 build: ignore not-implemented functions in coverage Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 4e00b550625aded93047719a73c70fcf9f08a172 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Aug 5 17:09:17 2022 +0300 refactor: convert get_data and get_attributes to private member functions instead of classmethods Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit d73311e44203d9d2aabbb378a131da2f7941deb7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:30:55 2022 +0300 test: remove unused variable Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 82aa0d41f727c61f0ec4b8cb72f08c34166653d8 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:30:24 2022 +0300 style: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f376bb51e6c70b0f2827775adaf5865d0b2ed789 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:29:42 2022 +0300 style: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 5c6a511e2e234097b1b9ae782e7010c587d1f8a9 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:26:56 2022 +0300 style: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit dbb8263e28ae2725773e7e6225a68f4aa8c30dcc Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:25:33 2022 +0300 test: add backwards compatibility tests Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 7eb8c9991cad818d282380e44a9107dc732298ca Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:22:25 2022 +0300 refactor: use direct imports Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 175084a01a851e5237413bdbed482087ee752515 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:21:51 2022 +0300 test: http event dict serialization Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit dec8244fb9d22a1b18dccde0b229c3fec6760775 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:19:49 2022 +0300 refactor: use direct imports Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit fdf4e8124eb1b35784c74f79e8e0ace6a613be9e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:16:47 2022 +0300 test: fix to_dict bug Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit adfbd40a92ccb7dd2f83472c79ef8216f548bb47 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:16:10 2022 +0300 refactor: gut util module Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9024c83a7897e655ad363bb8ce6a9679707c9faf Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:13:07 2022 +0300 refactor: remove problematic mappings module Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit ee34c0e744d0d263efbd69750c72386db477d194 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:05:18 2022 +0300 style: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 73d35da6229d6ab3243685c2775e34abbadf3098 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:03:06 2022 +0300 fix: order confusion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 8ef16850d291f72c8f4e4aa90364a0feef491304 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:01:45 2022 +0300 fix: remove uneeded symbol Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 7238465ecd282ba63d3fa9a2b70f5a0118599771 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 02:00:34 2022 +0300 fix: circular imports Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 618d2182aa9fba80a8dc9e88aff9612360014b76 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:59:38 2022 +0300 fix: from_dict order confusion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f4c7f729db256d403b7943e2a7a2b62a69ffdc70 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:58:42 2022 +0300 refactor: move is structured to sdk Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e11913bfcdf2900c3045c109ee576b1a090bf5c9 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:57:25 2022 +0300 refactor: move is_binary to sdk Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 067e046204c16878e31a4f213ae4402866fc2415 Merge: 48d7d68 0c2bafc Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:55:32 2022 +0300 Merge branch 'feature/abstract-cloudevent' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> # Conflicts: # cloudevents/http/http_methods.py # cloudevents/http/json_methods.py commit 0c2bafc423590b2e858420d6317a7f33cc208edf Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:53:52 2022 +0300 refactor: remove optional type Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 48d7d68686f630ee0f1f31283a33900b4174878e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:50:22 2022 +0300 refactor: move all methods to conversion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 81905e73050f0ba89ff5ba4aa6a47257aad7aadb Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:43:46 2022 +0300 refactor: move json methods to conversion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 474bf4368d0e540fee0bdfa632d01c81a16223d1 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:42:25 2022 +0300 refactor: merge conversion logic under conversion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit a8156274a8fc5ebe9af45a0b25bf9f78b10273e6 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:37:28 2022 +0300 feat: init default cloudevent Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 523e1cb331f1131390581389ded2e6de762087e6 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:37:12 2022 +0300 docs: dict conversion functions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 88c168932b97e3a73d02238e81a2e87328f69469 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:35:20 2022 +0300 refactor: move dict methods to conversion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit b6e008a338b1e4fd5a1d805792a12131a88ce99a Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:30:38 2022 +0300 fix: broken merge Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 2e9e255322064001e04c91fba6d96d89c2da1859 Merge: 316a9fc fbc0632 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:27:27 2022 +0300 Merge branch 'feature/abstract-cloudevent' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> # Conflicts: # cloudevents/abstract/json_methods.py # cloudevents/conversion.py # cloudevents/http/event.py # cloudevents/http/http_methods.py # cloudevents/http/json_methods.py # cloudevents/http/util.py commit fbc063244b0408c515941cca3bc3b81fd41b2325 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:26:10 2022 +0300 refactor: use classmethods Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit a8872b9808ce5fa6fad09369820fe078d6c3c8b9 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:06:06 2022 +0300 test: remove broken tests Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 065ef912776e4544d160e39eb9c50161f3832bf8 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 01:02:17 2022 +0300 refactor: expose data and attributes in class Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit c0b54130c6ecfd96d8b3182a0d0802982b13f6ee Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 00:56:01 2022 +0300 refactor: remove mutation variables from contract Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 1109bc5b76d4b326799aa7f3e10d94b8b923f419 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 00:55:34 2022 +0300 docs: remove inconsistent types Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6a9201647c0650a0aeaf0360c3cf0d40058dfafd Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 00:54:22 2022 +0300 refactor: add default value for conversions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 5d0882d8b9b37604d792c8991d1aab0bf19266c7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 00:50:04 2022 +0300 test: rename badly named test Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 41c5f5984b069cb4ba85cf80f976fc30d435883b Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 00:48:37 2022 +0300 refactor: move all abstract conversion logic under conversion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f47087d490399613f6bbf0203193402dff2c6158 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 25 00:32:16 2022 +0300 Revert "refactor: rename abstract to generic" This reverts commit 89d30eb23d90f2ff27ec92cf47c30f0e8d9ac347. Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit ea19f7dbd6287ef0d8da9c17cccda0487ccb9eaa Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 23:10:53 2022 +0300 test: fix broken test Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit ba16cdd3aca56c3a24f3f63dbab401ff862966fd Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 23:10:43 2022 +0300 refactor: cloudevent is no longer absctract Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit d303eaecabedd5faed34fb8e0599f76111388f28 Merge: 89d30eb 61c8657 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 23:06:37 2022 +0300 Merge branch 'main' into feature/abstract-cloudevent Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> # Conflicts: # CHANGELOG.md # cloudevents/http/event.py # cloudevents/tests/test_http_cloudevent.py commit 89d30eb23d90f2ff27ec92cf47c30f0e8d9ac347 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 23:04:58 2022 +0300 refactor: rename abstract to generic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit a22efbde377d23b0c05ad8ecdee06bd4e226c0fb Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 23:00:36 2022 +0300 test: add abstract cloudevent coverage tests Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 2b3c0f1292db53e75f1beb9dd8cb7321b3d60938 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 22:04:25 2022 +0300 docs: add missing comment to from_http Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 62595ffc3b8c018b417a37de045e16f9f7992e1b Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 22:02:48 2022 +0300 docs: explain why impl has no public attributes property Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit b9e8763594277cae4d4b49db59be6d447f8ffb29 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 21:59:53 2022 +0300 docs: not implemented errors Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit ecf9418a1bdaa9b9ed4d5cf1759213aa439b85c3 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 21:56:02 2022 +0300 docs: explain read model Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 1187600b1b3e343c362677ffb95037a7494e4d98 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 21:51:32 2022 +0300 docs: better cloudevent explenation Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit fb4f993536fe772004ee04e743441c511477e68c Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 21:50:22 2022 +0300 docs: getitem documentation Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 3845aa72951bfbe17177360cb91b9fa70602be20 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 24 21:48:38 2022 +0300 refactor: use anycloudevent for generics Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 316a9fca85a16f5771cf1cac7723d8711f3ada87 Merge: 8072e61 a96bd6c Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 01:22:39 2022 +0300 Merge branch 'feature/abstract-cloudevent' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit a96bd6cdde61ffa724c8e55d1fd474e8806f12c3 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 01:22:31 2022 +0300 feat: define abstract methods Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 8072e6110cbca2206e72a267f007e1e28f564c3c Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 01:18:30 2022 +0300 docs: wording Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e6b5c9c66d7774f9b993164e96b98dba1eed07b6 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 01:17:51 2022 +0300 refactor: explicit optional Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e51926c4d2e05c620f964b4cb5047bd5dec19dd7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 01:16:27 2022 +0300 refactor: use anystr Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 115c7f5223c4d4346c23786df7b0303a3b30ab4e Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Jul 22 22:14:15 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 60c00065679ddbd285898ada54a63459c514caa2 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 01:14:02 2022 +0300 test: remove pytest fixture parameterization Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 88f7ae58e7828c5b71b92e3cc3005a8a9ee2632e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 01:08:46 2022 +0300 feat: remove strict event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 982436c65b72ec46112645ede6fc9cdbe56ea6e4 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 01:08:07 2022 +0300 Revert "fix: strict event did not inherit descriptions" This reverts commit 63975cd67e5bdbc6889327914c1b78d3cd430aa7. Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> # Conflicts: # cloudevents/pydantic/event.py # cloudevents/pydantic/strict_event.py commit f569c541cf3f4d1850f5841504a90c087283766a Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Jul 22 21:59:25 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 43ecfeea816b2a98b6d2087e6c7d327817baed11 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:58:05 2022 +0300 refactor: remove uneeded code Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 154f7674533fa32f1789ed157353cc5d4ee1bceb Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:43:43 2022 +0300 refactor: integrate abstract event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 896299b66df63791258a4dc5594c30843ec76dae Merge: d034677 09062e3 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:40:46 2022 +0300 Merge branch 'feature/abstract-cloudevent' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 09062e35ff5350f8830b4c292dc075e335a970cf Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:40:40 2022 +0300 fix: intengrate data read model Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit d034677da266080c49a91cb857d9b660cb508111 Merge: fb5165e 5648968 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:39:03 2022 +0300 Merge branch 'feature/abstract-cloudevent' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 56489682c57b8c41cef6ece0600bbde0f756bd71 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:38:56 2022 +0300 feat: simplify data attributes Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit fb5165eb6c980fa4091dae66871e719e0b2a5aec Merge: af83fb0 01041e7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:28:21 2022 +0300 Merge branch 'feature/abstract-cloudevent' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> # Conflicts: # CHANGELOG.md # cloudevents/http/event.py # cloudevents/tests/test_http_cloudevent.py commit 01041e7cd5079a9a72bcc5479f942125f60496d7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:23:39 2022 +0300 docs: abstract cloudevent Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6588577ffc3030b79609d419ea3d9a6e206ca290 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 23 00:17:07 2022 +0300 refactor: create abstract cloudevent package Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit c747f59a296cf6dc373277259c7c839c62535635 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:31:06 2022 +0300 refactor: integrate abstract event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f1ff00908ea39332ed92da41e2e1cdfd1ad50599 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:58:52 2022 +0300 refactor: move to abstract Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 4488201812c17dca848540222e030a4106e19d96 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:40:05 2022 +0300 feat: any cloud event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 2b6483046ae82c8e7b45288a58efc6fed3950074 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:38:49 2022 +0300 feat: create function Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 5f8399fa096c7491d606ca8d68577f290fcbed33 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:31:55 2022 +0300 feat: add missing return type Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 41a9af287491d5080f3d6d3568dda26d50f9cedd Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:30:57 2022 +0300 feat: abstract event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit af83fb084cdd882a607982ad6352446804f45252 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:08:55 2022 +0300 fix: use python 3 type hints Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 771d2ab147e1755feb5cc0c2ee36edabb076e5e1 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:07:44 2022 +0300 test: explicit value names Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 899e81b670719a45bfc3fa2ff673da4ce90a46a5 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:04:53 2022 +0300 fix: make specversion comperable to strings Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 476d8226cf1b1ca6c6bd9e12cb9b380084f259ae Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:02:29 2022 +0300 docs: make return value more precise Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9896252a7b999d199c58d788fbc6e4bedb3aac53 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 23:00:00 2022 +0300 refactor: merge attributes to signle module Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 4be431f47fb3a06febe1bf73807a4ff754d722f7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 22:53:30 2022 +0300 build: explicit pydantic version Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e44e99687d03b717de0a9fe3abe43d4bdbf02c6f Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 22:46:51 2022 +0300 feat: remove content type from strict event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit eeb608cbfdbb23740cc90c701d9d4d3c20b8d5e4 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Fri Jul 22 22:46:22 2022 +0300 build: move pydantic tox deps to test.txt Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 63975cd67e5bdbc6889327914c1b78d3cd430aa7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 02:40:09 2022 +0300 fix: strict event did not inherit descriptions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 53ab87b817ce995894ce5b41cb6b775491e87105 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Jul 18 23:20:43 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 50a7fb506eecaba04434519eac49cfd5927d0929 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 02:20:31 2022 +0300 stlye: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit a7af0363228bab5309258ec720fda6bf21fe0ddf Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 02:19:39 2022 +0300 test: strict cloudevent Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit bdfb997e7fa5a5e00ba442fc2d3251c8c05aebf5 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 02:14:47 2022 +0300 test: pydantic json methods Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 1f580ecefbaf529a00da7a60820fab7e63de5da1 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 02:14:29 2022 +0300 fix: use correct import Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 030e7c0daa74592dfe32689c85c2f9fa8171f6b9 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 02:11:09 2022 +0300 test: pydantic events integration Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 92cb622bfe2f6230c9184fed05843cfda544bcc2 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 02:06:48 2022 +0300 fix: encode attribute access Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9d334563c2febdeda2776a7f02e8ed8278b1e96d Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 02:05:45 2022 +0300 feat: make encode attribute value public Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 100c78905ecf96c9afc01702f524426f77d882ff Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:57:38 2022 +0300 feat: strict event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 703fe1a78f5bb024d2b0d9e6cdc099e42c493d00 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:57:34 2022 +0300 feat: lax event requirments Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f2c9bc4af56b243e62949a99bbe890f069833fcc Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:50:48 2022 +0300 feat: add more proxy imports Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e8163a9bc1e1a3cff3b03ff20cb41a868c8d283e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:48:25 2022 +0300 test: data not in dummy event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit c3c9c7d1d3bfa56750da99f79a1c18d5d1efc105 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:46:55 2022 +0300 test: fix broken dummy values Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit bac4f19e6289137da53618476005985c4276cefe Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Jul 18 22:42:35 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 5f7c7b0b9620fbc841856fb43bfff4de7ca9ac95 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:37:28 2022 +0300 test: repr Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 593fa84428c5f0238cbce22461b85ea4eb62a664 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:35:36 2022 +0300 test: event length Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 0259e46aa4df676c015cf666bae7e5577c8be803 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:35:21 2022 +0300 fix: incorrect iteration Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit bafcec8c2923e3f02a1138578dd04cb35673a36a Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:30:56 2022 +0300 Revert "refactor: better iter type signature" This reverts commit 8bb3e76bf15d925ee5b5ac80e045d320f0bfbaa3. Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 8bec7b3dd014e0849a128c3ef5865f9b11bc94d5 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:28:53 2022 +0300 test: item access Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 8bb3e76bf15d925ee5b5ac80e045d320f0bfbaa3 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:23:14 2022 +0300 refactor: better iter type signature Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 37fdeec23bf136e771dc30195564a4bc77860a2f Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:15:27 2022 +0300 docs: cloudevent methods Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit e0ad1ae47261e7276f086fb06aa1730b055d72d4 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:09:37 2022 +0300 docs: fix typo Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 0095236d29e46adef34e1a80a1deb9deeb471557 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:09:23 2022 +0300 docs: fix typo Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 3eb1fe165527fdbc77b33b01ed8090f701022a51 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Jul 18 22:04:19 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 96d5b66b082b962b35895d48a073567d607d9ed2 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 01:03:13 2022 +0300 test: add xfail on the json content type Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 643ed7692184dc0cebb04ba92350779ffd15c66c Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Jul 18 21:19:50 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit efb5950b30129b78726bc601fae81c15225fdf97 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 00:18:52 2022 +0300 test: json or string Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 3307e2df6b6b21f6a37c29baa9829246ea4d7d3c Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 00:13:05 2022 +0300 refactor: better type information Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 6f336804dc33e844d54aed1385e3f2db516401da Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 00:10:16 2022 +0300 fix: add optional to signature Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit cb29c54effbf1e0dde28b08d426c67c67c58e705 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:55:25 2022 +0300 fix: add missing decode exception Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 412d1912c133b52851061646c9cf765b63c1c0e1 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Tue Jul 19 00:02:14 2022 +0300 fix: return str not bytes Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 00cc4e3ed232354a518887eeb2e998a7b021acbf Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:56:58 2022 +0300 fix: use correct iteration Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit c7693a1066a7bed4939d7f9fd23f80054d1f630e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:47:26 2022 +0300 fix: normalize datetime Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 0adbc5e08d752a8ec0a1c72e9d3f9b5e95f2092f Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:45:54 2022 +0300 refactor: simplify ce json Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 61025385ec677d61790716a4040094c83104d382 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:44:08 2022 +0300 refactor: simplify http adapter Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f3f22f175821560b3fc5681120e61e1e1d0a30e4 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:42:58 2022 +0300 feat: dict methods Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 08ab2ce7a61023069c6cbdc2f66d20c033e693c4 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:31:44 2022 +0300 feat: add type information for init Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 914bbcc18c296fcdf924b11442c21d8208f579d4 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:29:56 2022 +0300 fix: normalize enums Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit aeddc2e120a82a83dbb9adbad72614a9bc00b9b8 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:22:34 2022 +0300 fix: remove *args Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 50f985d36f822295cb8c73e8a9eb0e5f5b93fe22 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:21:55 2022 +0300 refactor: move json format methods to event module to prevent confusion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 73c0ada30fc7b037aca1fafd54bf4f7908e9ccd2 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:12:11 2022 +0300 feat: http methods Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 016a3d63a65f7e7f25121401bd2a875daf005fb6 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:11:59 2022 +0300 docs: license Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 388b27837adc3cba781a3accdd546ef5350d404b Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:06:32 2022 +0300 refactor: json methods to use http json methods Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 41a653937db75f6044e0e358c4228fea8561f6ee Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 23:05:48 2022 +0300 style: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 03fcc8df2661c8d9969b701b7affbc13e5e175f3 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 22:57:49 2022 +0300 feat: simplify json functions Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit cb88107c9c2bbd81e0ab5c372b5777faddf2eb4e Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 22:57:36 2022 +0300 feat: from http event Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit cabcf2a02fb1d7debb635818a8bf74207078a94f Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Mon Jul 18 22:50:24 2022 +0300 feat: http adapter Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 09fd02f727cd639ca6d5c7f3b0c579fe627ea5c5 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 22:01:57 2022 +0300 test: fix tests to adjust to specversion changes Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit c3c6f63a15d549aa24449b96248d957afa7a9c81 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:59:05 2022 +0300 fix: imports Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit d0253111eda0425df2779ad61777f5093c9c3437 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:56:26 2022 +0300 feat: spec version enum Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit dcd3871f502fe69293407ad97eb2ec5946334819 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:50:57 2022 +0300 refactor: split defaults module to attribute modules Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit fc0d718bcac9ec155a8d290fbfae21a4bd04bb82 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:45:44 2022 +0300 fix: every absolute uri is a uri reference Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 82e3439b8efb8a478d10f7425062a02f1bef7d07 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:44:42 2022 +0300 docs: explain why cannot use pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit fbdf8fd5c48449bb6fead21ad1dfd7ec5f335a8a Merge: eb32f0a 3bcf126 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:38:16 2022 +0300 Merge remote-tracking branch 'origin/feature/pydantic' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit eb32f0a910e8baded4549af6e07cf21538938470 Merge: 81935fc 0a95e63 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:38:03 2022 +0300 Merge remote-tracking branch 'upstream/main' into feature/pydantic Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 3bcf126a46857a27d46aefba2d456d853a18cde8 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun Jul 17 18:36:12 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 81935fcdf760222483f23728ce83be388974a623 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:30:14 2022 +0300 test: remove unused import Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 5452151b330d463f4eaf6d91ffc77e6c9d031db7 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun Jul 17 18:16:39 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit a849f536283836d2b66aa951b9fefce18999415a Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:12:28 2022 +0300 build: add missing pydantic dep Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit ce2526522b2e8f84e82e326ab744858179bf93eb Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sun Jul 17 21:09:10 2022 +0300 style: formatting Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9870c3c90a6f978d2137374aafb3b477ad9e2378 Author: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> Date: Fri Jul 15 11:22:29 2022 +0300 ci: migrate to `main` branch (#180) * ci: migrate to `main` branch Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs: mentioned default branch change in the changelog Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit be213912bcb8f5d308a8748442f7990d479672db Author: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> Date: Thu Jul 14 12:11:16 2022 +0300 release: v1.4.0 (#179) Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 84b488ac8a50131dd82c618cee6869d7be231366 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Thu Jul 14 00:10:08 2022 +0300 fix __eq__ operator raises attribute error on non-cloudevent values (#172) * fix: non-cloudevents values must not equal to cloudevents values (#171) Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> * test: refactor move fixtures to beginning Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> * test: cloudevent equality bug regression (#171) Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> * style: remove redundent else Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> * test: remove redundent test Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> * test: refactor non_cloudevent_value into a parameterization Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> * docs: update changelog Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * docs: fix bad merge Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 396c011a24964398e7d885bd13b441bb75b3a8e2 Author: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> Date: Mon Jul 11 20:05:45 2022 +0300 chore: drop `docs` and related files (#168) * chore: drop `docs` and related files Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs: update changelog Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit faff6dca07eec7f4e7bfbf5b5308c440e8424f65 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat Jul 16 12:24:07 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 9d8b6df94fa4ccbf70d060d9531a3830a101a196 Author: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> Date: Fri Jul 15 11:22:29 2022 +0300 ci: migrate to `main` branch (#180) * ci: migrate to `main` branch Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs: mentioned default branch change in the changelog Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit fa540c714781f641615282a57cca369d89f456d9 Author: Yurii Serhiichuk <xSAVIKx@users.noreply.github.com> Date: Thu Jul 14 12:11:16 2022 +0300 release: v1.4.0 (#179) Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> commit 573098232524d9dbb627615cdd0cdd42834dbed0 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 15:16:38 2022 +0300 style: sort imports Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 14fdbfcc760ea6a0c2e00c8760eecc4132942685 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 15:14:34 2022 +0300 feat: add more examples Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 49bd752b1efac4ba25826beb1ff3e09642f40352 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 15:04:51 2022 +0300 test: binary data deserialization Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit c5a8b8668029a68dbe3e6d27b2f876da2ee566c0 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 15:02:30 2022 +0300 fix: raise correct exception type to prevent confusion Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 0e075ae22531c042d89874c56e8d5076f81d8894 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 14:57:42 2022 +0300 test: binary data serialization Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit b325caeec49fcb1d2cd0e125881bec49e137e0a7 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 14:57:23 2022 +0300 fix: forbid api mixing Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit f07169dff83dd9d830cf9f927d0c922a8c5aaefa Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 14:47:06 2022 +0300 test: json content type serialization Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 525dee0ddeb2bf035e13383e29994e3ef785e761 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 14:39:16 2022 +0300 fix: incorrect behaviour for mirroring Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com> commit 29a48598877562a5f8ad392bea51ceb4c4815343 Author: Alexander Tkachev <sasha64sasha@gmail.com> Date: Sat Jul 16 14:33:37 2022 +0300 test: pydantic cloudevent Signed-off-by: Alexander Tkachev <sasha64sasha@gmai…
1 parent 47818a9 commit 87d390f

25 files changed

+1901
-149
lines changed

cloudevents/conversion.py

Lines changed: 106 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,44 @@
2323
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
2424
# License for the specific language governing permissions and limitations
2525
# under the License.
26+
import datetime
27+
import enum
2628
import json
2729
import typing
2830

2931
from cloudevents import exceptions as cloud_exceptions
3032
from cloudevents.abstract import AnyCloudEvent
31-
from cloudevents.http import is_binary
32-
from cloudevents.http.mappings import _marshaller_by_format, _obj_by_version
33-
from cloudevents.http.util import _json_or_string
3433
from cloudevents.sdk import converters, marshaller, types
34+
from cloudevents.sdk.converters import is_binary
35+
from cloudevents.sdk.event import v1, v03
36+
37+
38+
def _best_effort_serialize_to_json(
39+
value: typing.Any, *args, **kwargs
40+
) -> typing.Optional[typing.Union[bytes, str, typing.Any]]:
41+
"""
42+
Serializes the given value into a JSON-encoded string.
43+
44+
Given a None value returns None as is.
45+
Given a non-JSON-serializable value returns return the value as is.
46+
47+
:param value: The value to be serialized into a JSON string.
48+
:return: JSON string of the given value OR None OR given value.
49+
"""
50+
if value is None:
51+
return None
52+
try:
53+
return json.dumps(value, *args, **kwargs)
54+
except TypeError:
55+
return value
56+
57+
58+
_default_marshaller_by_format = {
59+
converters.TypeStructured: lambda x: x,
60+
converters.TypeBinary: _best_effort_serialize_to_json,
61+
} # type: typing.Dict[str, types.MarshallerType]
62+
63+
_obj_by_version = {"1.0": v1.Event, "0.3": v03.Event}
3564

3665

3766
def to_json(
@@ -169,7 +198,7 @@ def _to_http(
169198
:returns: (http_headers: dict, http_body: bytes or str)
170199
"""
171200
if data_marshaller is None:
172-
data_marshaller = _marshaller_by_format[format]
201+
data_marshaller = _default_marshaller_by_format[format]
173202

174203
if event["specversion"] not in _obj_by_version:
175204
raise cloud_exceptions.InvalidRequiredFields(
@@ -222,3 +251,76 @@ def to_binary(
222251
format=converters.TypeBinary,
223252
data_marshaller=data_marshaller,
224253
)
254+
255+
256+
def best_effort_encode_attribute_value(value: typing.Any) -> typing.Any:
257+
"""
258+
SHOULD convert any value into a JSON serialization friendly format.
259+
260+
This function acts in a best-effort manner and MAY not actually encode the value
261+
if it does not know how to do that, or the value is already JSON-friendly.
262+
263+
:param value: Value which MAY or MAY NOT be JSON serializable.
264+
:return: Possibly encoded value.
265+
"""
266+
if isinstance(value, enum.Enum):
267+
return value.value
268+
if isinstance(value, datetime.datetime):
269+
return value.isoformat()
270+
271+
return value
272+
273+
274+
def from_dict(
275+
event_type: typing.Type[AnyCloudEvent],
276+
event: typing.Dict[str, typing.Any],
277+
) -> AnyCloudEvent:
278+
"""
279+
Constructs an Event object of a given `event_type` from
280+
a dict `event` representation.
281+
282+
:param event: The event represented as a dict.
283+
:param event_type: The type of the event to be constructed from the dict.
284+
:returns: The event of the specified type backed by the given dict.
285+
"""
286+
attributes = {
287+
attr_name: best_effort_encode_attribute_value(attr_value)
288+
for attr_name, attr_value in event.items()
289+
if attr_name != "data"
290+
}
291+
return event_type.create(attributes=attributes, data=event.get("data"))
292+
293+
294+
def to_dict(event: AnyCloudEvent) -> typing.Dict[str, typing.Any]:
295+
"""
296+
Converts given `event` to its canonical dictionary representation.
297+
298+
:param event: The event to be converted into a dict.
299+
:returns: The canonical dict representation of the event.
300+
"""
301+
result = {attribute_name: event.get(attribute_name) for attribute_name in event}
302+
result["data"] = event.data
303+
return result
304+
305+
306+
def _json_or_string(
307+
content: typing.Optional[typing.AnyStr],
308+
) -> typing.Optional[
309+
typing.Union[
310+
typing.Dict[typing.Any, typing.Any],
311+
typing.List[typing.Any],
312+
typing.AnyStr,
313+
]
314+
]:
315+
"""
316+
Returns a JSON-decoded dictionary or a list of dictionaries if
317+
a valid JSON string is provided.
318+
319+
Returns the same `content` in case of an error or `None` when no content provided.
320+
"""
321+
if content is None:
322+
return None
323+
try:
324+
return json.loads(content)
325+
except (json.JSONDecodeError, TypeError, UnicodeDecodeError):
326+
return content

cloudevents/exceptions.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,16 @@ class DataMarshallerError(GenericException):
3939

4040
class DataUnmarshallerError(GenericException):
4141
pass
42+
43+
44+
class IncompatibleArgumentsError(GenericException):
45+
"""
46+
Raised when a user tries to call a function with arguments which are incompatible
47+
with each other.
48+
"""
49+
50+
51+
class PydanticFeatureNotInstalled(GenericException):
52+
"""
53+
Raised when a user tries to use the pydantic feature but did not install it.
54+
"""

cloudevents/http/__init__.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from cloudevents.http.event import CloudEvent # noqa
16-
from cloudevents.http.event_type import is_binary, is_structured # noqa
17-
from cloudevents.http.http_methods import ( # noqa
15+
16+
from cloudevents.http.conversion import ( # noqa
17+
from_dict,
1818
from_http,
19+
from_json,
1920
to_binary,
20-
to_binary_http,
21+
to_dict,
22+
to_json,
2123
to_structured,
22-
to_structured_http,
2324
)
24-
from cloudevents.http.json_methods import from_json, to_json # noqa
25+
from cloudevents.http.event import CloudEvent # noqa
26+
from cloudevents.http.http_methods import to_binary_http # deprecated # noqa
27+
from cloudevents.http.http_methods import to_structured_http # deprecated # noqa
28+
from cloudevents.sdk.converters.binary import is_binary # noqa
29+
from cloudevents.sdk.converters.structured import is_structured # noqa

cloudevents/http/conversion.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import typing
2+
3+
from cloudevents.conversion import from_dict as _abstract_from_dict
4+
from cloudevents.conversion import from_http as _abstract_from_http
5+
from cloudevents.conversion import from_json as _abstract_from_json
6+
from cloudevents.conversion import to_binary, to_dict, to_json, to_structured # noqa
7+
from cloudevents.http.event import CloudEvent
8+
from cloudevents.sdk import types
9+
10+
11+
def from_json(
12+
data: typing.Union[str, bytes],
13+
data_unmarshaller: types.UnmarshallerType = None,
14+
) -> CloudEvent:
15+
"""
16+
Parses JSON string `data` into a CloudEvent.
17+
18+
:param data: JSON string representation of a CloudEvent.
19+
:param data_unmarshaller: Callable function that casts `data` to a
20+
Python object.
21+
:returns: A CloudEvent parsed from the given JSON representation.
22+
"""
23+
return _abstract_from_json(CloudEvent, data, data_unmarshaller)
24+
25+
26+
def from_http(
27+
headers: typing.Dict[str, str],
28+
data: typing.Union[str, bytes, None],
29+
data_unmarshaller: types.UnmarshallerType = None,
30+
) -> CloudEvent:
31+
"""
32+
Parses CloudEvent `data` and `headers` into a CloudEvent`.
33+
34+
The method supports both binary and structured representations.
35+
36+
:param headers: The HTTP request headers.
37+
:param data: The HTTP request body. If set to None, "" or b'', the returned
38+
event's `data` field will be set to None.
39+
:param data_unmarshaller: Callable function to map data to a python object
40+
e.g. lambda x: x or lambda x: json.loads(x)
41+
:returns: A CloudEvent instance parsed from the passed HTTP parameters of
42+
the specified type.
43+
"""
44+
return _abstract_from_http(CloudEvent, headers, data, data_unmarshaller)
45+
46+
47+
def from_dict(
48+
event: typing.Dict[str, typing.Any],
49+
) -> CloudEvent:
50+
"""
51+
Constructs a CloudEvent from a dict `event` representation.
52+
53+
:param event: The event represented as a dict.
54+
:returns: The event of the specified type backed by the given dict.
55+
"""
56+
return _abstract_from_dict(CloudEvent, event)

cloudevents/http/event.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818

1919
import cloudevents.exceptions as cloud_exceptions
2020
from cloudevents import abstract
21-
from cloudevents.http.mappings import _required_by_version
21+
from cloudevents.sdk.event import v1, v03
22+
23+
_required_by_version = {
24+
"1.0": v1.Event._ce_required_fields,
25+
"0.3": v03.Event._ce_required_fields,
26+
}
2227

2328

2429
class CloudEvent(abstract.CloudEvent):
@@ -41,11 +46,11 @@ def __init__(self, attributes: typing.Dict[str, str], data: typing.Any = None):
4146
attributes 'specversion', 'id' or 'time', this will create
4247
those attributes with default values.
4348
e.g. {
44-
"content-type": "application/cloudevents+json",
45-
"id": "16fb5f0b-211e-1102-3dfe-ea6e2806f124",
46-
"source": "<event-source>",
47-
"type": "cloudevent.event.type",
48-
"specversion": "0.2"
49+
"specversion": "1.0",
50+
"type": "com.github.pull_request.opened",
51+
"source": "https://github.com/cloudevents/spec/pull",
52+
"id": "A234-1234-1234",
53+
"time": "2018-04-05T17:31:00Z",
4954
}
5055
:type attributes: typing.Dict[str, str]
5156
:param data: The payload of the event, as a python object

cloudevents/http/event_type.py

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,27 @@
1111
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
14-
1514
import typing
1615

17-
from cloudevents.sdk.converters import binary, structured
16+
from deprecation import deprecated
17+
18+
from cloudevents.sdk.converters import is_binary as _moved_is_binary
19+
from cloudevents.sdk.converters import is_structured as _moved_is_structured
20+
21+
# THIS MODULE IS DEPRECATED, YOU SHOULD NOT ADD NEW FUNCTIONALLY HERE
1822

1923

24+
@deprecated(
25+
deprecated_in="1.6.0",
26+
details="Use cloudevents.sdk.converters.is_binary function instead",
27+
)
2028
def is_binary(headers: typing.Dict[str, str]) -> bool:
21-
"""Uses internal marshallers to determine whether this event is binary
22-
:param headers: the HTTP headers
23-
:type headers: typing.Dict[str, str]
24-
:returns bool: returns a bool indicating whether the headers indicate
25-
a binary event type
26-
"""
27-
headers = {key.lower(): value for key, value in headers.items()}
28-
content_type = headers.get("content-type", "")
29-
binary_parser = binary.BinaryHTTPCloudEventConverter()
30-
return binary_parser.can_read(content_type=content_type, headers=headers)
29+
return _moved_is_binary(headers)
3130

3231

32+
@deprecated(
33+
deprecated_in="1.6.0",
34+
details="Use cloudevents.sdk.converters.is_structured function instead",
35+
)
3336
def is_structured(headers: typing.Dict[str, str]) -> bool:
34-
"""Uses internal marshallers to determine whether this event is structured
35-
:param headers: the HTTP headers
36-
:type headers: typing.Dict[str, str]
37-
:returns bool: returns a bool indicating whether the headers indicate
38-
a structured event type
39-
"""
40-
headers = {key.lower(): value for key, value in headers.items()}
41-
content_type = headers.get("content-type", "")
42-
structured_parser = structured.JSONHTTPCloudEventConverter()
43-
return structured_parser.can_read(content_type=content_type, headers=headers)
37+
return _moved_is_structured(headers)

cloudevents/http/http_methods.py

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,58 @@
1616

1717
from deprecation import deprecated
1818

19-
from cloudevents.conversion import from_http as _abstract_from_http
20-
from cloudevents.conversion import to_binary, to_structured
19+
from cloudevents.abstract import AnyCloudEvent
20+
from cloudevents.http.conversion import from_http as _moved_from_http
21+
from cloudevents.http.conversion import to_binary as _moved_to_binary
22+
from cloudevents.http.conversion import to_structured as _moved_to_structured
2123
from cloudevents.http.event import CloudEvent
2224
from cloudevents.sdk import types
2325

26+
# THIS MODULE IS DEPRECATED, YOU SHOULD NOT ADD NEW FUNCTIONALLY HERE
2427

28+
29+
@deprecated(
30+
deprecated_in="1.6.0",
31+
details="Use cloudevents.http.to_binary function instead",
32+
)
33+
def to_binary(
34+
event: AnyCloudEvent, data_marshaller: types.MarshallerType = None
35+
) -> typing.Tuple[dict, typing.Union[bytes, str]]:
36+
return _moved_to_binary(event, data_marshaller)
37+
38+
39+
@deprecated(
40+
deprecated_in="1.6.0",
41+
details="Use cloudevents.http.to_structured function instead",
42+
)
43+
def to_structured(
44+
event: AnyCloudEvent,
45+
data_marshaller: types.MarshallerType = None,
46+
) -> typing.Tuple[dict, typing.Union[bytes, str]]:
47+
return _moved_to_structured(event, data_marshaller)
48+
49+
50+
@deprecated(
51+
deprecated_in="1.6.0",
52+
details="Use cloudevents.http.from_http function instead",
53+
)
2554
def from_http(
2655
headers: typing.Dict[str, str],
2756
data: typing.Union[str, bytes, None],
2857
data_unmarshaller: types.UnmarshallerType = None,
2958
) -> CloudEvent:
30-
"""
31-
Unwrap a CloudEvent (binary or structured) from an HTTP request.
32-
:param headers: the HTTP headers
33-
:type headers: typing.Dict[str, str]
34-
:param data: the HTTP request body. If set to None, "" or b'', the returned
35-
event's data field will be set to None
36-
:type data: typing.IO
37-
:param data_unmarshaller: Callable function to map data to a python object
38-
e.g. lambda x: x or lambda x: json.loads(x)
39-
:type data_unmarshaller: types.UnmarshallerType
40-
"""
41-
return _abstract_from_http(CloudEvent, headers, data, data_unmarshaller)
42-
43-
44-
# backwards compatibility
45-
to_binary = to_binary
46-
# backwards compatibility
47-
to_structured = to_structured
59+
return _moved_from_http(headers, data, data_unmarshaller)
4860

4961

5062
@deprecated(deprecated_in="1.0.2", details="Use to_binary function instead")
5163
def to_binary_http(
5264
event: CloudEvent, data_marshaller: types.MarshallerType = None
5365
) -> typing.Tuple[dict, typing.Union[bytes, str]]:
54-
return to_binary(event, data_marshaller)
66+
return _moved_to_binary(event, data_marshaller)
5567

5668

5769
@deprecated(deprecated_in="1.0.2", details="Use to_structured function instead")
5870
def to_structured_http(
5971
event: CloudEvent, data_marshaller: types.MarshallerType = None
6072
) -> typing.Tuple[dict, typing.Union[bytes, str]]:
61-
return to_structured(event, data_marshaller)
73+
return _moved_to_structured(event, data_marshaller)

0 commit comments

Comments
 (0)