annotate setup.py @ 3:e9eaddab598e

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