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

Compilation failure when importing own interface #121

Open
xrchz opened this issue Jul 1, 2024 · 4 comments
Open

Compilation failure when importing own interface #121

xrchz opened this issue Jul 1, 2024 · 4 comments
Labels
category: bug Something isn't working

Comments

@xrchz
Copy link

xrchz commented Jul 1, 2024

Environment information

  • ape and plugin versions:
$ ape --version
0.8.5

$ ape plugins list
Installed Plugins
  etherscan    0.8.0
  foundry      0.8.0
  vyper        0.8.1
  • Python Version: 3.12.4
  • OS: GNU/Linux

What went wrong?

ape compile

produces

Traceback (most recent call last):
  File "/home/ramana/.local/pipx/venvs/eth-ape/lib/python3.12/site-packages/ape_vyper/compiler.py", line 386, in _get_imports
    sub_imports = self._get_imports((full_path,), project=project, handled=handled)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ramana/.local/pipx/venvs/eth-ape/lib/python3.12/site-packages/ape_vyper/compiler.py", line 386, in _get_imports
    sub_imports = self._get_imports((full_path,), project=project, handled=handled)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ramana/.local/pipx/venvs/eth-ape/lib/python3.12/site-packages/ape_vyper/compiler.py", line 386, in _get_imports
    sub_imports = self._get_imports((full_path,), project=project, handled=handled)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 993 more times]
  File "/home/ramana/.local/pipx/venvs/eth-ape/lib/python3.12/site-packages/ape_vyper/compiler.py", line 298, in _get_imports
    dependencies = self.get_dependencies(project=pm)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ramana/.local/pipx/venvs/eth-ape/lib/python3.12/site-packages/ape_vyper/compiler.py", line 488, in get_dependencies
    config = self.get_config(project=pm)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ramana/.local/pipx/venvs/eth-ape/lib/python3.12/site-packages/ape/api/compiler.py", line 65, in get_config
    return config.model_validate(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ramana/.local/pipx/venvs/eth-ape/lib/python3.12/site-packages/pydantic/main.py", line 551, in model_validate
    return cls.__pydantic_validator__.validate_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for VyperConfig
  Value error, error getting value for field "version" from source "DotEnvSettingsSource" [type=value_error, input_value={'version': None, 'evm_ve... 'import_remapping': []}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error

where contracts/test.vy contains

#pragma version ~=0.4.0

import test as TestInterface

@deploy
def __init__():
  pass
Copy link

linear bot commented Jul 1, 2024

@dtdang dtdang added the category: bug Something isn't working label Jul 1, 2024
@dtdang
Copy link
Contributor

dtdang commented Jul 2, 2024

Issue should be fixed with #122 and in the newest release of 0.8.2. Can you please check and comment if you're still running into any issues?

@xrchz
Copy link
Author

xrchz commented Jul 2, 2024

I believe it is fixed, although the example code I gave above does not work still: I don't know actually what the correct syntax is for importing one's own interface.

@antazoey
Copy link
Member

this might fix it: #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants