Mailing List Archive

Distutils for the std. library (was: Expat module)
On 30 March 2000, Andrew M. Kuchling said:
> Should we consider replacing the makesetup/Setup.in mechanism with a
> setup.py script that uses the Distutils? You'd have to compile a
> minipython with just enough critical modules -- strop and posixmodule
> are probably the most important ones -- in order to run setup.py.
> It's something I'd like to look at for 1.6, because then you could be
> much smarter in automatically enabling modules.

Gee, I didn't think anyone was gonna open *that* can of worms for 1.6.
Obviously, I'd love to see the Distutils used to build parts of the
Python library. Some possible problems:

* Distutils relies heavily on the sys, os, string, and re modules,
so those would have to be built and included in the mythical
mini-python (as would everything they rely on -- strop, pcre, ... ?)

* Distutils currently assumes that it's working with an installed
Python -- it doesn't know anything about working in the Python
source tree. I think this could be fixed just be tweaking the
distutils.sysconfig module, but there might be subtle assumptions
elsewhere in the code.

* I haven't written the mythical Autoconf-in-Python yet, so we'd still have
to rely on either the configure script or user intervention to find
out whether library X is installed, and where its header and library
files live (for X in zlib, tcl, tk, ...).

Of course, the configure script would still be needed to build the
mini-python, so it's not going away any time soon.

Greg
Re: Distutils for the std. library (was: Expat module) [ In reply to ]
On Fri, 31 Mar 2000, Greg Ward wrote:

> Gee, I didn't think anyone was gonna open *that* can of worms for 1.6.

Well, it's not like it's not a lot of work, but it could be done, with
liberal interpretation of "mini": include in "mini" Python *all* modules
which do not rely on libraries not distributed with the Python core --
zlib, expat and Tkinter go right out the window, but most everything
else can stay. That way, Distutils can use all modules it currently
uses <wink>.

The other problem, file-location, is a problem I have talked about
earlier: it *cannot* be assumed that the default place for putting new
libraries is the same place the Python interpreter resides, for many
reasons. Why not ask the user explicitly?


--
Moshe Zadka <mzadka@geocities.com>.
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com
Re: Distutils for the std. library (was: Expat module) [ In reply to ]
Greg> * Distutils relies heavily on the sys, os, string, and re
Greg> modules, so those would have to be built and included in the
Greg> mythical mini-python (as would everything they rely on --
Greg> strop, pcre, ... ?)

With string methods in 1.6, reliance on the string and strop modules should
be lessened or eliminated, right? re and os may need a tweak or two to use
string methods themselves. The sys module is always available. Perhaps it
would make sense to put sre(module)?.c into the Python directory where
sysmodule.c lives. That way, a Distutils-capable mini-python could be built
without messing around in the Modules directory at all...

--
Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/
Re: Distutils for the std. library (was: Expat module) [ In reply to ]
On 31 March 2000, Skip Montanaro said:
> With string methods in 1.6, reliance on the string and strop modules should
> be lessened or eliminated, right? re and os may need a tweak or two to use
> string methods themselves. The sys module is always available. Perhaps it
> would make sense to put sre(module)?.c into the Python directory where
> sysmodule.c lives. That way, a Distutils-capable mini-python could be built
> without messing around in the Modules directory at all...

But I'm striving to maintain compatability with (at least) Python 1.5.2
in Distutils. That need will fade with time, but it's not going to
disappear the moment Python 1.6 is released. (Guess I'll have to find
somewhere else to play with string methods and extended call syntax).

Greg