Closed antazoey closed 2 years ago
Sounds like this is not 100% the solution we want, and we may need to make changes to ape core. Discussions to be had!
Edit: changed it to ignore paths when interfaces
is in the base and now things seem to work. Just don't put actual vyper contracts in the <contracts_folder>/interfaces/
folder, which I don't see why you would, so I think this is fine.
@charles-cooper and @fubuloubu I am wondering your thoughts on this since you know more about the vyper sides of things.
Is this solution okay now, at least for a short term? I don't think any harm could come of it unless you put non-interface material in a folder names interfaces. Does that ever happen?
Is this solution okay now, at least for a short term? I don't think any harm could come of it unless you put non-interface material in a folder names interfaces. Does that ever happen?
This is more of a "framework expectation" sort of thing. Like is anyone else using it in this way? Or using it in a way that directly conflicts with this usage. Brownie had a feature where a separate interfaces folder could be defined that lives outside of the contracts folder, but you can import things in. I think that's the feature people expect. Is there a way to provide this feature in a different way that is a lot easier and less weird/error-prone to use? Worth some research
This is more of a "framework expectation" sort of thing. Like is anyone else using it in this way? Or using it in a way that directly conflicts with this usage. Brownie had a feature where a separate interfaces folder could be defined that lives outside of the contracts folder, but you can import things in. I think that's the feature people expect. Is there a way to provide this feature in a different way that is a lot easier and less weird/error-prone to use? Worth some research
agreed, the vyper does not really know about project layout, it only knows about files.
if i'm understanding correctly, the solution is to segregate compilation - only compile contracts in the contracts/
folder and never those in the interfaces/
folder. this makes sense. vyper interface files are not currently compile-able as standalone contracts, they can only be imported, so @unparalleled-js i think your solution works.
(as an aside, i am redoing how interfaces work in vyper, so we may need to revisit this at some point in the future)
What I did
fixes: #45
The issue is that vyper does not like the interfaces when they are passed in as source files. It seems to work fine when they are imported and not passed in as source files.
How I did it
interfaces/
so no interfaces files are ever passed in as source filesHow to verify it
Can compile a project with interfaces in it. Can use interfaces in contracts.
Checklist