slumber-python 5.4.0__tar.gz → 5.4.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 (69) hide show
  1. {slumber_python-5.4.0 → slumber_python-5.4.2}/Cargo.lock +26 -15
  2. {slumber_python-5.4.0 → slumber_python-5.4.2}/Cargo.toml +12 -11
  3. {slumber_python-5.4.0 → slumber_python-5.4.2}/PKG-INFO +1 -1
  4. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/database/convert.rs +1 -1
  5. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/database/tests.rs +1 -1
  6. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/database.rs +2 -2
  7. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/http/tests.rs +1 -1
  8. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/render/tests.rs +1 -1
  9. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/render.rs +4 -0
  10. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/util/src/lib.rs +3 -3
  11. {slumber_python-5.4.0 → slumber_python-5.4.2}/README.md +0 -0
  12. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/Cargo.toml +0 -0
  13. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/cereal.rs +0 -0
  14. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/default.yml +0 -0
  15. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/default_old.yml +0 -0
  16. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/lib.rs +0 -0
  17. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/tui/cereal.rs +0 -0
  18. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/tui/input.rs +0 -0
  19. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/tui/mime.rs +0 -0
  20. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/tui/theme.rs +0 -0
  21. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/config/src/tui.rs +0 -0
  22. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/console/Cargo.toml +0 -0
  23. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/console/src/lib.rs +0 -0
  24. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/Cargo.toml +0 -0
  25. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/collection/cereal.rs +0 -0
  26. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/collection/models.rs +0 -0
  27. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/collection/recipe_tree.rs +0 -0
  28. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/collection/schema.rs +0 -0
  29. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/collection/value_template.rs +0 -0
  30. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/collection.rs +0 -0
  31. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/database/migrations.rs +0 -0
  32. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/http/curl.rs +0 -0
  33. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/http/models.rs +0 -0
  34. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/http.rs +0 -0
  35. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/lib.rs +0 -0
  36. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/render/functions.rs +0 -0
  37. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/render/util.rs +0 -0
  38. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/test_util.rs +0 -0
  39. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/util/json.rs +0 -0
  40. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/core/src/util.rs +0 -0
  41. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/macros/Cargo.toml +0 -0
  42. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/macros/src/lib.rs +0 -0
  43. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/Cargo.toml +0 -0
  44. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/README.md +0 -0
  45. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/dev.py +0 -0
  46. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/mise.toml +0 -0
  47. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/slumber.pyi +0 -0
  48. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/src/lib.rs +0 -0
  49. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/tests/slumber.yml +0 -0
  50. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/tests/test.py +0 -0
  51. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/python/uv.lock +0 -0
  52. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/Cargo.toml +0 -0
  53. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/proptest-regressions/parse.txt +0 -0
  54. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/cereal.rs +0 -0
  55. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/display.rs +0 -0
  56. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/error.rs +0 -0
  57. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/expression.rs +0 -0
  58. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/lib.rs +0 -0
  59. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/parse.rs +0 -0
  60. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/test_util.rs +0 -0
  61. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/tests.rs +0 -0
  62. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/template/src/value.rs +0 -0
  63. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/util/Cargo.toml +0 -0
  64. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/util/src/paths.rs +0 -0
  65. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/util/src/test_util.rs +0 -0
  66. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/util/src/yaml/error.rs +0 -0
  67. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/util/src/yaml/resolve.rs +0 -0
  68. {slumber_python-5.4.0 → slumber_python-5.4.2}/crates/util/src/yaml.rs +0 -0
  69. {slumber_python-5.4.0 → slumber_python-5.4.2}/pyproject.toml +0 -0
@@ -160,13 +160,13 @@ dependencies = [
160
160
 
161
161
  [[package]]
162
162
  name = "async-trait"
163
- version = "0.1.89"
163
+ version = "0.1.92"
164
164
  source = "registry+https://github.com/rust-lang/crates.io-index"
165
- checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
165
+ checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
166
166
  dependencies = [
167
167
  "proc-macro2",
168
168
  "quote",
169
- "syn 2.0.114",
169
+ "syn 3.0.9",
170
170
  ]
171
171
 
172
172
  [[package]]
@@ -877,7 +877,7 @@ dependencies = [
877
877
 
878
878
  [[package]]
879
879
  name = "doc_utils"
880
- version = "5.4.0"
880
+ version = "5.4.2"
881
881
  dependencies = [
882
882
  "anyhow",
883
883
  "clap",
@@ -3348,7 +3348,7 @@ checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
3348
3348
 
3349
3349
  [[package]]
3350
3350
  name = "slumber"
3351
- version = "5.4.0"
3351
+ version = "5.4.2"
3352
3352
  dependencies = [
3353
3353
  "anyhow",
3354
3354
  "slumber_cli",
@@ -3360,7 +3360,7 @@ dependencies = [
3360
3360
 
3361
3361
  [[package]]
3362
3362
  name = "slumber_cli"
3363
- version = "5.4.0"
3363
+ version = "5.4.2"
3364
3364
  dependencies = [
3365
3365
  "anyhow",
3366
3366
  "assert_cmd",
@@ -3395,7 +3395,7 @@ dependencies = [
3395
3395
 
3396
3396
  [[package]]
3397
3397
  name = "slumber_config"
3398
- version = "5.4.0"
3398
+ version = "5.4.2"
3399
3399
  dependencies = [
3400
3400
  "derive_more",
3401
3401
  "dirs",
@@ -3420,7 +3420,7 @@ dependencies = [
3420
3420
 
3421
3421
  [[package]]
3422
3422
  name = "slumber_console"
3423
- version = "5.4.0"
3423
+ version = "5.4.2"
3424
3424
  dependencies = [
3425
3425
  "anyhow",
3426
3426
  "async-trait",
@@ -3434,7 +3434,7 @@ dependencies = [
3434
3434
 
3435
3435
  [[package]]
3436
3436
  name = "slumber_core"
3437
- version = "5.4.0"
3437
+ version = "5.4.2"
3438
3438
  dependencies = [
3439
3439
  "async-trait",
3440
3440
  "base64 0.22.1",
@@ -3482,7 +3482,7 @@ dependencies = [
3482
3482
 
3483
3483
  [[package]]
3484
3484
  name = "slumber_import"
3485
- version = "5.4.0"
3485
+ version = "5.4.2"
3486
3486
  dependencies = [
3487
3487
  "anyhow",
3488
3488
  "base64 0.22.1",
@@ -3514,7 +3514,7 @@ dependencies = [
3514
3514
 
3515
3515
  [[package]]
3516
3516
  name = "slumber_macros"
3517
- version = "5.4.0"
3517
+ version = "5.4.2"
3518
3518
  dependencies = [
3519
3519
  "proc-macro2",
3520
3520
  "quote",
@@ -3523,7 +3523,7 @@ dependencies = [
3523
3523
 
3524
3524
  [[package]]
3525
3525
  name = "slumber_python"
3526
- version = "5.4.0"
3526
+ version = "5.4.2"
3527
3527
  dependencies = [
3528
3528
  "async-trait",
3529
3529
  "indexmap",
@@ -3537,7 +3537,7 @@ dependencies = [
3537
3537
 
3538
3538
  [[package]]
3539
3539
  name = "slumber_template"
3540
- version = "5.4.0"
3540
+ version = "5.4.2"
3541
3541
  dependencies = [
3542
3542
  "bytes",
3543
3543
  "derive_more",
@@ -3564,7 +3564,7 @@ dependencies = [
3564
3564
 
3565
3565
  [[package]]
3566
3566
  name = "slumber_tui"
3567
- version = "5.4.0"
3567
+ version = "5.4.2"
3568
3568
  dependencies = [
3569
3569
  "anyhow",
3570
3570
  "async-trait",
@@ -3606,7 +3606,7 @@ dependencies = [
3606
3606
 
3607
3607
  [[package]]
3608
3608
  name = "slumber_util"
3609
- version = "5.4.0"
3609
+ version = "5.4.2"
3610
3610
  dependencies = [
3611
3611
  "console-subscriber",
3612
3612
  "derive_more",
@@ -3728,6 +3728,17 @@ dependencies = [
3728
3728
  "unicode-ident",
3729
3729
  ]
3730
3730
 
3731
+ [[package]]
3732
+ name = "syn"
3733
+ version = "3.0.9"
3734
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3735
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
3736
+ dependencies = [
3737
+ "proc-macro2",
3738
+ "quote",
3739
+ "unicode-ident",
3740
+ ]
3741
+
3731
3742
  [[package]]
3732
3743
  name = "sync_wrapper"
3733
3744
  version = "1.0.2"
@@ -9,9 +9,9 @@ homepage = "https://slumber.lucaspickering.me"
9
9
  keywords = ["rest", "http", "terminal", "tui"]
10
10
  license = "MIT"
11
11
  repository = "https://github.com/LucasPickering/slumber"
12
- version = "5.4.0"
12
+ version = "5.4.2"
13
13
  # Keep in sync w/ rust-toolchain.toml
14
- rust-version = "1.90.0"
14
+ rust-version = "1.99.0"
15
15
 
16
16
  # Dependencies used in multiple crates get de-duplicated here
17
17
  [workspace.dependencies]
@@ -43,15 +43,15 @@ serde_json = {version = "1.0.120", default-features = false, features = ["preser
43
43
  serde_json_path = "0.7.1"
44
44
  serde_test = "1.0.176"
45
45
  serde_yaml = {version = "0.9.0", default-features = false}
46
- slumber_cli = {path = "./crates/cli", version = "5.4.0" }
47
- slumber_config = {path = "./crates/config", version = "5.4.0", default-features = false}
48
- slumber_console = {path = "./crates/console", version = "5.4.0" }
49
- slumber_core = {path = "./crates/core", version = "5.4.0" }
50
- slumber_import = {path = "./crates/import", version = "5.4.0" }
51
- slumber_macros = {path = "./crates/macros", version = "5.4.0" }
52
- slumber_template = {path = "./crates/template", version = "5.4.0" }
53
- slumber_tui = {path = "./crates/tui", version = "5.4.0" }
54
- slumber_util = {path = "./crates/util", version = "5.4.0" }
46
+ slumber_cli = {path = "./crates/cli", version = "5.4.2" }
47
+ slumber_config = {path = "./crates/config", version = "5.4.2", default-features = false}
48
+ slumber_console = {path = "./crates/console", version = "5.4.2" }
49
+ slumber_core = {path = "./crates/core", version = "5.4.2" }
50
+ slumber_import = {path = "./crates/import", version = "5.4.2" }
51
+ slumber_macros = {path = "./crates/macros", version = "5.4.2" }
52
+ slumber_template = {path = "./crates/template", version = "5.4.2" }
53
+ slumber_tui = {path = "./crates/tui", version = "5.4.2" }
54
+ slumber_util = {path = "./crates/util", version = "5.4.2" }
55
55
  strum = {version = "0.27.0", default-features = false}
56
56
  syn = "2.0.101"
57
57
  terminput = "0.5.3"
@@ -92,6 +92,7 @@ needless_pass_by_value = "allow"
92
92
  similar_names = "allow"
93
93
  single_match = "allow"
94
94
  too_many_lines = "allow"
95
+ unused_async_trait_impl = "allow"
95
96
  unused_self = "allow"
96
97
  used_underscore_binding = "allow"
97
98
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: slumber-python
3
- Version: 5.4.0
3
+ Version: 5.4.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -353,7 +353,7 @@ impl FromSql for SqlWrap<Bytes> {
353
353
  impl FromSql for SqlWrap<StatusCode> {
354
354
  fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
355
355
  let code: u16 = value.as_i64()?.try_into().map_err(error_other)?;
356
- let code = StatusCode::from_u16(code as u16).map_err(error_other)?;
356
+ let code = StatusCode::from_u16(code).map_err(error_other)?;
357
357
  Ok(Self(code))
358
358
  }
359
359
  }
@@ -293,7 +293,7 @@ fn test_request_body(#[case] body: RequestBody) {
293
293
  });
294
294
 
295
295
  database.insert_exchange(&exchange).unwrap();
296
- let actual = database.get_request(exchange.id).unwrap().unwrap();
296
+ let actual = database.get_exchange(exchange.id).unwrap().unwrap();
297
297
 
298
298
  // What goes in is what comes out
299
299
  assert_eq!(actual.request.body, body);
@@ -392,8 +392,8 @@ impl CollectionDatabase {
392
392
  .traced();
393
393
  }
394
394
 
395
- /// Get a request by ID, or `None` if it does not exist in history.
396
- pub fn get_request(
395
+ /// Get an exchange by ID, or `None` if not in the database
396
+ pub fn get_exchange(
397
397
  &self,
398
398
  request_id: RequestId,
399
399
  ) -> Result<Option<Exchange>, DatabaseError> {
@@ -1082,7 +1082,7 @@ async fn test_send_request(http_engine: HttpEngine) {
1082
1082
  );
1083
1083
 
1084
1084
  // Ensure it was persisted
1085
- assert_eq!(database.get_request(exchange.id).unwrap(), Some(exchange));
1085
+ assert_eq!(database.get_exchange(exchange.id).unwrap(), Some(exchange));
1086
1086
  }
1087
1087
 
1088
1088
  /// Leading/trailing newlines should be stripped from rendered header
@@ -923,7 +923,7 @@ async fn test_response_header(
923
923
  ..ResponseRecord::factory(id)
924
924
  }
925
925
  .into(),
926
- end_time: Utc::now() - Duration::from_secs(60 * 60),
926
+ end_time: Utc::now() - Duration::from_hours(1),
927
927
  ..Exchange::factory((id, None, recipe.id.clone()))
928
928
  };
929
929
  database.insert_exchange(&exchange).unwrap();
@@ -212,6 +212,7 @@ impl TemplateContext {
212
212
  }
213
213
  }
214
214
 
215
+ /// Template context when producing eager values (where streams aren't allowed)
215
216
  impl Context<Value> for TemplateContext {
216
217
  async fn get_field(
217
218
  &self,
@@ -241,11 +242,14 @@ impl Context<Value> for TemplateContext {
241
242
  }
242
243
  }
243
244
 
245
+ /// Template context when producing lazy values (where streams are allowed)
244
246
  impl Context<ValueStream> for TemplateContext {
245
247
  async fn get_field(
246
248
  &self,
247
249
  field: &Identifier,
248
250
  ) -> Result<ValueStream, RenderError> {
251
+ // Streams can't be cached because they can only be resolved once. If
252
+ // the value is cached, it must be eager.
249
253
  let guard = match self.get_field_cache_guard(field).await {
250
254
  FieldCacheOutcome::Hit(value) => return Ok(value.into()),
251
255
  FieldCacheOutcome::Miss(guard) => guard,
@@ -143,11 +143,11 @@ where
143
143
  /// use slumber_util::doc_link;
144
144
  /// assert_eq!(
145
145
  /// doc_link("api/chain"),
146
- /// "https://slumber.lucaspickering.me/api/chain.html",
146
+ /// "https://slmbr.dev/api/chain.html",
147
147
  /// );
148
148
  /// ```
149
149
  pub fn doc_link(path: &str) -> String {
150
- const ROOT: &str = "https://slumber.lucaspickering.me/";
150
+ const ROOT: &str = "https://slmbr.dev/";
151
151
  if path.is_empty() {
152
152
  ROOT.into()
153
153
  } else {
@@ -414,7 +414,7 @@ mod tests {
414
414
  #[case::seconds_longer("100s", Duration::from_secs(100))]
415
415
  #[case::minutes("3m", Duration::from_secs(180))]
416
416
  #[case::hours("3h", Duration::from_secs(10_800))]
417
- #[case::days("2d", Duration::from_secs(172_800))]
417
+ #[case::days("2d", Duration::from_hours(48))]
418
418
  #[case::composite("2d3h10m17s", Duration::from_secs(
419
419
  2 * 86400 + 3 * 3600 + 10 * 60 + 17
420
420
  ))]
File without changes