Skip to content

Commit

Permalink
Take 2: don't import pygsm during install process as it may break
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasmcnulty committed Aug 18, 2011
1 parent e23a8ef commit 7a8cae0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
15 changes: 0 additions & 15 deletions lib/pygsm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,3 @@

from gsmmodem import GsmModem
__doc__ = GsmModem.__doc__

def get_version():
try:
# do we have a static version set from an install?
from __version__ import VERSION as version
except ImportError:
# if not, can we figure it out from the git tag?
import commands
try:
# see http://stackoverflow.com/questions/62264/#72874
version = commands.getoutput("git describe --tags --always")
except:
# otherwise, give up!
version = "unknown"
return version
18 changes: 17 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,23 @@
# are tagged with a reasonably exact git version.
#
sys.path = ["lib"] + sys.path
version = __import__("pygsm").get_version()

def get_version():
try:
# do we have a static version set from an install?
from __version__ import VERSION as version
except ImportError:
# if not, can we figure it out from the git tag?
import commands
try:
# see http://stackoverflow.com/questions/62264/#72874
version = commands.getoutput("git describe --tags --always")
except:
# otherwise, give up!
version = "unknown"
return version

version = get_version()

class build_py (_build_py):
def run (self):
Expand Down

0 comments on commit 7a8cae0

Please sign in to comment.