summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-07-05 21:57:07 -0400
committerMonty Taylor <mordred@inaugust.com>2013-07-05 22:00:09 -0400
commit72d3f88a83e47a99cbab0ba71b84ea2c0c981c18 (patch)
treed14c9b541dbd12e32a45deaeb9d71c4e44b462b9
parenta451014dd6d8798f3bc86e20e4c8c34e91340f49 (diff)
downloadoslo-72d3f88a83e47a99cbab0ba71b84ea2c0c981c18.tar.gz
oslo-72d3f88a83e47a99cbab0ba71b84ea2c0c981c18.tar.xz
oslo-72d3f88a83e47a99cbab0ba71b84ea2c0c981c18.zip
Stop using distribute in install_venv_common
Upstream distribute is dead and has been merged back into setuptools. Additionally, enhancements have been made to both setuptools and pip that mean we no longer have to carry hacks around versions. Also, we don't need to install greenlet here. Order is respected in requirements.txt. Also, let's kill the pip_requires verbage. Change-Id: Ia15c66d6a03522e804ff96fd6f8d81db00467a6e
-rw-r--r--tools/install_venv_common.py42
1 files changed, 16 insertions, 26 deletions
diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py
index 42a44e8..f428c1e 100644
--- a/tools/install_venv_common.py
+++ b/tools/install_venv_common.py
@@ -34,12 +34,13 @@ import sys
class InstallVenv(object):
- def __init__(self, root, venv, pip_requires, test_requires, py_version,
+ def __init__(self, root, venv, requirements,
+ test_requirements, py_version,
project):
self.root = root
self.venv = venv
- self.pip_requires = pip_requires
- self.test_requires = test_requires
+ self.requirements = requirements
+ self.test_requirements = test_requirements
self.py_version = py_version
self.project = project
@@ -75,11 +76,13 @@ class InstallVenv(object):
def get_distro(self):
if (os.path.exists('/etc/fedora-release') or
os.path.exists('/etc/redhat-release')):
- return Fedora(self.root, self.venv, self.pip_requires,
- self.test_requires, self.py_version, self.project)
+ return Fedora(
+ self.root, self.venv, self.requirements,
+ self.test_requirements, self.py_version, self.project)
else:
- return Distro(self.root, self.venv, self.pip_requires,
- self.test_requires, self.py_version, self.project)
+ return Distro(
+ self.root, self.venv, self.requirements,
+ self.test_requirements, self.py_version, self.project)
def check_dependencies(self):
self.get_distro().install_virtualenv()
@@ -98,11 +101,6 @@ class InstallVenv(object):
else:
self.run_command(['virtualenv', '-q', self.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.')
else:
print("venv already exists...")
pass
@@ -116,20 +114,12 @@ class InstallVenv(object):
print('Installing dependencies with pip (this can take a while)...')
# First things first, make sure our venv has the latest pip and
- # distribute.
- # NOTE: we keep pip at version 1.1 since the most recent version causes
- # the .venv creation to fail. See:
- # https://bugs.launchpad.net/nova/+bug/1047120
- self.pip_install('pip==1.1')
- self.pip_install('distribute')
-
- # Install greenlet by hand - just listing it in the requires file does
- # not
- # get it installed in the right order
- self.pip_install('greenlet')
-
- self.pip_install('-r', self.pip_requires)
- self.pip_install('-r', self.test_requires)
+ # setuptools.
+ self.pip_install('pip>=1.3')
+ self.pip_install('setuptools')
+
+ self.pip_install('-r', self.requirements)
+ self.pip_install('-r', self.test_requirements)
def post_process(self):
self.get_distro().post_process()