1
1
#!/usr/bin/env python
2
# $Id: setup.py,v 1.21 2004/05/09 16:22:22 felixwiemann Exp $
2
# $Id: setup.py 4260 2006-01-09 18:28:09Z fwiemann $
3
3
# Copyright: This file has been placed in the public domain.
7
8
from distutils.core import setup
8
9
from distutils.command.build_py import build_py
11
# From <http://groups.google.de/groups?as_umsgid=f70e3538.0404141327.6cea58ca@posting.google.com>.
12
from distutils.command.install import INSTALL_SCHEMES
13
for scheme in INSTALL_SCHEMES.values():
14
scheme['data'] = scheme['purelib']
12
18
kwargs = package_data.copy()
21
kwargs['py_modules'] = extras
13
22
if sys.hexversion >= 0x02030000: # Python 2.3
14
23
kwargs['classifiers'] = classifiers
17
26
dist = setup(**kwargs)
30
for dir in glob.glob('docutils/writers/s5_html/themes/*'):
31
if os.path.isdir(dir):
32
theme_files = glob.glob('%s/*' % dir)
33
s5_theme_files.append((dir, theme_files))
21
36
'name': 'docutils',
22
37
'description': 'Docutils -- Python Documentation Utilities',
23
38
'long_description': """\
24
39
Docutils is a modular system for processing documentation
25
into useful formats, such as HTML, XML, and TeX. For input
26
Docutils supports reStructuredText, an easy-to-read,
40
into useful formats, such as HTML, XML, and LaTeX. For
41
input Docutils supports reStructuredText, an easy-to-read,
27
42
what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60
28
43
'url': 'http://docutils.sourceforge.net/',
30
45
'author': 'David Goodger',
31
46
'author_email': 'goodger@users.sourceforge.net',
32
47
'license': 'public domain, Python, BSD, GPL (see COPYING.txt)',
33
48
'platforms': 'OS-independent',
34
'package_dir': {'docutils': 'docutils'},
35
'packages': ['docutils', 'docutils.languages',
36
'docutils.parsers', 'docutils.parsers.rst',
49
'package_dir': {'docutils': 'docutils', '': 'extras'},
50
'packages': ['docutils',
53
'docutils.parsers.rst',
37
54
'docutils.parsers.rst.directives',
38
55
'docutils.parsers.rst.languages',
39
'docutils.readers', 'docutils.readers.python',
57
'docutils.readers.python',
40
58
'docutils.transforms',
42
'scripts' : ['tools/rst2html.py',],}
60
'docutils.writers.html4css1',
61
'docutils.writers.pep_html',
62
'docutils.writers.s5_html',
63
'docutils.writers.latex2e',
64
'docutils.writers.newlatex2e'],
65
'data_files': ([('docutils/parsers/rst/include',
66
glob.glob('docutils/parsers/rst/include/*.txt')),
67
('docutils/writers/html4css1',
68
['docutils/writers/html4css1/html4css1.css']),
69
('docutils/writers/latex2e',
70
['docutils/writers/latex2e/latex2e.tex']),
71
('docutils/writers/newlatex2e',
72
['docutils/writers/newlatex2e/base.tex']),
73
('docutils/writers/pep_html',
74
['docutils/writers/pep_html/pep.css',
75
'docutils/writers/pep_html/template.txt']),
76
('docutils/writers/s5_html/themes',
77
['docutils/writers/s5_html/themes/README.txt']),]
79
'scripts' : ['tools/rst2html.py',
82
'tools/rst2newlatex.py',
84
'tools/rst2pseudoxml.py'],}
43
85
"""Distutils setup parameters."""
71
113
"""Trove classifiers for the Distutils "register" command;
72
114
Python 2.3 and up."""
116
extra_modules = [('optparse', '1.4.1', None),
117
('textwrap', None, None),
118
('roman', '1.4', ['toRoman', 'fromRoman',
119
'InvalidRomanNumeralError'])]
120
"""Third-party modules to install if they're not already present.
121
List of (module name, minimum __version__ string, [attribute names])."""
125
for module_name, version, attributes in extra_modules:
127
module = __import__(module_name)
128
if version and module.__version__ < version:
130
for attribute in attributes or []:
131
getattr(module, attribute)
132
print ('"%s" module already present; ignoring extras/%s.py.'
133
% (module_name, module_name))
134
except (ImportError, AttributeError, ValueError):
135
extras.append(module_name)
74
139
class dual_build_py(build_py):