optify 0.8.6__tar.gz → 0.12.0__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 (77) hide show
  1. {optify-0.8.6 → optify-0.12.0}/PKG-INFO +8 -3
  2. {optify-0.8.6/python/optify → optify-0.12.0}/README.md +7 -2
  3. {optify-0.8.6 → optify-0.12.0}/optify/optify.pyi +5 -0
  4. {optify-0.8.6 → optify-0.12.0}/pyproject.toml +2 -2
  5. {optify-0.8.6 → optify-0.12.0}/python/optify/Cargo.lock +400 -850
  6. {optify-0.8.6 → optify-0.12.0}/python/optify/Cargo.toml +3 -3
  7. {optify-0.8.6 → optify-0.12.0/python/optify}/README.md +7 -2
  8. {optify-0.8.6 → optify-0.12.0}/python/optify/src/provider.rs +22 -0
  9. {optify-0.8.6 → optify-0.12.0}/python/optify/src/watcher.rs +22 -0
  10. {optify-0.8.6 → optify-0.12.0}/python/optify/tests/test_provider.py +36 -2
  11. optify-0.12.0/rust/Cargo.toml +6 -0
  12. {optify-0.8.6 → optify-0.12.0}/rust/optify/Cargo.toml +15 -10
  13. {optify-0.8.6 → optify-0.12.0}/rust/optify/README.md +59 -6
  14. {optify-0.8.6 → optify-0.12.0}/rust/optify/benches/get_all_options_benchmark.rs +5 -2
  15. {optify-0.8.6 → optify-0.12.0}/rust/optify/benches/get_options_benchmark.rs +10 -7
  16. {optify-0.8.6 → optify-0.12.0}/rust/optify/benches/loading_benchmark.rs +28 -3
  17. optify-0.12.0/rust/optify/src/builder/builder_impl.rs +711 -0
  18. optify-0.12.0/rust/optify/src/builder/builder_options.rs +220 -0
  19. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/builder/builder_trait.rs +7 -3
  20. optify-0.12.0/rust/optify/src/builder/extract_configurable_string_files_from_config.rs +23 -0
  21. optify-0.12.0/rust/optify/src/builder/extract_files_from_config.rs +32 -0
  22. optify-0.12.0/rust/optify/src/builder/get_canonical_feature_name.rs +25 -0
  23. optify-0.12.0/rust/optify/src/builder/get_supported_extensions.rs +16 -0
  24. optify-0.12.0/rust/optify/src/builder/loading_result.rs +32 -0
  25. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/builder/mod.rs +5 -0
  26. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/builder/watcher_builder.rs +18 -7
  27. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/configurable_string/configurable_string_impl.rs +24 -1
  28. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/configurable_string/mod.rs +0 -1
  29. optify-0.12.0/rust/optify/src/configurable_values/configurable_list_impl.rs +43 -0
  30. optify-0.12.0/rust/optify/src/configurable_values/locator.rs +467 -0
  31. optify-0.12.0/rust/optify/src/configurable_values/mod.rs +2 -0
  32. optify-0.12.0/rust/optify/src/json/escape_json_pointer.rs +9 -0
  33. optify-0.12.0/rust/optify/src/json/merge.rs +218 -0
  34. optify-0.12.0/rust/optify/src/json/mod.rs +5 -0
  35. optify-0.12.0/rust/optify/src/lib.rs +10 -0
  36. optify-0.12.0/rust/optify/src/policies/feature_policies.rs +32 -0
  37. optify-0.12.0/rust/optify/src/policies/mod.rs +10 -0
  38. optify-0.12.0/rust/optify/src/policies/policies_file_contents.rs +12 -0
  39. optify-0.12.0/rust/optify/src/policies/policy_denied_error.rs +29 -0
  40. optify-0.12.0/rust/optify/src/policies/policy_store.rs +169 -0
  41. optify-0.12.0/rust/optify/src/policies/requester_feature_policy.rs +52 -0
  42. optify-0.12.0/rust/optify/src/policies/requester_policy.rs +38 -0
  43. optify-0.12.0/rust/optify/src/policies/validate_requester_policies.rs +56 -0
  44. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/provider/constraints.rs +2 -1
  45. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/provider/get_options_preferences.rs +28 -1
  46. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/provider/provider_impl.rs +282 -79
  47. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/provider/provider_trait.rs +71 -6
  48. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/provider/watcher.rs +68 -62
  49. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/schema/feature.rs +5 -2
  50. optify-0.8.6/rust/optify/.claude/settings.json +0 -24
  51. optify-0.8.6/rust/optify/src/builder/builder_impl.rs +0 -530
  52. optify-0.8.6/rust/optify/src/builder/builder_options.rs +0 -17
  53. optify-0.8.6/rust/optify/src/builder/loading_result.rs +0 -15
  54. optify-0.8.6/rust/optify/src/configurable_string/locator.rs +0 -353
  55. optify-0.8.6/rust/optify/src/json/merge.rs +0 -135
  56. optify-0.8.6/rust/optify/src/json/mod.rs +0 -2
  57. optify-0.8.6/rust/optify/src/lib.rs +0 -5
  58. {optify-0.8.6 → optify-0.12.0}/LICENSE.txt +0 -0
  59. {optify-0.8.6 → optify-0.12.0}/optify/__init__.py +0 -0
  60. {optify-0.8.6 → optify-0.12.0}/optify/py.typed +0 -0
  61. {optify-0.8.6 → optify-0.12.0}/python/optify/.gitignore +0 -0
  62. {optify-0.8.6 → optify-0.12.0}/python/optify/.vscode/settings.json +0 -0
  63. {optify-0.8.6 → optify-0.12.0}/python/optify/LICENSE.txt +0 -0
  64. {optify-0.8.6 → optify-0.12.0}/python/optify/src/lib.rs +0 -0
  65. {optify-0.8.6 → optify-0.12.0}/python/optify/src/preferences.rs +0 -0
  66. {optify-0.8.6 → optify-0.12.0}/python/optify/tests/test_builder.py +0 -0
  67. {optify-0.8.6 → optify-0.12.0}/python/optify/tests/test_dacite.py +0 -0
  68. {optify-0.8.6 → optify-0.12.0}/python/optify/tests/test_optify.py +0 -0
  69. {optify-0.8.6 → optify-0.12.0}/python/optify/tests/test_pydantic.py +0 -0
  70. {optify-0.8.6 → optify-0.12.0}/rust/optify/benches/caching_benchmark.rs +0 -0
  71. {optify-0.8.6 → optify-0.12.0}/rust/optify/build.rs +0 -0
  72. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/json/reader.rs +0 -0
  73. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/provider/mod.rs +0 -0
  74. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/provider/watcher_options.rs +0 -0
  75. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/schema/conditions.rs +0 -0
  76. {optify-0.8.6 → optify-0.12.0}/rust/optify/src/schema/metadata.rs +0 -0
  77. {optify-0.8.6 → optify-0.12.0}/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.8.6
3
+ Version: 0.12.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -30,6 +30,7 @@ This is just meant to be minimal to get started and help build a Python library.
30
30
  See the [homepage] for details about how feature files are combined to build the options to process at runtime.
31
31
 
32
32
  ## Usage
33
+
33
34
  ```Python
34
35
  import json
35
36
  from optify import OptionsProvider
@@ -40,6 +41,7 @@ print(config)
40
41
  ```
41
42
 
42
43
  Outputs:
44
+
43
45
  ```JSON
44
46
  {
45
47
  "myArray": [
@@ -154,11 +156,11 @@ watcher = OptionsWatcher.build('path/to/configs')
154
156
  ### Setup
155
157
 
156
158
  ```shell
157
- pyenv virtualenv optify-dev
159
+ pyenv virtualenv 3.12 optify-dev
158
160
  pyenv local optify-dev
159
- pyenv activate optify-dev
160
161
 
161
162
  pip install -e '.[dev]'
163
+ pip install maturin
162
164
  ```
163
165
 
164
166
  ### Build
@@ -174,12 +176,15 @@ pytest
174
176
  ```
175
177
 
176
178
  ### Formatting
179
+
177
180
  To automatically change the Rust code, run:
181
+
178
182
  ```shell
179
183
  cargo fmt && cargo clippy --fix --allow-dirty --allow-staged
180
184
  ```
181
185
 
182
186
  # Publishing
187
+
183
188
  A GitHub Action will automatically publish new versions: https://github.com/juharris/optify/actions/workflows/python_publish.yml
184
189
 
185
190
  [homepage]: https://github.com/juharris/optify
@@ -10,6 +10,7 @@ This is just meant to be minimal to get started and help build a Python library.
10
10
  See the [homepage] for details about how feature files are combined to build the options to process at runtime.
11
11
 
12
12
  ## Usage
13
+
13
14
  ```Python
14
15
  import json
15
16
  from optify import OptionsProvider
@@ -20,6 +21,7 @@ print(config)
20
21
  ```
21
22
 
22
23
  Outputs:
24
+
23
25
  ```JSON
24
26
  {
25
27
  "myArray": [
@@ -134,11 +136,11 @@ watcher = OptionsWatcher.build('path/to/configs')
134
136
  ### Setup
135
137
 
136
138
  ```shell
137
- pyenv virtualenv optify-dev
139
+ pyenv virtualenv 3.12 optify-dev
138
140
  pyenv local optify-dev
139
- pyenv activate optify-dev
140
141
 
141
142
  pip install -e '.[dev]'
143
+ pip install maturin
142
144
  ```
143
145
 
144
146
  ### Build
@@ -154,12 +156,15 @@ pytest
154
156
  ```
155
157
 
156
158
  ### Formatting
159
+
157
160
  To automatically change the Rust code, run:
161
+
158
162
  ```shell
159
163
  cargo fmt && cargo clippy --fix --allow-dirty --allow-staged
160
164
  ```
161
165
 
162
166
  # Publishing
167
+
163
168
  A GitHub Action will automatically publish new versions: https://github.com/juharris/optify/actions/workflows/python_publish.yml
164
169
 
165
170
  [homepage]: https://github.com/juharris/optify
@@ -27,11 +27,16 @@ class OptionsProviderBase(ABC):
27
27
 
28
28
  def features(self) -> List[str]: ...
29
29
 
30
+
31
+ def get_filtered_features(self, feature_names: List[str], preferences: Optional[GetOptionsPreferences] = None) -> List[str]: ...
32
+
30
33
  def get_options_json(self, key: str, feature_names: List[str]) -> str: ...
31
34
 
32
35
  def get_options_json_with_preferences(
33
36
  self, key: str, feature_names: List[str], preferences: Optional[GetOptionsPreferences]) -> str: ...
34
37
 
38
+ def map_feature_names(self, feature_names: List[str], preferences: Optional[GetOptionsPreferences] = None) -> List[Optional[str]]: ...
39
+
35
40
 
36
41
  class OptionsProvider(OptionsProviderBase):
37
42
  pass
@@ -26,11 +26,11 @@ build-backend = "maturin"
26
26
 
27
27
  [package]
28
28
  name = "optify"
29
- version = "0.8.6"
29
+ version = "0.12.0"
30
30
 
31
31
  [tool.poetry]
32
32
  name = "optify"
33
- version = "0.8.6"
33
+ version = "0.12.0"
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"]