Issues

Issue #23 resolved

Add support for toppcloud environments

Jorge Vargas
created an issue

After playing with the newest gem from Ian I think vevn wrapper should have toppcloud support.

I can see two things:

a new command mktoppcloudvirtualenv that will do exactly the same but call toppcloud init "$@" instead of virtualenv

possible a modification of workon to show a marker of which venv is a regular venv and which one is a toppcloud venv. (hint: check for app.ini)

Another option will be to add a --venvwrapper flag to toppcloud init (or make it be smart about $WORKON_HOME and put the venv in there if defined.

Comments (7)

  1. Doug Hellmann repo owner

    I haven't had time to study toppcloud, yet. What is it doing that's different from virtualenv? I thought it was a tool for deploying to remote servers?

  2. Jorge Vargas reporter

    It builds it's own basic layout which is a little different and it builds a venv for that.

    I wrote an email to ian and he explained it privately: here is what he had to say

    me: #1 what is the difference between a regular venv and a toppcloud venv? more importantly why this is needed?

    ian: The biggest thing is lib/python2.6/sitecustomize.py, which sets up the environment (e.g., CONFIG_PG_DBNAME will be set everytime you start the interpreter). The other stuff is just incidental. It also adds lib/python/ to the mix, which is a way of avoiding putting the "standard" libraries (like pip) into version control. Also distutils.cfg is set so that things automatically install into lib/python/.

    I think I'm going to play with this and try to come up with a patch that will just add some functions. Also note that due to the above cdsitepackages is "broken"

    In a nutshe ll I think 3 changes may be needed for venvwrapper

    1. mkvirtualenv clone that will call toppcloud init
    2. workon should detect the TC venv and mark it as so (more cosmetic reasons)
    3. cdsitepackages needs to change a little.

    Regarding #3 he also commented that this code should work for both types of venvs for cdsitepackages

    cdmod () {
     cd $(python -c "import os, $1; print os.path.dirname($1.__file__)")
    }
    
  3. Log in to comment