From 2c02767be849c4663851fac635ba5c5a33273a83 Mon Sep 17 00:00:00 2001 From: Forrest Voight Date: Fri, 13 Jan 2012 18:29:58 -0800 Subject: [PATCH] fixups to setup.py to include some extra required modules, bundle everything into one file, copy the READMEs, and insert a computed version into the source --- setup.py | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index f0204d5..06d7240 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,21 @@ +import os +import sys + from distutils.core import setup +import py2exe -try: - import py2exe -except ImportError: - print 'missing py2exe' +def get_version(): + root_dir = os.path.abspath(os.path.dirname(sys.argv[0])) + git_dir = os.path.join(root_dir, '.git') + head = open(os.path.join(git_dir, 'HEAD')).read().strip() + prefix = 'ref: ' + if head.startswith(prefix): + path = head[len(prefix):].split('/') + return open(os.path.join(git_dir, *path)).read().strip()[:7] + else: + return head[:7] +open('p2pool/__init__.py', 'wb').write('__version__ = %r\r\n\r\nDEBUG = False\r\n' % get_version()) setup(name='p2pool', version='1.0', @@ -12,6 +23,13 @@ setup(name='p2pool', author='Forrest Voight', author_email='forrest@forre.st', url='http://p2pool.forre.st/', + data_files=[('', ['README', 'README-Litecoin'])], console=['run_p2pool.py'], + options=dict(py2exe=dict( + bundle_files=1, + dll_excludes=['w9xpopen.exe'], + includes=['twisted.web.resource', 'ltc_scrypt'], + )), + zipfile=None, ) -- 1.7.1