The idea of the bootstrap script is that the bootstrap script is
responsible for creating a virtualenv with stuff installed and then
running paver to finish things off. So that bootstrap script +
pavement.py combine to set up an environment to do *something*
(whatever it is you need done). I've used it for setting up
development environments thus far.
So, the bootstrap is something you run just the first time. After
that, the easiest thing to do is
source bin/activate
and then just run paver and python as normal and have everything
happen within the virtualenv. Does that make sense?
Kevin
--
Kevin Dangoor
Product Manager
SitePen, Inc.
Web development experts:
development, support, training
>
>> I'm currently hitting an issue where a system site-packages module
>> (cjson) isn't getting copied into the virtualenv. Any idea how to
>> solve this?
I ran into something (this may be the same problem... not sure) just
getting a virtualenv installed in the first place. I was trying to run
virtualenv as a non-root user and it was failing because it was trying
to install setuptools globally. It turns out that the system python
dir had a distutils.cfg in lib/python/distutils. My solution was to
override that with a setup.cfg in the current directory (the top of
the virtualenv, where I was running the command).
Kevin
> The way I'm trying to approach it thus far:
>
> - kick off initial "paver" task using my system-installed Python
> - clean: rm -rf ./install
> - mkdir ./install
> - "bootstrap" task: create ./install/bootstrap.py, then run it
> - run my subtasks ("python setup.py install") using ./install/bin/
> python
>
> As you'll note, I don't use bin/activate -- I'm not running any manual
> shell commands whatsoever. This must all be kicked off by a master
> process. (Hence, why I'm looking at Paver in the first place.)
Usually, the "bootstrap" task is run once (or infrequently). You would
check the resulting script into your source control or distribute it
in some other fashion. That way, the target system does not need
virtualenv at all.
> There's also little point in recycling a previously-build virtualenv.
> To reuse it, I would have to guarantee absolutely all of my previous
> build artifacts were removed. It's probably better to just nuke it
> entirely and focus on recreating it quickly. (And thus have a build-
> install-test process that is stateless and trivially bootstrapped on
> new boxes.)
Yeah, nuking the build virtualenv makes sense.
> I'm currently hitting an issue where a system site-packages module
> (cjson) isn't getting copied into the virtualenv. Any idea how to
> solve this?
Does virtualenv actually copy the system site-packages modules in, or
just include them in the pythonpath? I didn't think it actually copied
them. I could be wrong, though, because I hadn't looked at that
machinery.
> It's also unfortunate that easy_install always makes requests to
> pypi.python.org every time, but I can probably install a Squid proxy
> and run the requests through that to remove some of the overhead.
>
Check out Ian Bicking's new pyinstall: http://blog.ianbicking.org/2008/09/23/pyinstall-a-new-hope/
That will likely help you already, and Ian is certainly very open to
patches.
Kevin