optify 0.6.0__tar.gz → 0.8.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 (58) hide show
  1. {optify-0.6.0 → optify-0.8.0}/PKG-INFO +13 -4
  2. {optify-0.6.0/python/optify → optify-0.8.0}/README.md +12 -3
  3. optify-0.8.0/optify/__init__.py +1 -0
  4. optify-0.8.0/optify/optify.pyi +49 -0
  5. optify-0.8.0/optify/py.typed +0 -0
  6. {optify-0.6.0 → optify-0.8.0}/pyproject.toml +3 -3
  7. optify-0.8.0/python/optify/.vscode/settings.json +9 -0
  8. optify-0.8.0/python/optify/Cargo.lock +2388 -0
  9. {optify-0.6.0 → optify-0.8.0}/python/optify/Cargo.toml +2 -2
  10. {optify-0.6.0 → optify-0.8.0/python/optify}/README.md +12 -3
  11. optify-0.8.0/python/optify/optify/__init__.py +1 -0
  12. optify-0.8.0/python/optify/optify/optify.pyi +49 -0
  13. optify-0.8.0/python/optify/optify/py.typed +0 -0
  14. optify-0.8.0/python/optify/src/lib.rs +30 -0
  15. optify-0.8.0/python/optify/src/preferences.rs +33 -0
  16. optify-0.6.0/python/optify/src/lib.rs → optify-0.8.0/python/optify/src/provider.rs +4 -30
  17. optify-0.8.0/python/optify/src/watcher.rs +97 -0
  18. {optify-0.6.0 → optify-0.8.0}/python/optify/tests/test_builder.py +3 -5
  19. {optify-0.6.0 → optify-0.8.0}/python/optify/tests/test_optify.py +9 -5
  20. optify-0.8.0/python/optify/tests/test_provider.py +52 -0
  21. {optify-0.6.0 → optify-0.8.0}/rust/optify/Cargo.toml +18 -8
  22. optify-0.8.0/rust/optify/benches/caching_benchmark.rs +194 -0
  23. optify-0.8.0/rust/optify/build.rs +75 -0
  24. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/builder/builder_impl.rs +254 -76
  25. optify-0.8.0/rust/optify/src/builder/builder_options.rs +17 -0
  26. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/builder/builder_trait.rs +6 -1
  27. optify-0.8.0/rust/optify/src/builder/loading_result.rs +12 -0
  28. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/builder/mod.rs +2 -0
  29. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/builder/watcher_builder.rs +23 -4
  30. optify-0.8.0/rust/optify/src/configurable_string/configurable_string_impl.rs +313 -0
  31. optify-0.8.0/rust/optify/src/configurable_string/locator.rs +353 -0
  32. optify-0.8.0/rust/optify/src/configurable_string/mod.rs +7 -0
  33. optify-0.8.0/rust/optify/src/json/mod.rs +1 -0
  34. optify-0.8.0/rust/optify/src/json/reader.rs +21 -0
  35. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/lib.rs +2 -0
  36. optify-0.8.0/rust/optify/src/provider/constraints.rs +21 -0
  37. optify-0.8.0/rust/optify/src/provider/get_options_preferences.rs +55 -0
  38. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/provider/mod.rs +4 -0
  39. optify-0.8.0/rust/optify/src/provider/provider_impl.rs +472 -0
  40. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/provider/provider_trait.rs +26 -0
  41. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/provider/watcher.rs +115 -15
  42. optify-0.8.0/rust/optify/src/provider/watcher_options.rs +22 -0
  43. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/schema/feature.rs +1 -1
  44. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/schema/metadata.rs +5 -0
  45. optify-0.6.0/python/optify/.vscode/settings.json +0 -3
  46. optify-0.6.0/python/optify/Cargo.lock +0 -1071
  47. optify-0.6.0/python/optify/tests/test_provider.py +0 -44
  48. optify-0.6.0/rust/optify/build.rs +0 -30
  49. optify-0.6.0/rust/optify/src/provider/constraints.rs +0 -4
  50. optify-0.6.0/rust/optify/src/provider/provider_impl.rs +0 -267
  51. {optify-0.6.0 → optify-0.8.0}/LICENSE.txt +0 -0
  52. {optify-0.6.0 → optify-0.8.0}/python/optify/.gitignore +0 -0
  53. {optify-0.6.0 → optify-0.8.0}/python/optify/LICENSE.txt +0 -0
  54. {optify-0.6.0 → optify-0.8.0}/rust/optify/.claude/settings.json +0 -0
  55. {optify-0.6.0 → optify-0.8.0}/rust/optify/README.md +0 -0
  56. {optify-0.6.0 → optify-0.8.0}/rust/optify/benches/loading_benchmark.rs +0 -0
  57. {optify-0.6.0 → optify-0.8.0}/rust/optify/src/schema/conditions.rs +0 -0
  58. {optify-0.6.0 → optify-0.8.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.6.0
3
+ Version: 0.8.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -22,10 +22,10 @@ Project-URL: Issues, https://github.com/juharris/optify/issues
22
22
  ](https://pypi.org/project/optify)
23
23
 
24
24
  ⚠️ Development in progress ⚠️\
25
- APIs are not final and may change, for example, interfaces may be used and names may change.
25
+ APIs are not final and may change, for example, interfaces may be used in the future or method names may change.
26
26
  This is just meant to be minimal to get started and help build a Python library.
27
27
 
28
- See the [homepage] for details.
28
+ See the [homepage] for details about how feature files are combined to build the options to process at runtime.
29
29
 
30
30
  ## Usage
31
31
  ```Python
@@ -55,9 +55,18 @@ Outputs:
55
55
  }
56
56
  ```
57
57
 
58
-
59
58
  See the [tests directory](./tests/) for more examples.
60
59
 
60
+ ### Watching for Changes
61
+
62
+ Use `OptionsWatcher` instead of `OptionsProvider` during development to have it automatically reload the options it stores when the files change:
63
+
64
+ ```Python
65
+ from optify import OptionsWatcher
66
+
67
+ watcher = OptionsWatcher.build('path/to/configs')
68
+ ```
69
+
61
70
  ## Development
62
71
 
63
72
  ### Setup
@@ -4,10 +4,10 @@
4
4
  ](https://pypi.org/project/optify)
5
5
 
6
6
  ⚠️ Development in progress ⚠️\
7
- APIs are not final and may change, for example, interfaces may be used and names may change.
7
+ APIs are not final and may change, for example, interfaces may be used in the future or method names may change.
8
8
  This is just meant to be minimal to get started and help build a Python library.
9
9
 
10
- See the [homepage] for details.
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
  ```Python
@@ -37,9 +37,18 @@ Outputs:
37
37
  }
38
38
  ```
39
39
 
40
-
41
40
  See the [tests directory](./tests/) for more examples.
42
41
 
42
+ ### Watching for Changes
43
+
44
+ Use `OptionsWatcher` instead of `OptionsProvider` during development to have it automatically reload the options it stores when the files change:
45
+
46
+ ```Python
47
+ from optify import OptionsWatcher
48
+
49
+ watcher = OptionsWatcher.build('path/to/configs')
50
+ ```
51
+
43
52
  ## Development
44
53
 
45
54
  ### Setup
@@ -0,0 +1 @@
1
+ from .optify import *
@@ -0,0 +1,49 @@
1
+ # Manually maintained interfaces as explained in: https://pyo3.rs/v0.25.1/python-typing-hints.html
2
+ # Eventually we should be able to automatically generate this as explained there.
3
+
4
+ from abc import ABC
5
+ from typing import List, Optional, Self
6
+
7
+
8
+ class GetOptionsPreferences:
9
+ def are_configurable_strings_enabled(self) -> bool: ...
10
+ def enable_configurable_strings(self) -> None: ...
11
+ def disable_configurable_strings(self) -> None: ...
12
+ def set_constraints_json(
13
+ self, constraints_json: Optional[str]) -> None: ...
14
+
15
+
16
+ class OptionsProviderBuilderBase(ABC):
17
+ def add_directory(self, directory: str) -> Self: ...
18
+
19
+
20
+ class OptionsProviderBase(ABC):
21
+ @classmethod
22
+ def build(cls, directory: str) -> Self: ...
23
+
24
+ @classmethod
25
+ def build_from_directories(
26
+ cls, directories: List[str]) -> Self: ...
27
+
28
+ def features(self) -> List[str]: ...
29
+
30
+ def get_options_json(self, key: str, feature_names: List[str]) -> str: ...
31
+
32
+ def get_options_json_with_preferences(
33
+ self, key: str, feature_names: List[str], preferences: Optional[GetOptionsPreferences]) -> str: ...
34
+
35
+
36
+ class OptionsProvider(OptionsProviderBase):
37
+ pass
38
+
39
+
40
+ class OptionsProviderBuilder(OptionsProviderBuilderBase):
41
+ def build(self) -> OptionsProvider: ...
42
+
43
+
44
+ class OptionsWatcher(OptionsProviderBase):
45
+ pass
46
+
47
+
48
+ class OptionsWatcherBuilder(OptionsProviderBuilderBase):
49
+ def build(self) -> OptionsWatcher: ...
File without changes
@@ -26,11 +26,11 @@ build-backend = "maturin"
26
26
 
27
27
  [package]
28
28
  name = "optify"
29
- version = "0.6.0"
29
+ version = "0.8.0"
30
30
 
31
31
  [tool.poetry]
32
32
  name = "optify"
33
- version = "0.6.0"
33
+ version = "0.8.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"]
@@ -41,7 +41,7 @@ packages = [{ include = "*", from = "src" }]
41
41
  name = "MIT"
42
42
 
43
43
  [tool.poetry.dependencies]
44
- maturin = "^1.8.2"
44
+ maturin = "^1.9.4"
45
45
  python = "^3.11"
46
46
 
47
47
  [tool.poetry.dev-dependencies]
@@ -0,0 +1,9 @@
1
+ {
2
+ "python.terminal.activateEnvironment": true,
3
+ "[rust]": {
4
+ "editor.formatOnSave": true
5
+ },
6
+ "[python]": {
7
+ "editor.formatOnSave": true
8
+ }
9
+ }