[Distutils] Just an idea

Greg Ward gward@ase.com
Tue, 25 Apr 2000 21:18:07 -0400


On 25 April 2000, Harry Henry Gebel said:
> Just an idea for generating both .pyc and .pyo byte code: have a new
> command that just generates byte code in an already installed set of
> files, (perhaps `setup.py compile_only`), then spawn
> 
> python -o setup.py compile_only
> 
> from within `setup.py install`

It has to be something like that, ie. you need to spawn another python
interpreter with the opposite debug state of the current one.
Obviously, you want to spawn only one interpreter to compile all
installed files.  (Or files-to-install if you're creating a built
distribution that inclues .pyc and/or .pyo files, which is probably what
we want to do for RPM -- I think complex/time-consuming post-install
scripts are to be avoided.  Anyone have experience with this?)

The question is, is it worth the complexity and expense of a whole new
Distutils command, or should we just spawn a simple "python -c
'compileall(...)'" command, or should be generate a temporary script and
run it?

I'm leaning towards the generate-a-temporary-script approach.  Any thoughts?

        Greg
-- 
Greg Ward - just another /P(erl|ython)/ hacker          gward@python.net
http://starship.python.net/~gward/
The world is coming to an end.  Please log off.