Skip to content

Commit

Permalink
version: Fix version lookup for virtualenv installs
Browse files Browse the repository at this point in the history
Previously when the package was being installed in a virtualenv
in somebody else's git repository the package would pick up and
use the git repository to determine the appropriate version.
  • Loading branch information
allancaffee committed Aug 24, 2011
1 parent 789016f commit b5f6e3c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions version.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@
__all__ = ("get_git_version")

from subprocess import Popen, PIPE
from os.path import isdir


def call_git_describe():

# If the current directory doesn't have a .git directory than we may be
# inside of somebody else's git repos. This can happen if someone installs
# our package from their project directory (e.g. with virtualenv).
if not isdir('.git'):
return None

try:
# Work around an apparent bug in git:
# http://comments.gmane.org/gmane.comp.version-control.git/178169
Expand Down

0 comments on commit b5f6e3c

Please sign in to comment.