graphddb-runtime 0.4.0__tar.gz → 0.4.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.
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/PKG-INFO +1 -1
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime.egg-info/PKG-INFO +1 -1
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime.egg-info/SOURCES.txt +1 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/pyproject.toml +1 -1
- graphddb_runtime-0.4.1/tests/test_description.py +78 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/README.md +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/__init__.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/async_runtime.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/batch.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/concurrency.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/cursor.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/errors.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/filters.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/hydration.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/limits.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/middleware.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/per_key_cursor.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/relations.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/runtime.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/templates.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime/transactions.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime.egg-info/dependency_links.txt +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime.egg-info/requires.txt +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime.egg-info/top_level.txt +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/setup.cfg +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_concurrency.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_contract_runtime.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_command.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_compose.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_contract.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_edge_derive.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_edge_write.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_events.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_maintain.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_middleware.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_referential.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_relations.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_integration_unique.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_maintain.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_middleware.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_relations.py +0 -0
- {graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/tests/test_unit.py +0 -0
|
@@ -22,6 +22,7 @@ graphddb_runtime.egg-info/requires.txt
|
|
|
22
22
|
graphddb_runtime.egg-info/top_level.txt
|
|
23
23
|
tests/test_concurrency.py
|
|
24
24
|
tests/test_contract_runtime.py
|
|
25
|
+
tests/test_description.py
|
|
25
26
|
tests/test_integration.py
|
|
26
27
|
tests/test_integration_command.py
|
|
27
28
|
tests/test_integration_compose.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "graphddb-runtime"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.1"
|
|
8
8
|
description = "Thin DynamoDB executor for GraphDDB-generated Python repositories (single-operation core, issue #44)."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Issue #154: the description taken in on the TS declaration sites is propagated
|
|
2
|
+
into the generated artifacts the Python bridge consumes — manifest.json (entity /
|
|
3
|
+
field), operations.json (query / command / param / contract method), and the
|
|
4
|
+
generated Python source docstrings (class docstring, field comment, method
|
|
5
|
+
docstring). An undescribed declaration carries no `description` key (backward
|
|
6
|
+
compatible). TS↔Python parity holds because both read the SAME serialized string.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import ast
|
|
12
|
+
import json
|
|
13
|
+
import os
|
|
14
|
+
|
|
15
|
+
import conftest
|
|
16
|
+
|
|
17
|
+
REPOSITORIES_PATH = os.path.join(conftest.FIXTURES_DIR, "repositories.py")
|
|
18
|
+
TYPES_PATH = os.path.join(conftest.FIXTURES_DIR, "types.py")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _manifest() -> dict:
|
|
22
|
+
with open(conftest.MANIFEST_PATH, encoding="utf-8") as fh:
|
|
23
|
+
return json.load(fh)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _operations() -> dict:
|
|
27
|
+
with open(conftest.OPERATIONS_PATH, encoding="utf-8") as fh:
|
|
28
|
+
return json.load(fh)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_manifest_carries_entity_and_field_description() -> None:
|
|
32
|
+
group = _manifest()["entities"]["GroupModel"]
|
|
33
|
+
assert group["description"] == "A group that users belong to."
|
|
34
|
+
assert group["fields"]["groupId"]["description"] == "The group unique identifier."
|
|
35
|
+
# A field without a declared description carries no `description` key.
|
|
36
|
+
assert "description" not in group["fields"]["name"]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def test_operations_carries_query_param_and_contract_description() -> None:
|
|
40
|
+
ops = _operations()
|
|
41
|
+
get_group = ops["queries"]["getGroup"]
|
|
42
|
+
assert get_group["description"] == "Fetch a single group by its id."
|
|
43
|
+
assert get_group["params"]["groupId"]["description"] == "The group id to fetch."
|
|
44
|
+
# The contract method description rides the `contracts` map.
|
|
45
|
+
method = ops["contracts"]["GroupById"]["methods"]["get"]
|
|
46
|
+
assert method["description"] == "Read a group by its id."
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_undescribed_query_has_no_description_key() -> None:
|
|
50
|
+
# `getUser` declares no description — backward compatible.
|
|
51
|
+
get_user = _operations()["queries"]["getUser"]
|
|
52
|
+
assert "description" not in get_user
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def test_generated_python_source_is_valid_and_carries_docstrings() -> None:
|
|
56
|
+
with open(TYPES_PATH, encoding="utf-8") as fh:
|
|
57
|
+
types_src = fh.read()
|
|
58
|
+
with open(REPOSITORIES_PATH, encoding="utf-8") as fh:
|
|
59
|
+
repos_src = fh.read()
|
|
60
|
+
|
|
61
|
+
# The generated source must remain syntactically valid Python.
|
|
62
|
+
ast.parse(types_src)
|
|
63
|
+
ast.parse(repos_src)
|
|
64
|
+
|
|
65
|
+
# Class docstring (from the @model description) + field comment (field desc).
|
|
66
|
+
assert '"""A group that users belong to."""' in types_src
|
|
67
|
+
assert "# The group unique identifier." in types_src
|
|
68
|
+
|
|
69
|
+
# Method docstring (from the query description) on the generated repo method.
|
|
70
|
+
assert '"""Fetch a single group by its id."""' in repos_src
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def test_ts_python_description_parity_for_contract_method() -> None:
|
|
74
|
+
# The Python side reads the SAME serialized description the TS IR produced; if
|
|
75
|
+
# they ever diverged this string would differ. (The TS-side equality is asserted
|
|
76
|
+
# in __tests__/spec/description.test.ts; here we lock the Python-visible value.)
|
|
77
|
+
method = _operations()["contracts"]["GroupById"]["methods"]["get"]
|
|
78
|
+
assert method["description"] == "Read a group by its id."
|
|
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
|
{graphddb_runtime-0.4.0 → graphddb_runtime-0.4.1}/graphddb_runtime.egg-info/dependency_links.txt
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|