annotate setup.py @ 20:c4fc7b88206e trunk

Fix typo in doc.
author cmlenz
date Thu, 31 May 2007 17:58:38 +0000
parents e6ba3e878b10
children 0739bc8e7210
rev   line source
1
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
1 #!/usr/bin/env python
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
2 # -*- coding: utf-8 -*-
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
3 #
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
4 # Copyright (C) 2007 Edgewall Software
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
5 # All rights reserved.
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
6 #
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
7 # This software is licensed as described in the file COPYING, which
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
8 # you should have received as part of this distribution. The terms
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
9 # are also available at http://babel.edgewall.org/wiki/License.
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
10 #
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
11 # This software consists of voluntary contributions made by many
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
12 # individuals. For the exact contribution history, see the revision
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
13 # history and logs, available at http://babel.edgewall.org/log/.
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
14
12
e6ba3e878b10 * Removed pkg_resources/setuptools requirement from various places.
cmlenz
parents: 1
diff changeset
15 from distutils.cmd import Command
1
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
16 import doctest
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
17 from glob import glob
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
18 import os
12
e6ba3e878b10 * Removed pkg_resources/setuptools requirement from various places.
cmlenz
parents: 1
diff changeset
19 try:
e6ba3e878b10 * Removed pkg_resources/setuptools requirement from various places.
cmlenz
parents: 1
diff changeset
20 from setuptools import setup
e6ba3e878b10 * Removed pkg_resources/setuptools requirement from various places.
cmlenz
parents: 1
diff changeset
21 except ImportError:
e6ba3e878b10 * Removed pkg_resources/setuptools requirement from various places.
cmlenz
parents: 1
diff changeset
22 from distutils.core import setup
1
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
23 import sys
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
24
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
25
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
26 class build_doc(Command):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
27 description = 'Builds the documentation'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
28 user_options = []
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
29
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
30 def initialize_options(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
31 pass
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
32
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
33 def finalize_options(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
34 pass
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
35
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
36 def run(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
37 from docutils.core import publish_cmdline
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
38 docutils_conf = os.path.join('doc', 'docutils.conf')
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
39 epydoc_conf = os.path.join('doc', 'epydoc.conf')
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
40
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
41 for source in glob('doc/*.txt'):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
42 dest = os.path.splitext(source)[0] + '.html'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
43 if not os.path.exists(dest) or \
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
44 os.path.getmtime(dest) < os.path.getmtime(source):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
45 print 'building documentation file %s' % dest
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
46 publish_cmdline(writer_name='html',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
47 argv=['--config=%s' % docutils_conf, source,
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
48 dest])
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
49
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
50 try:
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
51 from epydoc import cli
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
52 old_argv = sys.argv[1:]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
53 sys.argv[1:] = [
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
54 '--config=%s' % epydoc_conf,
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
55 '--no-private', # epydoc bug, not read from config
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
56 '--simple-term',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
57 '--verbose'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
58 ]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
59 cli.cli()
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
60 sys.argv[1:] = old_argv
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
61
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
62 except ImportError:
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
63 print 'epydoc not installed, skipping API documentation.'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
64
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
65
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
66 class test_doc(Command):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
67 description = 'Tests the code examples in the documentation'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
68 user_options = []
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
69
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
70 def initialize_options(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
71 pass
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
72
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
73 def finalize_options(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
74 pass
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
75
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
76 def run(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
77 for filename in glob('doc/*.txt'):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
78 print 'testing documentation file %s' % filename
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
79 doctest.testfile(filename, False, optionflags=doctest.ELLIPSIS)
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
80
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
81
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
82 setup(
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
83 name = 'Babel',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
84 version = '0.1',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
85 description = 'Internationalization utilities',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
86 long_description = \
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
87 """A collection of tools for internationalizing Python applications.""",
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
88 author = 'Edgewall Software',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
89 author_email = 'info@edgewall.org',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
90 license = 'BSD',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
91 url = 'http://babel.edgewall.org/',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
92 download_url = 'http://babel.edgewall.org/wiki/Download',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
93 zip_safe = False,
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
94
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
95 classifiers = [
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
96 'Development Status :: 4 - Beta',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
97 'Environment :: Web Environment',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
98 'Intended Audience :: Developers',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
99 'License :: OSI Approved :: BSD License',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
100 'Operating System :: OS Independent',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
101 'Programming Language :: Python',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
102 'Topic :: Software Development :: Libraries :: Python Modules',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
103 ],
12
e6ba3e878b10 * Removed pkg_resources/setuptools requirement from various places.
cmlenz
parents: 1
diff changeset
104 packages = ['babel', 'babel.catalog'],
1
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
105 package_data = {'babel': ['localedata/*.dat']},
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
106 test_suite = 'babel.tests.suite',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
107
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
108 entry_points = """
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
109 [console_scripts]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
110 pygettext = babel.catalog.frontend:main
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
111
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
112 [distutils.commands]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
113 extract_messages = babel.catalog.frontend:extract_messages
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
114
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
115 [babel.extractors]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
116 genshi = babel.catalog.extract:extract_genshi
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
117 python = babel.catalog.extract:extract_python
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
118 """,
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
119
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
120 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc}
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
121 )
Copyright (C) 2012-2017 Edgewall Software