[Distutils] generating pyc and pyo files

Michael P. Reilly arcege@shore.net
Mon, 29 Mar 1999 21:51:18 -0500 (EST)

> Quoth Andrew Dalke, on 28 March 1999:
> > When should the .pyc and .pyo files be generated during the
> > install process, in the "build" directory or the "install" one?
> Sounds like everyone is in favour of compiling at build time: good.
> Nobody mentioned my reason for favouring this, which is simple:
> installation should consist of nothing more than copying files and
> (possibly) changing modes and ownerships.  All files that will be
> installed should be generated at build time.  This makes lots of things
> easier, notably: installation itself; updating the mythical database of
> installed files; and creating "built distributions" such as RPM.

I disagree.  I see no reason to double the size of the distribution by
shipping redundent files (on average, a .pyc is 78.786% of a .py, based
on the Python 1.5.1 distribution; .pyo is 88.148%).

Permissions and ownerships cannot be handled at build time.  And as the
other thread (about placement of distribution files) has stated, it is
something the sys admins and installers will have to handle - and can
override.  If the person is not the sys admin, s/he will have to talk
to the the sys admin to open global areas, or deal with creating their
own areas.  Making pyc/pyo files is trivial and unnecessary (for

There is already an installation step; it's nothing to add a compileall
and chownall/chmodall step too.

> Wow, a thread where everybody agrees... we must be on to to something.

Not quite, I'm just getting my new house straightened out is all.

>         Greg


| Michael P. Reilly, Release Engineer | Email: arcege@shore.net        |
| Salem, Mass. USA  01970             |                                |