xwjson 0.9.0.6__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.
- xwjson-0.9.0.6/.github/workflows/check-versions.yml +32 -0
- xwjson-0.9.0.6/.github/workflows/check_version_source_of_truth.py +147 -0
- xwjson-0.9.0.6/.github/workflows/compliance.yml +39 -0
- xwjson-0.9.0.6/.github/workflows/publish.yml +86 -0
- xwjson-0.9.0.6/.github/workflows/update_release_date_from_version_file.py +60 -0
- xwjson-0.9.0.6/.github/workflows/verify_tag_matches_version.py +72 -0
- xwjson-0.9.0.6/.github/workflows-config.yaml +9 -0
- xwjson-0.9.0.6/.gitignore +61 -0
- xwjson-0.9.0.6/LICENSE +21 -0
- xwjson-0.9.0.6/PKG-INFO +91 -0
- xwjson-0.9.0.6/README.md +70 -0
- xwjson-0.9.0.6/pyproject.toml +60 -0
- xwjson-0.9.0.6/src/exonware/__init__.py +1 -0
- xwjson-0.9.0.6/src/exonware/xwjson/__init__.py +101 -0
- xwjson-0.9.0.6/src/exonware/xwjson/base.py +84 -0
- xwjson-0.9.0.6/src/exonware/xwjson/common/benchmarking.py +147 -0
- xwjson-0.9.0.6/src/exonware/xwjson/config.py +26 -0
- xwjson-0.9.0.6/src/exonware/xwjson/contracts.py +82 -0
- xwjson-0.9.0.6/src/exonware/xwjson/defs.py +46 -0
- xwjson-0.9.0.6/src/exonware/xwjson/errors.py +42 -0
- xwjson-0.9.0.6/src/exonware/xwjson/facade.py +97 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/__init__.py +9 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/__init__.py +9 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/__init__.py +9 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/batch_operations.py +209 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/converter.py +236 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/dependency_graph.py +301 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/encoder.py +576 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/lazy.py +230 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/metadata.py +399 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/references.py +597 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/schema.py +210 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/serializer.py +1005 -0
- xwjson-0.9.0.6/src/exonware/xwjson/formats/binary/xwjson/transactions.py +192 -0
- xwjson-0.9.0.6/src/exonware/xwjson/operations/__init__.py +7 -0
- xwjson-0.9.0.6/src/exonware/xwjson/operations/xwjson_ops.py +851 -0
- xwjson-0.9.0.6/src/exonware/xwjson/version.py +85 -0
- xwjson-0.9.0.6/src/xwjson.py +9 -0
- xwjson-0.9.0.6/tests/0.core/__init__.py +3 -0
- xwjson-0.9.0.6/tests/0.core/conftest.py +4 -0
- xwjson-0.9.0.6/tests/0.core/runner.py +39 -0
- xwjson-0.9.0.6/tests/0.core/test_basic_encoding.py +224 -0
- xwjson-0.9.0.6/tests/0.core/test_import.py +60 -0
- xwjson-0.9.0.6/tests/1.unit/__init__.py +3 -0
- xwjson-0.9.0.6/tests/1.unit/conftest.py +4 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/__init__.py +4 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/__init__.py +4 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/__init__.py +4 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_batch_operations.py +138 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_converter.py +126 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_dependency_graph.py +69 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_encoder.py +142 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_lazy.py +57 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_metadata.py +191 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_references.py +93 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_schema.py +217 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_serializer.py +86 -0
- xwjson-0.9.0.6/tests/1.unit/formats_tests/binary_tests/xwjson_tests/test_transactions.py +159 -0
- xwjson-0.9.0.6/tests/1.unit/operations_tests/__init__.py +4 -0
- xwjson-0.9.0.6/tests/1.unit/operations_tests/test_xwjson_ops.py +376 -0
- xwjson-0.9.0.6/tests/1.unit/runner.py +39 -0
- xwjson-0.9.0.6/tests/2.integration/__init__.py +3 -0
- xwjson-0.9.0.6/tests/2.integration/conftest.py +4 -0
- xwjson-0.9.0.6/tests/2.integration/runner.py +39 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/__init__.py +4 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_5gb_performance.py +375 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_additional_comprehensive_coverage.py +500 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_comprehensive_class_correctness.py +372 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_comprehensive_correctness_100_percent.py +445 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_comprehensive_xwnode_integration.py +261 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_edge_cases_comprehensive.py +447 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_format_conversion_matrix.py +213 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_round_trip_correctness.py +355 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_batch_operations.py +201 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_concurrent.py +154 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_conversion_performance.py +216 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_format_conversion.py +507 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_large_files.py +143 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_lazy_loading.py +101 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_memory.py +158 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_queries.py +186 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_references.py +115 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_schema_validation.py +115 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_transactions.py +112 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_xwnode_caching.py +112 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_stress_xwnode_indexing.py +140 -0
- xwjson-0.9.0.6/tests/2.integration/scenarios/test_xwnode_integration.py +133 -0
- xwjson-0.9.0.6/tests/3.advance/__init__.py +4 -0
- xwjson-0.9.0.6/tests/3.advance/conftest.py +4 -0
- xwjson-0.9.0.6/tests/3.advance/runner.py +39 -0
- xwjson-0.9.0.6/tests/3.advance/test_extensibility.py +52 -0
- xwjson-0.9.0.6/tests/3.advance/test_maintainability.py +62 -0
- xwjson-0.9.0.6/tests/3.advance/test_performance.py +142 -0
- xwjson-0.9.0.6/tests/3.advance/test_security.py +102 -0
- xwjson-0.9.0.6/tests/3.advance/test_usability.py +64 -0
- xwjson-0.9.0.6/tests/COMPREHENSIVE_TESTING_SUMMARY.md +324 -0
- xwjson-0.9.0.6/tests/FINAL_TEST_SUMMARY.md +466 -0
- xwjson-0.9.0.6/tests/README.md +164 -0
- xwjson-0.9.0.6/tests/TEST_COVERAGE_SUMMARY.md +346 -0
- xwjson-0.9.0.6/tests/TEST_SUMMARY.md +163 -0
- xwjson-0.9.0.6/tests/__init__.py +4 -0
- xwjson-0.9.0.6/tests/conftest.py +61 -0
- xwjson-0.9.0.6/tests/runner.py +88 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# NOTE: AUTO-GENERATED FILE
|
|
2
|
+
# This workflow was generated by tools/ci/python_scripts/generate_workflows.py.
|
|
3
|
+
# Do NOT edit this file manually - changes will be overwritten.
|
|
4
|
+
|
|
5
|
+
name: Check for Hardcoded Versions
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
pull_request:
|
|
9
|
+
paths:
|
|
10
|
+
- 'src/**/*.py'
|
|
11
|
+
- 'tests/**/*.py'
|
|
12
|
+
- 'docs/**/*.md'
|
|
13
|
+
- '*.md'
|
|
14
|
+
- '*.txt'
|
|
15
|
+
push:
|
|
16
|
+
branches: [main, develop]
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
check-versions:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v3
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v4
|
|
26
|
+
with:
|
|
27
|
+
python-version: '3.12'
|
|
28
|
+
|
|
29
|
+
- name: Verify version.py is the source of truth
|
|
30
|
+
run: |
|
|
31
|
+
python .github/workflows/check_version_source_of_truth.py
|
|
32
|
+
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Verify that the version configured in pyproject.toml ultimately comes from a
|
|
4
|
+
single source-of-truth version location (file or attribute) and print it.
|
|
5
|
+
|
|
6
|
+
This is extracted from the GitHub Actions check-versions workflow so it can be
|
|
7
|
+
tested and reused outside of CI.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import importlib
|
|
13
|
+
import re
|
|
14
|
+
import sys
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _read_pyproject() -> str:
|
|
19
|
+
path = Path("pyproject.toml")
|
|
20
|
+
if not path.exists():
|
|
21
|
+
print("No pyproject.toml", file=sys.stderr)
|
|
22
|
+
sys.exit(2)
|
|
23
|
+
return path.read_text(encoding="utf-8")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _read_attr_from_module_source(
|
|
27
|
+
project_root: Path,
|
|
28
|
+
module_name: str,
|
|
29
|
+
attr_name: str,
|
|
30
|
+
) -> str | None:
|
|
31
|
+
"""
|
|
32
|
+
Resolve module source under ./src and read a simple string assignment
|
|
33
|
+
like: __version__ = "1.2.3"
|
|
34
|
+
This avoids import side effects from package-level dependencies.
|
|
35
|
+
"""
|
|
36
|
+
module_rel = Path(*module_name.split("."))
|
|
37
|
+
candidates = [
|
|
38
|
+
project_root / "src" / (str(module_rel) + ".py"),
|
|
39
|
+
project_root / "src" / module_rel / "__init__.py",
|
|
40
|
+
]
|
|
41
|
+
pattern = re.compile(
|
|
42
|
+
rf"^\s*{re.escape(attr_name)}\s*=\s*['\"]([^'\"]+)['\"]\s*$",
|
|
43
|
+
re.MULTILINE,
|
|
44
|
+
)
|
|
45
|
+
for candidate in candidates:
|
|
46
|
+
if not candidate.exists():
|
|
47
|
+
continue
|
|
48
|
+
text = candidate.read_text(encoding="utf-8")
|
|
49
|
+
m = pattern.search(text)
|
|
50
|
+
if m:
|
|
51
|
+
return m.group(1)
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def main() -> None:
|
|
56
|
+
text = _read_pyproject()
|
|
57
|
+
|
|
58
|
+
# 1) Hatchling: [tool.hatch.version] path = ".../version.py"
|
|
59
|
+
m = re.search(
|
|
60
|
+
r"\[tool\.hatch\.version\][^\n]*\n\s*path\s*=\s*[\"']([^\"']+)[\"']",
|
|
61
|
+
text,
|
|
62
|
+
re.DOTALL,
|
|
63
|
+
)
|
|
64
|
+
if m:
|
|
65
|
+
version_file = Path(m.group(1).strip())
|
|
66
|
+
if not version_file.exists():
|
|
67
|
+
print(f"Version file not found: {version_file}", file=sys.stderr)
|
|
68
|
+
sys.exit(2)
|
|
69
|
+
ns: dict[str, object] = {}
|
|
70
|
+
exec(version_file.read_text(encoding="utf-8"), ns)
|
|
71
|
+
version = ns.get("__version__")
|
|
72
|
+
if not isinstance(version, str) or not version:
|
|
73
|
+
print(f"__version__ missing or empty in {version_file}", file=sys.stderr)
|
|
74
|
+
sys.exit(2)
|
|
75
|
+
print("Current version:", version)
|
|
76
|
+
sys.exit(0)
|
|
77
|
+
|
|
78
|
+
# 2) Setuptools dynamic inline table (file=...) -> open version file and exec
|
|
79
|
+
m = re.search(
|
|
80
|
+
r'version\s*=\s*\{\s*file\s*=\s*["\']([^"\']+)["\']',
|
|
81
|
+
text,
|
|
82
|
+
re.DOTALL,
|
|
83
|
+
)
|
|
84
|
+
if not m:
|
|
85
|
+
# 2b) Setuptools dynamic table style:
|
|
86
|
+
# [tool.setuptools.dynamic.version]
|
|
87
|
+
# attr = "pkg.module.__version__" OR file = "..."
|
|
88
|
+
m = re.search(
|
|
89
|
+
r"\[tool\.setuptools\.dynamic\.version\][^\n]*\n\s*file\s*=\s*[\"']([^\"']+)[\"']",
|
|
90
|
+
text,
|
|
91
|
+
re.DOTALL,
|
|
92
|
+
)
|
|
93
|
+
if m:
|
|
94
|
+
version_file = Path(m.group(1).strip())
|
|
95
|
+
if not version_file.exists():
|
|
96
|
+
print(f"Version file not found: {version_file}", file=sys.stderr)
|
|
97
|
+
sys.exit(2)
|
|
98
|
+
ns: dict[str, object] = {}
|
|
99
|
+
exec(version_file.read_text(encoding="utf-8"), ns)
|
|
100
|
+
version = ns.get("__version__")
|
|
101
|
+
if not isinstance(version, str) or not version:
|
|
102
|
+
print(f"__version__ missing or empty in {version_file}", file=sys.stderr)
|
|
103
|
+
sys.exit(2)
|
|
104
|
+
print("Current version:", version)
|
|
105
|
+
sys.exit(0)
|
|
106
|
+
|
|
107
|
+
# 3) Setuptools dynamic inline table (attr="pkg.module.__version__")
|
|
108
|
+
m = re.search(
|
|
109
|
+
r'version\s*=\s*\{\s*attr\s*=\s*["\']([^"\']+)["\']',
|
|
110
|
+
text,
|
|
111
|
+
re.DOTALL,
|
|
112
|
+
)
|
|
113
|
+
if not m:
|
|
114
|
+
# 3b) Setuptools dynamic table style:
|
|
115
|
+
# [tool.setuptools.dynamic.version]
|
|
116
|
+
# attr = "pkg.module.__version__"
|
|
117
|
+
m = re.search(
|
|
118
|
+
r"\[tool\.setuptools\.dynamic\.version\][^\n]*\n\s*attr\s*=\s*[\"']([^\"']+)[\"']",
|
|
119
|
+
text,
|
|
120
|
+
re.DOTALL,
|
|
121
|
+
)
|
|
122
|
+
if m:
|
|
123
|
+
attr_path = m.group(1).strip()
|
|
124
|
+
module_name, _, attr = attr_path.rpartition(".")
|
|
125
|
+
if not module_name or not attr:
|
|
126
|
+
sys.exit(2)
|
|
127
|
+
version = _read_attr_from_module_source(Path("."), module_name, attr)
|
|
128
|
+
if version is None:
|
|
129
|
+
# Fallback to import for unusual dynamic cases.
|
|
130
|
+
mod = importlib.import_module(module_name)
|
|
131
|
+
version = getattr(mod, attr, None)
|
|
132
|
+
if not isinstance(version, str) or not version:
|
|
133
|
+
print(
|
|
134
|
+
f"Attribute {attr_path} is missing or empty",
|
|
135
|
+
file=sys.stderr,
|
|
136
|
+
)
|
|
137
|
+
sys.exit(2)
|
|
138
|
+
print("Current version:", version)
|
|
139
|
+
sys.exit(0)
|
|
140
|
+
|
|
141
|
+
# If none of the patterns matched, exit with a non-success status expected by CI.
|
|
142
|
+
sys.exit(2)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
if __name__ == "__main__":
|
|
146
|
+
main()
|
|
147
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: xwjson Compliance
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
paths:
|
|
6
|
+
- "xwjson/**"
|
|
7
|
+
- "tools/ci/python_scripts/**"
|
|
8
|
+
push:
|
|
9
|
+
branches: ["main"]
|
|
10
|
+
paths:
|
|
11
|
+
- "xwjson/**"
|
|
12
|
+
- "tools/ci/python_scripts/**"
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
compliance:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.12"
|
|
24
|
+
|
|
25
|
+
- name: Install dev dependencies
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install -e ".[dev]"
|
|
29
|
+
|
|
30
|
+
- name: Format & type checks
|
|
31
|
+
run: |
|
|
32
|
+
black --check src tests
|
|
33
|
+
isort --check-only src tests
|
|
34
|
+
mypy src
|
|
35
|
+
|
|
36
|
+
- name: Test suite
|
|
37
|
+
run: |
|
|
38
|
+
python -m pytest tests
|
|
39
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# NOTE: AUTO-GENERATED FILE
|
|
2
|
+
# This workflow was generated by tools/ci/python_scripts/generate_workflows.py.
|
|
3
|
+
# Do NOT edit this file manually - changes will be overwritten.
|
|
4
|
+
|
|
5
|
+
name: Dual PyPI Publish - exonware-xwjson & xwjson
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags:
|
|
10
|
+
- 'v*' # Triggers on version tags like v0.0.2, v1.0.0, etc.
|
|
11
|
+
workflow_dispatch: # Allows manual trigger of the workflow
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
publish:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v4
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.12'
|
|
24
|
+
|
|
25
|
+
- name: Verify tag matches version.py
|
|
26
|
+
run: |
|
|
27
|
+
python .github/workflows/verify_tag_matches_version.py
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
pip install build twine
|
|
33
|
+
|
|
34
|
+
- name: Set release date to today
|
|
35
|
+
run: |
|
|
36
|
+
python .github/workflows/update_release_date_from_version_file.py
|
|
37
|
+
|
|
38
|
+
- name: Build exonware-xwjson package
|
|
39
|
+
run: |
|
|
40
|
+
echo "Building exonware-xwjson package..."
|
|
41
|
+
python -m build
|
|
42
|
+
|
|
43
|
+
- name: Build xwjson package
|
|
44
|
+
run: |
|
|
45
|
+
echo "Building xwjson package..."
|
|
46
|
+
cp pyproject.toml pyproject.backup.toml
|
|
47
|
+
cp pyproject.xwjson.toml pyproject.toml
|
|
48
|
+
python -m build
|
|
49
|
+
mv pyproject.backup.toml pyproject.toml
|
|
50
|
+
|
|
51
|
+
- name: List built packages
|
|
52
|
+
run: |
|
|
53
|
+
echo "Built packages:"
|
|
54
|
+
find dist -name "*.whl" -o -name "*.tar.gz" | sort
|
|
55
|
+
|
|
56
|
+
- name: Publish exonware-xwjson to PyPI
|
|
57
|
+
env:
|
|
58
|
+
TWINE_USERNAME: __token__
|
|
59
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
60
|
+
run: |
|
|
61
|
+
echo "Publishing exonware-xwjson to PyPI..."
|
|
62
|
+
ls -la dist/
|
|
63
|
+
twine upload dist/exonware_xwjson-*.whl dist/exonware_xwjson-*.tar.gz
|
|
64
|
+
|
|
65
|
+
- name: Publish xwjson to PyPI
|
|
66
|
+
env:
|
|
67
|
+
TWINE_USERNAME: __token__
|
|
68
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
69
|
+
run: |
|
|
70
|
+
echo "Publishing xwjson to PyPI..."
|
|
71
|
+
twine upload dist/xwjson-*.whl dist/xwjson-*.tar.gz
|
|
72
|
+
|
|
73
|
+
- name: Success notification
|
|
74
|
+
run: |
|
|
75
|
+
echo "Successfully published both packages:"
|
|
76
|
+
echo " exonware-xwjson v${{ github.ref_name }}"
|
|
77
|
+
echo " xwjson v${{ github.ref_name }}"
|
|
78
|
+
echo ""
|
|
79
|
+
echo "PyPI URLs:"
|
|
80
|
+
echo " https://pypi.org/project/exonware-xwjson/"
|
|
81
|
+
echo " https://pypi.org/project/xwjson/"
|
|
82
|
+
echo ""
|
|
83
|
+
echo "Install with:"
|
|
84
|
+
echo " pip install exonware-xwjson"
|
|
85
|
+
echo " pip install xwjson"
|
|
86
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Update a __date__ literal in the version file referenced from pyproject.toml
|
|
4
|
+
to today's ISO date (YYYY-MM-DD), when present as a string literal.
|
|
5
|
+
|
|
6
|
+
This is extracted from the GitHub Actions publish workflow so it can be reused
|
|
7
|
+
and tested outside of CI.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import re
|
|
13
|
+
import sys
|
|
14
|
+
from datetime import date
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def main() -> None:
|
|
19
|
+
pyproject_path = Path("pyproject.toml")
|
|
20
|
+
if not pyproject_path.exists():
|
|
21
|
+
print("No pyproject.toml; skipping __date__ update")
|
|
22
|
+
sys.exit(0)
|
|
23
|
+
|
|
24
|
+
pyproject = pyproject_path.read_text(encoding="utf-8")
|
|
25
|
+
m = re.search(
|
|
26
|
+
r"\[tool\.hatch\.version\][^\n]*\n\s*path\s*=\s*[\"']([^\"']+)[\"']",
|
|
27
|
+
pyproject,
|
|
28
|
+
re.DOTALL,
|
|
29
|
+
)
|
|
30
|
+
if not m:
|
|
31
|
+
print("No [tool.hatch.version] path; skipping __date__ update")
|
|
32
|
+
sys.exit(0)
|
|
33
|
+
|
|
34
|
+
version_file = Path(m.group(1).strip())
|
|
35
|
+
if not version_file.exists():
|
|
36
|
+
print(f"Version file not found: {version_file}; skipping __date__ update")
|
|
37
|
+
sys.exit(0)
|
|
38
|
+
|
|
39
|
+
text = version_file.read_text(encoding="utf-8")
|
|
40
|
+
literal_match = re.search(
|
|
41
|
+
r"__date__\s*=\s*[\"'][^\"']*[\"']",
|
|
42
|
+
text,
|
|
43
|
+
)
|
|
44
|
+
if not literal_match:
|
|
45
|
+
print("__date__ is dynamic or missing; no update needed")
|
|
46
|
+
sys.exit(0)
|
|
47
|
+
|
|
48
|
+
today = date.today().isoformat()
|
|
49
|
+
new_text = re.sub(
|
|
50
|
+
r"(__date__\s*=\s*)[\"'][^\"']*[\"']",
|
|
51
|
+
r'\1"' + today + '"',
|
|
52
|
+
text,
|
|
53
|
+
)
|
|
54
|
+
version_file.write_text(new_text, encoding="utf-8")
|
|
55
|
+
print("Set __date__ to", today, "in", version_file)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
if __name__ == "__main__":
|
|
59
|
+
main()
|
|
60
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Verify that the current Git reference (tag) matches the library version defined
|
|
4
|
+
in the version file referenced from pyproject.toml.
|
|
5
|
+
|
|
6
|
+
This script is extracted from the GitHub Actions publish workflow so it can be
|
|
7
|
+
reused and tested outside of CI.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
import re
|
|
14
|
+
import sys
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _load_version_from_pyproject() -> str | None:
|
|
19
|
+
pyproject_path = Path("pyproject.toml")
|
|
20
|
+
if not pyproject_path.exists():
|
|
21
|
+
print("No pyproject.toml; skipping", file=sys.stderr)
|
|
22
|
+
return None
|
|
23
|
+
|
|
24
|
+
text = pyproject_path.read_text(encoding="utf-8")
|
|
25
|
+
m = re.search(
|
|
26
|
+
r"\[tool\.hatch\.version\][^\n]*\n\s*path\s*=\s*[\"']([^\"']+)[\"']",
|
|
27
|
+
text,
|
|
28
|
+
re.DOTALL,
|
|
29
|
+
)
|
|
30
|
+
if not m:
|
|
31
|
+
print("No [tool.hatch.version] path; skipping", file=sys.stderr)
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
version_file = Path(m.group(1).strip())
|
|
35
|
+
if not version_file.exists():
|
|
36
|
+
print(f"Version file not found: {version_file}", file=sys.stderr)
|
|
37
|
+
sys.exit(1)
|
|
38
|
+
|
|
39
|
+
ns: dict[str, object] = {}
|
|
40
|
+
exec(version_file.read_text(encoding="utf-8"), ns)
|
|
41
|
+
version = ns.get("__version__")
|
|
42
|
+
if not isinstance(version, str) or not version:
|
|
43
|
+
print(f"__version__ missing or empty in {version_file}", file=sys.stderr)
|
|
44
|
+
sys.exit(1)
|
|
45
|
+
return version
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def main() -> None:
|
|
49
|
+
file_ver = _load_version_from_pyproject()
|
|
50
|
+
if not file_ver:
|
|
51
|
+
# Nothing to check; treat as non-fatal.
|
|
52
|
+
sys.exit(0)
|
|
53
|
+
|
|
54
|
+
ref = os.environ.get("GITHUB_REF", "")
|
|
55
|
+
if not ref.startswith("refs/tags/"):
|
|
56
|
+
print(f"Not a tag build; version: {file_ver}")
|
|
57
|
+
sys.exit(0)
|
|
58
|
+
|
|
59
|
+
tag_name = ref.removeprefix("refs/tags/")
|
|
60
|
+
tag_ver = tag_name[1:] if tag_name.startswith("v") else tag_name
|
|
61
|
+
|
|
62
|
+
if tag_ver != file_ver:
|
|
63
|
+
print(f"ERROR: Tag {tag_ver} != version.py {file_ver}", file=sys.stderr)
|
|
64
|
+
sys.exit(1)
|
|
65
|
+
|
|
66
|
+
print("OK: tag and version match:", file_ver)
|
|
67
|
+
sys.exit(0)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
main()
|
|
72
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
venv/
|
|
25
|
+
env/
|
|
26
|
+
ENV/
|
|
27
|
+
|
|
28
|
+
# IDE
|
|
29
|
+
.vscode/
|
|
30
|
+
.idea/
|
|
31
|
+
*.swp
|
|
32
|
+
*.swo
|
|
33
|
+
*~
|
|
34
|
+
|
|
35
|
+
# Testing
|
|
36
|
+
.pytest_cache/
|
|
37
|
+
.coverage
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
|
|
41
|
+
# Documentation
|
|
42
|
+
docs/_build/
|
|
43
|
+
|
|
44
|
+
# OS
|
|
45
|
+
.DS_Store
|
|
46
|
+
Thumbs.db
|
|
47
|
+
|
|
48
|
+
# xwlazy generated files (should be in ~/.xwlazy/ but ignore in case of old behavior)
|
|
49
|
+
xwlazy.lock.toml
|
|
50
|
+
xwlazy_sbom.toml
|
|
51
|
+
|
|
52
|
+
# Local secrets and archives
|
|
53
|
+
.secrets
|
|
54
|
+
.archieve/
|
|
55
|
+
|
|
56
|
+
# Benchmark/example data (over GitHub 100MB limit; generate locally if needed)
|
|
57
|
+
examples/benchmark_data/huge_file.data.xwjson
|
|
58
|
+
examples/benchmark_data/huge_file.xwjson
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
.examples/
|
xwjson-0.9.0.6/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 eXonware.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
xwjson-0.9.0.6/PKG-INFO
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xwjson
|
|
3
|
+
Version: 0.9.0.6
|
|
4
|
+
Summary: Convenience wrapper for exonware-xwjson - provides 'import xwjson' alias
|
|
5
|
+
Project-URL: Homepage, https://exonware.com
|
|
6
|
+
Project-URL: Repository, https://github.com/exonware/xwjson
|
|
7
|
+
Project-URL: Documentation, https://github.com/exonware/xwjson#readme
|
|
8
|
+
Project-URL: Subtree, https://github.com/exonware/xwjson.git
|
|
9
|
+
Author-email: eXonware Backend Team <connect@exonware.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Python: >=3.12
|
|
13
|
+
Requires-Dist: exonware-xwjson
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: exonware-xwjson[dev]; extra == 'dev'
|
|
16
|
+
Provides-Extra: full
|
|
17
|
+
Requires-Dist: exonware-xwjson[full]; extra == 'full'
|
|
18
|
+
Provides-Extra: lazy
|
|
19
|
+
Requires-Dist: exonware-xwjson[lazy]; extra == 'lazy'
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# xwjson
|
|
23
|
+
|
|
24
|
+
**Extended binary JSON.** MessagePack-based intermediate format that is ~10x faster than text JSON, preserves schema/format metadata, supports lazy loading and references ($ref, @href, *anchor), and powers conversions and transactions across the stack.
|
|
25
|
+
|
|
26
|
+
*Full feature tour, examples, and troubleshooting: [README_LONG.md](README_LONG.md).*
|
|
27
|
+
|
|
28
|
+
**Company:** eXonware.com · **Author:** eXonware Backend Team · **Email:** connect@exonware.com
|
|
29
|
+
**Version:** See [version.py](src/exonware/xwjson/version.py) or PyPI. · **Updated:** See [version.py](src/exonware/xwjson/version.py) (`__date__`)
|
|
30
|
+
|
|
31
|
+
[](https://exonware.com)
|
|
32
|
+
[](https://www.python.org)
|
|
33
|
+
[](LICENSE)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install exonware-xwjson
|
|
41
|
+
# Full (optional)
|
|
42
|
+
pip install exonware-xwjson[full]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Quick start
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from exonware.xwjson import XWJSONSerializer
|
|
51
|
+
|
|
52
|
+
serializer = XWJSONSerializer()
|
|
53
|
+
# Async (recommended)
|
|
54
|
+
data = await serializer.load_file_async("data.xwjson")
|
|
55
|
+
await serializer.save_file_async(data, "output.xwjson")
|
|
56
|
+
# Sync
|
|
57
|
+
data = serializer.load_file("data.xwjson")
|
|
58
|
+
serializer.save_file(data, "output.xwjson")
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
See [docs/](docs/) for REF_*, guides, and examples.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## What you get
|
|
66
|
+
|
|
67
|
+
| Area | What's in it |
|
|
68
|
+
|------|----------------|
|
|
69
|
+
| **Binary** | MessagePack-based encoding; faster than text JSON. |
|
|
70
|
+
| **Lazy** | Defer parsing until access. |
|
|
71
|
+
| **References** | $ref, @href, *anchor preserved and resolved. |
|
|
72
|
+
| **Integration** | xwnode, xwschema; format metadata preserved. |
|
|
73
|
+
| **Transactions** | ACID; batch operations with dependency-aware parallel execution. |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Docs and tests
|
|
78
|
+
|
|
79
|
+
- **Start:** [docs/INDEX.md](docs/INDEX.md) or [docs/](docs/).
|
|
80
|
+
- **Guides:** Basic/Advanced usage, Performance, Format conversion, Schema validation when present under docs/.
|
|
81
|
+
- **Tests:** Run from project root per project layout.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## License and links
|
|
86
|
+
|
|
87
|
+
MIT — see [LICENSE](LICENSE). **Homepage:** https://exonware.com · **Repository:** https://github.com/exonware/xwjson
|
|
88
|
+
|
|
89
|
+
Contributing → CONTRIBUTING.md · Security → SECURITY.md (when present).
|
|
90
|
+
|
|
91
|
+
*Built with ❤️ by eXonware.com - Revolutionizing Python Development Since 2025*
|
xwjson-0.9.0.6/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# xwjson
|
|
2
|
+
|
|
3
|
+
**Extended binary JSON.** MessagePack-based intermediate format that is ~10x faster than text JSON, preserves schema/format metadata, supports lazy loading and references ($ref, @href, *anchor), and powers conversions and transactions across the stack.
|
|
4
|
+
|
|
5
|
+
*Full feature tour, examples, and troubleshooting: [README_LONG.md](README_LONG.md).*
|
|
6
|
+
|
|
7
|
+
**Company:** eXonware.com · **Author:** eXonware Backend Team · **Email:** connect@exonware.com
|
|
8
|
+
**Version:** See [version.py](src/exonware/xwjson/version.py) or PyPI. · **Updated:** See [version.py](src/exonware/xwjson/version.py) (`__date__`)
|
|
9
|
+
|
|
10
|
+
[](https://exonware.com)
|
|
11
|
+
[](https://www.python.org)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install exonware-xwjson
|
|
20
|
+
# Full (optional)
|
|
21
|
+
pip install exonware-xwjson[full]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Quick start
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from exonware.xwjson import XWJSONSerializer
|
|
30
|
+
|
|
31
|
+
serializer = XWJSONSerializer()
|
|
32
|
+
# Async (recommended)
|
|
33
|
+
data = await serializer.load_file_async("data.xwjson")
|
|
34
|
+
await serializer.save_file_async(data, "output.xwjson")
|
|
35
|
+
# Sync
|
|
36
|
+
data = serializer.load_file("data.xwjson")
|
|
37
|
+
serializer.save_file(data, "output.xwjson")
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
See [docs/](docs/) for REF_*, guides, and examples.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## What you get
|
|
45
|
+
|
|
46
|
+
| Area | What's in it |
|
|
47
|
+
|------|----------------|
|
|
48
|
+
| **Binary** | MessagePack-based encoding; faster than text JSON. |
|
|
49
|
+
| **Lazy** | Defer parsing until access. |
|
|
50
|
+
| **References** | $ref, @href, *anchor preserved and resolved. |
|
|
51
|
+
| **Integration** | xwnode, xwschema; format metadata preserved. |
|
|
52
|
+
| **Transactions** | ACID; batch operations with dependency-aware parallel execution. |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Docs and tests
|
|
57
|
+
|
|
58
|
+
- **Start:** [docs/INDEX.md](docs/INDEX.md) or [docs/](docs/).
|
|
59
|
+
- **Guides:** Basic/Advanced usage, Performance, Format conversion, Schema validation when present under docs/.
|
|
60
|
+
- **Tests:** Run from project root per project layout.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## License and links
|
|
65
|
+
|
|
66
|
+
MIT — see [LICENSE](LICENSE). **Homepage:** https://exonware.com · **Repository:** https://github.com/exonware/xwjson
|
|
67
|
+
|
|
68
|
+
Contributing → CONTRIBUTING.md · Security → SECURITY.md (when present).
|
|
69
|
+
|
|
70
|
+
*Built with ❤️ by eXonware.com - Revolutionizing Python Development Since 2025*
|