From a75e531889a1cf521d1f1b84d5e1cb9ab7800f4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Apr 2023 00:42:16 +0000 Subject: [PATCH] Bump fluvio from 0.16.0 to 0.18.1 (#245) Bumps [fluvio](https://github.com/infinyon/fluvio) from 0.16.0 to 0.18.1. Release notes Sourced from fluvio's releases. dev Published artifacts from the latest build Commits See full diff in compare view [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) Co-authored-by: Luis Moreno --- Cargo.lock | 157 +++++++++++++++--------- Cargo.toml | 3 +- integration-tests/test_fluvio_python.py | 11 +- macos-ci-tests/test_connect.py | 14 +-- src/error.rs | 13 ++ src/lib.rs | 32 +++-- 6 files changed, 143 insertions(+), 87 deletions(-) create mode 100644 src/error.rs diff --git a/Cargo.lock b/Cargo.lock index ff3f20c7..a32eabb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,10 +6,11 @@ version = 3 name = "_fluvio_python" version = "0.14.0" dependencies = [ + "anyhow", "async-h1", "async-std", "cpython", - "dirs", + "dirs 4.0.0", "env_logger", "flapigen", "fluvio", @@ -111,9 +112,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.68" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "async-channel" @@ -198,7 +199,7 @@ dependencies = [ "slab", "socket2", "waker-fn", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -259,7 +260,7 @@ dependencies = [ "futures-lite", "libc", "signal-hook", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -353,9 +354,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bitflags" @@ -397,9 +398,9 @@ dependencies = [ [[package]] name = "built" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9c056b9ed43aee5e064b683aa1ec783e19c6acec7559e3ae931b7490472fbe" +checksum = "96f9cdd34d6eb553f9ea20e5bf84abb7b13c729f113fc1d8e49dc00ad9fa8738" dependencies = [ "cargo-lock", ] @@ -781,7 +782,16 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dece029acd3353e3a58ac2e3eb3c8d6c35827a892edc6cc4138ef9c33df46ecd" +dependencies = [ + "dirs-sys 0.4.0", ] [[package]] @@ -795,6 +805,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "dirs-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04414300db88f70d74c5ff54e50f9e1d1737d9a5b90f53fcf2e95ca2a9ab554b" +dependencies = [ + "libc", + "redox_users", + "windows-sys 0.45.0", +] + [[package]] name = "discard" version = "1.0.4" @@ -931,21 +952,21 @@ dependencies = [ [[package]] name = "fluvio" -version = "0.16.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05dd7e4c85ab7516ec6ffa957fdaededb3acecd53976e95d3b0643063cdd6940" +checksum = "584f6bd4fce13bfb62e1f6fe644db076edf004041e18f80089b9d56d1e730b14" dependencies = [ "anyhow", "async-channel", "async-lock", "async-rwlock", "async-trait", - "base64 0.20.0", + "base64 0.21.0", "bytes", "cfg-if", "chrono", "derive_builder", - "dirs", + "dirs 5.0.0", "event-listener", "fluvio-compression", "fluvio-future", @@ -964,7 +985,7 @@ dependencies = [ "siphasher", "thiserror", "tokio", - "toml 0.5.11", + "toml 0.7.3", "tracing", ] @@ -984,12 +1005,12 @@ dependencies = [ [[package]] name = "fluvio-controlplane-metadata" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c124889987d8a4adf98f70627a2bd5924eae9eac43e3f92c7a15b38132d782e" +checksum = "436f8f8a4446c066e692a1584ac655758793e2315dcf3ee8efde46ba42044444" dependencies = [ "async-trait", - "base64 0.20.0", + "base64 0.21.0", "bytes", "flate2", "fluvio-future", @@ -1001,7 +1022,7 @@ dependencies = [ "semver 1.0.16", "serde", "thiserror", - "toml 0.5.11", + "toml 0.7.3", "tracing", ] @@ -1033,9 +1054,9 @@ dependencies = [ [[package]] name = "fluvio-protocol" -version = "0.8.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175c3ba82fb0fa388cbb9d01b2ee90b210e622e75c544205c1464d016bc1d397" +checksum = "53c0c69fe2cf98c94be24be12588c91fa2acdecb8058d68d8fb0b0595e99e0e4" dependencies = [ "bytes", "content_inspector", @@ -1055,9 +1076,9 @@ dependencies = [ [[package]] name = "fluvio-protocol-derive" -version = "0.4.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be1a3fafae877a328607b0f14df6c1a5f05eab778f2b7dfdf14635991f3eeec" +checksum = "f5398a06c3c9d9cc995adf5e380b2da02976d3778fa8bdf1afff06b318c1d4fb" dependencies = [ "proc-macro2", "quote", @@ -1067,9 +1088,9 @@ dependencies = [ [[package]] name = "fluvio-sc-schema" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a067fbedf0061c6333fcc5521b1d55dc5bc56cad3a54ea1f9cd037423c552499" +checksum = "ec0dad741c0502ec34ecde9696d4f338b690fab9a0efac6c0fa4cdb0ff5049e1" dependencies = [ "fluvio-controlplane-metadata", "fluvio-protocol", @@ -1084,9 +1105,9 @@ dependencies = [ [[package]] name = "fluvio-smartmodule" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a10bef73ebe43bf2ec120003b36079424cd3bcad7d8d9f5dbd248078a3fab029" +checksum = "763c7759b6b47f5e1245f7aa4bdf10f76d3fad571d95370a2c61580e694b22ad" dependencies = [ "eyre", "fluvio-protocol", @@ -1097,9 +1118,9 @@ dependencies = [ [[package]] name = "fluvio-smartmodule-derive" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1465b33d396d943cc819ae8cb2ad8e80998a974189320221a4c90e9439e062c" +checksum = "00adc30d860f881c2f3b4f8a50fa4701df6a4928014c731f51884cb9c5bae102" dependencies = [ "proc-macro2", "quote", @@ -1108,9 +1129,9 @@ dependencies = [ [[package]] name = "fluvio-socket" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b752d8e48b4b73431a94eba45f1111bfb7ffbf26691f88ff4212b602d164b5" +checksum = "bf0d64f650b8b7ea016eb959dd31e55b2cf37a8da3c120d226ac32351b5eee3a" dependencies = [ "async-channel", "async-lock", @@ -1133,9 +1154,9 @@ dependencies = [ [[package]] name = "fluvio-spu-schema" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a455b11d3d2115612f9b149570118727f7ce121ac4255d2ca66e77d505d9aca3" +checksum = "8cabfb364213f5cbf3c18dc8c29993ece69987b0fa9cb7b88d6cbd81149bd040" dependencies = [ "bytes", "educe", @@ -1152,9 +1173,9 @@ dependencies = [ [[package]] name = "fluvio-stream-model" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c92f9760268840bbc4b3e275421b6a9350e4e06746c36deb4c16455b70ea4d" +checksum = "e2b1157f194e3480931a68d8d6a21e829d96acd09332fc2db7a511e4ccfe0784" dependencies = [ "async-rwlock", "event-listener", @@ -1548,7 +1569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1560,7 +1581,7 @@ dependencies = [ "hermit-abi", "io-lifetimes", "rustix", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1992,7 +2013,7 @@ dependencies = [ "libc", "log", "wepoll-ffi", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2226,7 +2247,7 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2256,7 +2277,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2732,7 +2753,7 @@ dependencies = [ "autocfg", "pin-project-lite", "tokio-macros", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3077,7 +3098,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec1eb1958002617e0247ccae4fd0ec7fb5fbb566a28e93ede1ea73fac578a0e" dependencies = [ "core-foundation", - "dirs", + "dirs 4.0.0", "jni", "log", "ndk-context", @@ -3153,47 +3174,71 @@ dependencies = [ "windows_x86_64_msvc", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winnow" diff --git a/Cargo.toml b/Cargo.toml index 6206f2e8..7329a3a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ log = "^0.4.17" [dependencies] cpython = { version = "0.7", features = ["extension-module"] } -fluvio = { version = "0.16" } +fluvio = { version = "0.18" } fluvio-future = { version = "0.4.2", features = ["task", "io", "native2_tls", "subscriber"] } thiserror = "1.0.21" @@ -36,3 +36,4 @@ webbrowser = "0.8.2" toml = "0.7.3" serde_json = "1.0.59" rpassword = "5.0.0" +anyhow = "1.0.70" diff --git a/integration-tests/test_fluvio_python.py b/integration-tests/test_fluvio_python.py index 2ed2fd5b..b64cb1c6 100644 --- a/integration-tests/test_fluvio_python.py +++ b/integration-tests/test_fluvio_python.py @@ -491,8 +491,8 @@ def test_produce_on_uncreated_topic(self): with self.assertRaises(Exception) as ctx: fluvio.topic_producer(topic_name) - self.assertEqual( - ctx.exception.args, ("Topic not found: %s" % topic_name,) # noqa: E501 + self.assertIn( + "Topic not found: %s" % topic_name, ctx.exception.args[0] # noqa: E501 ) def test_consumer_config_no_sm_name_or_path(self): @@ -516,14 +516,15 @@ def test_consumer_config_attribute_error(self): config = ConsumerConfig() with self.assertRaises(AttributeError) as ctx: config.smartmodule(kind="foobar") - self.assertEqual(ctx.exception.args, ("'str' object has no attribute 'value'",)) + self.assertIn("'str' object has no attribute 'value'", ctx.exception.args[0]) def test_consumer_config_no_file(self): config = ConsumerConfig() with self.assertRaises(Exception) as ctx: config.smartmodule(path="does_not_exist.wasm", kind=SmartModuleKind.Filter) - self.assertEqual( - ctx.exception.args, ("No such file or directory (os error 2)",) + self.assertIn( + "No such file or directory (os error 2)", + ctx.exception.args[0], ) diff --git a/macos-ci-tests/test_connect.py b/macos-ci-tests/test_connect.py index 78b24535..f389b2d7 100644 --- a/macos-ci-tests/test_connect.py +++ b/macos-ci-tests/test_connect.py @@ -19,16 +19,6 @@ def test_connection_failure(self): self.assertTrue(error is not None) self.assertIn( - error.args, - [ - ( - "Config error: Config has no active profile\nCaused by:\nConfig has no active profile", # noqa: E501 - ), - ( - "Fluvio config error: Config has no active profile\nCaused by:\nConfig has no active profile", # noqa: E501 - ), - ( - "Fluvio socket error: Connection refused (os error 61)\nCaused by:\nConnection refused (os error 61)", # noqa: E501 - ), - ], + "Config has no active profile", + error.args[0], ) diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 00000000..023ac887 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,13 @@ +use thiserror::Error; + +use fluvio::FluvioError as FluvioClientError; + +#[derive(Error, Debug)] +pub enum FluvioError { + #[error(transparent)] + FluvioError(#[from] FluvioClientError), + #[error("{0}")] + AnyhowError(#[from] anyhow::Error), + #[error("IO Error: {0}")] + IoError(#[from] std::io::Error), +} diff --git a/src/lib.rs b/src/lib.rs index bb27eb6f..ac9ef85a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ use fluvio::consumer::{ SmartModuleInvocation, SmartModuleInvocationWasm, SmartModuleKind as NativeSmartModuleKind, }; use fluvio::dataplane::link::ErrorCode; -use fluvio::{consumer::Record, Fluvio, FluvioError, Offset, PartitionConsumer, TopicProducer}; +use fluvio::{consumer::Record, Fluvio, Offset, PartitionConsumer, TopicProducer}; use fluvio_future::{ io::{Stream, StreamExt}, task::run_block_on, @@ -14,22 +14,26 @@ use std::io::{Error, Read}; use std::pin::Pin; use std::string::FromUtf8Error; mod cloud; +use crate::error::FluvioError; use cloud::{CloudClient, CloudLoginError}; +mod error; + mod _Fluvio { + use super::*; pub fn connect() -> Result { - run_block_on(Fluvio::connect()) + Ok(run_block_on(Fluvio::connect())?) } pub fn partition_consumer( fluvio: &Fluvio, topic: String, partition: u32, ) -> Result { - run_block_on(fluvio.partition_consumer(topic, partition)) + Ok(run_block_on(fluvio.partition_consumer(topic, partition))?) } pub fn topic_producer(fluvio: &Fluvio, topic: String) -> Result { - run_block_on(fluvio.topic_producer(topic)) + Ok(run_block_on(fluvio.topic_producer(topic))?) } } @@ -177,11 +181,13 @@ mod _PartitionConsumer { ) -> Result { let config = config.build()?; - run_block_on(consumer.stream_with_config(offset.clone(), config)).map(|stream| { - PartitionConsumerStream { - inner: Box::pin(stream), - } - }) + Ok( + run_block_on(consumer.stream_with_config(offset.clone(), config)).map(|stream| { + PartitionConsumerStream { + inner: Box::pin(stream), + } + })?, + ) } } @@ -209,21 +215,21 @@ impl ProducerBatchRecord { mod _TopicProducer { use super::*; pub fn send(producer: &TopicProducer, key: &[u8], value: &[u8]) -> Result<(), FluvioError> { - run_block_on(producer.send(key, value)).map(|_| ()) + Ok(run_block_on(producer.send(key, value)).map(|_| ())?) } pub fn send_all( producer: &TopicProducer, records: &[ProducerBatchRecord], ) -> Result<(), FluvioError> { - run_block_on( + Ok(run_block_on( producer.send_all(records.iter().map(|record| -> (Vec, Vec) { (record.key.clone(), record.value.clone()) })), ) - .map(|_| ()) + .map(|_| ())?) } pub fn flush(producer: &TopicProducer) -> Result<(), FluvioError> { - run_block_on(producer.flush()) + Ok(run_block_on(producer.flush())?) } }
Sourced from fluvio's releases.
dev Published artifacts from the latest build
Published artifacts from the latest build