annotate setup.py @ 1:7870274479f5 trunk

Import of initial code base.
author cmlenz
date Tue, 29 May 2007 20:33:55 +0000
parents
children e6ba3e878b10
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
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
15 import doctest
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
16 from glob import glob
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
17 import os
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
18 from setuptools import find_packages, setup, Command
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
19 import sys
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
20
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
21
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
22 class build_doc(Command):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
23 description = 'Builds the documentation'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
24 user_options = []
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
25
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
26 def initialize_options(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
27 pass
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
28
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
29 def finalize_options(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
30 pass
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
31
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
32 def run(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
33 from docutils.core import publish_cmdline
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
34 docutils_conf = os.path.join('doc', 'docutils.conf')
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
35 epydoc_conf = os.path.join('doc', 'epydoc.conf')
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
36
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
37 for source in glob('doc/*.txt'):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
38 dest = os.path.splitext(source)[0] + '.html'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
39 if not os.path.exists(dest) or \
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
40 os.path.getmtime(dest) < os.path.getmtime(source):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
41 print 'building documentation file %s' % dest
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
42 publish_cmdline(writer_name='html',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
43 argv=['--config=%s' % docutils_conf, source,
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
44 dest])
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
45
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
46 try:
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
47 from epydoc import cli
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
48 old_argv = sys.argv[1:]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
49 sys.argv[1:] = [
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
50 '--config=%s' % epydoc_conf,
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
51 '--no-private', # epydoc bug, not read from config
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
52 '--simple-term',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
53 '--verbose'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
54 ]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
55 cli.cli()
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
56 sys.argv[1:] = old_argv
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
57
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
58 except ImportError:
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
59 print 'epydoc not installed, skipping API documentation.'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
60
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
61
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
62 class test_doc(Command):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
63 description = 'Tests the code examples in the documentation'
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
64 user_options = []
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
65
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
66 def initialize_options(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
67 pass
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
68
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
69 def finalize_options(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
70 pass
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
71
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
72 def run(self):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
73 for filename in glob('doc/*.txt'):
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
74 print 'testing documentation file %s' % filename
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
75 doctest.testfile(filename, False, optionflags=doctest.ELLIPSIS)
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
76
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
77
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
78 setup(
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
79 name = 'Babel',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
80 version = '0.1',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
81 description = 'Internationalization utilities',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
82 long_description = \
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
83 """A collection of tools for internationalizing Python applications.""",
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
84 author = 'Edgewall Software',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
85 author_email = 'info@edgewall.org',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
86 license = 'BSD',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
87 url = 'http://babel.edgewall.org/',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
88 download_url = 'http://babel.edgewall.org/wiki/Download',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
89 zip_safe = False,
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
90
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
91 classifiers = [
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
92 'Development Status :: 4 - Beta',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
93 'Environment :: Web Environment',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
94 'Intended Audience :: Developers',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
95 'License :: OSI Approved :: BSD License',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
96 'Operating System :: OS Independent',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
97 'Programming Language :: Python',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
98 'Topic :: Software Development :: Libraries :: Python Modules',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
99 ],
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
100 packages = find_packages(exclude=['tests']),
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
101 package_data = {'babel': ['localedata/*.dat']},
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
102 test_suite = 'babel.tests.suite',
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
103
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
104 entry_points = """
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
105 [console_scripts]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
106 pygettext = babel.catalog.frontend:main
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
107
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
108 [distutils.commands]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
109 extract_messages = babel.catalog.frontend:extract_messages
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
110
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
111 [babel.extractors]
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
112 genshi = babel.catalog.extract:extract_genshi
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
113 python = babel.catalog.extract:extract_python
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
114 """,
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
115
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
116 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc}
7870274479f5 Import of initial code base.
cmlenz
parents:
diff changeset
117 )
Copyright (C) 2012-2017 Edgewall Software