Skip to content

Create macros.cfg file to generate a virtual environment

Thomas Leymonerie requested to merge tleymone/slapos:macro_recipe_build into master

This merge request replaces https://lab.nexedi.com/nexedi/slapos.recipe.build/merge_requests/15.

Rather creating a recipe or extending zc.recipe.egg, I created a macro with slapos.recipe.build as suggested by Julien.

I've put in component/macros.cfg so it can be reused.

You can use it like this :

[buildout]
extends = 
   ../../component/macros.cfg

[django-tutorial]
<= macro-virtual-env
location = ${buildout:directory}/activate
eggs = Django

This will create a script activate in the buildout bin directory. After that, all you have to do is source the script and you will have a virtual environment with Django. The script only works in POSIX and bash-like shell.

The virtual environment can be deactivated by calling deactivate.

Edited by Xavier Thompson

Merge request reports