Skip to content

Commit

Permalink
Fix for Bug #888820 - pip-requires file support for plugins
Browse files Browse the repository at this point in the history
Change-Id: I6e0833ec0c875ec38db419a88fd6c2db02142f08
  • Loading branch information
tylesmit committed Mar 12, 2011
1 parent 881a685 commit 3760868
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions plugins/cisco-plugin/pip-requires
@@ -0,0 +1 @@
http://github.com/CiscoSystems/ncclient.git
17 changes: 14 additions & 3 deletions tools/install_venv.py
Expand Up @@ -31,7 +31,14 @@
ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
VENV = os.path.expanduser('~/.quantum-venv')
VENV_EXISTS = bool(os.path.exists(VENV))
PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires')

# Find all pip-requires in the project
PIP_REQUIRES = []
for root, dirs, files in os.walk(os.path.join(ROOT)):
for f in files:
if f == 'pip-requires':
if os.path.isfile(os.path.join(root, f)):
PIP_REQUIRES.append(os.path.join(root, f))


def die(message, *args):
Expand Down Expand Up @@ -92,8 +99,12 @@ def install_dependencies(venv=VENV):

# Install greenlet by hand - just listing it in the requires file does not
# get it in stalled in the right order
run_command(['tools/with_venv.sh', 'pip', 'install', '-E', venv,
'-r', PIP_REQUIRES], redirect_output=False)
# Create an install command with all found PIP_REQUIRES
cmd = ['tools/with_venv.sh', 'pip', 'install', '-E', venv]
for p in PIP_REQUIRES:
cmd.extend(['-r', p])

run_command(cmd, redirect_output=False)

# Tell the virtual env how to "import quantum"
pthfile = os.path.join(venv, "lib", "python2.6", "site-packages",
Expand Down

0 comments on commit 3760868

Please sign in to comment.