6
6
from vvm .exceptions import UnexpectedVersionError
7
7
from vvm .utils .versioning import _detect_version_specifier , _pick_vyper_version
8
8
9
- LAST_PER_MINOR = {
10
- 1 : Version ("0.1.0b17" ),
11
- 2 : Version ("0.2.16" ),
12
- 3 : Version ("0.3.10" ),
13
- }
14
-
15
9
16
10
def test_foo_vyper_version (foo_source , vyper_version ):
17
11
specifier = _detect_version_specifier (foo_source )
@@ -23,9 +17,10 @@ def test_foo_vyper_version(foo_source, vyper_version):
23
17
@pytest .mark .parametrize (
24
18
"version_str,decorator,pragma,expected_specifier,expected_version" ,
25
19
[
26
- ("^0.1.1 " , "public" , "@version" , "~=0.1 " , "latest " ),
20
+ ("^0.2.0 " , "public" , "@version" , "~=0.2.0 " , "0.2.16 " ),
27
21
("~0.3.0" , "external" , "pragma version" , "~=0.3.0" , "0.3.10" ),
28
22
("0.1.0b17" , "public" , "@version" , "==0.1.0b17" , "0.1.0b17" ),
23
+ ("^0.1.0b16" , "public" , "@version" , "~=0.1.0b16" , "0.1.0b17" ),
29
24
(">=0.3.0-beta17" , "external" , "@version" , ">=0.3.0-beta17" , "latest" ),
30
25
("0.4.0rc6" , "external" , "pragma version" , "==0.4.0rc6" , "0.4.0rc6" ),
31
26
],
@@ -57,3 +52,11 @@ def test_version_does_not_exist():
57
52
with pytest .raises (UnexpectedVersionError ) as excinfo :
58
53
detect_vyper_version_from_source ("# pragma version 2024.0.1" )
59
54
assert str (excinfo .value ) == "No installable Vyper satisfies the specifier ==2024.0.1"
55
+
56
+
57
+ def test_npm_version_for_04_release ():
58
+ with pytest .raises (UnexpectedVersionError ) as excinfo :
59
+ detect_vyper_version_from_source ("# pragma version ^0.4.0" )
60
+
61
+ expected_msg = "Please use the pypi-style version specifier for vyper versions >= 0.4.0"
62
+ assert str (excinfo .value ) == expected_msg
0 commit comments