summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDevananda van der Veen <devananda.vdv@gmail.com>2013-05-07 16:36:49 -0700
committerDevananda van der Veen <devananda.vdv@gmail.com>2013-05-07 16:47:49 -0700
commit05e9ce4c489adc24c4f70d01f4182a9d64fcf582 (patch)
treee157760a521f43a6fc248fcb107b8867cab41215 /tools
parent089e2ff25b963cbad11338edbfe245b6027ecf4e (diff)
downloadironic-05e9ce4c489adc24c4f70d01f4182a9d64fcf582.tar.gz
Import add'l files from Nova
Import lots of files from Nova at rev f0da3464ab17552f24977d22365fa9573702f5a8
Diffstat (limited to 'tools')
-rw-r--r--tools/flakes.py24
-rw-r--r--tools/install_venv_common.py39
-rw-r--r--tools/pip-requires30
-rw-r--r--tools/test-requires17
4 files changed, 93 insertions, 17 deletions
diff --git a/tools/flakes.py b/tools/flakes.py
new file mode 100644
index 000000000..191bd6eab
--- /dev/null
+++ b/tools/flakes.py
@@ -0,0 +1,24 @@
+"""
+ wrapper for pyflakes to ignore gettext based warning:
+ "undefined name '_'"
+
+ Synced in from openstack-common
+"""
+
+__all__ = ['main']
+
+import __builtin__ as builtins
+import sys
+
+import pyflakes.api
+from pyflakes import checker
+
+
+def main():
+ checker.Checker.builtIns = (set(dir(builtins)) |
+ set(['_']) |
+ set(checker._MAGIC_GLOBALS))
+ sys.exit(pyflakes.api.main())
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py
index f0a1722c3..914fcf17e 100644
--- a/tools/install_venv_common.py
+++ b/tools/install_venv_common.py
@@ -18,10 +18,15 @@
"""Provides methods needed by installation script for OpenStack development
virtual environments.
+Since this script is used to bootstrap a virtualenv from the system's Python
+environment, it should be kept strictly compatible with Python 2.6.
+
Synced in from openstack-common
"""
-import argparse
+from __future__ import print_function
+
+import optparse
import os
import subprocess
import sys
@@ -39,7 +44,7 @@ class InstallVenv(object):
self.project = project
def die(self, message, *args):
- print >> sys.stderr, message % args
+ print(message % args, file=sys.stderr)
sys.exit(1)
def check_python_version(self):
@@ -86,20 +91,20 @@ class InstallVenv(object):
virtual environment.
"""
if not os.path.isdir(self.venv):
- print 'Creating venv...',
+ print('Creating venv...', end=' ')
if no_site_packages:
self.run_command(['virtualenv', '-q', '--no-site-packages',
self.venv])
else:
self.run_command(['virtualenv', '-q', self.venv])
- print 'done.'
- print 'Installing pip in venv...',
+ print('done.')
+ print('Installing pip in venv...', end=' ')
if not self.run_command(['tools/with_venv.sh', 'easy_install',
'pip>1.0']).strip():
self.die("Failed to install pip.")
- print 'done.'
+ print('done.')
else:
- print "venv already exists..."
+ print("venv already exists...")
pass
def pip_install(self, *args):
@@ -108,7 +113,7 @@ class InstallVenv(object):
redirect_output=False)
def install_dependencies(self):
- print 'Installing dependencies with pip (this can take a while)...'
+ print('Installing dependencies with pip (this can take a while)...')
# First things first, make sure our venv has the latest pip and
# distribute.
@@ -131,12 +136,12 @@ class InstallVenv(object):
def parse_args(self, argv):
"""Parses command-line arguments."""
- parser = argparse.ArgumentParser()
- parser.add_argument('-n', '--no-site-packages',
- action='store_true',
- help="Do not inherit packages from global Python "
- "install")
- return parser.parse_args(argv[1:])
+ parser = optparse.OptionParser()
+ parser.add_option('-n', '--no-site-packages',
+ action='store_true',
+ help="Do not inherit packages from global Python "
+ "install")
+ return parser.parse_args(argv[1:])[0]
class Distro(InstallVenv):
@@ -150,12 +155,12 @@ class Distro(InstallVenv):
return
if self.check_cmd('easy_install'):
- print 'Installing virtualenv via easy_install...',
+ print('Installing virtualenv via easy_install...', end=' ')
if self.run_command(['easy_install', 'virtualenv']):
- print 'Succeeded'
+ print('Succeeded')
return
else:
- print 'Failed'
+ print('Failed')
self.die('ERROR: virtualenv not found.\n\n%s development'
' requires virtualenv, please install it using your'
diff --git a/tools/pip-requires b/tools/pip-requires
new file mode 100644
index 000000000..05a103ee9
--- /dev/null
+++ b/tools/pip-requires
@@ -0,0 +1,30 @@
+SQLAlchemy>=0.7.8,<0.7.99
+Cheetah>=2.4.4
+amqplib>=0.6.1
+anyjson>=0.2.4
+argparse
+boto
+eventlet>=0.9.17
+kombu>=1.0.4
+lxml>=2.3
+routes>=1.12.3
+WebOb==1.2.3
+greenlet>=0.3.1
+PasteDeploy>=1.5.0
+paste
+sqlalchemy-migrate>=0.7.2
+netaddr>=0.7.6
+suds>=0.4
+paramiko
+pyasn1
+Babel>=0.9.6
+iso8601>=0.1.4
+httplib2
+setuptools_git>=0.4
+python-cinderclient>=1.0.1
+python-quantumclient>=2.2.0,<3.0.0
+python-glanceclient>=0.5.0,<2
+python-keystoneclient>=0.2.0
+stevedore>=0.7
+websockify<0.4
+oslo.config>=1.1.0
diff --git a/tools/test-requires b/tools/test-requires
new file mode 100644
index 000000000..1318ecd9a
--- /dev/null
+++ b/tools/test-requires
@@ -0,0 +1,17 @@
+# Packages needed for dev testing
+distribute>=0.6.24
+
+coverage>=3.6
+discover
+feedparser
+fixtures>=0.3.12
+mox==0.5.3
+MySQL-python
+psycopg2
+pep8==1.3.3
+pyflakes
+pylint==0.25.2
+python-subunit
+sphinx>=1.1.2
+testrepository>=0.0.13
+testtools>=0.9.27