~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Patch Queue Manager
  • Date: 2013-02-07 09:25:16 UTC
  • mfrom: (6572.1.2 bug-1107464)
  • Revision ID: pqm@pqm.ubuntu.com-20130207092516-eax0tqbckd3oiaw8
(jameinel) Fix bug #1107464,
 to allow the test suite to pass when python-apport is installed. (Dylan
 McCall)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
import os.path
11
11
import sys
12
12
import copy
 
13
import glob
13
14
 
14
15
if sys.version_info < (2, 6):
15
16
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.6+\n")
70
71
                                        'tests/ssl_certs/server_without_pass.key',
71
72
                                        'tests/ssl_certs/server_with_pass.key',
72
73
                                        'tests/ssl_certs/server.crt',
73
 
                                        'locale/*/LC_MESSAGES/*.mo',
74
74
                                       ]},
75
75
           }
76
 
 
 
76
I18N_FILES = []
 
77
for filepath in glob.glob("bzrlib/locale/*/LC_MESSAGES/*.mo"):
 
78
    langfile = filepath[len("bzrlib/locale/"):]
 
79
    targetpath = os.path.dirname(os.path.join("share/locale", langfile))
 
80
    I18N_FILES.append((targetpath, [filepath]))
77
81
 
78
82
def get_bzrlib_packages():
79
83
    """Recurse through the bzrlib directory, and extract the package names"""
168
172
## Setup
169
173
########################
170
174
 
171
 
from tools.build_mo import build_mo
 
175
from bzrlib.bzr_distutils import build_mo
172
176
 
173
177
command_classes = {'install_scripts': my_install_scripts,
174
178
                   'build': bzr_build,
198
202
    from distutils.command.build_ext import build_ext
199
203
else:
200
204
    have_pyrex = True
201
 
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
 
205
    pyrex_version_info = tuple(map(int, pyrex_version.rstrip("+").split('.')))
202
206
 
203
207
 
204
208
class build_ext_if_possible(build_ext):
427
431
    # PyQt4 itself still escapes the plugin detection code for some reason...
428
432
    includes.append('PyQt4.QtCore')
429
433
    includes.append('PyQt4.QtGui')
 
434
    includes.append('PyQt4.QtTest')
430
435
    includes.append('sip') # extension module required for Qt.
431
436
    packages.append('pygments') # colorizer for qbzr
432
437
    packages.append('docutils') # html formatting
478
483
    packages.append('sqlite3')
479
484
 
480
485
 
 
486
def get_git_py2exe_info(includes, excludes, packages):
 
487
    packages.append('dulwich')
 
488
 
 
489
 
481
490
def get_fastimport_py2exe_info(includes, excludes, packages):
482
491
    # This is the python-fastimport package, not to be confused with the
483
492
    # bzr-fastimport plugin.
513
522
 
514
523
    ARGS.update(META_INFO)
515
524
    ARGS.update(BZRLIB)
 
525
    PKG_DATA['package_data']['bzrlib'].append('locale/*/LC_MESSAGES/*.mo')
516
526
    ARGS.update(PKG_DATA)
517
527
 
518
528
    setup(**ARGS)
519
529
 
520
530
elif 'py2exe' in sys.argv:
521
 
    import glob
522
531
    # py2exe setup
523
532
    import py2exe
524
533
 
668
677
                       'tools/win32/bzr_postinstall.py',
669
678
                       ]
670
679
    gui_targets = [gui_target]
671
 
    data_files = topics_files + plugins_files
 
680
    data_files = topics_files + plugins_files + I18N_FILES
672
681
 
673
682
    if 'qbzr' in plugins:
674
683
        get_qbzr_py2exe_info(includes, excludes, packages, data_files)
676
685
    if 'svn' in plugins:
677
686
        get_svn_py2exe_info(includes, excludes, packages)
678
687
 
 
688
    if 'git' in plugins:
 
689
        get_git_py2exe_info(includes, excludes, packages)
 
690
 
679
691
    if 'fastimport' in plugins:
680
692
        get_fastimport_py2exe_info(includes, excludes, packages)
681
693
 
752
764
        # easy_install one
753
765
        DATA_FILES = [('man/man1', ['bzr.1'])]
754
766
 
 
767
    DATA_FILES = DATA_FILES + I18N_FILES
755
768
    # std setup
756
769
    ARGS = {'scripts': ['bzr'],
757
770
            'data_files': DATA_FILES,