tstring-bindings 0.2.0__tar.gz → 0.2.1__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 (40) hide show
  1. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/Cargo.lock +8 -8
  2. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/Cargo.toml +1 -1
  3. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/PKG-INFO +1 -1
  4. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/json-tstring-rs/Cargo.toml +1 -1
  5. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/pyproject.toml +1 -1
  6. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python/tstring_bindings/__init__.py +17 -13
  7. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python/tstring_bindings/__init__.pyi +11 -7
  8. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python/tstring_bindings/tstring_bindings.pyi +13 -10
  9. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python-bindings/Cargo.toml +5 -5
  10. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python-bindings/src/lib.rs +1 -1
  11. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/toml-tstring-rs/Cargo.toml +1 -1
  12. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-pyo3-bindings/Cargo.toml +4 -4
  13. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/yaml-tstring-rs/Cargo.toml +1 -1
  14. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/README.md +0 -0
  15. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/json-tstring-rs/README.md +0 -0
  16. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/json-tstring-rs/src/lib.rs +0 -0
  17. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/json-tstring-rs/tests/conformance.rs +0 -0
  18. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/json-tstring-rs/tests/parser.rs +0 -0
  19. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python/tstring_bindings/_profiles.py +0 -0
  20. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python/tstring_bindings/_types.py +0 -0
  21. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python/tstring_bindings/py.typed +0 -0
  22. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/python-bindings/README.md +0 -0
  23. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/toml-tstring-rs/README.md +0 -0
  24. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/toml-tstring-rs/src/lib.rs +0 -0
  25. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/toml-tstring-rs/tests/conformance.rs +0 -0
  26. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/toml-tstring-rs/tests/parser.rs +0 -0
  27. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-core-rs/Cargo.toml +0 -0
  28. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-core-rs/README.md +0 -0
  29. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-core-rs/src/lib.rs +0 -0
  30. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-pyo3-bindings/benches/render_paths.rs +0 -0
  31. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-pyo3-bindings/src/json.rs +0 -0
  32. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-pyo3-bindings/src/lib.rs +0 -0
  33. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-pyo3-bindings/src/toml.rs +0 -0
  34. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/tstring-pyo3-bindings/src/yaml.rs +0 -0
  35. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/yaml-tstring-rs/README.md +0 -0
  36. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/yaml-tstring-rs/src/lib.rs +0 -0
  37. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/yaml-tstring-rs/test-support/renderer_layout.rs +0 -0
  38. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/yaml-tstring-rs/tests/conformance.rs +0 -0
  39. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/yaml-tstring-rs/tests/normalized.rs +0 -0
  40. {tstring_bindings-0.2.0 → tstring_bindings-0.2.1}/yaml-tstring-rs/tests/parser.rs +0 -0
@@ -725,7 +725,7 @@ checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
725
725
 
726
726
  [[package]]
727
727
  name = "tstring-backend-e2e-tests"
728
- version = "0.2.0"
728
+ version = "0.2.1"
729
729
  dependencies = [
730
730
  "tstring-json",
731
731
  "tstring-syntax",
@@ -735,7 +735,7 @@ dependencies = [
735
735
 
736
736
  [[package]]
737
737
  name = "tstring-bindings"
738
- version = "0.2.0"
738
+ version = "0.2.1"
739
739
  dependencies = [
740
740
  "pyo3",
741
741
  "pythonize",
@@ -751,7 +751,7 @@ dependencies = [
751
751
 
752
752
  [[package]]
753
753
  name = "tstring-json"
754
- version = "0.2.0"
754
+ version = "0.2.1"
755
755
  dependencies = [
756
756
  "serde_json",
757
757
  "toml",
@@ -760,7 +760,7 @@ dependencies = [
760
760
 
761
761
  [[package]]
762
762
  name = "tstring-pyo3-bindings"
763
- version = "0.2.0"
763
+ version = "0.2.1"
764
764
  dependencies = [
765
765
  "criterion",
766
766
  "pyo3",
@@ -776,14 +776,14 @@ dependencies = [
776
776
 
777
777
  [[package]]
778
778
  name = "tstring-syntax"
779
- version = "0.2.0"
779
+ version = "0.2.1"
780
780
  dependencies = [
781
781
  "num-bigint",
782
782
  ]
783
783
 
784
784
  [[package]]
785
785
  name = "tstring-toml"
786
- version = "0.2.0"
786
+ version = "0.2.1"
787
787
  dependencies = [
788
788
  "serde_json",
789
789
  "toml",
@@ -792,7 +792,7 @@ dependencies = [
792
792
 
793
793
  [[package]]
794
794
  name = "tstring-yaml"
795
- version = "0.2.0"
795
+ version = "0.2.1"
796
796
  dependencies = [
797
797
  "saphyr",
798
798
  "saphyr-parser",
@@ -803,7 +803,7 @@ dependencies = [
803
803
 
804
804
  [[package]]
805
805
  name = "tstring-yaml-pyo3-tests"
806
- version = "0.2.0"
806
+ version = "0.2.1"
807
807
  dependencies = [
808
808
  "pyo3",
809
809
  "saphyr",
@@ -9,7 +9,7 @@ homepage = "https://github.com/koxudaxi/tstring-structured-data"
9
9
  license = "MIT"
10
10
  repository = "https://github.com/koxudaxi/tstring-structured-data"
11
11
  rust-version = "1.94.0"
12
- version = "0.2.0"
12
+ version = "0.2.1"
13
13
 
14
14
  [workspace.dependencies]
15
15
  num-bigint = "0.4.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tstring-bindings
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -18,7 +18,7 @@ test = false
18
18
 
19
19
  [dependencies]
20
20
  serde_json = { workspace = true }
21
- tstring-syntax = { version = "0.2.0", path = "../tstring-core-rs" }
21
+ tstring-syntax = { version = "0.2.1", path = "../tstring-core-rs" }
22
22
 
23
23
  [dev-dependencies]
24
24
  toml = { workspace = true }
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tstring-bindings"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Native Python bindings for t-string structured data backends"
5
5
  readme = "README.md"
6
6
  license = { text = "MIT" }
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from string.templatelib import Template
4
- from typing import Protocol, cast
4
+ from typing import Annotated, Protocol, cast
5
5
 
6
6
  from . import tstring_bindings as _bindings
7
7
  from ._profiles import (
@@ -14,29 +14,33 @@ from ._profiles import (
14
14
  )
15
15
  from ._types import JsonValue, TomlValue, YamlValue
16
16
 
17
+ type JsonTemplate = Annotated[Template, "json"]
18
+ type TomlTemplate = Annotated[Template, "toml"]
19
+ type YamlTemplate = Annotated[Template, "yaml"]
20
+
17
21
 
18
22
  class _RenderJson(Protocol):
19
- def __call__(self, template: Template, profile: JsonProfile) -> JsonValue: ...
23
+ def __call__(self, template: JsonTemplate, profile: JsonProfile) -> JsonValue: ...
20
24
 
21
25
 
22
26
  class _RenderJsonText(Protocol):
23
- def __call__(self, template: Template, profile: JsonProfile) -> str: ...
27
+ def __call__(self, template: JsonTemplate, profile: JsonProfile) -> str: ...
24
28
 
25
29
 
26
30
  class _RenderToml(Protocol):
27
- def __call__(self, template: Template, profile: TomlProfile) -> TomlValue: ...
31
+ def __call__(self, template: TomlTemplate, profile: TomlProfile) -> TomlValue: ...
28
32
 
29
33
 
30
34
  class _RenderTomlText(Protocol):
31
- def __call__(self, template: Template, profile: TomlProfile) -> str: ...
35
+ def __call__(self, template: TomlTemplate, profile: TomlProfile) -> str: ...
32
36
 
33
37
 
34
38
  class _RenderYaml(Protocol):
35
- def __call__(self, template: Template, profile: YamlProfile) -> YamlValue: ...
39
+ def __call__(self, template: YamlTemplate, profile: YamlProfile) -> YamlValue: ...
36
40
 
37
41
 
38
42
  class _RenderYamlText(Protocol):
39
- def __call__(self, template: Template, profile: YamlProfile) -> str: ...
43
+ def __call__(self, template: YamlTemplate, profile: YamlProfile) -> str: ...
40
44
 
41
45
 
42
46
  class _BindingsContract(Protocol):
@@ -101,37 +105,37 @@ _render_yaml_text = _EXTENSION.render_yaml_text
101
105
 
102
106
 
103
107
  def render_json(
104
- template: Template, *, profile: JsonProfile | str | None = None
108
+ template: JsonTemplate, *, profile: JsonProfile | str | None = None
105
109
  ) -> JsonValue:
106
110
  return _render_json(template, resolve_json_profile(profile))
107
111
 
108
112
 
109
113
  def render_json_text(
110
- template: Template, *, profile: JsonProfile | str | None = None
114
+ template: JsonTemplate, *, profile: JsonProfile | str | None = None
111
115
  ) -> str:
112
116
  return _render_json_text(template, resolve_json_profile(profile))
113
117
 
114
118
 
115
119
  def render_toml(
116
- template: Template, *, profile: TomlProfile | str | None = None
120
+ template: TomlTemplate, *, profile: TomlProfile | str | None = None
117
121
  ) -> TomlValue:
118
122
  return _render_toml(template, resolve_toml_profile(profile))
119
123
 
120
124
 
121
125
  def render_toml_text(
122
- template: Template, *, profile: TomlProfile | str | None = None
126
+ template: TomlTemplate, *, profile: TomlProfile | str | None = None
123
127
  ) -> str:
124
128
  return _render_toml_text(template, resolve_toml_profile(profile))
125
129
 
126
130
 
127
131
  def render_yaml(
128
- template: Template, *, profile: YamlProfile | str | None = None
132
+ template: YamlTemplate, *, profile: YamlProfile | str | None = None
129
133
  ) -> YamlValue:
130
134
  return _render_yaml(template, resolve_yaml_profile(profile))
131
135
 
132
136
 
133
137
  def render_yaml_text(
134
- template: Template, *, profile: YamlProfile | str | None = None
138
+ template: YamlTemplate, *, profile: YamlProfile | str | None = None
135
139
  ) -> str:
136
140
  return _render_yaml_text(template, resolve_yaml_profile(profile))
137
141
 
@@ -1,10 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from string.templatelib import Template
4
- from typing import Any
4
+ from typing import Annotated, Any
5
5
 
6
6
  from ._profiles import JsonProfile, TomlProfile, YamlProfile
7
7
 
8
+ type JsonTemplate = Annotated[Template, "json"]
9
+ type TomlTemplate = Annotated[Template, "toml"]
10
+ type YamlTemplate = Annotated[Template, "yaml"]
11
+
8
12
  type ExceptionSpan = tuple[tuple[int, int], tuple[int, int]]
9
13
  type ExceptionDiagnostic = dict[str, object]
10
14
 
@@ -19,20 +23,20 @@ class TemplateSemanticError(TemplateError): ...
19
23
  class UnrepresentableValueError(TemplateSemanticError): ...
20
24
 
21
25
  def render_json(
22
- template: Template, *, profile: JsonProfile | str | None = ...
26
+ template: JsonTemplate, *, profile: JsonProfile | str | None = ...
23
27
  ) -> Any: ...
24
28
  def render_json_text(
25
- template: Template, *, profile: JsonProfile | str | None = ...
29
+ template: JsonTemplate, *, profile: JsonProfile | str | None = ...
26
30
  ) -> str: ...
27
31
  def render_toml(
28
- template: Template, *, profile: TomlProfile | str | None = ...
32
+ template: TomlTemplate, *, profile: TomlProfile | str | None = ...
29
33
  ) -> Any: ...
30
34
  def render_toml_text(
31
- template: Template, *, profile: TomlProfile | str | None = ...
35
+ template: TomlTemplate, *, profile: TomlProfile | str | None = ...
32
36
  ) -> str: ...
33
37
  def render_yaml(
34
- template: Template, *, profile: YamlProfile | str | None = ...
38
+ template: YamlTemplate, *, profile: YamlProfile | str | None = ...
35
39
  ) -> Any: ...
36
40
  def render_yaml_text(
37
- template: Template, *, profile: YamlProfile | str | None = ...
41
+ template: YamlTemplate, *, profile: YamlProfile | str | None = ...
38
42
  ) -> str: ...
@@ -1,11 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from string.templatelib import Template
4
- from typing import Any
4
+ from typing import Annotated, Any
5
5
 
6
6
  # Non-public extension module retained for internal imports and packaging
7
7
  # compatibility. Public callers should use `tstring_bindings`.
8
8
 
9
+ type JsonTemplate = Annotated[Template, "json"]
10
+ type TomlTemplate = Annotated[Template, "toml"]
11
+ type YamlTemplate = Annotated[Template, "yaml"]
9
12
  type ExceptionSpan = tuple[tuple[int, int], tuple[int, int]]
10
13
  type ExceptionDiagnostic = dict[str, object]
11
14
 
@@ -22,18 +25,18 @@ class UnrepresentableValueError(TemplateSemanticError): ...
22
25
  __contract_version__: int
23
26
  __contract_symbols__: tuple[str, ...]
24
27
 
25
- def render_json(template: Template, profile: str = ...) -> Any: ...
26
- def render_json_text(template: Template, profile: str = ...) -> str: ...
28
+ def render_json(template: JsonTemplate, profile: str = ...) -> Any: ...
29
+ def render_json_text(template: JsonTemplate, profile: str = ...) -> str: ...
27
30
  def _render_json_result_payload(
28
- template: Template, profile: str = ...
31
+ template: JsonTemplate, profile: str = ...
29
32
  ) -> tuple[str, Any]: ...
30
- def render_toml(template: Template, profile: str = ...) -> Any: ...
31
- def render_toml_text(template: Template, profile: str = ...) -> str: ...
33
+ def render_toml(template: TomlTemplate, profile: str = ...) -> Any: ...
34
+ def render_toml_text(template: TomlTemplate, profile: str = ...) -> str: ...
32
35
  def _render_toml_result_payload(
33
- template: Template, profile: str = ...
36
+ template: TomlTemplate, profile: str = ...
34
37
  ) -> tuple[str, Any]: ...
35
- def render_yaml(template: Template, profile: str = ...) -> Any: ...
36
- def render_yaml_text(template: Template, profile: str = ...) -> str: ...
38
+ def render_yaml(template: YamlTemplate, profile: str = ...) -> Any: ...
39
+ def render_yaml_text(template: YamlTemplate, profile: str = ...) -> str: ...
37
40
  def _render_yaml_result_payload(
38
- template: Template, profile: str = ...
41
+ template: YamlTemplate, profile: str = ...
39
42
  ) -> tuple[str, Any]: ...
@@ -24,12 +24,12 @@ pyo3 = { workspace = true, features = ["abi3-py314"] }
24
24
  pythonize = { workspace = true }
25
25
  saphyr = { workspace = true }
26
26
  serde_json = { workspace = true }
27
- tstring-json = { version = "0.2.0", path = "../json-tstring-rs" }
28
- tstring-pyo3-bindings = { version = "0.2.0", path = "../tstring-pyo3-bindings" }
29
- tstring-syntax = { version = "0.2.0", path = "../tstring-core-rs" }
27
+ tstring-json = { version = "0.2.1", path = "../json-tstring-rs" }
28
+ tstring-pyo3-bindings = { version = "0.2.1", path = "../tstring-pyo3-bindings" }
29
+ tstring-syntax = { version = "0.2.1", path = "../tstring-core-rs" }
30
30
  toml = { workspace = true }
31
- tstring-toml = { version = "0.2.0", path = "../toml-tstring-rs" }
32
- tstring-yaml = { version = "0.2.0", path = "../yaml-tstring-rs" }
31
+ tstring-toml = { version = "0.2.1", path = "../toml-tstring-rs" }
32
+ tstring-yaml = { version = "0.2.1", path = "../yaml-tstring-rs" }
33
33
 
34
34
  [dev-dependencies]
35
35
  pyo3 = { workspace = true, features = ["auto-initialize"] }
@@ -627,7 +627,7 @@ fn normalized_offset_to_python(py: Python<'_>, offset_minutes: i16) -> PyResult<
627
627
 
628
628
  #[pymodule]
629
629
  fn tstring_bindings(py: Python<'_>, module: &Bound<'_, PyModule>) -> PyResult<()> {
630
- module.add("__version__", "0.2.0")?;
630
+ module.add("__version__", "0.2.1")?;
631
631
  module.add("__contract_version__", CONTRACT_VERSION)?;
632
632
  module.add("__contract_symbols__", PyTuple::new(py, CONTRACT_SYMBOLS)?)?;
633
633
  module.add("TemplateError", py.get_type::<TemplateError>())?;
@@ -19,4 +19,4 @@ test = false
19
19
  [dependencies]
20
20
  serde_json = { workspace = true }
21
21
  toml = { workspace = true }
22
- tstring-syntax = { version = "0.2.0", path = "../tstring-core-rs" }
22
+ tstring-syntax = { version = "0.2.1", path = "../tstring-core-rs" }
@@ -16,10 +16,10 @@ serde_json = { workspace = true }
16
16
  saphyr = { workspace = true }
17
17
  saphyr-parser = { workspace = true }
18
18
  toml = { workspace = true }
19
- tstring-json = { version = "0.2.0", path = "../json-tstring-rs" }
20
- tstring-syntax = { version = "0.2.0", path = "../tstring-core-rs" }
21
- tstring-toml = { version = "0.2.0", path = "../toml-tstring-rs" }
22
- tstring-yaml = { version = "0.2.0", path = "../yaml-tstring-rs" }
19
+ tstring-json = { version = "0.2.1", path = "../json-tstring-rs" }
20
+ tstring-syntax = { version = "0.2.1", path = "../tstring-core-rs" }
21
+ tstring-toml = { version = "0.2.1", path = "../toml-tstring-rs" }
22
+ tstring-yaml = { version = "0.2.1", path = "../yaml-tstring-rs" }
23
23
 
24
24
  [dev-dependencies]
25
25
  criterion = "0.8.2"
@@ -20,7 +20,7 @@ test = false
20
20
  saphyr = { workspace = true }
21
21
  saphyr-parser = { workspace = true }
22
22
  serde_json = { workspace = true }
23
- tstring-syntax = { version = "0.2.0", path = "../tstring-core-rs" }
23
+ tstring-syntax = { version = "0.2.1", path = "../tstring-core-rs" }
24
24
 
25
25
  [dev-dependencies]
26
26
  toml = { workspace = true }