annotate setup.py @ 98:9ba5c3df5e30

automagically install buildbotcustom
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 13 Jan 2011 11:20:57 -0800
parents 2de829d2c3f7
children 3b3c83f803b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
98
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
1 import os, sys
0
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 from setuptools import setup, find_packages
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 version = '0.0'
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 setup(name='autobot',
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 version=version,
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 description="buildbot incarnation for Mozilla AutoTools team",
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 long_description="""\
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 """,
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 keywords='buildbot automation',
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 author='Jeff Hammel',
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 author_email='jhammel@mozilla.com',
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 url='https://wiki.mozilla.org/Auto-tools',
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 license='MPL',
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 include_package_data=True,
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 zip_safe=False,
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 install_requires=[
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 # -*- Extra requirements: -*-
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 'buildbot',
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 'buildbot-slave',
91
2de829d2c3f7 add dependency on MakeItSo
Jeff Hammel <jhammel@mozilla.com>
parents: 67
diff changeset
24 'virtualenv',
2de829d2c3f7 add dependency on MakeItSo
Jeff Hammel <jhammel@mozilla.com>
parents: 67
diff changeset
25 'MakeItSo',
0
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 ],
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 entry_points="""
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28 # -*- Entry points: -*-
15
d7c4e9d6d9dd note console_script
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
29 [console_scripts]
23
a32a7055f3e6 combine variables for buildbot master+slave
Jeff Hammel <jhammel@mozilla.com>
parents: 20
diff changeset
30 create-autobot = autobot.template:create_autobot
20
30ec24255ce9 stub out having a slave template too
Jeff Hammel <jhammel@mozilla.com>
parents: 15
diff changeset
31 create-autobot-master = autobot.template:create_master
30ec24255ce9 stub out having a slave template too
Jeff Hammel <jhammel@mozilla.com>
parents: 15
diff changeset
32 create-autobot-slave = autobot.template:create_slave
67
e8dabfd24c42 stub for a template to create new autobot factories; unfinished
Jeff Hammel <jhammel@mozilla.com>
parents: 23
diff changeset
33 create-autobot-project = autobot.template:create_project
0
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34 """,
8e14b6322cc7 initial stub for ateam buildbot
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 )
98
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
36
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
37 def install_hg(sources):
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
38 """
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
39 - sources : dict of hg sources to install: {'package': 'http://hg...'}
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
40 """
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
41 try:
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
42 from subprocess import check_call as call
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
43 except:
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
44 from subprocess import call
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
45
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
46 # see if you can find site-packages
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
47 import site
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
48 site_dir = os.path.abspath(os.path.dirname(site.__file__))
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
49 site_packages = os.path.join(site_dir, 'site-packages')
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
50 if not (os.path.exists(site_packages) and os.path.isdir(site_packages)):
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
51 raise IOError("Cannot find site-packages directory")
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
52
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
53 # figure out what you need to install
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
54 missing = set()
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
55 for source in sources:
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
56 try:
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
57 __import__(source)
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
58 except ImportError:
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
59 missing.add(source)
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
60
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
61 # install it
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
62 for source in missing:
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
63 call(['hg', 'clone', sources[source],
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
64 os.path.join(site_packages, source)])
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
65
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
66 ### install unpackaged dependencies
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
67 source = {'buildbotcustom': 'http://hg.mozilla.org/build/buildbotcustom'}
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
68 if set(['install', 'develop']).intersection(sys.argv[1:]):
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
69 try:
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
70 install_hg(source)
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
71 except:
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
72 print 'Please make sure the source is installed:'
9ba5c3df5e30 automagically install buildbotcustom
Jeff Hammel <jhammel@mozilla.com>
parents: 91
diff changeset
73 print source