diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac497d41..9b60580d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,10 +30,16 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Cargo fmt - run: cargo fmt --all -- --check + run: | + cargo fmt --all -- --check + cd pyo3-object_store && cargo fmt --all -- --check && cd .. + cd pyo3-bytes && cargo fmt --all -- --check && cd .. - name: "clippy --all" - run: cargo clippy --all --all-features --tests -- -D warnings + run: | + cargo clippy --all --all-features --tests -- -D warnings + cd pyo3-object_store && cargo clippy --all --all-features --tests -- -D warnings && cd .. + cd pyo3-bytes && cargo clippy --all --all-features --tests -- -D warnings && cd .. - name: "cargo check" run: cargo check --all --all-features diff --git a/pyo3-object_store/src/aws/shared_config.rs b/pyo3-object_store/src/aws/shared_config.rs index 689b185e..439bf55d 100644 --- a/pyo3-object_store/src/aws/shared_config.rs +++ b/pyo3-object_store/src/aws/shared_config.rs @@ -19,7 +19,7 @@ pub fn from_sdk_config(config: SdkConfig) -> AmazonS3Builder { builder = builder.with_endpoint(endpoint); } if let Some(retry_config) = config.retry_config() { - builder = builder.with_retry(from_retry_config(&retry_config)); + builder = builder.with_retry(from_retry_config(retry_config)); } builder @@ -63,23 +63,3 @@ impl CredentialProvider for WrappedAwsCredentialsProvider { Ok(Arc::new(credentials)) } } - -#[cfg(test)] -mod test { - use super::*; - use object_store::aws::AwsCredentialProvider; - - #[test] - fn tmp() {} - - #[tokio::test] - async fn test_s3() { - let config = aws_config::from_env(); - - let config = aws_config::load_from_env().await; - dbg!(&config); - let creds = config.credentials_provider().unwrap(); - // let creds = AWSCredentials(creds).get_credential().await.unwrap(); - // dbg!(creds); - } -} diff --git a/pyo3-object_store/src/runtime.rs b/pyo3-object_store/src/runtime.rs index 4d407960..6bbdda83 100644 --- a/pyo3-object_store/src/runtime.rs +++ b/pyo3-object_store/src/runtime.rs @@ -30,9 +30,9 @@ pub fn get_runtime(py: Python<'_>) -> PyResult<&'static Runtime> { } let runtime = RUNTIME.get_or_try_init(py, || { - Ok::<_, PyErr>(Runtime::new().map_err(|err| { + Runtime::new().map_err(|err| { PyValueError::new_err(format!("Could not create tokio runtime. {}", err)) - })?) + }) })?; Ok(runtime) }