missing documentation on how to install extensions

Bug #1116560 reported by Antonio Terceiro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LAVA Server
Confirmed
Low
Antonio Terceiro

Bug Description

Trying to follow http://lava-server.readthedocs.org/en/latest/extending.html I did the following:

. /srv/lava/instances/development/bin/activate
cd /path/to/lava-server/demo
./setup.py develop

It blew up with:

~/demo$ ./setup.py develop
error in lava-server-demo setup command: Unable to import 'demo_app': No module named demo_app

I noticed that in the instance virtualenv, '.' is not the load path, so the only way I could install the demo app was with the following patch to setup.py:

----------------8<----------------8<----------------8<-----------------
--- /vagrant/lava-server/trunk/demo/setup.py 2012-12-03 13:37:58.722090000 +0000
+++ setup.py 2013-02-05 18:44:27.926303586 +0000
@@ -20,6 +20,9 @@

 from setuptools import setup, find_packages

+import sys
+sys.path.insert(0, '.')
+

 setup(
     name='lava-server-demo',
----------------8<----------------8<----------------8<-----------------

This feels like a hack that could be avoided if the proper way to install extensions is documented.

Tags: docs
Revision history for this message
Antonio Terceiro (terceiro) wrote :

properly formatted patch: http://paste.ubuntu.com/1613711/

Revision history for this message
Antonio Terceiro (terceiro) wrote :

if a try instead:

$ lava-develop-local /path/to/lava-server-demo

everything seems fines, but then it does not work at all. i.e. no "Demo" link at the top menu, nothing.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Ah, so sorry that this isn't documented properly. One of the things about buildout is that it separates the packages that are available -- which is what lava-develop-local manipulates -- and which packages are *used* -- this is specified by the value of the 'eggs' entry in the [server] section of the buildout config (plus the dependencies of those packages). So to install a custom extension, you need a custom buildout.cfg, somewhat like what is explained here: http://lava-deployment-tool.readthedocs.org/en/latest/#limited-deployments (except with += rather than -=)

Revision history for this message
Antonio Terceiro (terceiro) wrote :

FTR I could make it work here like this:

$ cat /srv/lava/instances/limited/buildout-custom.cfg
[buildout]
extends = buildout-development.cfg

[server]
eggs += lava-server-demo

[branches]
lava-server-demo = /home/vagrant/demo
$ grep BUILDOUT /srv/lava/instances/limited/instance.conf
LAVA_BUILDOUT_CFG='../../buildout-custom.cfg'

Changed in lava-server:
assignee: nobody → Antonio Terceiro (terceiro)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Antonio Terceiro (terceiro) wrote :

FIXED set of commands

for completeness:

for that setup to work /home/vagrant/demo must be a proper bzr repo

I copied the "demo" directory to /home/vagrant/demo, then

cd /home/vagrant/demo
bzr init
bar add .
bzr commit -m 'demo extension'

Revision history for this message
Antonio Terceiro (terceiro) wrote :

there is still a typo on comment #6, where it says "bar", it's actually "bzr"

Revision history for this message
Tyler Baker (tyler-baker) wrote :

Let try to work on this for 2013.07.

tags: added: docs
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.