Jens Vagelpohl 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.
Yeah, this is why setup.py sucks ;-)
I've just been doing some build and release tools for a customer that
involve this sort of stuff, I resorted to:
with nested(Replacer(),OutputCapture()) as (r,o):
curdir = os.getcwd()
# yuk, but setup.py is yuk anyway!
if 'setup' in sys.modules:
..in my tests, the del from sys.modules is to allow this to by done
multiple times in one process.
OutputCapture looks like:
self.original_stdout = sys.stdout
self.original_stderr = sys.stderr
self.output = sys.stdout = sys.stderr = StringIO()
sys.stdout = self.original_stdout
sys.stderr = self.original_stderr
> Having to
> invoke another Python interpreter in a subshell because that's too
> complicated to do any other way is awful.
Yeah, I do resort to this for some things too ;-)
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -