~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
694
694
                               "optimize": 2,
695
695
                              },
696
696
                   }
 
697
 
 
698
    # We want the libaray.zip to have optimize = 2, but the exe to have
 
699
    # optimize = 1, so that .py files that get compilied at run time
 
700
    # (e.g. user installed plugins) dont have their doc strings removed.
 
701
    class py2exe_no_oo_exe(py2exe.build_exe.py2exe):
 
702
        def build_executable(self, *args, **kwargs):
 
703
            self.optimize = 1
 
704
            py2exe.build_exe.py2exe.build_executable(self, *args, **kwargs)
 
705
            self.optimize = 2
 
706
 
697
707
    if __name__ == '__main__':
698
708
        setup(options=options_list,
699
709
              console=console_targets,
700
710
              windows=gui_targets,
701
711
              zipfile='lib/library.zip',
702
712
              data_files=data_files,
703
 
              cmdclass={'install_data': install_data_with_bytecompile},
 
713
              cmdclass={'install_data': install_data_with_bytecompile,
 
714
                        'py2exe': py2exe_no_oo_exe},
704
715
              )
705
716
 
706
717
else: