primp 1.2.1__tar.gz → 1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {primp-1.2.1 → primp-1.2.2}/Cargo.lock +60 -60
  2. {primp-1.2.1 → primp-1.2.2}/Cargo.toml +1 -1
  3. {primp-1.2.1 → primp-1.2.2}/PKG-INFO +1 -1
  4. {primp-1.2.1 → primp-1.2.2}/crates/primp/Cargo.toml +1 -1
  5. {primp-1.2.1 → primp-1.2.2}/crates/primp/src/lib.rs +8 -0
  6. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/Cargo.toml +1 -1
  7. primp-1.2.2/crates/primp-python/benchmark/benchmark.jpg +0 -0
  8. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/benchmark/benchmark.py +30 -19
  9. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/benchmark/run.py +34 -27
  10. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/benchmark/server.py +19 -15
  11. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/docs/async_client.md +4 -0
  12. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/docs/client.md +9 -4
  13. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/docs/response.md +4 -16
  14. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/async_usage.py +1 -0
  15. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/authentication.py +2 -8
  16. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/basic_usage.py +20 -4
  17. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/cookies.py +9 -8
  18. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/error_handling.py +7 -0
  19. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/post_requests.py +6 -8
  20. primp-1.2.2/crates/primp-python/primp.pyi +831 -0
  21. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/async/client.rs +117 -23
  22. primp-1.2.2/crates/primp-python/src/async/mod.rs +5 -0
  23. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/async/response.rs +82 -125
  24. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/client_builder.rs +12 -0
  25. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/lib.rs +236 -54
  26. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/response.rs +113 -194
  27. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/server.py +42 -11
  28. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/test_client.py +279 -3
  29. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/test_exceptions.py +26 -0
  30. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/test_http_methods.py +132 -0
  31. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/test_request_params.py +171 -0
  32. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/test_response.py +21 -0
  33. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/test_streaming.py +312 -0
  34. primp-1.2.1/crates/primp-python/benchmark/benchmark.jpg +0 -0
  35. primp-1.2.1/crates/primp-python/primp.pyi +0 -1031
  36. primp-1.2.1/crates/primp-python/src/async/mod.rs +0 -7
  37. {primp-1.2.1 → primp-1.2.2}/README.md +0 -0
  38. {primp-1.2.1 → primp-1.2.2}/crates/primp/LICENSE-MIT +0 -0
  39. {primp-1.2.1 → primp-1.2.2}/crates/primp/README.md +0 -0
  40. {primp-1.2.1 → primp-1.2.2}/crates/primp/src/imp/chrome/mod.rs +0 -0
  41. {primp-1.2.1 → primp-1.2.2}/crates/primp/src/imp/edge/mod.rs +0 -0
  42. {primp-1.2.1 → primp-1.2.2}/crates/primp/src/imp/firefox/mod.rs +0 -0
  43. {primp-1.2.1 → primp-1.2.2}/crates/primp/src/imp/mod.rs +0 -0
  44. {primp-1.2.1 → primp-1.2.2}/crates/primp/src/imp/opera/mod.rs +0 -0
  45. {primp-1.2.1 → primp-1.2.2}/crates/primp/src/imp/safari/mod.rs +0 -0
  46. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/.gitignore +0 -0
  47. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/README.md +0 -0
  48. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/benchmark/README.md +0 -0
  49. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/benchmark/requirements.txt +0 -0
  50. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/docs/exceptions.md +0 -0
  51. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/docs/impersonate.md +0 -0
  52. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/html_conversion.py +0 -0
  53. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/proxy.py +0 -0
  54. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/examples/streaming.py +1 -1
  55. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/py.typed +0 -0
  56. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/error.rs +0 -0
  57. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/impersonate.rs +0 -0
  58. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/traits.rs +0 -0
  59. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/src/utils.rs +0 -0
  60. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/__init__.py +0 -0
  61. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/conftest.py +0 -0
  62. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/test_header_order.py +0 -0
  63. {primp-1.2.1 → primp-1.2.2}/crates/primp-python/tests/test_impersonate.py +0 -0
  64. {primp-1.2.1 → primp-1.2.2}/pyproject.toml +0 -0
@@ -1229,9 +1229,9 @@ dependencies = [
1229
1229
 
1230
1230
  [[package]]
1231
1231
  name = "indexmap"
1232
- version = "2.13.0"
1232
+ version = "2.13.1"
1233
1233
  source = "registry+https://github.com/rust-lang/crates.io-index"
1234
- checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
1234
+ checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff"
1235
1235
  dependencies = [
1236
1236
  "equivalent",
1237
1237
  "hashbrown 0.16.1",
@@ -1241,9 +1241,9 @@ dependencies = [
1241
1241
 
1242
1242
  [[package]]
1243
1243
  name = "inventory"
1244
- version = "0.3.23"
1244
+ version = "0.3.24"
1245
1245
  source = "registry+https://github.com/rust-lang/crates.io-index"
1246
- checksum = "8062b737e5389949f477d4760a2ebbff0c366f97798f2419b8d8f366363d3342"
1246
+ checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b"
1247
1247
  dependencies = [
1248
1248
  "rustversion",
1249
1249
  ]
@@ -1324,9 +1324,9 @@ dependencies = [
1324
1324
 
1325
1325
  [[package]]
1326
1326
  name = "js-sys"
1327
- version = "0.3.92"
1327
+ version = "0.3.94"
1328
1328
  source = "registry+https://github.com/rust-lang/crates.io-index"
1329
- checksum = "cc4c90f45aa2e6eacbe8645f77fdea542ac97a494bcd117a67df9ff4d611f995"
1329
+ checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9"
1330
1330
  dependencies = [
1331
1331
  "cfg-if",
1332
1332
  "futures-util",
@@ -1348,9 +1348,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
1348
1348
 
1349
1349
  [[package]]
1350
1350
  name = "libc"
1351
- version = "0.2.183"
1351
+ version = "0.2.184"
1352
1352
  source = "registry+https://github.com/rust-lang/crates.io-index"
1353
- checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
1353
+ checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
1354
1354
 
1355
1355
  [[package]]
1356
1356
  name = "libm"
@@ -1366,9 +1366,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
1366
1366
 
1367
1367
  [[package]]
1368
1368
  name = "litemap"
1369
- version = "0.8.1"
1369
+ version = "0.8.2"
1370
1370
  source = "registry+https://github.com/rust-lang/crates.io-index"
1371
- checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
1371
+ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
1372
1372
 
1373
1373
  [[package]]
1374
1374
  name = "litrs"
@@ -1862,9 +1862,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
1862
1862
 
1863
1863
  [[package]]
1864
1864
  name = "potential_utf"
1865
- version = "0.1.4"
1865
+ version = "0.1.5"
1866
1866
  source = "registry+https://github.com/rust-lang/crates.io-index"
1867
- checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
1867
+ checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
1868
1868
  dependencies = [
1869
1869
  "zerovec",
1870
1870
  ]
@@ -1912,7 +1912,7 @@ dependencies = [
1912
1912
 
1913
1913
  [[package]]
1914
1914
  name = "primp"
1915
- version = "1.2.1"
1915
+ version = "1.2.2"
1916
1916
  dependencies = [
1917
1917
  "criterion",
1918
1918
  "h2",
@@ -1928,7 +1928,7 @@ dependencies = [
1928
1928
 
1929
1929
  [[package]]
1930
1930
  name = "primp-python"
1931
- version = "1.2.1"
1931
+ version = "1.2.2"
1932
1932
  dependencies = [
1933
1933
  "anyhow",
1934
1934
  "bytes",
@@ -1982,9 +1982,9 @@ dependencies = [
1982
1982
 
1983
1983
  [[package]]
1984
1984
  name = "pyo3"
1985
- version = "0.28.2"
1985
+ version = "0.28.3"
1986
1986
  source = "registry+https://github.com/rust-lang/crates.io-index"
1987
- checksum = "cf85e27e86080aafd5a22eae58a162e133a589551542b3e5cee4beb27e54f8e1"
1987
+ checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
1988
1988
  dependencies = [
1989
1989
  "anyhow",
1990
1990
  "indexmap",
@@ -2013,18 +2013,18 @@ dependencies = [
2013
2013
 
2014
2014
  [[package]]
2015
2015
  name = "pyo3-build-config"
2016
- version = "0.28.2"
2016
+ version = "0.28.3"
2017
2017
  source = "registry+https://github.com/rust-lang/crates.io-index"
2018
- checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7"
2018
+ checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
2019
2019
  dependencies = [
2020
2020
  "target-lexicon",
2021
2021
  ]
2022
2022
 
2023
2023
  [[package]]
2024
2024
  name = "pyo3-ffi"
2025
- version = "0.28.2"
2025
+ version = "0.28.3"
2026
2026
  source = "registry+https://github.com/rust-lang/crates.io-index"
2027
- checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc"
2027
+ checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
2028
2028
  dependencies = [
2029
2029
  "libc",
2030
2030
  "pyo3-build-config",
@@ -2043,9 +2043,9 @@ dependencies = [
2043
2043
 
2044
2044
  [[package]]
2045
2045
  name = "pyo3-macros"
2046
- version = "0.28.2"
2046
+ version = "0.28.3"
2047
2047
  source = "registry+https://github.com/rust-lang/crates.io-index"
2048
- checksum = "f5d671734e9d7a43449f8480f8b38115df67bef8d21f76837fa75ee7aaa5e52e"
2048
+ checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
2049
2049
  dependencies = [
2050
2050
  "proc-macro2",
2051
2051
  "pyo3-macros-backend",
@@ -2055,9 +2055,9 @@ dependencies = [
2055
2055
 
2056
2056
  [[package]]
2057
2057
  name = "pyo3-macros-backend"
2058
- version = "0.28.2"
2058
+ version = "0.28.3"
2059
2059
  source = "registry+https://github.com/rust-lang/crates.io-index"
2060
- checksum = "22faaa1ce6c430a1f71658760497291065e6450d7b5dc2bcf254d49f66ee700a"
2060
+ checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
2061
2061
  dependencies = [
2062
2062
  "heck",
2063
2063
  "proc-macro2",
@@ -2875,9 +2875,9 @@ dependencies = [
2875
2875
 
2876
2876
  [[package]]
2877
2877
  name = "tinystr"
2878
- version = "0.8.2"
2878
+ version = "0.8.3"
2879
2879
  source = "registry+https://github.com/rust-lang/crates.io-index"
2880
- checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
2880
+ checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
2881
2881
  dependencies = [
2882
2882
  "displaydoc",
2883
2883
  "zerovec",
@@ -3243,9 +3243,9 @@ dependencies = [
3243
3243
 
3244
3244
  [[package]]
3245
3245
  name = "wasm-bindgen"
3246
- version = "0.2.115"
3246
+ version = "0.2.117"
3247
3247
  source = "registry+https://github.com/rust-lang/crates.io-index"
3248
- checksum = "6523d69017b7633e396a89c5efab138161ed5aafcbc8d3e5c5a42ae38f50495a"
3248
+ checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0"
3249
3249
  dependencies = [
3250
3250
  "cfg-if",
3251
3251
  "once_cell",
@@ -3258,9 +3258,9 @@ dependencies = [
3258
3258
 
3259
3259
  [[package]]
3260
3260
  name = "wasm-bindgen-futures"
3261
- version = "0.4.65"
3261
+ version = "0.4.67"
3262
3262
  source = "registry+https://github.com/rust-lang/crates.io-index"
3263
- checksum = "2d1faf851e778dfa54db7cd438b70758eba9755cb47403f3496edd7c8fc212f0"
3263
+ checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e"
3264
3264
  dependencies = [
3265
3265
  "js-sys",
3266
3266
  "wasm-bindgen",
@@ -3268,9 +3268,9 @@ dependencies = [
3268
3268
 
3269
3269
  [[package]]
3270
3270
  name = "wasm-bindgen-macro"
3271
- version = "0.2.115"
3271
+ version = "0.2.117"
3272
3272
  source = "registry+https://github.com/rust-lang/crates.io-index"
3273
- checksum = "4e3a6c758eb2f701ed3d052ff5737f5bfe6614326ea7f3bbac7156192dc32e67"
3273
+ checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be"
3274
3274
  dependencies = [
3275
3275
  "quote",
3276
3276
  "wasm-bindgen-macro-support",
@@ -3278,9 +3278,9 @@ dependencies = [
3278
3278
 
3279
3279
  [[package]]
3280
3280
  name = "wasm-bindgen-macro-support"
3281
- version = "0.2.115"
3281
+ version = "0.2.117"
3282
3282
  source = "registry+https://github.com/rust-lang/crates.io-index"
3283
- checksum = "921de2737904886b52bcbb237301552d05969a6f9c40d261eb0533c8b055fedf"
3283
+ checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2"
3284
3284
  dependencies = [
3285
3285
  "bumpalo",
3286
3286
  "proc-macro2",
@@ -3291,18 +3291,18 @@ dependencies = [
3291
3291
 
3292
3292
  [[package]]
3293
3293
  name = "wasm-bindgen-shared"
3294
- version = "0.2.115"
3294
+ version = "0.2.117"
3295
3295
  source = "registry+https://github.com/rust-lang/crates.io-index"
3296
- checksum = "a93e946af942b58934c604527337bad9ae33ba1d5c6900bbb41c2c07c2364a93"
3296
+ checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b"
3297
3297
  dependencies = [
3298
3298
  "unicode-ident",
3299
3299
  ]
3300
3300
 
3301
3301
  [[package]]
3302
3302
  name = "wasm-bindgen-test"
3303
- version = "0.3.65"
3303
+ version = "0.3.67"
3304
3304
  source = "registry+https://github.com/rust-lang/crates.io-index"
3305
- checksum = "1138411301a026d6662dc44e7076a74dbaa76a369312275eea5dee4d7dc68c7c"
3305
+ checksum = "941c102b3f0c15b6d72a53205e09e6646aafcf2991e18412cc331dbac1806bc0"
3306
3306
  dependencies = [
3307
3307
  "async-trait",
3308
3308
  "cast",
@@ -3322,9 +3322,9 @@ dependencies = [
3322
3322
 
3323
3323
  [[package]]
3324
3324
  name = "wasm-bindgen-test-macro"
3325
- version = "0.3.65"
3325
+ version = "0.3.67"
3326
3326
  source = "registry+https://github.com/rust-lang/crates.io-index"
3327
- checksum = "186ddfe8383ba7ae7927bae3bb7343fd1f03ba2dbaf1474410f0d831131c269b"
3327
+ checksum = "a26bd6570f39bb1440fd8f01b63461faaf2a3f6078a508e4e54efa99363108d2"
3328
3328
  dependencies = [
3329
3329
  "proc-macro2",
3330
3330
  "quote",
@@ -3333,9 +3333,9 @@ dependencies = [
3333
3333
 
3334
3334
  [[package]]
3335
3335
  name = "wasm-bindgen-test-shared"
3336
- version = "0.2.115"
3336
+ version = "0.2.117"
3337
3337
  source = "registry+https://github.com/rust-lang/crates.io-index"
3338
- checksum = "f032e076ceb8d36d5921c6cef5bf447f2ca2bbd5439ce1683d68d1c99cc2be16"
3338
+ checksum = "1c29582b14d5bf030b02fa232b9b57faf2afc322d2c61964dd80bad02bf76207"
3339
3339
 
3340
3340
  [[package]]
3341
3341
  name = "wasm-encoder"
@@ -3386,9 +3386,9 @@ dependencies = [
3386
3386
 
3387
3387
  [[package]]
3388
3388
  name = "web-sys"
3389
- version = "0.3.92"
3389
+ version = "0.3.94"
3390
3390
  source = "registry+https://github.com/rust-lang/crates.io-index"
3391
- checksum = "84cde8507f4d7cfcb1185b8cb5890c494ffea65edbe1ba82cfd63661c805ed94"
3391
+ checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a"
3392
3392
  dependencies = [
3393
3393
  "js-sys",
3394
3394
  "wasm-bindgen",
@@ -3758,9 +3758,9 @@ dependencies = [
3758
3758
 
3759
3759
  [[package]]
3760
3760
  name = "writeable"
3761
- version = "0.6.2"
3761
+ version = "0.6.3"
3762
3762
  source = "registry+https://github.com/rust-lang/crates.io-index"
3763
- checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
3763
+ checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
3764
3764
 
3765
3765
  [[package]]
3766
3766
  name = "x509-parser"
@@ -3790,9 +3790,9 @@ dependencies = [
3790
3790
 
3791
3791
  [[package]]
3792
3792
  name = "yoke"
3793
- version = "0.8.1"
3793
+ version = "0.8.2"
3794
3794
  source = "registry+https://github.com/rust-lang/crates.io-index"
3795
- checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
3795
+ checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca"
3796
3796
  dependencies = [
3797
3797
  "stable_deref_trait",
3798
3798
  "yoke-derive",
@@ -3801,9 +3801,9 @@ dependencies = [
3801
3801
 
3802
3802
  [[package]]
3803
3803
  name = "yoke-derive"
3804
- version = "0.8.1"
3804
+ version = "0.8.2"
3805
3805
  source = "registry+https://github.com/rust-lang/crates.io-index"
3806
- checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
3806
+ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
3807
3807
  dependencies = [
3808
3808
  "proc-macro2",
3809
3809
  "quote",
@@ -3833,18 +3833,18 @@ dependencies = [
3833
3833
 
3834
3834
  [[package]]
3835
3835
  name = "zerofrom"
3836
- version = "0.1.6"
3836
+ version = "0.1.7"
3837
3837
  source = "registry+https://github.com/rust-lang/crates.io-index"
3838
- checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
3838
+ checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df"
3839
3839
  dependencies = [
3840
3840
  "zerofrom-derive",
3841
3841
  ]
3842
3842
 
3843
3843
  [[package]]
3844
3844
  name = "zerofrom-derive"
3845
- version = "0.1.6"
3845
+ version = "0.1.7"
3846
3846
  source = "registry+https://github.com/rust-lang/crates.io-index"
3847
- checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
3847
+ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
3848
3848
  dependencies = [
3849
3849
  "proc-macro2",
3850
3850
  "quote",
@@ -3874,9 +3874,9 @@ dependencies = [
3874
3874
 
3875
3875
  [[package]]
3876
3876
  name = "zerotrie"
3877
- version = "0.2.3"
3877
+ version = "0.2.4"
3878
3878
  source = "registry+https://github.com/rust-lang/crates.io-index"
3879
- checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
3879
+ checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
3880
3880
  dependencies = [
3881
3881
  "displaydoc",
3882
3882
  "yoke",
@@ -3885,9 +3885,9 @@ dependencies = [
3885
3885
 
3886
3886
  [[package]]
3887
3887
  name = "zerovec"
3888
- version = "0.11.5"
3888
+ version = "0.11.6"
3889
3889
  source = "registry+https://github.com/rust-lang/crates.io-index"
3890
- checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
3890
+ checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
3891
3891
  dependencies = [
3892
3892
  "yoke",
3893
3893
  "zerofrom",
@@ -3896,9 +3896,9 @@ dependencies = [
3896
3896
 
3897
3897
  [[package]]
3898
3898
  name = "zerovec-derive"
3899
- version = "0.11.2"
3899
+ version = "0.11.3"
3900
3900
  source = "registry+https://github.com/rust-lang/crates.io-index"
3901
- checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
3901
+ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
3902
3902
  dependencies = [
3903
3903
  "proc-macro2",
3904
3904
  "quote",
@@ -3,7 +3,7 @@ resolver = "3"
3
3
  members = ["crates/primp", "crates/primp-python"]
4
4
 
5
5
  [workspace.package]
6
- version = "1.2.1"
6
+ version = "1.2.2"
7
7
  edition = "2021"
8
8
  rust-version = "1.84"
9
9
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: primp
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "primp"
3
- version = "1.2.1"
3
+ version = "1.2.2"
4
4
  description = "HTTP client with browser impersonation capabilities"
5
5
  keywords = ["http", "request", "client", "impersonate"]
6
6
  categories = ["web-programming::http-client"]
@@ -518,6 +518,14 @@ impl Client {
518
518
  pub fn set_proxies(&mut self, proxies: Vec<reqwest::Proxy>) {
519
519
  self.inner.set_proxies(proxies)
520
520
  }
521
+
522
+ /// Set the redirect policy for the client.
523
+ ///
524
+ /// This allows changing redirect behavior at runtime without rebuilding the client.
525
+ /// Use `Policy::none()` to disable redirects, or `Policy::limited(n)` to set a limit.
526
+ pub fn set_redirect_policy(&mut self, policy: reqwest::redirect::Policy) {
527
+ self.inner.set_redirect_policy(policy);
528
+ }
521
529
  }
522
530
 
523
531
  impl Default for Client {
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "primp-python"
3
- version = "1.2.1"
3
+ version = "1.2.2"
4
4
  edition = "2021"
5
5
  rust-version = "1.84"
6
6
  description = "HTTP client that can impersonate web browsers"
@@ -65,7 +65,7 @@ def get_test(session_class, requests_number):
65
65
  for _ in range(requests_number):
66
66
  s = session_class()
67
67
  try:
68
- s.get(url).text
68
+ _ = s.get(url).text
69
69
  finally:
70
70
  if hasattr(s, "close"):
71
71
  s.close()
@@ -75,7 +75,7 @@ def session_get_test(session_class, requests_number):
75
75
  s = session_class()
76
76
  try:
77
77
  for _ in range(requests_number):
78
- s.get(url).text
78
+ _ = s.get(url).text
79
79
  finally:
80
80
  if hasattr(s, "close"):
81
81
  s.close()
@@ -110,28 +110,28 @@ def plot_data(data, ax, title):
110
110
  """Plot data for a single session type."""
111
111
  names = list(data.keys())
112
112
  sizes = ["5k", "50k", "200k"]
113
-
113
+
114
114
  x = np.arange(len(names))
115
115
  width = 0.125 # Narrower bars to fit 6 bars per group
116
-
116
+
117
117
  # Plot time bars (first 3)
118
118
  for i, size in enumerate(sizes):
119
119
  values = [data[name].get(size, {}).get("time", 0) for name in names]
120
120
  rects = ax.bar(x + i * width, values, width, label=f"Time {size}")
121
121
  ax.bar_label(rects, padding=3, fontsize=8, rotation=90)
122
-
122
+
123
123
  # Plot cpu_time bars (next 3)
124
124
  for i, size in enumerate(sizes):
125
125
  values = [data[name].get(size, {}).get("cpu_time", 0) for name in names]
126
126
  rects = ax.bar(x + (i + 3) * width, values, width, label=f"CPU Time {size}")
127
127
  ax.bar_label(rects, padding=3, fontsize=8, rotation=90)
128
-
128
+
129
129
  ax.set_ylabel("Time (s)", fontsize=10)
130
130
  ax.set_title(title, fontsize=11)
131
131
  ax.set_xticks(x + 3 * width - width / 2)
132
132
  ax.set_xticklabels(names, rotation=0, ha="center", fontsize=9)
133
133
  ax.legend(loc="upper left", ncols=6, prop={"size": 8})
134
-
134
+
135
135
  # Adjust y-axis
136
136
  y_min, y_max = ax.get_ylim()
137
137
  ax.set_ylim(y_min, y_max * 1.2)
@@ -140,11 +140,23 @@ def plot_data(data, ax, title):
140
140
  def generate_image():
141
141
  """Generate the benchmark image from in-memory data."""
142
142
  fig, (ax1, ax2, ax3) = plt.subplots(3, 1, figsize=(10, 7), layout="constrained")
143
-
144
- plot_data(results_data["sync_no_session"], ax1, "Session=False | Requests: 500 | Response: gzip, utf-8, size 5Kb, 50Kb, 200Kb")
145
- plot_data(results_data["sync_session"], ax2, "Session=True | Requests: 500 | Response: gzip, utf-8, size 5Kb, 50Kb, 200Kb")
146
- plot_data(results_data["async_session"], ax3, "Session=Async | Requests: 500 | Response: gzip, utf-8, size 5Kb, 50Kb, 200Kb")
147
-
143
+
144
+ plot_data(
145
+ results_data["sync_no_session"],
146
+ ax1,
147
+ "Session=False | Requests: 500 | Response: gzip, utf-8, size 5Kb, 50Kb, 200Kb",
148
+ )
149
+ plot_data(
150
+ results_data["sync_session"],
151
+ ax2,
152
+ "Session=True | Requests: 500 | Response: gzip, utf-8, size 5Kb, 50Kb, 200Kb",
153
+ )
154
+ plot_data(
155
+ results_data["async_session"],
156
+ ax3,
157
+ "Session=Async | Requests: 500 | Response: gzip, utf-8, size 5Kb, 50Kb, 200Kb",
158
+ )
159
+
148
160
  plt.savefig("benchmark.jpg", format="jpg", dpi=80, bbox_inches="tight")
149
161
  print("\nBenchmark image saved to benchmark.jpg")
150
162
 
@@ -154,9 +166,9 @@ AsyncPACKAGES = add_package_version(AsyncPACKAGES)
154
166
  requests_number = 500
155
167
 
156
168
  # Sync - No Session
157
- print(f"\n{'='*60}")
169
+ print(f"\n{'=' * 60}")
158
170
  print(f"Threads=1, session=False, requests={requests_number}")
159
- print(f"{'='*60}")
171
+ print(f"{'=' * 60}")
160
172
  for response_size in ["5k", "50k", "200k"]:
161
173
  url = f"http://127.0.0.1:8000/{response_size}"
162
174
  print(f"\n{response_size}:")
@@ -172,9 +184,9 @@ for response_size in ["5k", "50k", "200k"]:
172
184
  print(f" {name:<30} time: {dur}s cpu_time: {cpu_dur}s")
173
185
 
174
186
  # Sync - With Session
175
- print(f"\n{'='*60}")
187
+ print(f"\n{'=' * 60}")
176
188
  print(f"Threads=1, session=True, requests={requests_number}")
177
- print(f"{'='*60}")
189
+ print(f"{'=' * 60}")
178
190
  for response_size in ["5k", "50k", "200k"]:
179
191
  url = f"http://127.0.0.1:8000/{response_size}"
180
192
  print(f"\n{response_size}:")
@@ -190,9 +202,9 @@ for response_size in ["5k", "50k", "200k"]:
190
202
  print(f" {name:<30} time: {dur}s cpu_time: {cpu_dur}s")
191
203
 
192
204
  # Async
193
- print(f"\n{'='*60}")
205
+ print(f"\n{'=' * 60}")
194
206
  print(f"Threads=1, session=Async, requests={requests_number}")
195
- print(f"{'='*60}")
207
+ print(f"{'=' * 60}")
196
208
  for response_size in ["5k", "50k", "200k"]:
197
209
  url = f"http://127.0.0.1:8000/{response_size}"
198
210
  print(f"\n{response_size}:")
@@ -209,4 +221,3 @@ for response_size in ["5k", "50k", "200k"]:
209
221
 
210
222
  # Generate image from in-memory data
211
223
  generate_image()
212
-