Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #461 (new task)

Opened 18 months ago

Last modified 3 months ago

exclude all non-platform modules

Reported by: htgoebel Owned by: matysek
Priority: low Milestone: PyInstaller 2.2
Component: Hooks Version: develop
Severity: normal Keywords:
Cc:

Description

Both remove modules not used for the target platform. hook-os removes some more, while hook-iu differs between more platform.

Attachments

Change History

comment:1 Changed 18 months ago by htgoebel

  • Status changed from new to assigned
  • Summary changed from unify hook-iu and hook-os to exclude all non-platform modules

Rethinking the topic, this should exclude all non-platform modules, not only in hook-iu and hook-os.

comment:2 Changed 18 months ago by htgoebel

I would like to add code like this to mf.py:

PLATFORM_REMOVES = set([
    'ce',
    'dos', 'dospath',
    'mac', 'macpath', 'macurl2path',
    'nt', 'ntpath', 'nturl2path',
    'os2', 'os2emxpath',
    'posix', 'posixpath',
    'riscos', 'riscosenviron','riscospath',
    'win32api'])

names = sys.builtin_module_names
if 'posix' in names:
    PLATFORM_REMOVES -= set('posix', 'posixpath')
elif 'nt' in names:
    PLATFORM_REMOVES -= set(['nt', 'ntpath', 'nturl2path', 'win32api'])
elif 'os2' in names:
    PLATFORM_REMOVES -= set(['os2', 'os2emxpath'])
elif 'dos' in names:
    PLATFORM_REMOVES -= set(['dos', 'dospath'])
elif 'mac' in names:
    PLATFORM_REMOVES -= set(['mac', 'macpath', 'macurl2path'])

pprint(PLATFORM_REMOVES)

What do you think?

Last edited 18 months ago by htgoebel (previous) (diff)

comment:3 Changed 18 months ago by htgoebel

On the other had: Is this needed at all? This should only suppress warnings, since modules for a different platform are not available anyway.

comment:4 Changed 18 months ago by htgoebel

This would be really useful: As soon as os is imported, this will add posix, posixpath, os2emxpath, _emx_link, ntpath, nt and probably some others.

comment:5 Changed 16 months ago by htgoebel

  • Milestone changed from PyInstaller 2.0 to PyInstaller 2.1

comment:6 Changed 3 months ago by matysek

  • Owner changed from htgoebel to matysek
  • Status changed from assigned to new
  • Milestone changed from PyInstaller 2.1 to PyInstaller 2.2
View

Add a comment

Modify Ticket

Action
as new
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.