/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Vincent Ladeuil
  • Date: 2011-07-06 09:22:00 UTC
  • mfrom: (6008 +trunk)
  • mto: (6012.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6013.
  • Revision ID: v.ladeuil+lp@free.fr-20110706092200-7iai2mwzc0sqdsvf
MergingĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
import sys
12
12
import copy
13
13
 
14
 
if sys.version_info < (2, 4):
15
 
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.4+\n")
 
14
if sys.version_info < (2, 6):
 
15
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.6+\n")
16
16
    sys.exit(1)
17
17
 
18
18
# NOTE: The directory containing setup.py, whether run by 'python setup.py' or
69
69
                                        'tests/ssl_certs/ca.crt',
70
70
                                        'tests/ssl_certs/server_without_pass.key',
71
71
                                        'tests/ssl_certs/server_with_pass.key',
72
 
                                        'tests/ssl_certs/server.crt'
 
72
                                        'tests/ssl_certs/server.crt',
 
73
                                        'locale/*/LC_MESSAGES/*.mo',
73
74
                                       ]},
74
75
           }
75
76
 
152
153
    Generate bzr.1.
153
154
    """
154
155
 
 
156
    sub_commands = build.sub_commands + [
 
157
            ('build_mo', lambda _: True),
 
158
            ]
 
159
 
155
160
    def run(self):
156
161
        build.run(self)
157
162
 
163
168
## Setup
164
169
########################
165
170
 
 
171
from tools.build_mo import build_mo
 
172
 
166
173
command_classes = {'install_scripts': my_install_scripts,
167
 
                   'build': bzr_build}
 
174
                   'build': bzr_build,
 
175
                   'build_mo': build_mo,
 
176
                   }
168
177
from distutils import log
169
178
from distutils.errors import CCompilerError, DistutilsPlatformError
170
179
from distutils.extension import Extension
171
180
ext_modules = []
172
181
try:
173
182
    try:
 
183
        from Cython.Distutils import build_ext
 
184
        from Cython.Compiler.Version import version as pyrex_version
 
185
    except ImportError:
 
186
        print("No Cython, trying Pyrex...")
174
187
        from Pyrex.Distutils import build_ext
175
188
        from Pyrex.Compiler.Version import version as pyrex_version
176
 
    except ImportError:
177
 
        print("No Pyrex, trying Cython...")
178
 
        from Cython.Distutils import build_ext
179
 
        from Cython.Compiler.Version import version as pyrex_version
180
189
except ImportError:
181
190
    have_pyrex = False
182
191
    # try to build the extension from the prior generated source.
499
508
            # help pages
500
509
            'data_files': find_docs(),
501
510
            # for building pyrex extensions
502
 
            'cmdclass': {'build_ext': build_ext_if_possible},
 
511
            'cmdclass': command_classes,
503
512
           }
504
513
 
505
514
    ARGS.update(META_INFO)
506
515
    ARGS.update(BZRLIB)
507
516
    ARGS.update(PKG_DATA)
508
 
    
 
517
 
509
518
    setup(**ARGS)
510
519
 
511
520
elif 'py2exe' in sys.argv:
725
734
            self.optimize = 2
726
735
 
727
736
    if __name__ == '__main__':
 
737
        command_classes['install_data'] = install_data_with_bytecompile
 
738
        command_classes['py2exe'] = py2exe_no_oo_exe
728
739
        setup(options=options_list,
729
740
              console=console_targets,
730
741
              windows=gui_targets,
731
742
              zipfile='lib/library.zip',
732
743
              data_files=data_files,
733
 
              cmdclass={'install_data': install_data_with_bytecompile,
734
 
                        'py2exe': py2exe_no_oo_exe},
 
744
              cmdclass=command_classes,
735
745
              )
736
746
 
737
747
else: