File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,23 +54,24 @@ def convert_sls_version_to_python(sls_version: str) -> str:
5454 return python_version
5555
5656
57- try :
58- gitversion = (
59- subprocess .check_output (
60- "git describe --tags --always --first-parent" .split ()
57+ if not path .exists (VERSION_PY_PATH ):
58+ try :
59+ gitversion = (
60+ subprocess .check_output (
61+ "git describe --tags --always --first-parent" .split ()
62+ )
63+ .decode ()
64+ .strip ()
6165 )
62- .decode ()
63- .strip ()
64- )
65- open (VERSION_PY_PATH , "w" ).write (
66- '__version__ = "{}"\n ' .format (
67- convert_sls_version_to_python (gitversion )
66+ open (VERSION_PY_PATH , "w" ).write (
67+ '__version__ = "{}"\n ' .format (
68+ convert_sls_version_to_python (gitversion )
69+ )
6870 )
69- )
70- if not path .exists ("build" ):
71- makedirs ("build" )
72- except subprocess .CalledProcessError :
73- print ("outside git repo, not generating new version string" )
71+ if not path .exists ("build" ):
72+ makedirs ("build" )
73+ except subprocess .CalledProcessError :
74+ print ("outside git repo, not generating new version string" )
7475exec (open (VERSION_PY_PATH ).read ())
7576
7677
You can’t perform that action at this time.
0 commit comments