Commits

Brent Tubbs committed 0a8e78d

use own distribute and pip in making new virtualenv instead of pulling from pypi

  • Participants
  • Parent commits ff412ac

Comments (0)

Files changed (4)

 include README.rst
 include LICENSE.txt
 include silk/deps.yaml
+include silk/prereqs *
 recursive-include silk/conf_templates *
 recursive-include silk/site_templates *

File silk/fabfile.py

 from fabric.api import *
 from fabric.colors import green, red, yellow
 from fabric.contrib.files import exists, contains, upload_template
+from fabric.contrib.project import rsync_project
 
 import silk.lib
 
         pyversion = '--python=%s' % env.config['runtime']
     else:
         pyversion = ''
-    cmd = "virtualenv --no-site-packages %s %s" % (pyversion, env.envdir)
-    sudo(cmd)
+
+    # Put all the prereq packages into /srv/pip_cache on the remote host, if
+    # they're not already there.
+    local_dir = pkg_resources.resource_filename('silk', 'prereqs')
+    # Ensure that local_dir ends in a slash so we just rsync the contents and
+    # not the whole folder.
+    if not local_dir.endswith('/'):
+        local_dir += '/'
+
+    tmpl_vars = vars()
+    tmpl_vars.update(env)
+    tmpl_vars['dest'] = '%(user)s@%(host)s:/tmp/' % tmpl_vars
+    local('rsync -Orvz %(local_dir)s %(dest)s' % tmpl_vars)
+
+    c = ("virtualenv --no-site-packages %(pyversion)s --extra-search-dir=/tmp "
+         "--never-download %(envdir)s") % tmpl_vars
+    sudo(c)
 
 def pip_deps():
     """Install requirements listed in the site's requirements.txt file."""

File silk/prereqs/distribute-0.6.21.tar.gz

Binary file added.

File silk/prereqs/pip-1.0.2.tar.gz

Binary file added.