~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-17 14:03:17 UTC
  • mfrom: (1930.3.5 fix-setup-py)
  • Revision ID: pqm@pqm.ubuntu.com-20060817140317-623b0681eb5ec11a
(jam) update setup.py to automatically find and include bzrlib packages

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.benchmarks.tree_creator',
26
 
                       'bzrlib.bundle',
27
 
                       'bzrlib.bundle.serializer',
28
 
                       'bzrlib.doc',
29
 
                       'bzrlib.doc.api',
30
 
                       'bzrlib.export',
31
 
                       'bzrlib.plugins',
32
 
                       'bzrlib.plugins.launchpad',
33
 
                       'bzrlib.store',
34
 
                       'bzrlib.store.revision',
35
 
                       'bzrlib.store.versioned',
36
 
                       'bzrlib.tests',
37
 
                       'bzrlib.tests.blackbox',
38
 
                       'bzrlib.tests.branch_implementations',
39
 
                       'bzrlib.tests.bzrdir_implementations',
40
 
                       'bzrlib.tests.interrepository_implementations',
41
 
                       'bzrlib.tests.intertree_implementations',
42
 
                       'bzrlib.tests.interversionedfile_implementations',
43
 
                       'bzrlib.tests.repository_implementations',
44
 
                       'bzrlib.tests.revisionstore_implementations',
45
 
                       'bzrlib.tests.tree_implementations',
46
 
                       'bzrlib.tests.workingtree_implementations',
47
 
                       'bzrlib.transport',
48
 
                       'bzrlib.transport.http',
49
 
                       'bzrlib.ui',
50
 
                       'bzrlib.util',
51
 
                       'bzrlib.util.configobj',
52
 
                       'bzrlib.util.effbot.org',
53
 
                       'bzrlib.util.elementtree',
54
 
                      ],
55
 
         }
 
26
# The list of packages is automatically generated later. Add other things
 
27
# that are part of BZRLIB here.
 
28
BZRLIB = {}
56
29
 
57
30
PKG_DATA = {# install files from selftest suite
58
31
            'package_data': {'bzrlib': ['doc/api/*.txt',
64
37
# Reinvocation stolen from bzr, we need python2.4 by virtue of bzr_man
65
38
# including bzrlib.help
66
39
 
67
 
import os
68
 
import sys
69
 
 
70
40
try:
71
41
    version_info = sys.version_info
72
42
except AttributeError:
92
62
    os.unsetenv(REINVOKE)
93
63
 
94
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
 
95
89
from distutils.core import setup
96
90
from distutils.command.install_scripts import install_scripts
97
91
from distutils.command.build import build