From 7620db9a3483f21cb9f052f3cf5fb593edd41c29 Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Tue, 3 Dec 2024 19:40:05 +0300 Subject: [PATCH 1/4] cargo update --- Cargo.lock | 85 +++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6092c74..7b2dc10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -147,9 +147,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "boring-sys2" -version = "4.12.0" +version = "4.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "254e876c468cbe4dd404331f6aeaea12c6cca75a84485a26091db6d6ed4ede0c" +checksum = "ec4f49862fee9ed1669e512b6eaf86926e7106e5e18d1ebc49e7900833faf695" dependencies = [ "autocfg", "bindgen", @@ -160,9 +160,9 @@ dependencies = [ [[package]] name = "boring2" -version = "4.12.0" +version = "4.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488b7cdf45c609ab21c1202b682e2e683c22e58692812a85bb3bfc3a38fe5260" +checksum = "353195dd52bdc6510134727d887a3a6d2169387a08e5722e225b2782273ed552" dependencies = [ "bitflags", "boring-sys2", @@ -201,15 +201,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "jobserver", "libc", @@ -507,23 +507,17 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "html2text" -version = "0.13.4" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30428514ad6e806b3fac736b1e76cae415ec5e2fcc25ec904a01c68ef703ac8a" +checksum = "68b2a77923bd16367f5d738c706b81b97ddb436c8ae863da5efc66599ef99552" dependencies = [ "html5ever", "markup5ever", "nom", "tendril", - "thiserror 2.0.3", + "thiserror 2.0.4", "unicode-width", ] @@ -740,9 +734,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -787,15 +781,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.165" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb4d3d38eab6c5239a362fa8bae48c03baf980a6e7079f063942d563ef3533e" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets", @@ -912,11 +906,10 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", "wasi", "windows-sys", @@ -1485,9 +1478,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys", @@ -1527,9 +1520,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1596,11 +1589,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" dependencies = [ - "thiserror-impl 2.0.3", + "thiserror-impl 2.0.4", ] [[package]] @@ -1616,9 +1609,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" dependencies = [ "proc-macro2", "quote", @@ -1627,9 +1620,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -1648,9 +1641,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -1668,9 +1661,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -1686,9 +1679,9 @@ dependencies = [ [[package]] name = "tokio-boring2" -version = "4.12.0" +version = "4.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf301f7c0c67ce618e396c1862758cec44b8977747302f61705494c970cacb" +checksum = "96829eb2a2277cb4aa3128cc76fbe76de83eab085156895dfc07ea483bbac487" dependencies = [ "boring-sys2", "boring2", @@ -1746,9 +1739,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-core", From b59e999cd03f36126927e36286341abf23406686 Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Tue, 3 Dec 2024 19:55:01 +0300 Subject: [PATCH 2/4] Change content: PyBytes::new_bound PyBytes::new --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d7227ae..b101ffc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -386,7 +386,7 @@ impl Client { let (f_buf, f_cookies, f_headers, f_status_code, f_url) = result?; Ok(Response { - content: PyBytes::new_bound(py, &f_buf).unbind(), + content: PyBytes::new(py, &f_buf).unbind(), cookies: f_cookies, encoding: String::new(), headers: f_headers, From 96812e931c42c70c6767ff81cd1a53d0b55e9bc5 Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:14:41 +0300 Subject: [PATCH 3/4] parameters `data`, `json` - replace PyDict with PyAny --- src/lib.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b101ffc..986e513 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ use bytes::Bytes; use indexmap::IndexMap; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; -use pyo3::types::{PyBytes, PyDict}; +use pyo3::types::PyBytes; use pythonize::depythonize; use rquest::boring::x509::{store::X509StoreBuilder, X509}; use rquest::header::{HeaderMap, HeaderName, HeaderValue, COOKIE}; @@ -249,8 +249,8 @@ impl Client { headers: Option>, cookies: Option>, content: Option>, - data: Option<&Bound<'_, PyDict>>, - json: Option<&Bound<'_, PyDict>>, + data: Option<&Bound<'_, PyAny>>, + json: Option<&Bound<'_, PyAny>>, files: Option>>, auth: Option<(String, Option)>, auth_bearer: Option, @@ -521,8 +521,8 @@ impl Client { headers: Option>, cookies: Option>, content: Option>, - data: Option<&Bound<'_, PyDict>>, - json: Option<&Bound<'_, PyDict>>, + data: Option<&Bound<'_, PyAny>>, + json: Option<&Bound<'_, PyAny>>, files: Option>>, auth: Option<(String, Option)>, auth_bearer: Option, @@ -555,8 +555,8 @@ impl Client { headers: Option>, cookies: Option>, content: Option>, - data: Option<&Bound<'_, PyDict>>, - json: Option<&Bound<'_, PyDict>>, + data: Option<&Bound<'_, PyAny>>, + json: Option<&Bound<'_, PyAny>>, files: Option>>, auth: Option<(String, Option)>, auth_bearer: Option, @@ -589,8 +589,8 @@ impl Client { headers: Option>, cookies: Option>, content: Option>, - data: Option<&Bound<'_, PyDict>>, - json: Option<&Bound<'_, PyDict>>, + data: Option<&Bound<'_, PyAny>>, + json: Option<&Bound<'_, PyAny>>, files: Option>>, auth: Option<(String, Option)>, auth_bearer: Option, @@ -627,8 +627,8 @@ fn request( headers: Option>, cookies: Option>, content: Option>, - data: Option<&Bound<'_, PyDict>>, - json: Option<&Bound<'_, PyDict>>, + data: Option<&Bound<'_, PyAny>>, + json: Option<&Bound<'_, PyAny>>, files: Option>>, auth: Option<(String, Option)>, auth_bearer: Option, @@ -867,8 +867,8 @@ fn post( headers: Option>, cookies: Option>, content: Option>, - data: Option<&Bound<'_, PyDict>>, - json: Option<&Bound<'_, PyDict>>, + data: Option<&Bound<'_, PyAny>>, + json: Option<&Bound<'_, PyAny>>, files: Option>>, auth: Option<(String, Option)>, auth_bearer: Option, @@ -922,8 +922,8 @@ fn put( headers: Option>, cookies: Option>, content: Option>, - data: Option<&Bound<'_, PyDict>>, - json: Option<&Bound<'_, PyDict>>, + data: Option<&Bound<'_, PyAny>>, + json: Option<&Bound<'_, PyAny>>, files: Option>>, auth: Option<(String, Option)>, auth_bearer: Option, @@ -977,8 +977,8 @@ fn patch( headers: Option>, cookies: Option>, content: Option>, - data: Option<&Bound<'_, PyDict>>, - json: Option<&Bound<'_, PyDict>>, + data: Option<&Bound<'_, PyAny>>, + json: Option<&Bound<'_, PyAny>>, files: Option>>, auth: Option<(String, Option)>, auth_bearer: Option, From 9fd59f3113d9748609c1673cc7ea6aefdae942d7 Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Tue, 3 Dec 2024 21:25:35 +0300 Subject: [PATCH 4/4] CI: macos - update runner (macos-12 to macos-13) --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8ea2588..8644862 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -241,7 +241,7 @@ jobs: fail-fast: false matrix: platform: - - runner: macos-12 + - runner: macos-13 target: x86_64 - runner: macos-14 target: aarch64