[Zope-dev] docs.zope.org automation

Hanno Schlichting hanno at hannosch.eu
Tue Aug 3 17:35:00 EDT 2010


On Tue, Aug 3, 2010 at 11:05 PM, Jens Vagelpohl <jens at dataflake.org> wrote:
> I understand that. But it must be possible to do that programatically in
> my code. I mean, "setup.py --long-description" obviously executes Python
> code, which I may be able to execute myself in my current interpreter
> session by importing and executing stuff from setuptools. Having to
> invoke another Python interpreter in a subshell because that's too
> complicated to do any other way is awful.

Maybe this gets you a bit further:

import os
from setuptools.sandbox import run_setup

package = os.path.join(os.curdir, 'zope.component')
os.chdir(package)
run_setup('setup.py', ['--long-description'])
os.chdir(os.pardir)


The run_setup call seems to dump the output to sys.stdout which might
be a bit painful to grab.

Hanno


More information about the Zope-Dev mailing list