@@ -47,7 +47,6 @@ def validate_init(init):
47
47
isinstance (init , tuple )
48
48
and len (init ) in (3 , 4 )
49
49
and all (isinstance (i , int ) for i in init [:3 ])
50
- and (len (init ) == 3 or init [3 ] == "DEV" )
51
50
):
52
51
raise ValueError ("Wrong format of __version__ in __init__.py" )
53
52
@@ -74,31 +73,20 @@ def head_git_tag():
74
73
m = regex .match (st )
75
74
if m is None :
76
75
raise ValueError ("HEADs git tag is not a valid version number" )
77
- vnum = tuple (int (i ) for i in m .groups ()[1 :4 ])
78
- tagname = m .groups ()[0 ]
79
-
80
- # Check it's annotated if it exists - then returncode is 0
81
- proc = subprocess .run (["git" , "describe" , tagname ])
82
- is_annotated = proc .returncode == 0
83
- return (vnum , is_annotated )
76
+ return tuple (int (i ) for i in m .groups ()[1 :4 ])
84
77
85
78
86
79
class TestVersions (unittest .TestCase ):
87
80
@classmethod
88
81
def setUpClass (cls ):
89
- cls .v_snakemake_readme = readme_vamb_version ("../workflow/README.md" )
90
82
validate_init (vamb .__version__ )
91
83
cls .v_init = vamb .__version__
92
84
cls .v_changelog = changelog_version ("../CHANGELOG.md" )
93
85
cls .last_tag = latest_git_tag ()
94
- head_tag , is_annotated = head_git_tag ()
86
+ head_tag = head_git_tag ()
95
87
cls .head_tag = head_tag
96
- cls .is_annotated = is_annotated
97
88
98
89
def test_same_versions (self ):
99
- # envs/vamb version, versions in README and last tag must all point to the latest release
100
- self .assertEqual (self .last_tag , self .v_snakemake_readme )
101
-
102
90
# The version in the changelog must fit the one in __init__
103
91
self .assertEqual (self .v_init , self .v_changelog )
104
92
@@ -107,9 +95,8 @@ def test_dev_version(self):
107
95
# than the latest release.
108
96
# If not, it must be the same version as the tag of the current commit,
109
97
# i.e. the current commit must be a release version.
110
- if self .v_init [ - 1 ] == "DEV" :
98
+ if len ( self .v_init ) > 3 :
111
99
self .assertGreater (self .v_init [:3 ], self .last_tag )
112
100
else :
113
101
self .assertEqual (self .v_init , self .head_tag )
114
102
self .assertEqual (self .v_init [:3 ], self .last_tag )
115
- self .assertTrue (self .is_annotated )
0 commit comments