~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-16 15:09:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1940.
  • Revision ID: john@arbash-meinel.com-20060816150939-0ba78bf74a339f78
Change setup.py to auto-generate the list of packages to install

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
BZRLIB = {'packages':get_bzrlib_packages()}
55
27
 
56
28
PKG_DATA = {# install files from selftest suite
57
29
            'package_data': {'bzrlib': ['doc/api/*.txt',
63
35
# Reinvocation stolen from bzr, we need python2.4 by virtue of bzr_man
64
36
# including bzrlib.help
65
37
 
66
 
import os
67
 
import sys
68
 
 
69
38
try:
70
39
    version_info = sys.version_info
71
40
except AttributeError:
91
60
    os.unsetenv(REINVOKE)
92
61
 
93
62
 
 
63
def get_bzrlib_packages():
 
64
    """Recurse through the bzrlib directory, and extract the package names"""
 
65
 
 
66
    packages = []
 
67
    base_path = os.path.dirname(os.path.abspath(bzrlib.__file__))
 
68
    for root, dirs, files in os.walk(base_path):
 
69
        if '__init__.py' in files:
 
70
            assert root.startswith(base_path)
 
71
            # Get just the path below bzrlib
 
72
            package_path = root[len(base_path):]
 
73
            # Remove leading and trailing slashes
 
74
            package_path = package_path.strip('\\/')
 
75
            if not package_path:
 
76
                package_name = 'bzrlib'
 
77
            else:
 
78
                package_name = ('bzrlib.' +
 
79
                            package_path.replace('/', '.').replace('\\', '.'))
 
80
            packages.append(package_name)
 
81
    return sorted(packages)
 
82
 
 
83
 
94
84
from distutils.core import setup
95
85
from distutils.command.install_scripts import install_scripts
96
86
from distutils.command.build import build