ApeWorX / ape-vyper

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

Plugin doesn't work with beta versions of Vyper #36

Closed fubuloubu closed 2 months ago

fubuloubu commented 2 years ago

Environment information

$ ape --version
0.1.5

$ ape plugins list
Installed Plugins:
  vyper       0.1.0

What went wrong?

Attempted to install a project that uses older Vyper versions:

dependencies:
  - name: curve
    github: curvefi/curve-contract
    branch: master

Which raises the following error:

$ ape compile
INFO: Cloning branch 'master' from 'curve-contract'.
...
ERROR: (VyperCompileError) vyper.exceptions.VersionException: line 1:0 Version specification "0.1.0b16" is not compatible with compiler version "0.3.1"
[9032] Failed to execute script 'vyper_compile' due to unhandled exception!

How can it be fixed?

All version selection to work with b16 tags

fubuloubu commented 2 months ago

Think this might actually no longer be the case, @antazoey agree?

antazoey commented 2 months ago

No, i didnt think beta versions were required. How many betas do we need to ensure we are supporting? Does this include betas fro before releases like 3.10 as well?

fubuloubu commented 2 months ago

No, i didnt think beta versions were required. How many betas do we need to ensure we are supporting? Does this include betas fro before releases like 3.10 as well?

They aren't "required" but I thought if you manually install a beta/release candidate the plugin would let you use that? At least thats how people were testing v0.4 prereleases

antazoey commented 2 months ago

ya, RC versions seem to work... However, something weird I noticed:

If your pragma is:

# pragma version ~=0.4.0rc6

and this you run this line:

versions = sorted(list(pragma_spec.filter(self.installed_versions)), reverse=True)

versions[0] is 0.4.0, so somehow you can use 0.4.0 for 0.4.0rc6 pragma... weird... should it not do that?

Edit: I suppose the ~= is at play

antazoey commented 2 months ago

OK, messing around a bit more, RC versions works great! they work the same as any other version... The only issue might be specific handlings within those versions (not guaranteed to work), but they at least can auto-install and compile and all that.

fubuloubu commented 2 months ago

ya, RC versions seem to work... However, something weird I noticed:

If your pragma is:

# pragma version ~=0.4.0rc6

and this you run this line:

versions = sorted(list(pragma_spec.filter(self.installed_versions)), reverse=True)

versions[0] is 0.4.0, so somehow you can use 0.4.0 for 0.4.0rc6 pragma... weird... should it not do that?

I think that's okay, because 0.4.0 is actually > 0.4.0rcX