Mercurial > genshi > mirror
annotate setup.py @ 850:e8f596c726c4 trunk
Update copyright years on files changed due to advanced-i18n merge.
author | cmlenz |
---|---|
date | Tue, 10 Nov 2009 20:57:32 +0000 |
parents | f5076e2a9786 |
children | f33ecf3c319e |
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
2682dabbcd04
* 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
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
17 from distutils.errors import CCompilerError, DistutilsPlatformError |
382
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
18 import doctest |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
19 from glob import glob |
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
20 import os |
84
0a1843b2c096
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
21 try: |
541 | 22 from setuptools import setup, Extension, Feature |
786
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
23 from setuptools.command.bdist_egg import bdist_egg |
84
0a1843b2c096
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
24 except ImportError: |
541 | 25 from distutils.core import setup, Extension |
26 Feature = None | |
786
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
27 bdist_egg = None |
426 | 28 import sys |
1 | 29 |
585
db133252d1ff
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
30 sys.path.append(os.path.join('doc', 'common')) |
db133252d1ff
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
31 try: |
db133252d1ff
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
32 from doctools import build_doc, test_doc |
db133252d1ff
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
33 except ImportError: |
db133252d1ff
Documentation stuff moved to a common shared repository.
cmlenz
parents:
541
diff
changeset
|
34 build_doc = test_doc = None |
394 | 35 |
786
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
36 _speedup_available = False |
394 | 37 |
541 | 38 class optional_build_ext(build_ext): |
39 # This class allows C extension building to fail. | |
673
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
40 def run(self): |
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
41 try: |
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
42 build_ext.run(self) |
795 | 43 except DistutilsPlatformError, e: |
44 self._unavailable(e) | |
673
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
45 |
541 | 46 def build_extension(self, ext): |
47 try: | |
48 build_ext.build_extension(self, ext) | |
786
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
49 global _speedup_available |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
50 _speedup_available = True |
795 | 51 except CCompilerError, e: |
52 self._unavailable(e) | |
673
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
53 |
795 | 54 def _unavailable(self, exc): |
673
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
55 print '*' * 70 |
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
56 print """WARNING: |
541 | 57 An optional C extension could not be compiled, speedups will not be |
58 available.""" | |
673
ae54722b00d1
Ignore missing compiler errors on Windows. Fixes #174 and #165.
athomas
parents:
599
diff
changeset
|
59 print '*' * 70 |
795 | 60 print exc |
541 | 61 |
62 | |
63 if Feature: | |
64 speedups = Feature( | |
65 "optionial C speed-enhancements", | |
66 standard = True, | |
67 ext_modules = [ | |
68 Extension('genshi._speedups', ['genshi/_speedups.c']), | |
69 ], | |
70 ) | |
71 else: | |
72 speedups = None | |
73 | |
786
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
74 |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
75 # Setuptools need some help figuring out if the egg is "zip_safe" or not |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
76 if bdist_egg: |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
77 class my_bdist_egg(bdist_egg): |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
78 def zip_safe(self): |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
79 return not _speedup_available and bdist_egg.zip_safe(self) |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
80 |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
81 |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
82 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc, |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
83 'build_ext': optional_build_ext} |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
84 if bdist_egg: |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
85 cmdclass['bdist_egg'] = my_bdist_egg |
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
86 |
795 | 87 |
1 | 88 setup( |
230 | 89 name = 'Genshi', |
749 | 90 version = '0.6', |
599
eaf2a3171e12
Get rid of the previously overemphasized term ?stream-based? in the tagline, which seems to turn some people off.
cmlenz
parents:
596
diff
changeset
|
91 description = 'A toolkit for generation of output for the web', |
148
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
92 long_description = \ |
452 | 93 """Genshi is a Python library that provides an integrated set of |
94 components for parsing, generating, and processing HTML, XML or | |
95 other textual content for output generation on the web. The major | |
96 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
|
97 author = 'Edgewall Software', |
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
98 author_email = 'info@edgewall.org', |
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
99 license = 'BSD', |
230 | 100 url = 'http://genshi.edgewall.org/', |
256 | 101 download_url = 'http://genshi.edgewall.org/wiki/Download', |
148
dcc9dc25bc59
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
102 |
124
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
103 classifiers = [ |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
104 'Development Status :: 4 - Beta', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
105 'Environment :: Web Environment', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
106 'Intended Audience :: Developers', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
107 'License :: OSI Approved :: BSD License', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
108 'Operating System :: OS Independent', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
109 'Programming Language :: Python', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
110 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
111 'Topic :: Software Development :: Libraries :: Python Modules', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
112 'Topic :: Text Processing :: Markup :: HTML', |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
113 'Topic :: Text Processing :: Markup :: XML' |
a9a8db67bb5a
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
114 ], |
215 | 115 keywords = ['python.templating.engines'], |
452 | 116 packages = ['genshi', 'genshi.filters', 'genshi.template'], |
230 | 117 test_suite = 'genshi.tests.suite', |
84
0a1843b2c096
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
118 |
530 | 119 extras_require = { |
120 'i18n': ['Babel>=0.8'], | |
121 'plugin': ['setuptools>=0.6a2'] | |
122 }, | |
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
|
123 entry_points = """ |
528
24df908da22d
Integrated [http://babel.edgewall.org/ Babel] message extraction plugin, and added I18n doc page.
cmlenz
parents:
508
diff
changeset
|
124 [babel.extractors] |
530 | 125 genshi = genshi.filters.i18n:extract[i18n] |
528
24df908da22d
Integrated [http://babel.edgewall.org/ Babel] message extraction plugin, and added I18n doc page.
cmlenz
parents:
508
diff
changeset
|
126 |
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
|
127 [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
|
128 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
|
129 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
|
130 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
|
131 """, |
382
2682dabbcd04
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
132 |
541 | 133 features = {'speedups': speedups}, |
786
291700beaa94
Set zip_safe to False if the c speedup module is successfully built. Closes #252.
jonas
parents:
749
diff
changeset
|
134 cmdclass = cmdclass |
1 | 135 ) |