Skip to content

Commit

Permalink
FIX: Calling git if there is no repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Wilhelm authored and Florian Wilhelm committed Mar 4, 2015
1 parent 96810fd commit 67d9d24
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pyscaffold/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ def version_from_vcs(tag_prefix, root, verbose=False):
if not git:
print("no git found")
return None
tag = next(git("describe", "--tags", "--dirty", "--always"))
try:
tag = next(git("describe", "--tags", "--dirty", "--always"))
except subprocess.CalledProcessError:
return None
if not tag.startswith(tag_prefix):
if verbose:
print("tag '{}' doesn't start with prefix '{}'".format(tag,
Expand Down
5 changes: 4 additions & 1 deletion pyscaffold/data/_version.template
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ def version_from_vcs(tag_prefix, root, verbose=False):
if not git:
print("no git found")
return None
tag = next(git("describe", "--tags", "--dirty", "--always"))
try:
tag = next(git("describe", "--tags", "--dirty", "--always"))
except subprocess.CalledProcessError:
return None
if not tag.startswith(tag_prefix):
if verbose:
print("tag '{}' doesn't start with prefix '{}'".format(tag,
Expand Down
2 changes: 1 addition & 1 deletion pyscaffold/data/setup_py.template
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def setup_package():
data_files=[('.', metadata['data_files'])],
command_options=command_options,
entry_points={'console_scripts': console_scripts},
zip_safe=False) # do not zip egg files after setup.py install
zip_safe=False) # do not zip egg file after setup.py install


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def setup_package():
data_files=[('.', metadata['data_files'])],
command_options=command_options,
entry_points={'console_scripts': console_scripts},
zip_safe=False) # Do not zip egg file after setup.py install
zip_safe=False) # do not zip egg file after setup.py install


if __name__ == "__main__":
Expand Down

0 comments on commit 67d9d24

Please sign in to comment.