File tree Expand file tree Collapse file tree
installers/gh_release/resolvers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ def install_aptitude_packages(
126126def install_apk_packages (
127127 packages : str = typer .Argument (None , help = "comma separated list of apk packages" )
128128) -> None :
129+ print ("hoii" , flush = True )
129130 ApkInstaller .install (
130131 packages = packages .split ("," ),
131132 )
Original file line number Diff line number Diff line change 11import json
2+ import logging
23import re
34import urllib
45from typing import Any , Dict , List , Optional
56
67import invoke
78from natsort import natsorted
89
10+ logger = logging .getLogger (__name__ )
11+
912
1013class ReleaseResolver :
1114 class ReleaseResolverError (Exception ):
@@ -44,13 +47,26 @@ def get_version_tags(
4447 return stringified_matches
4548 return []
4649
50+ @classmethod
51+ def valid_version (cls , value : str ) -> bool :
52+ normalized_value = value .lstrip ("v" )
53+ return normalized_value [0 ].isalpha () or normalized_value [0 ].isdigit ()
54+
4755 @classmethod
4856 def get_latest_git_version_tag (
4957 cls , repo : str , release_tag_regex : Optional [str ] = None
5058 ) -> str :
5159 all_version_tags = cls .get_version_tags (repo , release_tag_regex )
5260
53- return natsorted (all_version_tags )[- 1 ]
61+ valid_versions = list (filter (cls .valid_version , all_version_tags ))
62+
63+ if len (valid_versions ) != len (all_version_tags ):
64+ logger .warning (
65+ "The following release versions were filtered out as invalid: %s" ,
66+ str (set (all_version_tags ) - set (valid_versions )),
67+ )
68+
69+ return natsorted (valid_versions )[- 1 ]
5470
5571 @classmethod
5672 def get_latest_release_tag (
You can’t perform that action at this time.
0 commit comments