# HG changeset patch # User Jeff Hammel # Date 1284044774 25200 # Node ID 064d247e6ed38b7f439f8b73beb7da706d06e73e # Parent fa1dfcb2ec6a0f748f92cf1d17c3767f0b1c20b5# Parent 9a37a94fed68fe851583f4ed1e03c641707a9884 not sure what happened here diff -r 9a37a94fed68 -r 064d247e6ed3 buttercup/__init__.py --- a/buttercup/__init__.py Wed Jul 28 20:40:39 2010 -0700 +++ b/buttercup/__init__.py Thu Sep 09 08:06:14 2010 -0700 @@ -1,4 +1,5 @@ from paste.script import templates +from checkout import sources var = templates.var @@ -16,6 +17,9 @@ """ called before the template is applied """ + src = sources() + vars['install_requires'] = '\n'.join([repr(s[0])+',' + for s in src]) def post(self, command, output_dir, vars): """ diff -r 9a37a94fed68 -r 064d247e6ed3 buttercup/checkout.py --- a/buttercup/checkout.py Wed Jul 28 20:40:39 2010 -0700 +++ b/buttercup/checkout.py Thu Sep 09 08:06:14 2010 -0700 @@ -4,6 +4,12 @@ checks out the source as associated with the buttercup package """ +# XXX could/should use e.g. +# pip install --editable hg+https://slinkp@bitbucket.org/slinkp/purplevoter#egg=purplevoter +# -or - +# pip install -r foo.txt + +import os import sys import subprocess from optparse import OptionParser @@ -11,6 +17,7 @@ HG='http://k0s.org/hg' PACKAGES=['bitsyauth', 'bitsyblog', + 'bitsytweet', 'buttercup', 'clwapp', 'commentator', @@ -25,22 +32,38 @@ 'webob_view', 'wordstream'] +def sources(): + return [(package, '%s/%s' % (HG, package)) + for package in PACKAGES ] + def main(args=sys.argv[1:]): parser = OptionParser() + parser.add_option('--install', action="store_true", default=False, + help="install the packages") parser.add_option('--list', action="store_true", default=False, help="list the source to be installed") options, args = parser.parse_args(args) - sources = ['%s/%s' % (HG, package) - for package in PACKAGES ] - + sources = globals()['sources']() if options.list: for source in sources: - print source + print source[0], source[1] sys.exit(0) + assert 'VIRTUAL_ENV' in os.environ + src = os.path.join(os.environ['VIRTUAL_ENV'], 'src') + if not os.path.exists(src): + os.mkdir(src) + os.chdir(src) + for source in sources: - subprocess.call(['hg', 'clone', source]) + subprocess.call(['hg', 'clone', source[1]]) + + if options.install: + for source in sources: + os.chdir(source[0]) + subprocess.call(['python', 'setup.py', 'develop']) + os.chdir('..') if __name__ == '__main__': main() diff -r 9a37a94fed68 -r 064d247e6ed3 buttercup/template/setup.py --- a/buttercup/template/setup.py Wed Jul 28 20:40:39 2010 -0700 +++ b/buttercup/template/setup.py Thu Sep 09 08:06:14 2010 -0700 @@ -12,18 +12,7 @@ license="", packages=find_packages(exclude=['ez_setup', 'examples', 'tests*']), include_package_data=True, - install_requires = [ - 'PasteScript', - 'decoupage', - 'contenttransformer', - 'montage', - 'cropresize', - 'hgpaste', - 'wordstream', - 'bitsyblog', - 'bitsyauth', - 'clwapp', - ], + install_requires = [ ${install_requires} ], zip_safe=False, entry_points = """ [paste.paster_create_template]