setup_windows ModuleΒΆ

Module to distribute the application with distutils

For running Pyinstaller, use: # From Pytomo sources directory find . -name ‘*.pyc’ -delete rm -r build

# On Windows, from the parent of the Pytomo directory
Example using Pytomo-1.9.6 source distribution
  • to build pytomo_windows_x86.exe:
    • to create the .spec file used to build the .exe:

    > python C:Python27pyinstaller-1.5.1Makespec.py –onefile -p Pytomo-1.9.6-p Pytomo-1.9.6pytomo -o Pytomo-1.9.6 Pytomo-1.9.6inpytomo * modify by hand Pytomo-1.9.6pytomo.spec to make sure the .exe is created directly in the root directory (due to distutils problems with including data files); it should look something like: > type Pytomo-1.9.6pytomo.spec # -- mode: python -- from platform import system, machine a = Analysis([os.path.join(HOMEPATH,’support_mountzlib.py’), os.path.join(HOMEPATH,’supportuseUnicode.py’), ‘Pytomo-1.9.6binpytomo’],

    pathex=[‘Pytomo-1.9.6’, ‘Pytomo-1.9.6pytomo’, ‘C:Documents and Settingsrqpj0589Desktop’])

    pyz = PYZ(a.pure) exe = EXE( pyz,

    a.scripts, a.binaries, a.zipfiles, a.datas, name=’‘.join((‘_’.join((‘pytomo’, system().lower(), machine())),

    ‘.exe’)),

    #name=os.path.join(‘dist’, ‘pytomo.exe’), debug=False, strip=False, upx=True, console=True )’])

    • to create the executable pytomo_windows_x86.exe:

    > python C:Python27pyinstaller-1.5.1Build.py Pytomo-1.9.6pytomo.spec

  • to build pytomo_web_interface_windows_x86.exe
    • to create the .spec file used to build the .exe:

    > python C:Python27pyinstaller-1.5.1Makespec.py –onefile -p Pytomo-1.9.6-p Pytomo-1.9.6pytomo -o Pytomo-1.9.6 Pytomo-1.9.6inpytomo_web_interface * modify by hand Pytomo-1.9.6pytomo.spec to make sure the .exe is created directly in the root directory (due to distutils problems with including data files); it should look something like: > type Pytomo-1.9.6pytomo_web_interface.spec # -- mode: python -- from platform import system, machine a = Analysis([os.path.join(HOMEPATH,’support_mountzlib.py’), os.path.join(HOMEPATH,’supportuseUnicode.py’), ‘Pytomo-1.9.6binpytomo_web_interface’],

    pathex=[‘Pytomo-1.9.6’, ‘Pytomo-1.9.6pytomo’, ‘C:Documents and Settingsrqpj0589Desktop’])’])

    pyz = PYZ(a.pure) exe = EXE( pyz,

    a.scripts, a.binaries, a.zipfiles, a.datas, name=’‘.join((‘_’.join((‘pytomo_web_interface’,system().lower(),

    machine())), ‘.exe’)),

    #name=os.path.join(‘dist’, ‘pytomo.exe’), debug=False, strip=False, upx=True, console=True )’])

    • to create the executable pytomo_windows_x86.exe:

    > python C:Python27pyinstaller-1.5.1Build.py Pytomo-1.9.6pytomo_web_interface.spec

  • to create binary distribution:

    > cd Pytomo-1.9.6 Pytomo-1.9.6> python setup_windows.py sdist -t MANIFEST_windows.in

# for MAC: import sys if sys.platform.startswith(“darwin”):

app = BUNDLE(exe,
name=os.path.join(‘dist’, ‘NAME.app’), version=version)

Previous topic

setup Module

Next topic

start_crawl Module

This Page