~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: wang
  • Date: 2006-10-29 13:41:32 UTC
  • mto: (2104.4.1 wang_65714)
  • mto: This revision was merged to the branch mainline in revision 2109.
  • Revision ID: wang@ubuntu-20061029134132-3d7f4216f20c4aef
Replace python's difflib by patiencediff because the worst case 
performance is cubic for difflib and people commiting large data 
files are often hurt by this. The worst case performance of patience is 
quadratic. Fix bug 65714.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 './setup.py --help' for more options
7
7
"""
8
8
 
 
9
import os
 
10
import sys
 
11
 
9
12
import bzrlib
10
13
 
11
14
##
20
23
             'license':      'GNU GPL v2',
21
24
            }
22
25
 
23
 
BZRLIB = {'packages': ['bzrlib',
24
 
                       'bzrlib.benchmarks',
25
 
                       'bzrlib.bundle',
26
 
                       'bzrlib.bundle.serializer',
27
 
                       'bzrlib.doc',
28
 
                       'bzrlib.doc.api',
29
 
                       'bzrlib.export',
30
 
                       'bzrlib.plugins',
31
 
                       'bzrlib.plugins.launchpad',
32
 
                       'bzrlib.store',
33
 
                       'bzrlib.store.revision',
34
 
                       'bzrlib.store.versioned',
35
 
                       'bzrlib.tests',
36
 
                       'bzrlib.tests.blackbox',
37
 
                       'bzrlib.tests.branch_implementations',
38
 
                       'bzrlib.tests.bzrdir_implementations',
39
 
                       'bzrlib.tests.interrepository_implementations',
40
 
                       'bzrlib.tests.intertree_implementations',
41
 
                       'bzrlib.tests.interversionedfile_implementations',
42
 
                       'bzrlib.tests.repository_implementations',
43
 
                       'bzrlib.tests.revisionstore_implementations',
44
 
                       'bzrlib.tests.tree_implementations',
45
 
                       'bzrlib.tests.workingtree_implementations',
46
 
                       'bzrlib.transport',
47
 
                       'bzrlib.transport.http',
48
 
                       'bzrlib.ui',
49
 
                       'bzrlib.util',
50
 
                       'bzrlib.util.configobj',
51
 
                       'bzrlib.util.effbot.org',
52
 
                       'bzrlib.util.elementtree',
53
 
                      ],
54
 
         }
 
26
# The list of packages is automatically generated later. Add other things
 
27
# that are part of BZRLIB here.
 
28
BZRLIB = {}
55
29
 
56
30
PKG_DATA = {# install files from selftest suite
57
31
            'package_data': {'bzrlib': ['doc/api/*.txt',
63
37
# Reinvocation stolen from bzr, we need python2.4 by virtue of bzr_man
64
38
# including bzrlib.help
65
39
 
66
 
import os
67
 
import sys
68
 
 
69
40
try:
70
41
    version_info = sys.version_info
71
42
except AttributeError:
87
58
    print >>sys.stderr, "bzr: error: cannot find a suitable python interpreter"
88
59
    print >>sys.stderr, "  (need %d.%d or later)" % NEED_VERS
89
60
    sys.exit(1)
90
 
if hasattr(os, "unsetenv"):
 
61
if getattr(os, "unsetenv", None) is not None:
91
62
    os.unsetenv(REINVOKE)
92
63
 
93
64
 
 
65
def get_bzrlib_packages():
 
66
    """Recurse through the bzrlib directory, and extract the package names"""
 
67
 
 
68
    packages = []
 
69
    base_path = os.path.dirname(os.path.abspath(bzrlib.__file__))
 
70
    for root, dirs, files in os.walk(base_path):
 
71
        if '__init__.py' in files:
 
72
            assert root.startswith(base_path)
 
73
            # Get just the path below bzrlib
 
74
            package_path = root[len(base_path):]
 
75
            # Remove leading and trailing slashes
 
76
            package_path = package_path.strip('\\/')
 
77
            if not package_path:
 
78
                package_name = 'bzrlib'
 
79
            else:
 
80
                package_name = ('bzrlib.' +
 
81
                            package_path.replace('/', '.').replace('\\', '.'))
 
82
            packages.append(package_name)
 
83
    return sorted(packages)
 
84
 
 
85
 
 
86
BZRLIB['packages'] = get_bzrlib_packages()
 
87
 
 
88
 
94
89
from distutils.core import setup
95
90
from distutils.command.install_scripts import install_scripts
96
91
from distutils.command.build import build