Skip to content

Commit fbcb590

Browse files
committed
fix: python error if no tag is found
Using the default_config with only 'starting_version' set in a repository without tags the following error was raised: ... File "../project/.eggs/setuptools_git_versioning-1.2.6-py3.7.egg/setuptools_git_versioning.py", line 156, in version_from_git if not os.path.exists(version_file): File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/genericpath.py", line 19, in exists os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType ``` Python 3.7.3 (on MacOS)
1 parent bc7e350 commit fbcb590

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

setuptools_git_versioning.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def version_from_git(template=DEFAULT_TEMPLATE,
152152
else:
153153
return version_callback
154154

155-
if not os.path.exists(version_file):
155+
if version_file is None or not os.path.exists(version_file):
156156
return starting_version
157157
else:
158158
from_file = True

0 commit comments

Comments
 (0)