Skip to content

Commit

Permalink
getting version from git or failing
Browse files Browse the repository at this point in the history
  • Loading branch information
gcmalloc committed Nov 28, 2012
1 parent 190e8e2 commit 87bec4c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@
except ImportError:
sys.stderr.write("Cannot import py2exe")
import os
import subprocess

"""This will create an exe that needs Microsoft Visual C++ 2008 Redistributable Package"""
"""The p2exe option will create an exe that needs Microsoft Visual C++ 2008 Redistributable Package.
python setup.py py2exe
You can also build a zip executable with
python setup.py bdist --format=zip
"""

# If run without args, build executables
if len(sys.argv) == 1:
sys.argv.append("py2exe")

# os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # conflict with wine-py2exe.sh
sys.path.append('./youtube_dl')
#sys.path.append('./youtube_dl')

options = {
"bundle_files": 1,
Expand All @@ -29,11 +36,10 @@
}]

init_file = open('./youtube_dl/__init__.py')
for line in init_file.readlines():
if line.startswith('__version__'):
version = line[11:].strip(" ='\n")
break
else:

try:
version = subprocess.checkoutput(["git", "describe", "--abbrev=0", "--tags"])
except:
version = ''

setup(name='youtube-dl',
Expand Down

0 comments on commit 87bec4c

Please sign in to comment.