ethspecify 0.2.2__tar.gz → 0.2.4__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.
- {ethspecify-0.2.2 → ethspecify-0.2.4}/PKG-INFO +2 -1
- {ethspecify-0.2.2 → ethspecify-0.2.4}/ethspecify/cli.py +73 -2
- ethspecify-0.2.4/ethspecify/core.py +1004 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/ethspecify.egg-info/PKG-INFO +2 -1
- {ethspecify-0.2.2 → ethspecify-0.2.4}/ethspecify.egg-info/requires.txt +1 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/setup.py +2 -1
- ethspecify-0.2.2/ethspecify/core.py +0 -496
- {ethspecify-0.2.2 → ethspecify-0.2.4}/LICENSE +0 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/README.md +0 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/ethspecify/__init__.py +0 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/ethspecify.egg-info/SOURCES.txt +0 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/ethspecify.egg-info/dependency_links.txt +0 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/ethspecify.egg-info/entry_points.txt +0 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/ethspecify.egg-info/top_level.txt +0 -0
- {ethspecify-0.2.2 → ethspecify-0.2.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ethspecify
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: A utility for processing Ethereum specification tags.
|
|
5
5
|
Home-page: https://github.com/jtraglia/ethspecify
|
|
6
6
|
Author: Justin Traglia
|
|
@@ -12,6 +12,7 @@ Requires-Python: >=3.6
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: requests==2.32.3
|
|
15
|
+
Requires-Dist: PyYAML>=6.0
|
|
15
16
|
Dynamic: author
|
|
16
17
|
Dynamic: author-email
|
|
17
18
|
Dynamic: classifier
|
|
@@ -3,7 +3,7 @@ import json
|
|
|
3
3
|
import os
|
|
4
4
|
import sys
|
|
5
5
|
|
|
6
|
-
from .core import grep, replace_spec_tags, get_pyspec, get_latest_fork, get_spec_item_history
|
|
6
|
+
from .core import grep, replace_spec_tags, get_pyspec, get_latest_fork, get_spec_item_history, load_config, run_checks
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def process(args):
|
|
@@ -13,9 +13,12 @@ def process(args):
|
|
|
13
13
|
print(f"Error: The directory {repr(project_dir)} does not exist.")
|
|
14
14
|
return 1
|
|
15
15
|
|
|
16
|
+
# Load config once from the project directory
|
|
17
|
+
config = load_config(project_dir)
|
|
18
|
+
|
|
16
19
|
for f in grep(project_dir, r"<spec\b.*?>", args.exclude):
|
|
17
20
|
print(f"Processing file: {f}")
|
|
18
|
-
replace_spec_tags(f)
|
|
21
|
+
replace_spec_tags(f, config)
|
|
19
22
|
|
|
20
23
|
return 0
|
|
21
24
|
|
|
@@ -66,6 +69,64 @@ def _list_tags_with_history(args, preset):
|
|
|
66
69
|
return 0
|
|
67
70
|
|
|
68
71
|
|
|
72
|
+
def check(args):
|
|
73
|
+
"""Run checks to validate spec references."""
|
|
74
|
+
project_dir = os.path.abspath(os.path.expanduser(args.path))
|
|
75
|
+
if not os.path.isdir(project_dir):
|
|
76
|
+
print(f"Error: The directory {repr(project_dir)} does not exist.")
|
|
77
|
+
return 1
|
|
78
|
+
|
|
79
|
+
# Load config
|
|
80
|
+
config = load_config(project_dir)
|
|
81
|
+
|
|
82
|
+
# Run checks
|
|
83
|
+
success, results = run_checks(project_dir, config)
|
|
84
|
+
|
|
85
|
+
# Collect all missing items and errors
|
|
86
|
+
all_missing = []
|
|
87
|
+
all_errors = []
|
|
88
|
+
total_coverage = {"found": 0, "expected": 0}
|
|
89
|
+
total_source_files = {"valid": 0, "total": 0}
|
|
90
|
+
|
|
91
|
+
for section_name, section_results in results.items():
|
|
92
|
+
# Determine the type prefix from section name
|
|
93
|
+
if "Config Variables" in section_name:
|
|
94
|
+
type_prefix = "config_var"
|
|
95
|
+
elif "Preset Variables" in section_name:
|
|
96
|
+
type_prefix = "preset_var"
|
|
97
|
+
elif "Ssz Objects" in section_name:
|
|
98
|
+
type_prefix = "ssz_object"
|
|
99
|
+
elif "Dataclasses" in section_name:
|
|
100
|
+
type_prefix = "dataclass"
|
|
101
|
+
else:
|
|
102
|
+
type_prefix = section_name.lower().replace(" ", "_")
|
|
103
|
+
|
|
104
|
+
# Collect source file errors
|
|
105
|
+
source = section_results['source_files']
|
|
106
|
+
total_source_files["valid"] += source["valid"]
|
|
107
|
+
total_source_files["total"] += source["total"]
|
|
108
|
+
all_errors.extend(source["errors"])
|
|
109
|
+
|
|
110
|
+
# Collect missing items with type prefix
|
|
111
|
+
coverage = section_results['coverage']
|
|
112
|
+
total_coverage["found"] += coverage["found"]
|
|
113
|
+
total_coverage["expected"] += coverage["expected"]
|
|
114
|
+
for missing in coverage['missing']:
|
|
115
|
+
all_missing.append(f"MISSING: {type_prefix}.{missing}")
|
|
116
|
+
|
|
117
|
+
# Display only errors and missing items
|
|
118
|
+
for error in all_errors:
|
|
119
|
+
print(error)
|
|
120
|
+
|
|
121
|
+
for missing in sorted(all_missing):
|
|
122
|
+
print(missing)
|
|
123
|
+
|
|
124
|
+
if all_errors or all_missing:
|
|
125
|
+
return 1
|
|
126
|
+
else:
|
|
127
|
+
total_refs = total_coverage['expected']
|
|
128
|
+
print(f"All specification references ({total_refs}) are valid.")
|
|
129
|
+
return 0
|
|
69
130
|
|
|
70
131
|
|
|
71
132
|
def list_forks(args):
|
|
@@ -139,6 +200,16 @@ def main():
|
|
|
139
200
|
default=None,
|
|
140
201
|
)
|
|
141
202
|
|
|
203
|
+
# Parser for 'check' command
|
|
204
|
+
check_parser = subparsers.add_parser("check", help="Check spec reference coverage and validity")
|
|
205
|
+
check_parser.set_defaults(func=check)
|
|
206
|
+
check_parser.add_argument(
|
|
207
|
+
"--path",
|
|
208
|
+
type=str,
|
|
209
|
+
help="Directory containing YAML files to check",
|
|
210
|
+
default=".",
|
|
211
|
+
)
|
|
212
|
+
|
|
142
213
|
# Parser for 'list-forks' command
|
|
143
214
|
list_forks_parser = subparsers.add_parser("list-forks", help="List available forks")
|
|
144
215
|
list_forks_parser.set_defaults(func=list_forks)
|