File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -777,6 +777,19 @@ def get_git_commit_hash(length=8):
777777 return ""
778778
779779
780+ def get_flagtree_version ():
781+ import hashlib
782+ PYPI_KEY_MD5 = "ed98ae2a2ba0429b189537c0d3dbef43"
783+ key = os .environ .get ("FLAGTREE_PYPI_KEY" , "" )
784+ flagtree_ver = os .environ .get ("FLAGTREE_WHEEL_VERSION" , "" )
785+ if flagtree_ver :
786+ if hashlib .md5 (key .encode ()).hexdigest () == PYPI_KEY_MD5 :
787+ return flagtree_ver
788+ else :
789+ return flagtree_ver + get_git_commit_hash ().replace ("+" , "." )
790+ return "0.5.0" + get_git_commit_hash ()
791+
792+
780793def get_git_branch ():
781794 try :
782795 cmd = ['git' , 'rev-parse' , '--abbrev-ref' , 'HEAD' ]
@@ -799,7 +812,7 @@ def get_git_version_suffix():
799812
800813setup (
801814 name = os .environ .get ("FLAGTREE_WHEEL_NAME" , "flagtree" ),
802- version = os . environ . get ( "FLAGTREE_WHEEL_VERSION" , "" ) or "0.5.0" + get_git_commit_hash (),
815+ version = get_flagtree_version (),
803816 author = "FlagOS" ,
804817 author_email = "contact@flagos.io" ,
805818 description =
You can’t perform that action at this time.
0 commit comments