ethspecify 0.3.2__tar.gz → 0.3.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.3.2 → ethspecify-0.3.4}/PKG-INFO +1 -1
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify/core.py +60 -47
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify.egg-info/PKG-INFO +1 -1
- {ethspecify-0.3.2 → ethspecify-0.3.4}/setup.py +1 -1
- {ethspecify-0.3.2 → ethspecify-0.3.4}/LICENSE +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/README.md +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify/__init__.py +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify/cli.py +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify.egg-info/SOURCES.txt +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify.egg-info/dependency_links.txt +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify.egg-info/entry_points.txt +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify.egg-info/requires.txt +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/ethspecify.egg-info/top_level.txt +0 -0
- {ethspecify-0.3.2 → ethspecify-0.3.4}/setup.cfg +0 -0
|
@@ -589,9 +589,18 @@ def sort_specref_yaml(yaml_file):
|
|
|
589
589
|
with open(yaml_file, 'r') as f:
|
|
590
590
|
content_str = f.read()
|
|
591
591
|
|
|
592
|
-
#
|
|
593
|
-
# This
|
|
594
|
-
|
|
592
|
+
# Extract search values that originally had single or double quotes before YAML parsing
|
|
593
|
+
# This preserves the original quoting style exactly
|
|
594
|
+
single_quoted_searches = set()
|
|
595
|
+
for match in re.finditer(r"search:\s*'([^']*)'", content_str):
|
|
596
|
+
single_quoted_searches.add(match.group(1))
|
|
597
|
+
double_quoted_searches = set()
|
|
598
|
+
for match in re.finditer(r'search:\s*"([^"]*)"', content_str):
|
|
599
|
+
double_quoted_searches.add(match.group(1))
|
|
600
|
+
|
|
601
|
+
# Temporarily quote unquoted search strings with colons so YAML can parse them
|
|
602
|
+
# This doesn't affect the output - we restore original quoting when writing
|
|
603
|
+
content_str = re.sub(r'(\s+search:\s+)([^"\'\n]+:)(\s*$)', r'\1"\2"\3', content_str, flags=re.MULTILINE)
|
|
595
604
|
|
|
596
605
|
try:
|
|
597
606
|
content = yaml.safe_load(content_str)
|
|
@@ -672,16 +681,11 @@ def sort_specref_yaml(yaml_file):
|
|
|
672
681
|
output_lines.append(f" - file: {source.get('file', '')}")
|
|
673
682
|
if 'search' in source:
|
|
674
683
|
search_val = source['search']
|
|
675
|
-
#
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
not (search_val.startswith('"') and search_val.endswith('"')) and
|
|
681
|
-
'"' not in search_val):
|
|
682
|
-
# Only quote simple strings with colons, not complex patterns
|
|
683
|
-
if not any(char in search_val for char in ['\\', '*', '|', '[', ']', '(', ')']):
|
|
684
|
-
search_val = f'"{search_val}"'
|
|
684
|
+
# Preserve original quoting style exactly
|
|
685
|
+
if search_val in single_quoted_searches:
|
|
686
|
+
search_val = f"'{search_val}'"
|
|
687
|
+
elif search_val in double_quoted_searches:
|
|
688
|
+
search_val = f'"{search_val}"'
|
|
685
689
|
output_lines.append(f" search: {search_val}")
|
|
686
690
|
if 'regex' in source:
|
|
687
691
|
# Keep boolean values lowercase for consistency
|
|
@@ -888,6 +892,18 @@ def add_missing_entries_to_yaml(yaml_file, new_entries):
|
|
|
888
892
|
if not new_entries:
|
|
889
893
|
return
|
|
890
894
|
|
|
895
|
+
# Extract search values that originally had single or double quotes before YAML parsing
|
|
896
|
+
# This preserves the original quoting style exactly
|
|
897
|
+
single_quoted_searches = set()
|
|
898
|
+
double_quoted_searches = set()
|
|
899
|
+
if os.path.exists(yaml_file):
|
|
900
|
+
with open(yaml_file, 'r') as f:
|
|
901
|
+
content_str = f.read()
|
|
902
|
+
for match in re.finditer(r"search:\s*'([^']*)'", content_str):
|
|
903
|
+
single_quoted_searches.add(match.group(1))
|
|
904
|
+
for match in re.finditer(r'search:\s*"([^"]*)"', content_str):
|
|
905
|
+
double_quoted_searches.add(match.group(1))
|
|
906
|
+
|
|
891
907
|
# Load existing entries
|
|
892
908
|
existing_entries = load_yaml_entries(yaml_file)
|
|
893
909
|
|
|
@@ -931,7 +947,13 @@ def add_missing_entries_to_yaml(yaml_file, new_entries):
|
|
|
931
947
|
if isinstance(source, dict):
|
|
932
948
|
f.write(f' - file: {source.get("file", "")}\n')
|
|
933
949
|
if 'search' in source:
|
|
934
|
-
|
|
950
|
+
search_val = source["search"]
|
|
951
|
+
# Preserve original quoting style exactly
|
|
952
|
+
if search_val in single_quoted_searches:
|
|
953
|
+
search_val = f"'{search_val}'"
|
|
954
|
+
elif search_val in double_quoted_searches:
|
|
955
|
+
search_val = f'"{search_val}"'
|
|
956
|
+
f.write(f' search: {search_val}\n')
|
|
935
957
|
if 'regex' in source:
|
|
936
958
|
f.write(f' regex: {source["regex"]}\n')
|
|
937
959
|
else:
|
|
@@ -1690,6 +1712,17 @@ def update_entry_names_in_yaml_files(project_dir, specrefs_files):
|
|
|
1690
1712
|
if not os.path.exists(yaml_path):
|
|
1691
1713
|
continue
|
|
1692
1714
|
|
|
1715
|
+
# Extract search values that originally had single or double quotes before YAML parsing
|
|
1716
|
+
# This preserves the original quoting style exactly
|
|
1717
|
+
single_quoted_searches = set()
|
|
1718
|
+
double_quoted_searches = set()
|
|
1719
|
+
with open(yaml_path, 'r') as f:
|
|
1720
|
+
content_str = f.read()
|
|
1721
|
+
for match in re.finditer(r"search:\s*'([^']*)'", content_str):
|
|
1722
|
+
single_quoted_searches.add(match.group(1))
|
|
1723
|
+
for match in re.finditer(r'search:\s*"([^"]*)"', content_str):
|
|
1724
|
+
double_quoted_searches.add(match.group(1))
|
|
1725
|
+
|
|
1693
1726
|
# Load existing entries
|
|
1694
1727
|
existing_entries = load_yaml_entries(yaml_path)
|
|
1695
1728
|
if not existing_entries:
|
|
@@ -1737,7 +1770,13 @@ def update_entry_names_in_yaml_files(project_dir, specrefs_files):
|
|
|
1737
1770
|
if isinstance(source, dict):
|
|
1738
1771
|
f.write(f' - file: {source.get("file", "")}\n')
|
|
1739
1772
|
if 'search' in source:
|
|
1740
|
-
|
|
1773
|
+
search_val = source["search"]
|
|
1774
|
+
# Preserve original quoting style exactly
|
|
1775
|
+
if search_val in single_quoted_searches:
|
|
1776
|
+
search_val = f"'{search_val}'"
|
|
1777
|
+
elif search_val in double_quoted_searches:
|
|
1778
|
+
search_val = f'"{search_val}"'
|
|
1779
|
+
f.write(f' search: {search_val}\n')
|
|
1741
1780
|
if 'regex' in source:
|
|
1742
1781
|
f.write(f' regex: {source["regex"]}\n')
|
|
1743
1782
|
else:
|
|
@@ -1853,28 +1892,15 @@ def add_missing_spec_items_to_yaml_files(project_dir, config, specrefs_files):
|
|
|
1853
1892
|
# Calculate hash of current version
|
|
1854
1893
|
hash_value = hashlib.sha256(spec_content.encode('utf-8')).hexdigest()[:8]
|
|
1855
1894
|
|
|
1856
|
-
#
|
|
1857
|
-
|
|
1858
|
-
# Get previous version for diff
|
|
1859
|
-
prev_fork, _, prev_spec_content = versions[idx - 1]
|
|
1860
|
-
|
|
1861
|
-
# Generate diff
|
|
1862
|
-
diff_content = diff(prev_fork, strip_comments(prev_spec_content), fork, strip_comments(spec_content))
|
|
1863
|
-
|
|
1864
|
-
# Build spec tag with style="diff"
|
|
1865
|
-
spec_tag = f'<spec {spec_attr}="{item_name}" fork="{fork}" style="diff" hash="{hash_value}">'
|
|
1866
|
-
content = diff_content
|
|
1867
|
-
else:
|
|
1868
|
-
# Build spec tag without style="diff"
|
|
1869
|
-
spec_tag = f'<spec {spec_attr}="{item_name}" fork="{fork}" hash="{hash_value}">'
|
|
1870
|
-
content = spec_content
|
|
1895
|
+
# Build spec tag
|
|
1896
|
+
spec_tag = f'<spec {spec_attr}="{item_name}" fork="{fork}" hash="{hash_value}">'
|
|
1871
1897
|
|
|
1872
1898
|
# Create entry
|
|
1873
1899
|
entry_name = f'{item_name}#{fork}' if use_fork_suffix else item_name
|
|
1874
1900
|
entry = {
|
|
1875
1901
|
'name': entry_name,
|
|
1876
1902
|
'sources': [],
|
|
1877
|
-
'spec': f'{spec_tag}\n{
|
|
1903
|
+
'spec': f'{spec_tag}\n{spec_content}\n</spec>'
|
|
1878
1904
|
}
|
|
1879
1905
|
new_entries.append(entry)
|
|
1880
1906
|
|
|
@@ -1984,28 +2010,15 @@ def generate_specref_files(output_dir, version="nightly", preset="mainnet"):
|
|
|
1984
2010
|
# Calculate hash of current version
|
|
1985
2011
|
hash_value = hashlib.sha256(spec_content.encode('utf-8')).hexdigest()[:8]
|
|
1986
2012
|
|
|
1987
|
-
#
|
|
1988
|
-
|
|
1989
|
-
# Get previous version for diff
|
|
1990
|
-
prev_fork, _, prev_spec_content = versions[idx - 1]
|
|
1991
|
-
|
|
1992
|
-
# Generate diff
|
|
1993
|
-
diff_content = diff(prev_fork, strip_comments(prev_spec_content), fork, strip_comments(spec_content))
|
|
1994
|
-
|
|
1995
|
-
# Build spec tag with style="diff"
|
|
1996
|
-
spec_tag = f'<spec {spec_attr}="{item_name}" fork="{fork}" style="diff" hash="{hash_value}">'
|
|
1997
|
-
content = diff_content
|
|
1998
|
-
else:
|
|
1999
|
-
# Build spec tag without style="diff"
|
|
2000
|
-
spec_tag = f'<spec {spec_attr}="{item_name}" fork="{fork}" hash="{hash_value}">'
|
|
2001
|
-
content = spec_content
|
|
2013
|
+
# Build spec tag
|
|
2014
|
+
spec_tag = f'<spec {spec_attr}="{item_name}" fork="{fork}" hash="{hash_value}">'
|
|
2002
2015
|
|
|
2003
2016
|
# Create entry
|
|
2004
2017
|
entry_name = f'{item_name}#{fork}' if use_fork_suffix else item_name
|
|
2005
2018
|
entry = {
|
|
2006
2019
|
'name': entry_name,
|
|
2007
2020
|
'sources': [],
|
|
2008
|
-
'spec': f'{spec_tag}\n{
|
|
2021
|
+
'spec': f'{spec_tag}\n{spec_content}\n</spec>'
|
|
2009
2022
|
}
|
|
2010
2023
|
entries.append(entry)
|
|
2011
2024
|
|
|
@@ -8,7 +8,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name="ethspecify",
|
|
11
|
-
version="0.3.
|
|
11
|
+
version="0.3.4",
|
|
12
12
|
description="A utility for processing Ethereum specification tags.",
|
|
13
13
|
long_description=long_description,
|
|
14
14
|
long_description_content_type="text/markdown",
|
|
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
|