# HG changeset patch # User Jeff Hammel # Date 1269889068 25200 # Node ID e6e80bf0476f6e2ce4e4545370d8a680c30a6ad8 # Parent f207357d7ca98e4a9ce61cf29b24ffa7c5ec6806 update the way checkout works; maybe should move to pip at some point diff -r f207357d7ca9 -r e6e80bf0476f buttercup/__init__.py --- a/buttercup/__init__.py Mon Mar 29 11:31:14 2010 -0700 +++ b/buttercup/__init__.py Mon Mar 29 11:57:48 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 f207357d7ca9 -r e6e80bf0476f buttercup/checkout.py --- a/buttercup/checkout.py Mon Mar 29 11:31:14 2010 -0700 +++ b/buttercup/checkout.py Mon Mar 29 11:57:48 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 @@ -25,22 +31,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 f207357d7ca9 -r e6e80bf0476f buttercup/template/setup.py --- a/buttercup/template/setup.py Mon Mar 29 11:31:14 2010 -0700 +++ b/buttercup/template/setup.py Mon Mar 29 11:57:48 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]