Make versioneer work from subdirectory

This commit is contained in:
Sebastian Messmer 2016-03-02 11:02:49 +01:00
parent 5f3b28262c
commit f69cc4492f
3 changed files with 6 additions and 2 deletions

3
.gitignore vendored
View File

@ -4,3 +4,6 @@ umltest.status
/cmake
/.idea
*~
gitversion/*.pyc
gitversion/__pycache__

View File

@ -2,4 +2,4 @@
import versioneer
print versioneer.get_version()
print(versioneer.get_version())

View File

@ -1048,7 +1048,8 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
expanded, and _version.py hasn't already been rewritten with a short
version string, meaning we're inside a checked out source tree.
"""
if not os.path.exists(os.path.join(root, ".git")):
# -- (MESSMER) CHANGED FOLLOWING LINE TO LOOK FOR ../.git instead of .git --
if not os.path.exists(os.path.join(root, "../.git")):
if verbose:
print("no .git in %s" % root)
raise NotThisMethod("no .git directory")