On Sun, Apr 12, 2009 at 2:56 AM, Noah Gift <[email protected]> wrote:
>
> I said I would get this done this weekend, so here it is:
>
> If you check out go-pylons.txt and the README.txt, it shows that I
> simply added a resource directory that will contain all of the code
> for a framework.  Next I added these lines to the go-pylons.py
> boostrap script:
>
> #hack to install local source code
>   path = "resources"
>   for dir in os.listdir(path):
>       source_dir = "%s/%s" % (path,dir)
>       subprocess.call([join(bin_dir, 'easy_install'),
>       source_dir])
>
> This should work for any framework, but I need to write something to
> parse a setup.py and then run:
> easy_install -eb resources "found egg"
> "found egg" being the egg found in setup.py
>
> http://bitbucket.org/noahgift/bootstrap_pylons/
>
> At this point it only took about 5 lines a code, but if we want to
> automatically parse setup.py it may take a bit more work.  I wonder
> what Ian thinks of this?  Anyone feel free to slice, and dice, and
> fix.

I gave it a test run on Linux.  According to the output, it installed
resources/pylons, and then downloaded all the dependencies.  The
virtualenv has everything installed in the easy_install manner (i.e.,
.egg directories).

It looks like a good start.  Four comments:

- I would rename resources/pylons to resources/Pylons so that it's
clear it's a source directory and not a package or a preinstalled
package.  I had to guess from the contents what it was.

- Virtualenv is going to automatically install pip soon, so I would do
a pip-based install.  For now you can put pip in resouces,
easy_install it, and then pip install the rest.  That would eliminate
most of the entries in easy-install.pth.  (One problem is that pip
doesn't install from source directories without the -e option.  I
don't know why that is.)

- Is there some advantage to putting the source directories in
resources/ unpacked rather than just copying the tarballs from
http://pylonshq.com/download ?  Since easy_install/pip know how to
unpack them, I'm not sure if the slight added efficiency is worth it.

- Is there a way to call easy_install without using subprocess?  I'm
always leery of scripts that call subprocesses, since they can break
if the path or environment isn't what's expected.  But that may be an
advanced issue to deal with later.

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to