~ubuntu-branches/ubuntu/karmic/python-docutils/karmic

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2004-05-18 08:36:50 UTC
  • Revision ID: james.westby@ubuntu.com-20040518083650-ife8gdsk0s95m8k1
Tags: 0.3.3-1
* New Upstream release.
  - Closes: #249246
* De-right-aligned the Closes: entries in the changelog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
def do_setup():
12
12
    kwargs = package_data.copy()
13
 
    extras = get_extras()
14
 
    if extras:
15
 
        kwargs['py_modules'] = extras
16
13
    if sys.hexversion >= 0x02030000:    # Python 2.3
17
14
        kwargs['classifiers'] = classifiers
18
15
    else:
34
31
    'author_email': 'goodger@users.sourceforge.net',
35
32
    'license': 'public domain, Python, BSD, GPL (see COPYING.txt)',
36
33
    'platforms': 'OS-independent',
37
 
    'package_dir': {'docutils': 'docutils', '': 'extras'},
 
34
    'package_dir': {'docutils': 'docutils'},
38
35
    'packages': ['docutils', 'docutils.languages',
39
36
                 'docutils.parsers', 'docutils.parsers.rst',
40
37
                 'docutils.parsers.rst.directives',
74
71
"""Trove classifiers for the Distutils "register" command;
75
72
Python 2.3 and up."""
76
73
 
77
 
extra_modules = [('optparse', '1.4.1', None),
78
 
                 ('textwrap', None, None),
79
 
                 ('roman', '1.4', ['toRoman', 'fromRoman',
80
 
                                   'InvalidRomanNumeralError'])]
81
 
"""Third-party modules to install if they're not already present.
82
 
List of (module name, minimum __version__ string, [attribute names])."""
83
 
 
84
 
def get_extras():
85
 
    extras = []
86
 
    for module_name, version, attributes in extra_modules:
87
 
        try:
88
 
            module = __import__(module_name)
89
 
            if version and module.__version__ < version:
90
 
                raise ValueError
91
 
            for attribute in attributes or []:
92
 
                getattr(module, attribute)
93
 
            print ('"%s" module already present; ignoring extras/%s.py.'
94
 
                   % (module_name, module_name))
95
 
        except (ImportError, AttributeError, ValueError):
96
 
            extras.append(module_name)
97
 
    return extras
98
 
 
99
 
 
100
74
class dual_build_py(build_py):
101
75
 
102
76
    """