This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: BuildApplication includes many unneeded modules
Type: Stage:
Components: macOS Versions:
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: jackjansen Nosy List: jackjansen, neil_mayhew
Priority: normal Keywords:

Created on 2004-12-01 04:35 by neil_mayhew, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg23414 - (view) Author: Neil Mayhew (neil_mayhew) Date: 2004-12-01 04:35
I have a simple application to calculate MD5 sums for Macintosh 
files with resource forks. BuildApplication includes a whole raft of 
modules, such as httplib, that seem to be unrelated to my 
application. My imports are:

import sys, os
import md5
import EasyDialogs
import MacOS
import Carbon.File as macfs

Apologies if this is a known limitation, but I didn't see it mentioned 
msg23415 - (view) Author: Neil Mayhew (neil_mayhew) Date: 2004-12-01 04:36
Logged In: YES 

MacPython-OS9 2.3.3, on Mac OS 9.1
msg23416 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2004-12-27 16:29
Logged In: YES 

BuildApplication includes all modules that could possibly be needed by 
recursively inspecting all modules for their imports.In your case I guess 
EasyDialogs or os somehow indirectly caused httplib to be included.

This process can be controlled (you can forcibly include or exclude 
modules) by adding :macfreeze: directives to your source code, but this 
is not documented, really.

Look in :Mac:Tools:macfreeze for the code that does it, you may be able 
to infer how it is done.
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41259
2004-12-01 04:35:20neil_mayhewcreate