Mercurial > genshi > genshi-test
annotate setup.py @ 771:b4c973fbe6f5
Unbuffered match templates could result in parts of the matched content being included in the output if the match template didn't actually consume it via one or more calls to the `select()` function. Closes #243. Thanks to Felix Schwarz for the report and test case.
author | cmlenz |
---|---|
date | Mon, 07 Jul 2008 16:35:06 +0000 |
parents | 3a456053fa1a |
children | d30a27266b45 |
rev | line source |
---|---|
1 | 1 #!/usr/bin/env python |
2 # -*- coding: utf-8 -*- | |
3 # | |
719 | 4 # Copyright (C) 2006-2008 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
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
15 from distutils.cmd import Command |
541 | 16 from distutils.command.build_ext import build_ext |
673
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
17 from distutils.errors import CCompilerError, DistutilsPlatformError |
382
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
18 import doctest |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
19 from glob import glob |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
20 import os |
84
894576e2b813
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
21 try: |
541 | 22 from setuptools import setup, Extension, Feature |
84
894576e2b813
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
23 except ImportError: |
541 | 24 from distutils.core import setup, Extension |
25 Feature = None | |
426 | 26 import sys |
1 | 27 |
585
e0d57ab9b0be
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
28 sys.path.append(os.path.join('doc', 'common')) |
e0d57ab9b0be
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
29 try: |
e0d57ab9b0be
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
30 from doctools import build_doc, test_doc |
e0d57ab9b0be
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
31 except ImportError: |
e0d57ab9b0be
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
32 build_doc = test_doc = None |
394 | 33 |
34 | |
541 | 35 class optional_build_ext(build_ext): |
36 # This class allows C extension building to fail. | |
673
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
37 def run(self): |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
38 try: |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
39 build_ext.run(self) |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
40 except DistutilsPlatformError: |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
41 self._unavailable() |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
42 |
541 | 43 def build_extension(self, ext): |
44 try: | |
45 build_ext.build_extension(self, ext) | |
46 except CCompilerError, x: | |
673
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
47 self._unavailable() |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
48 |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
49 def _unavailable(self): |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
50 print '*' * 70 |
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
51 print """WARNING: |
541 | 52 An optional C extension could not be compiled, speedups will not be |
53 available.""" | |
673
3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
54 print '*' * 70 |
541 | 55 |
56 | |
57 if Feature: | |
58 speedups = Feature( | |
59 "optionial C speed-enhancements", | |
60 standard = True, | |
61 ext_modules = [ | |
62 Extension('genshi._speedups', ['genshi/_speedups.c']), | |
63 ], | |
64 ) | |
65 else: | |
66 speedups = None | |
67 | |
1 | 68 setup( |
230 | 69 name = 'Genshi', |
749 | 70 version = '0.6', |
599
e4ec94fcb0c0
Get rid of the previously overemphasized term ?stream-based? in the tagline, which seems to turn some people off.
cmlenz
parents:
596
diff
changeset
|
71 description = 'A toolkit for generation of output for the web', |
148
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
72 long_description = \ |
452 | 73 """Genshi is a Python library that provides an integrated set of |
74 components for parsing, generating, and processing HTML, XML or | |
75 other textual content for output generation on the web. The major | |
76 feature is a template language, which is heavily inspired by Kid.""", | |
148
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
77 author = 'Edgewall Software', |
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
78 author_email = 'info@edgewall.org', |
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
79 license = 'BSD', |
230 | 80 url = 'http://genshi.edgewall.org/', |
256 | 81 download_url = 'http://genshi.edgewall.org/wiki/Download', |
148
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
82 zip_safe = True, |
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
83 |
124
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
84 classifiers = [ |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
85 'Development Status :: 4 - Beta', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
86 'Environment :: Web Environment', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
87 'Intended Audience :: Developers', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
88 'License :: OSI Approved :: BSD License', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
89 'Operating System :: OS Independent', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
90 'Programming Language :: Python', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
91 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
92 'Topic :: Software Development :: Libraries :: Python Modules', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
93 'Topic :: Text Processing :: Markup :: HTML', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
94 'Topic :: Text Processing :: Markup :: XML' |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
95 ], |
215 | 96 keywords = ['python.templating.engines'], |
452 | 97 packages = ['genshi', 'genshi.filters', 'genshi.template'], |
230 | 98 test_suite = 'genshi.tests.suite', |
84
894576e2b813
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
99 |
530 | 100 extras_require = { |
101 'i18n': ['Babel>=0.8'], | |
102 'plugin': ['setuptools>=0.6a2'] | |
103 }, | |
4
f8612f05af99
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
|
104 entry_points = """ |
528
f38ce008ab0a
Integrated [http://babel.edgewall.org/ Babel] message extraction plugin, and added I18n doc page.
cmlenz
parents:
508
diff
changeset
|
105 [babel.extractors] |
530 | 106 genshi = genshi.filters.i18n:extract[i18n] |
528
f38ce008ab0a
Integrated [http://babel.edgewall.org/ Babel] message extraction plugin, and added I18n doc page.
cmlenz
parents:
508
diff
changeset
|
107 |
4
f8612f05af99
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
|
108 [python.templating.engines] |
336
5f2c7782cd8a
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
109 genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] |
5f2c7782cd8a
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
110 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] |
5f2c7782cd8a
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
111 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin] |
4
f8612f05af99
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
|
112 """, |
382
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
113 |
541 | 114 features = {'speedups': speedups}, |
115 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc, | |
116 'build_ext': optional_build_ext} | |
1 | 117 ) |