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