ApeWorX / ape-vyper

Vyper compiler plugin for the Ape Framework, using VVM
https://www.apeworx.io/
Apache License 2.0
27 stars 9 forks source link

Vyper interface files (`.vyi`) do not appear as interfaces in `project` #134

Open fubuloubu opened 1 month ago

fubuloubu commented 1 month ago

Overview

The vyper plugin does not currently generate Vyper ABI artifacts for .vyi interface files:

contracts/
  StreamFactory.vy
  StreamManager.vy
  Validator.vyi
$ ape console
In [1]: print(project.Validator.contract_type)
ERROR: (ApeAttributeError) 'LocalProject' object has no attribute 'Validator'. Also checked extra(s) 'contracts'.

Specification

The plugin should be able to do this natively. For now, the workaround is that you can place a <Interface>.json in your contracts folder (with hopefully the same ABI) and the pm "compiler" will grab it. Obviously a potentially source for human error, but it works

Dependencies

n/a

linear[bot] commented 1 month ago

APE-1833 Vyper interface files (`.vyi`) do not appear as interfaces in `project`

antazoey commented 1 month ago

I get error in vyper when I try to compile interfaces, like:

ERROR: (VyperCompileError) contracts/interfaces/IFaceZeroFour.vyi
StructureException:`...` is not allowed in `.vy` files! Did you mean to import me as a `.vyi` file?

^ very odd error, may be a bug in vyper even

Maybe they need special output selection.

antazoey commented 1 month ago

I get this same error when running vyper directly:

vyper contracts/interfaces/IFaceZeroFour.vyi
fubuloubu commented 1 month ago

I get error in vyper when I try to compile interfaces, like:

ERROR: (VyperCompileError) contracts/interfaces/IFaceZeroFour.vyi
StructureException:`...` is not allowed in `.vy` files! Did you mean to import me as a `.vyi` file?

^ very odd error, may be a bug in vyper even

Maybe they need special output selection.

you can't actually "compile" them, but I think -f abi should work

antazoey commented 1 month ago

https://github.com/vyperlang/vyper/issues/4232#issuecomment-2349381788

antazoey commented 1 month ago

you can't actually "compile" them, but I think -f abi should work

I tried this but got the same error.