tigrbl-core 0.4.5.dev1__tar.gz → 0.4.5.dev4__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.
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/PKG-INFO +1 -1
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/pyproject.toml +1 -1
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/op_spec.py +48 -3
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/LICENSE +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/NOTICE +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/README.md +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/__init__.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/alias_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/app_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/binding_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/column_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/datatypes.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/docs_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/engine_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/exceptions.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/exposure_policy.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/field_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/headers_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/hook_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/hook_types.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/io_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/middleware_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/monotone.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/op_utils.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/path_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/plugins.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/registry.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/request_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/response_resolver.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/response_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/response_types.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/router_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/schema_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/serde.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/session_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/storage_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/table_profile_bindings.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/table_profile_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/table_registry_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/table_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/transport_stack.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/well_known_spec.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/canonical_json.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/config/__init__.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/config/constants.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/config/defaults.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/config/engine_traversal.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/config/resolver.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/core/__init__.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/op/__init__.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/op/canonical.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/op/collect.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/op/types.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/__init__.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/__init__.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/build_schema.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/cache.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/extras.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/helpers.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/list_params.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/strip_parent_fields.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/get_schema.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/provenance.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/provenance_inventory.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/spec_json.py +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/surface_chains.json +0 -0
- {tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tigrbl-core"
|
|
3
|
-
version = "0.4.5.
|
|
3
|
+
version = "0.4.5.dev4"
|
|
4
4
|
description = "Core Tigrbl framework specifications, decorators, schemas, hooks, operations, and primitives for schema-first APIs."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
|
+
from importlib import metadata as importlib_metadata
|
|
4
5
|
import inspect
|
|
6
|
+
import warnings
|
|
5
7
|
from typing import (
|
|
6
8
|
TYPE_CHECKING,
|
|
7
9
|
Any,
|
|
@@ -59,6 +61,11 @@ TargetOp = Literal[
|
|
|
59
61
|
"custom",
|
|
60
62
|
]
|
|
61
63
|
|
|
64
|
+
_CANONICAL_OP_SPEC_ATTR = "__tigrbl_op_spec__"
|
|
65
|
+
_LEGACY_OP_DECL_ATTR = "__tigrbl_op_decl__"
|
|
66
|
+
_LEGACY_OP_DECL_FALLBACK_VERSION = "0.4.5.dev1"
|
|
67
|
+
_LEGACY_OP_DECL_FAILS_IN = (0, 7)
|
|
68
|
+
|
|
62
69
|
|
|
63
70
|
if TYPE_CHECKING: # pragma: no cover
|
|
64
71
|
from .._spec.engine_spec import EngineCfg
|
|
@@ -151,6 +158,46 @@ class OpSpec(SerdeMixin):
|
|
|
151
158
|
|
|
152
159
|
|
|
153
160
|
_ALIAS_RE = __import__("re").compile(r"^[a-z][a-z0-9_]*$")
|
|
161
|
+
_VERSION_RE = __import__("re").compile(r"^\s*(\d+)\.(\d+)")
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def _parse_major_minor(version: str) -> tuple[int, int]:
|
|
165
|
+
match = _VERSION_RE.match(version)
|
|
166
|
+
if match is None:
|
|
167
|
+
return (0, 0)
|
|
168
|
+
return (int(match.group(1)), int(match.group(2)))
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def _current_major_minor() -> tuple[int, int]:
|
|
172
|
+
try:
|
|
173
|
+
version = importlib_metadata.version("tigrbl-core")
|
|
174
|
+
except importlib_metadata.PackageNotFoundError:
|
|
175
|
+
version = _LEGACY_OP_DECL_FALLBACK_VERSION
|
|
176
|
+
return _parse_major_minor(version)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def _warn_or_fail_legacy_op_decl() -> None:
|
|
180
|
+
if _current_major_minor() >= _LEGACY_OP_DECL_FAILS_IN:
|
|
181
|
+
raise RuntimeError(
|
|
182
|
+
"__tigrbl_op_decl__ is no longer supported; use "
|
|
183
|
+
"__tigrbl_op_spec__ for operation metadata."
|
|
184
|
+
)
|
|
185
|
+
warnings.warn(
|
|
186
|
+
"__tigrbl_op_decl__ is deprecated and will be removed in "
|
|
187
|
+
"tigrbl-core 0.7.0; use __tigrbl_op_spec__ instead.",
|
|
188
|
+
DeprecationWarning,
|
|
189
|
+
stacklevel=3,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def _get_decorated_op_spec(func: Any) -> Optional["OpSpec"]:
|
|
194
|
+
op_spec: OpSpec | None = getattr(func, _CANONICAL_OP_SPEC_ATTR, None)
|
|
195
|
+
if op_spec is not None:
|
|
196
|
+
return op_spec
|
|
197
|
+
op_spec = getattr(func, _LEGACY_OP_DECL_ATTR, None)
|
|
198
|
+
if op_spec is not None:
|
|
199
|
+
_warn_or_fail_legacy_op_decl()
|
|
200
|
+
return op_spec
|
|
154
201
|
|
|
155
202
|
|
|
156
203
|
def _ensure_spec_table(spec: Any, table: type) -> OpSpec:
|
|
@@ -484,9 +531,7 @@ def _mro_collect_decorated_ops(table: type) -> List["OpSpec"]:
|
|
|
484
531
|
if name in seen:
|
|
485
532
|
continue
|
|
486
533
|
func = _unwrap(attr)
|
|
487
|
-
op_spec
|
|
488
|
-
if op_spec is None:
|
|
489
|
-
op_spec = getattr(func, "__tigrbl_op_decl__", None)
|
|
534
|
+
op_spec = _get_decorated_op_spec(func)
|
|
490
535
|
if op_spec is None:
|
|
491
536
|
continue
|
|
492
537
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/_spec/table_profile_bindings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/build_schema.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/builder/strip_parent_fields.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tigrbl_core-0.4.5.dev1 → tigrbl_core-0.4.5.dev4}/tigrbl_core/schema/provenance_inventory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|