Mercurial > hg > buttercup
changeset 8:064d247e6ed3
not sure what happened here
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 09 Sep 2010 08:06:14 -0700 |
parents | fa1dfcb2ec6a (diff) 9a37a94fed68 (current diff) |
children | fe197282c615 |
files | |
diffstat | 3 files changed, 33 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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): """
--- 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()
--- 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]