By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,492 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,492 IT Pros & Developers. It's quick & easy.

How to disable tk inclusion in py build

P: n/a
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

Jun 27 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ve******@yahoo.com wrote:
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>

Jun 27 '06 #2

P: n/a
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

Jun 27 '06 #3

P: n/a
ve******@yahoo.com wrote:
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.


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>

Jun 28 '06 #4

P: n/a
> 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

Jun 29 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.