How to disable tk inclusion in py build

V

venkatbo

Hi folks,

I'd like to disable the inclusion of tk graphics lib in my py build.
Looked around but couldn't find a clear answer. Which one of
the following would I need to use in the configure step:
--disable-tkbuild
--without-tk

Thanks,
/venkat
 
F

Fredrik Lundh

I'd like to disable the inclusion of tk graphics lib in my py build.
Looked around but couldn't find a clear answer. Which one of
the following would I need to use in the configure step:
--disable-tkbuild
--without-tk

since _tkinter.so is only built if it's found by the setup script,
and if built, it's only loaded if you actually use it, why bother
"disabling" it ?

</F>
 
V

venkatbo

Hi Fredrick,
since _tkinter.so is only built if it's found by the setup script,
and if built, it's only loaded if you actually use it, why bother
"disabling" it ?

I don't want it to build tk into the py dist, even if it finds it on
the build box - its not needed in the deployment. Keeping it
out will make the deployed pkg leaner. Don't want end-users
accessing it, since its not meant to be accessed.

Thanks,
/venkat
 
F

Fredrik Lundh

I don't want it to build tk into the py dist, even if it finds it on
the build box - its not needed in the deployment. Keeping it
out will make the deployed pkg leaner.

so don't deploy it.

if you want a lean package, you should use a deployment script that copies
the stuff you need; relying on the build process isn't very reliable (and means
more work when it's time to upgrade to a newer Python).

</F>
 
V

venkatbo

I'd like to disable the inclusion of tk graphics lib in my py build.
Looked around but couldn't find a clear answer. Which one of
the following would I need to use in the configure step:
--disable-tkbuild
--without-tk

In case anyone is intereted, as it turns out, one way of achieving
this is to disable the following statement in python's setup.py:
self.detect_tkinter(inc_dirs, lib_dirs)
of
def detect_modules(self):
This will ignore the compilation of _tkinter.c and tkappinit.c of
the python distribution.

This will totally skip the detection and inclusion of tk/tcl into
the "built-in" pkg, irrespective of its presence on the buildbox.
This will also work in the case of cross-compile builds of python.
In the cross-compile case, there is a likelihood of the build process
attempting to pick tk/tcl lib files from the buildbox (platform) and
using it wrongly for the different target platform.

In addition, one would also have to skip the inclusion of the
python2.x/Lib/lib-tk/*.py
files in the final dist. Just this exclusion is not enuff, the earlier
detection step change is also needed to prevent all the buildtime
errors.

Thanks,
/venkat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top