ethspecify 0.2.7__tar.gz → 0.2.9__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.

Potentially problematic release.


This version of ethspecify might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ethspecify
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: A utility for processing Ethereum specification tags.
5
5
  Home-page: https://github.com/jtraglia/ethspecify
6
6
  Author: Justin Traglia
@@ -232,10 +232,16 @@ def get_spec(attributes, preset, fork, version="nightly"):
232
232
  + " = "
233
233
  + pyspec[preset][fork]["custom_types"][attributes["custom_type"]]
234
234
  )
235
- elif "ssz_object" in attributes:
235
+ elif "ssz_object" in attributes or "container" in attributes:
236
236
  if spec is not None:
237
237
  raise Exception(f"Tag can only specify one spec item")
238
- spec = pyspec[preset][fork]["ssz_objects"][attributes["ssz_object"]]
238
+ if "ssz_object" in attributes and "container" in attributes:
239
+ raise Exception(f"cannot contain 'ssz_object' and 'container'")
240
+ if "ssz_object" in attributes:
241
+ object_name = attributes["ssz_object"]
242
+ else:
243
+ object_name = attributes["container"]
244
+ spec = pyspec[preset][fork]["ssz_objects"][object_name]
239
245
  elif "dataclass" in attributes:
240
246
  if spec is not None:
241
247
  raise Exception(f"Tag can only specify one spec item")
@@ -614,6 +620,7 @@ def check_source_files(yaml_file, project_root, exceptions=None):
614
620
  'config_var': 'configs',
615
621
  'preset_var': 'presets',
616
622
  'ssz_object': 'ssz_objects',
623
+ 'container': 'ssz_objects',
617
624
  'dataclass': 'dataclasses',
618
625
  'custom_type': 'custom_types'
619
626
  }
@@ -758,7 +765,7 @@ def extract_spec_tags_from_yaml(yaml_file, tag_type=None):
758
765
 
759
766
  # Known tag type attributes
760
767
  tag_attributes = ['fn', 'function', 'constant_var', 'config_var', 'preset_var',
761
- 'ssz_object', 'dataclass', 'custom_type']
768
+ 'ssz_object', 'container', 'dataclass', 'custom_type']
762
769
 
763
770
  try:
764
771
  with open(yaml_file, 'r') as f:
@@ -807,6 +814,9 @@ def extract_spec_tags_from_yaml(yaml_file, tag_type=None):
807
814
  # Normalize function to fn
808
815
  if found_tag_type == 'function':
809
816
  found_tag_type = 'fn'
817
+ # Normalize container to ssz_object
818
+ if found_tag_type == 'container':
819
+ found_tag_type = 'ssz_object'
810
820
  break
811
821
 
812
822
  if found_tag_type and 'fork' in attrs:
@@ -849,13 +859,16 @@ def generate_specrefs_from_files(files_with_spec_tags, project_dir):
849
859
 
850
860
  # Check each possible spec attribute
851
861
  for attr_name in ['fn', 'function', 'constant_var', 'config_var',
852
- 'preset_var', 'ssz_object', 'dataclass', 'custom_type']:
862
+ 'preset_var', 'ssz_object', 'container', 'dataclass', 'custom_type']:
853
863
  if attr_name in attrs:
854
864
  spec_type = attr_name
855
865
  spec_name = attrs[attr_name]
856
866
  break
857
867
 
858
868
  if spec_type and spec_name:
869
+ # Normalize container to ssz_object for consistency
870
+ if spec_type == 'container':
871
+ spec_type = 'ssz_object'
859
872
  # Create a unique key for this spec reference
860
873
  key = f"{spec_type}.{spec_name}"
861
874
  if fork:
@@ -911,6 +924,7 @@ def process_generated_specrefs(specrefs, exceptions, version):
911
924
  'config_var': 'config_vars',
912
925
  'preset_var': 'preset_vars',
913
926
  'ssz_object': 'ssz_objects',
927
+ 'container': 'ssz_objects',
914
928
  'dataclass': 'dataclasses',
915
929
  'custom_type': 'custom_types'
916
930
  }
@@ -923,6 +937,7 @@ def process_generated_specrefs(specrefs, exceptions, version):
923
937
  'config_var': 'configs',
924
938
  'preset_var': 'presets',
925
939
  'ssz_object': 'ssz_objects',
940
+ 'container': 'ssz_objects',
926
941
  'dataclass': 'dataclasses',
927
942
  'custom_type': 'custom_types'
928
943
  }
@@ -949,6 +964,14 @@ def process_generated_specrefs(specrefs, exceptions, version):
949
964
  # Check if singular form exists when we have plural
950
965
  elif exception_key.endswith('s') and exception_key[:-1] in exceptions:
951
966
  type_exceptions = exceptions[exception_key[:-1]]
967
+
968
+ # Special handling for ssz_objects/containers
969
+ if spec_type in ['ssz_object', 'container'] and not type_exceptions:
970
+ # Check for 'containers' as an alternative key
971
+ if 'containers' in exceptions:
972
+ type_exceptions = exceptions['containers']
973
+ elif 'container' in exceptions:
974
+ type_exceptions = exceptions['container']
952
975
 
953
976
  # Build set of what we found
954
977
  found_items = set()
@@ -1020,6 +1043,7 @@ def check_coverage(yaml_file, tag_type, exceptions, preset="mainnet", version="n
1020
1043
  # Map tag types to history keys
1021
1044
  history_key_map = {
1022
1045
  'ssz_object': 'ssz_objects',
1046
+ 'container': 'ssz_objects',
1023
1047
  'config_var': 'config_vars',
1024
1048
  'preset_var': 'preset_vars',
1025
1049
  'dataclass': 'dataclasses',
@@ -1125,7 +1149,8 @@ def run_checks(project_dir, config):
1125
1149
 
1126
1150
  # Map tag types to exception keys (support both singular and plural)
1127
1151
  exception_key_map = {
1128
- 'ssz_object': ['ssz_objects', 'ssz_object'],
1152
+ 'ssz_object': ['ssz_objects', 'ssz_object', 'containers', 'container'],
1153
+ 'container': ['ssz_objects', 'ssz_object', 'containers', 'container'],
1129
1154
  'config_var': ['configs', 'config_variables', 'config_var'],
1130
1155
  'preset_var': ['presets', 'preset_variables', 'preset_var'],
1131
1156
  'dataclass': ['dataclasses', 'dataclass'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ethspecify
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: A utility for processing Ethereum specification tags.
5
5
  Home-page: https://github.com/jtraglia/ethspecify
6
6
  Author: Justin Traglia
@@ -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.2.7",
11
+ version="0.2.9",
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