[Python-Dev] Re: packaging Tkinter separately from core Python
Greg Ward
gward@python.net
Wed, 13 Sep 2000 22:53:51 -0400
On 13 September 2000, Guido van Rossum said:
> Hm. Would it be easier to have Tkinter.py and friends be part of the
> core distribution, and place only _tkinter and Tcl/Tk in the Tkinter
> RPM?
That seems unnecessarily complex.
> If that's not good, I would recommend installing as a subdir of
> site-packages, with a .pth file pointing to that subdir, e.g.:
And that seems nice. ;-)
Much easier to get the Distutils to install a .pth file than to do evil
trickery to make it install into, eg., the standard library: just use
the 'extra_path' option. Eg. in the NumPy setup script
(distutils/examples/numpy_setup.py):
extra_path = 'Numeric'
means put everything into a directory "Numeric" and create
"Numeric.pth". If you want different names, you have to make
'extra_path' a tuple:
extra_path = ('tkinter', 'tkinter-lib')
should get your example setup:
> site-packages/
> tkinter.pth ".../site-packages/tkinter-lib"
> tkinter-lib/
> _tkinter.so
> Tkinter.py
> Tkconstants.py
> ...etc...
But it's been a while since this stuff was tested.
BTW, is there any good reason to call that directory "tkinter-lib"
instead of "tkinter"? Is that the preferred convention for directories-
full-of-modules that are not packages?
Greg
--
Greg Ward gward@python.net
http://starship.python.net/~gward/