Mercurial > genshi > mirror
annotate setup.py @ 503:2e1dbb344b89 trunk
Minor doc tweaks for new transformation filter.
author | cmlenz |
---|---|
date | Mon, 04 Jun 2007 21:47:28 +0000 |
parents | fd10321bb1ba |
children | 5fbc1cde74d6 |
rev | line source |
---|---|
1 | 1 #!/usr/bin/env python |
2 # -*- coding: utf-8 -*- | |
3 # | |
66
59eb24184e9c
Switch copyright to Edgewall and URLs to markup.edgewall.org.
cmlenz
parents:
27
diff
changeset
|
4 # Copyright (C) 2006 Edgewall Software |
1 | 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 | |
230 | 9 # are also available at http://genshi.edgewall.org/wiki/License. |
1 | 10 # |
11 # This software consists of voluntary contributions made by many | |
12 # individuals. For the exact contribution history, see the revision | |
230 | 13 # history and logs, available at http://genshi.edgewall.org/log/. |
1 | 14 |
382
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
15 from distutils.cmd import Command |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
16 import doctest |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
17 from glob import glob |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
18 import os |
84
0a1843b2c096
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
19 try: |
145
47bbd9d2a5af
* Fix error in expression evaluation when the expression evaluates to an iterable that does not produce event tuples.
cmlenz
parents:
129
diff
changeset
|
20 from setuptools import setup |
84
0a1843b2c096
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
21 except ImportError: |
0a1843b2c096
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
22 from distutils.core import setup |
426 | 23 import sys |
1 | 24 |
382
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
25 |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
26 class build_doc(Command): |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
27 description = 'Builds the documentation' |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
28 user_options = [] |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
29 |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
30 def initialize_options(self): |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
31 pass |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
32 |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
33 def finalize_options(self): |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
34 pass |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
35 |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
36 def run(self): |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
37 from docutils.core import publish_cmdline |
426 | 38 docutils_conf = os.path.join('doc', 'docutils.conf') |
39 epydoc_conf = os.path.join('doc', 'epydoc.conf') | |
382
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
40 |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
41 for source in glob('doc/*.txt'): |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
42 dest = os.path.splitext(source)[0] + '.html' |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
43 if not os.path.exists(dest) or \ |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
44 os.path.getmtime(dest) < os.path.getmtime(source): |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
45 print 'building documentation file %s' % dest |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
46 publish_cmdline(writer_name='html', |
426 | 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.' | |
382
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
64 |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
65 |
394 | 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 | |
1 | 82 setup( |
230 | 83 name = 'Genshi', |
455 | 84 version = '0.5', |
230 | 85 description = 'A toolkit for stream-based generation of output for the web', |
148
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
86 long_description = \ |
452 | 87 """Genshi is a Python library that provides an integrated set of |
88 components for parsing, generating, and processing HTML, XML or | |
89 other textual content for output generation on the web. The major | |
90 feature is a template language, which is heavily inspired by Kid.""", | |
148
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
91 author = 'Edgewall Software', |
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
92 author_email = 'info@edgewall.org', |
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
93 license = 'BSD', |
230 | 94 url = 'http://genshi.edgewall.org/', |
256 | 95 download_url = 'http://genshi.edgewall.org/wiki/Download', |
148
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
96 zip_safe = True, |
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
97 |
124
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
98 classifiers = [ |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
99 'Development Status :: 4 - Beta', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
100 'Environment :: Web Environment', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
101 'Intended Audience :: Developers', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
102 'License :: OSI Approved :: BSD License', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
103 'Operating System :: OS Independent', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
104 'Programming Language :: Python', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
105 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
106 'Topic :: Software Development :: Libraries :: Python Modules', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
107 'Topic :: Text Processing :: Markup :: HTML', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
108 'Topic :: Text Processing :: Markup :: XML' |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
109 ], |
215 | 110 keywords = ['python.templating.engines'], |
452 | 111 packages = ['genshi', 'genshi.filters', 'genshi.template'], |
230 | 112 test_suite = 'genshi.tests.suite', |
84
0a1843b2c096
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
113 |
148
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
114 extras_require = {'plugin': ['setuptools>=0.6a2']}, |
4
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
1
diff
changeset
|
115 entry_points = """ |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
1
diff
changeset
|
116 [python.templating.engines] |
336
7763f7aec949
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
117 genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] |
7763f7aec949
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
118 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] |
7763f7aec949
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
119 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin] |
4
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
1
diff
changeset
|
120 """, |
382
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
121 |
492 | 122 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc} |
1 | 123 ) |