简体   繁体   中英

How make buildout add eggs to virtualenv

I have to work with few django projects that uses virtualenv (and that is fine). Except its quite hard to get this virtual setup every time I want to develop something.

So I'd like to use zc.buildout , it would solve easy environment construction issue. Unfortunately I must not break old virtualenv way of developing/deploying .

Projects heavily rely on manage.py file.

/project_root
|-- virtual
|-- website
    |-- manage.py (has to access all python packages that buildout installs)
    `-- ...

Basically I need buildout to install eggs to virtual/lib/python/site_packages folder, best would be to symlink form egg cache.

Notes:

  1. buildout generates django executable script that contains all required paths. This script gets installed into virtual/bin/ .
  2. I've tried gp.recipe.pip , but it doesn't seem to do what I need.
  3. I haven't tried rjm.recipe.venv yet

Solution

Its not perfect, but works:

  1. collect eggs to one folder using collective.recipe.omelette .
  2. add __init__.py file to this folder using cp.recipe.cmd (thanks to sureshvv ).
  3. append path to this folder in required python files (in my case its manage.py).

您可以使用cp.recipe.cmd并通过--install-dir选项运行easy_install命令

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM