~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-17 18:13:57 UTC
  • mfrom: (5268.7.29 transport-segments)
  • Revision ID: pqm@pqm.ubuntu.com-20110817181357-y5q5eth1hk8bl3om
(jelmer) Allow specifying the colocated branch to use in the branch URL,
 and retrieving the branch name using ControlDir._get_selected_branch.
 (Jelmer Vernooij)

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
14
13
 
15
14
if sys.version_info < (2, 6):
16
15
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.6+\n")
71
70
                                        'tests/ssl_certs/server_without_pass.key',
72
71
                                        'tests/ssl_certs/server_with_pass.key',
73
72
                                        'tests/ssl_certs/server.crt',
 
73
                                        'locale/*/LC_MESSAGES/*.mo',
74
74
                                       ]},
75
75
           }
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]))
 
76
 
81
77
 
82
78
def get_bzrlib_packages():
83
79
    """Recurse through the bzrlib directory, and extract the package names"""
105
101
 
106
102
from distutils import log
107
103
from distutils.core import setup
108
 
from distutils.version import LooseVersion
109
104
from distutils.command.install_scripts import install_scripts
110
105
from distutils.command.install_data import install_data
111
106
from distutils.command.build import build
173
168
## Setup
174
169
########################
175
170
 
176
 
from bzrlib.bzr_distutils import build_mo
 
171
from tools.build_mo import build_mo
177
172
 
178
173
command_classes = {'install_scripts': my_install_scripts,
179
174
                   'build': bzr_build,
203
198
    from distutils.command.build_ext import build_ext
204
199
else:
205
200
    have_pyrex = True
206
 
    pyrex_version_info = LooseVersion(pyrex_version)
 
201
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
207
202
 
208
203
 
209
204
class build_ext_if_possible(build_ext):
300
295
                        libraries=['Ws2_32'])
301
296
    add_pyrex_extension('bzrlib._walkdirs_win32')
302
297
else:
303
 
    if have_pyrex and pyrex_version_info == LooseVersion("0.9.4.1"):
 
298
    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
304
299
        # Pyrex 0.9.4.1 fails to compile this extension correctly
305
300
        # The code it generates re-uses a "local" pointer and
306
301
        # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
318
313
add_pyrex_extension('bzrlib._chk_map_pyx')
319
314
ext_modules.append(Extension('bzrlib._patiencediff_c',
320
315
                             ['bzrlib/_patiencediff_c.c']))
321
 
if have_pyrex and pyrex_version_info < LooseVersion("0.9.6.3"):
 
316
if have_pyrex and pyrex_version_info < (0, 9, 6, 3):
322
317
    print("")
323
318
    print('Your Pyrex/Cython version %s is too old to build the simple_set' % (
324
319
        pyrex_version))
432
427
    # PyQt4 itself still escapes the plugin detection code for some reason...
433
428
    includes.append('PyQt4.QtCore')
434
429
    includes.append('PyQt4.QtGui')
435
 
    includes.append('PyQt4.QtTest')
436
430
    includes.append('sip') # extension module required for Qt.
437
431
    packages.append('pygments') # colorizer for qbzr
438
432
    packages.append('docutils') # html formatting
484
478
    packages.append('sqlite3')
485
479
 
486
480
 
487
 
def get_git_py2exe_info(includes, excludes, packages):
488
 
    packages.append('dulwich')
489
 
 
490
 
 
491
481
def get_fastimport_py2exe_info(includes, excludes, packages):
492
482
    # This is the python-fastimport package, not to be confused with the
493
483
    # bzr-fastimport plugin.
523
513
 
524
514
    ARGS.update(META_INFO)
525
515
    ARGS.update(BZRLIB)
526
 
    PKG_DATA['package_data']['bzrlib'].append('locale/*/LC_MESSAGES/*.mo')
527
516
    ARGS.update(PKG_DATA)
528
517
 
529
518
    setup(**ARGS)
530
519
 
531
520
elif 'py2exe' in sys.argv:
 
521
    import glob
532
522
    # py2exe setup
533
523
    import py2exe
534
524
 
678
668
                       'tools/win32/bzr_postinstall.py',
679
669
                       ]
680
670
    gui_targets = [gui_target]
681
 
    data_files = topics_files + plugins_files + I18N_FILES
 
671
    data_files = topics_files + plugins_files
682
672
 
683
673
    if 'qbzr' in plugins:
684
674
        get_qbzr_py2exe_info(includes, excludes, packages, data_files)
686
676
    if 'svn' in plugins:
687
677
        get_svn_py2exe_info(includes, excludes, packages)
688
678
 
689
 
    if 'git' in plugins:
690
 
        get_git_py2exe_info(includes, excludes, packages)
691
 
 
692
679
    if 'fastimport' in plugins:
693
680
        get_fastimport_py2exe_info(includes, excludes, packages)
694
681
 
765
752
        # easy_install one
766
753
        DATA_FILES = [('man/man1', ['bzr.1'])]
767
754
 
768
 
    DATA_FILES = DATA_FILES + I18N_FILES
769
755
    # std setup
770
756
    ARGS = {'scripts': ['bzr'],
771
757
            'data_files': DATA_FILES,