Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

horus-compile raises a typeguard runtime error on Python 3.9 #197

Open
langfield opened this issue Mar 31, 2023 · 1 comment
Open

horus-compile raises a typeguard runtime error on Python 3.9 #197

langfield opened this issue Mar 31, 2023 · 1 comment

Comments

@langfield
Copy link
Contributor

See below.

(horus39) mal@computer:~/pkgs/horus-checker$ horus-compile annotated.cairo --output compiled.json --spec_output spec.json
Traceback (most recent call last):
  File "/home/mal/conda/envs/horus39/bin/horus-compile", line 8, in <module>
    sys.exit(run())
  File "/home/mal/pkgs/horus-checker/horus-compile/src/horus/compiler/horus_compile.py", line 412, in run
    main(sys.argv[1:])
  File "/home/mal/pkgs/horus-checker/horus-compile/src/horus/compiler/horus_compile.py", line 396, in main
    preprocessed = horus_compile_common(
  File "/home/mal/pkgs/horus-checker/horus-compile/src/horus/compiler/horus_compile.py", line 225, in horus_compile_common
    pass_manager = pass_manager_factory(args, module_reader)
  File "/home/mal/pkgs/horus-checker/horus-compile/src/horus/compiler/horus_compile.py", line 375, in pass_manager_factory
    return horus_pass_manager(
  File "/home/mal/pkgs/horus-checker/horus-compile/src/horus/compiler/horus_compile.py", line 115, in horus_pass_manager
    manager = starknet_pass_manager(
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starknet/compiler/starknet_pass_manager.py", line 33, in starknet_pass_manager
    hint_whitelist = None if disable_hint_validation else get_hints_whitelist()
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starknet/security/hints_whitelist.py", line 9, in get_hints_whitelist
    return HintsWhitelist.from_dir(dirname=WHILTELIST_DIR)
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starknet/security/secure_hints.py", line 110, in from_dir
    whitelists = [
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starknet/security/secure_hints.py", line 111, in <listcomp>
    cls.from_file(filename=os.path.join(dirname, x))
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starknet/security/secure_hints.py", line 103, in from_file
    return cls.loads(data=fp.read())
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starkware_utils/serializable_dataclass.py", line 32, in loads
    return cls.Schema().loads(json_data=data)
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow/schema.py", line 756, in loads
    return self.load(data, many=many, partial=partial, unknown=unknown)
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow_dataclass/__init__.py", line 639, in load
    all_loaded = super().load(data, many=many, **kwargs)
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow/schema.py", line 722, in load
    return self._do_load(
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow/schema.py", line 861, in _do_load
    result = self._deserialize(
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow/schema.py", line 664, in _deserialize
    value = self._call_and_store(
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow/schema.py", line 500, in _call_and_store
    value = getter_func(data)
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow/schema.py", line 661, in <lambda>
    getter = lambda val: field_obj.deserialize(
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow/fields.py", line 370, in deserialize
    output = self._deserialize(value, attr, data, **kwargs)
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starknet/security/secure_hints.py", line 77, in _deserialize
    entries = [HintsWhitelistEntry.Schema().load(entry) for entry in value]
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starknet/security/secure_hints.py", line 77, in <listcomp>
    entries = [HintsWhitelistEntry.Schema().load(entry) for entry in value]
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/marshmallow_dataclass/__init__.py", line 644, in load
    return clazz(**all_loaded)
  File "<string>", line 5, in __init__
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starkware_utils/validated_dataclass.py", line 24, in __post_init__
    self.validate_dataclass()
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starkware_utils/validated_dataclass.py", line 27, in validate_dataclass
    self.validate_types()
  File "/home/mal/conda/envs/horus39/lib/python3.9/site-packages/starkware/starkware_utils/validated_dataclass.py", line 123, in validate_types
    typeguard.check_type(
TypeError: check_type() got an unexpected keyword argument 'argname'
@langfield
Copy link
Contributor Author

langfield commented Mar 31, 2023

Easily fixed by pinning typeguard == 2.13.3. See requirements.txt file in starkware-libs/cairo-lang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant