-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: allow specifying version in config [APE-1473] #98
Conversation
3d03212
to
2b24650
Compare
2b24650
to
568bfc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work, can you please review comment to make sure that it is appropriately working for me the way that it is desired to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ ape compile -f
INFO: Compiling 'Token.vy'.
ERROR: (VyperCompileError) Token.vy
VersionException:line 1:0 Version specification "0.3.9" is not compatible with compiler version "0.3.7"
$ cat contracts/Token.vy | grep "@version"
# @version 0.3.9
$ cat ape-config.yaml
name: TokenProject
plugins:
- name: vyper
vyper:
version: 0.3.7
$ pico ape-config.yaml
$ cat ape-config.yaml
name: TokenProject
plugins:
- name: vyper
vyper:
version: 0.3.9
$ ape compile -f
INFO: Compiling 'Token.vy'.
Note: This seems to work for me, when the pragma matches the config it works and when it doesn't it fails with the error. Is this the desired effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce the same result. I just want to make sure this is what we want @antazoey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also:
if i do the opposite, where they are not the same it also fails in the same manner:
$ ape compile -f
INFO: Compiling 'Token.vy'.
ERROR: (VyperCompileError) Token.vy
VersionException:line 1:0 Version specification "0.3.7" is not compatible with compiler version "0.3.9"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as requested I have tested it without the pragma now and it still compiles:
$ cat ape-config.yaml
name: TokenProject
plugins:
- name: vyper
vyper:
version: 0.3.9
$ cat contracts/Token.vy | grep "@version"
$ ape compile -f
INFO: Compiling 'Token.vy'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it also works if there is no pragma and no version in the config:
$ cat ape-config.yaml
name: TokenProject
plugins:
- name: vyper
$ cat contracts/Token.vy | grep "@version"
$ ape compile -f
INFO: Compiling 'Token.vy'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it also works if there is only a pragma and there is not a version in the config:
$ cat ape-config.yaml
name: TokenProject
plugins:
- name: vyper
$ cat contracts/Token.vy | grep "@version"
# @version 0.3.7
$ ape compile -f
INFO: Compiling 'Token.vy'.
|
||
# Show it uses this version in the compiler. | ||
project.load_contracts(use_cache=False) | ||
assert str(spy.call_args[1]["vyper_version"]) == version_from_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same results as @sabotagebeats i just want to make sure it works as intended
What I did
same as ApeWorX/ape-solidity#46
How I did it
How to verify it
Checklist