optify 0.10.0__tar.gz → 0.10.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 (62) hide show
  1. {optify-0.10.0 → optify-0.10.2}/PKG-INFO +1 -1
  2. {optify-0.10.0 → optify-0.10.2}/pyproject.toml +2 -2
  3. {optify-0.10.0 → optify-0.10.2}/python/optify/Cargo.lock +12 -13
  4. {optify-0.10.0 → optify-0.10.2}/python/optify/Cargo.toml +3 -3
  5. {optify-0.10.0 → optify-0.10.2}/rust/optify/Cargo.toml +1 -1
  6. {optify-0.10.0 → optify-0.10.2}/rust/optify/README.md +1 -0
  7. {optify-0.10.0 → optify-0.10.2}/rust/optify/benches/get_options_benchmark.rs +4 -4
  8. {optify-0.10.0 → optify-0.10.2}/rust/optify/benches/loading_benchmark.rs +23 -1
  9. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/builder_impl.rs +264 -218
  10. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/extract_configurable_string_files_from_config.rs +1 -2
  11. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/extract_files_from_config.rs +1 -4
  12. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/loading_result.rs +13 -2
  13. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/configurable_values/locator.rs +110 -35
  14. optify-0.10.2/rust/optify/src/json/merge.rs +218 -0
  15. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/provider/provider_impl.rs +122 -89
  16. optify-0.10.0/rust/optify/src/json/merge.rs +0 -135
  17. {optify-0.10.0 → optify-0.10.2}/LICENSE.txt +0 -0
  18. {optify-0.10.0 → optify-0.10.2}/README.md +0 -0
  19. {optify-0.10.0 → optify-0.10.2}/optify/__init__.py +0 -0
  20. {optify-0.10.0 → optify-0.10.2}/optify/optify.pyi +0 -0
  21. {optify-0.10.0 → optify-0.10.2}/optify/py.typed +0 -0
  22. {optify-0.10.0 → optify-0.10.2}/python/optify/.gitignore +0 -0
  23. {optify-0.10.0 → optify-0.10.2}/python/optify/.vscode/settings.json +0 -0
  24. {optify-0.10.0 → optify-0.10.2}/python/optify/LICENSE.txt +0 -0
  25. {optify-0.10.0 → optify-0.10.2}/python/optify/README.md +0 -0
  26. {optify-0.10.0 → optify-0.10.2}/python/optify/src/lib.rs +0 -0
  27. {optify-0.10.0 → optify-0.10.2}/python/optify/src/preferences.rs +0 -0
  28. {optify-0.10.0 → optify-0.10.2}/python/optify/src/provider.rs +0 -0
  29. {optify-0.10.0 → optify-0.10.2}/python/optify/src/watcher.rs +0 -0
  30. {optify-0.10.0 → optify-0.10.2}/python/optify/tests/test_builder.py +0 -0
  31. {optify-0.10.0 → optify-0.10.2}/python/optify/tests/test_dacite.py +0 -0
  32. {optify-0.10.0 → optify-0.10.2}/python/optify/tests/test_optify.py +0 -0
  33. {optify-0.10.0 → optify-0.10.2}/python/optify/tests/test_provider.py +0 -0
  34. {optify-0.10.0 → optify-0.10.2}/python/optify/tests/test_pydantic.py +0 -0
  35. {optify-0.10.0 → optify-0.10.2}/rust/Cargo.toml +0 -0
  36. {optify-0.10.0 → optify-0.10.2}/rust/optify/benches/caching_benchmark.rs +0 -0
  37. {optify-0.10.0 → optify-0.10.2}/rust/optify/benches/get_all_options_benchmark.rs +0 -0
  38. {optify-0.10.0 → optify-0.10.2}/rust/optify/build.rs +0 -0
  39. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/builder_options.rs +0 -0
  40. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/builder_trait.rs +0 -0
  41. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/get_canonical_feature_name.rs +0 -0
  42. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/get_supported_extensions.rs +0 -0
  43. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/mod.rs +0 -0
  44. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/builder/watcher_builder.rs +0 -0
  45. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/configurable_string/configurable_string_impl.rs +0 -0
  46. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/configurable_string/mod.rs +0 -0
  47. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/configurable_values/configurable_list_impl.rs +0 -0
  48. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/configurable_values/mod.rs +0 -0
  49. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/json/escape_json_pointer.rs +0 -0
  50. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/json/mod.rs +0 -0
  51. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/json/reader.rs +0 -0
  52. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/lib.rs +0 -0
  53. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/provider/constraints.rs +0 -0
  54. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/provider/get_options_preferences.rs +0 -0
  55. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/provider/mod.rs +0 -0
  56. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/provider/provider_trait.rs +0 -0
  57. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/provider/watcher.rs +0 -0
  58. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/provider/watcher_options.rs +0 -0
  59. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/schema/conditions.rs +0 -0
  60. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/schema/feature.rs +0 -0
  61. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/schema/metadata.rs +0 -0
  62. {optify-0.10.0 → optify-0.10.2}/rust/optify/src/schema/mod.rs +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: optify
3
- Version: 0.10.0
3
+ Version: 0.10.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -26,11 +26,11 @@ build-backend = "maturin"
26
26
 
27
27
  [package]
28
28
  name = "optify"
29
- version = "0.10.0"
29
+ version = "0.10.2"
30
30
 
31
31
  [tool.poetry]
32
32
  name = "optify"
33
- version = "0.10.0"
33
+ version = "0.10.2"
34
34
  description = "Simplifies getting the right configuration options for a process using pre-loaded configurations from files to manage options for experiments or flights."
35
35
  authors = ["Justin D. Harris"]
36
36
  maintainers = ["Justin D. Harris"]
@@ -898,7 +898,7 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
898
898
 
899
899
  [[package]]
900
900
  name = "optify"
901
- version = "1.3.0"
901
+ version = "1.3.2"
902
902
  dependencies = [
903
903
  "config",
904
904
  "cow-utils",
@@ -917,7 +917,7 @@ dependencies = [
917
917
 
918
918
  [[package]]
919
919
  name = "optify-python"
920
- version = "0.10.0"
920
+ version = "0.10.2"
921
921
  dependencies = [
922
922
  "optify",
923
923
  "pyo3",
@@ -1049,9 +1049,9 @@ dependencies = [
1049
1049
 
1050
1050
  [[package]]
1051
1051
  name = "pyo3"
1052
- version = "0.28.3"
1052
+ version = "0.29.0"
1053
1053
  source = "registry+https://github.com/rust-lang/crates.io-index"
1054
- checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
1054
+ checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
1055
1055
  dependencies = [
1056
1056
  "libc",
1057
1057
  "once_cell",
@@ -1063,18 +1063,18 @@ dependencies = [
1063
1063
 
1064
1064
  [[package]]
1065
1065
  name = "pyo3-build-config"
1066
- version = "0.28.3"
1066
+ version = "0.29.0"
1067
1067
  source = "registry+https://github.com/rust-lang/crates.io-index"
1068
- checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
1068
+ checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
1069
1069
  dependencies = [
1070
1070
  "target-lexicon",
1071
1071
  ]
1072
1072
 
1073
1073
  [[package]]
1074
1074
  name = "pyo3-ffi"
1075
- version = "0.28.3"
1075
+ version = "0.29.0"
1076
1076
  source = "registry+https://github.com/rust-lang/crates.io-index"
1077
- checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
1077
+ checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
1078
1078
  dependencies = [
1079
1079
  "libc",
1080
1080
  "pyo3-build-config",
@@ -1082,9 +1082,9 @@ dependencies = [
1082
1082
 
1083
1083
  [[package]]
1084
1084
  name = "pyo3-macros"
1085
- version = "0.28.3"
1085
+ version = "0.29.0"
1086
1086
  source = "registry+https://github.com/rust-lang/crates.io-index"
1087
- checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
1087
+ checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
1088
1088
  dependencies = [
1089
1089
  "proc-macro2",
1090
1090
  "pyo3-macros-backend",
@@ -1094,13 +1094,12 @@ dependencies = [
1094
1094
 
1095
1095
  [[package]]
1096
1096
  name = "pyo3-macros-backend"
1097
- version = "0.28.3"
1097
+ version = "0.29.0"
1098
1098
  source = "registry+https://github.com/rust-lang/crates.io-index"
1099
- checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
1099
+ checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
1100
1100
  dependencies = [
1101
1101
  "heck",
1102
1102
  "proc-macro2",
1103
- "pyo3-build-config",
1104
1103
  "quote",
1105
1104
  "syn",
1106
1105
  ]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "optify-python"
3
- version = "0.10.0"
3
+ version = "0.10.2"
4
4
  edition = "2021"
5
5
 
6
6
  description = "Simplifies getting the right configuration options for a process using pre-loaded configurations from files (JSON, YAML, etc.) to manage options for experiments or flights. This library is mainly made to support building implementations for other languages such as Node.js, Python, and Ruby. It is not meant to be consumed directly yet."
@@ -15,5 +15,5 @@ name = "optify"
15
15
  crate-type = ["cdylib"]
16
16
 
17
17
  [dependencies]
18
- optify = { path = "../../rust/optify", version = "1.3.0" }
19
- pyo3 = "0.28.2"
18
+ optify = { path = "../../rust/optify", version = "1.3.2" }
19
+ pyo3 = "0.29.0"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "optify"
3
- version = "1.3.0"
3
+ version = "1.3.2"
4
4
  edition = "2021"
5
5
  build = "build.rs"
6
6
 
@@ -90,6 +90,7 @@ cargo bench
90
90
 
91
91
  # Run one specific benchmark, example:
92
92
  cargo bench --bench get_options_benchmark
93
+ cargo bench --bench get_options_benchmark -- 'get_options/many features'
93
94
 
94
95
  # Open one of the reports
95
96
  open target/criterion/*/report/index.html
@@ -260,18 +260,18 @@ fn benchmark_many_features(c: &mut Criterion) {
260
260
  "with_files",
261
261
  ];
262
262
 
263
+ let mut preferences = GetOptionsPreferences::new();
264
+ preferences.are_configurable_strings_enabled = true;
265
+ let preferences = Some(&preferences);
263
266
  for key in keys {
264
267
  group.bench_function(key, |b| {
265
- let mut preferences = GetOptionsPreferences::new();
266
- preferences.are_configurable_strings_enabled = true;
267
- let preferences = Some(&preferences);
268
268
  b.iter(|| {
269
269
  provider
270
270
  .get_options_with_preferences(
271
271
  black_box(key),
272
272
  black_box(&features),
273
273
  None,
274
- preferences,
274
+ black_box(preferences),
275
275
  )
276
276
  .unwrap()
277
277
  })
@@ -1,4 +1,5 @@
1
1
  use criterion::{black_box, criterion_group, criterion_main, Criterion};
2
+ use optify::builder::BuilderOptions;
2
3
  use optify::builder::OptionsProviderBuilder;
3
4
  use optify::builder::OptionsRegistryBuilder;
4
5
  use optify::provider::OptionsRegistry;
@@ -55,6 +56,7 @@ fn create_test_files(dir: &Path, num_files: usize) {
55
56
  file.write_all(content.as_bytes()).unwrap();
56
57
  }
57
58
 
59
+ // Create features with imports.
58
60
  for i in num_files / 2..num_files {
59
61
  let file_path = dir.join(format!("test_{i}.yaml"));
60
62
  let mut file = fs::File::create(&file_path).unwrap();
@@ -90,6 +92,18 @@ options:
90
92
  );
91
93
  file.write_all(content.as_bytes()).unwrap();
92
94
  }
95
+
96
+ // Create raw files.
97
+ for i in 0..num_files / 2 {
98
+ let file_path = dir.join(format!("test_{i}.txt"));
99
+ let mut file = fs::File::create(&file_path).unwrap();
100
+
101
+ let content = format!(
102
+ r#"This is what goes in the file {i}
103
+ "#
104
+ );
105
+ file.write_all(content.as_bytes()).unwrap();
106
+ }
93
107
  }
94
108
 
95
109
  fn cleanup_test_files(dir: &Path) {
@@ -110,7 +124,15 @@ fn benchmark_loading(c: &mut Criterion) {
110
124
 
111
125
  group.bench_function("parallel loading", |b| {
112
126
  b.iter(|| {
113
- let mut builder = OptionsProviderBuilder::new();
127
+ let mut builder = black_box(OptionsProviderBuilder::new());
128
+ black_box(
129
+ builder
130
+ .with_options(BuilderOptions {
131
+ are_configurable_values_enabled: true,
132
+ ..Default::default()
133
+ })
134
+ .unwrap(),
135
+ );
114
136
  builder.add_directory(black_box(test_dir)).unwrap();
115
137
  })
116
138
  });