annotate setup.py @ 902:09cc3627654c experimental-inline

Sync `experimental/inline` branch with [source:trunk@1126].
author cmlenz
date Fri, 23 Apr 2010 21:08:26 +0000
parents 1837f39efd6f
children
rev   line source
1
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
1 #!/usr/bin/env python
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
2 # -*- coding: utf-8 -*-
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
3 #
902
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
4 # Copyright (C) 2006-2010 Edgewall Software
1
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
5 # All rights reserved.
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
6 #
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
7 # This software is licensed as described in the file COPYING, which
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
8 # you should have received as part of this distribution. The terms
230
24757b771651 Renamed Markup to Genshi in repository.
cmlenz
parents: 215
diff changeset
9 # are also available at http://genshi.edgewall.org/wiki/License.
1
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
10 #
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
11 # This software consists of voluntary contributions made by many
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
12 # individuals. For the exact contribution history, see the revision
230
24757b771651 Renamed Markup to Genshi in repository.
cmlenz
parents: 215
diff changeset
13 # history and logs, available at http://genshi.edgewall.org/log/.
1
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
14
395
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
15 from distutils.cmd import Command
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
16 from distutils.command.build_ext import build_ext
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
17 from distutils.errors import CCompilerError, DistutilsPlatformError
395
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
18 import doctest
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
19 from glob import glob
55cf81951686 inline branch: Merged [439:479/trunk].
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:
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
22 from setuptools import setup, Extension, Feature
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
23 from setuptools.command.bdist_egg import bdist_egg
84
894576e2b813 Make dependency of the setup script on setuptools optional.
cmlenz
parents: 66
diff changeset
24 except ImportError:
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
25 from distutils.core import setup, Extension
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
26 Feature = None
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
27 bdist_egg = None
500
0742f421caba Merged revisions 487-603 via svnmerge from
cmlenz
parents: 395
diff changeset
28 import sys
1
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
29
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
30 sys.path.append(os.path.join('doc', 'common'))
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
31 try:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
32 from doctools import build_doc, test_doc
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
33 except ImportError:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
34 build_doc = test_doc = None
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
35
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
36 _speedup_available = False
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
37
902
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
38
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
39 class optional_build_ext(build_ext):
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
40 # This class allows C extension building to fail.
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
41 def run(self):
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
42 try:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
43 build_ext.run(self)
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
44 except DistutilsPlatformError, e:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
45 self._unavailable(e)
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
46
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
47 def build_extension(self, ext):
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
48 try:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
49 build_ext.build_extension(self, ext)
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
50 global _speedup_available
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
51 _speedup_available = True
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
52 except CCompilerError, e:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
53 self._unavailable(e)
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
54
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
55 def _unavailable(self, exc):
902
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
56 print('*' * 70)
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
57 print("""WARNING:
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
58 An optional C extension could not be compiled, speedups will not be
902
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
59 available.""")
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
60 print('*' * 70)
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
61 print(exc)
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
62
395
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
63
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
64 if Feature:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
65 speedups = Feature(
902
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
66 "optional C speed-enhancements",
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
67 standard = False,
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
68 ext_modules = [
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
69 Extension('genshi._speedups', ['genshi/_speedups.c']),
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
70 ],
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
71 )
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
72 else:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
73 speedups = None
395
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
74
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
75
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
76 # Setuptools need some help figuring out if the egg is "zip_safe" or not
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
77 if bdist_egg:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
78 class my_bdist_egg(bdist_egg):
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
79 def zip_safe(self):
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
80 return not _speedup_available and bdist_egg.zip_safe(self)
395
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
81
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
82
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
83 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc,
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
84 'build_ext': optional_build_ext}
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
85 if bdist_egg:
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
86 cmdclass['bdist_egg'] = my_bdist_egg
395
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
87
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
88
1
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
89 setup(
230
24757b771651 Renamed Markup to Genshi in repository.
cmlenz
parents: 215
diff changeset
90 name = 'Genshi',
902
09cc3627654c Sync `experimental/inline` branch with [source:trunk@1126].
cmlenz
parents: 820
diff changeset
91 version = '0.7',
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
92 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
93 long_description = \
500
0742f421caba Merged revisions 487-603 via svnmerge from
cmlenz
parents: 395
diff changeset
94 """Genshi is a Python library that provides an integrated set of
0742f421caba Merged revisions 487-603 via svnmerge from
cmlenz
parents: 395
diff changeset
95 components for parsing, generating, and processing HTML, XML or
0742f421caba Merged revisions 487-603 via svnmerge from
cmlenz
parents: 395
diff changeset
96 other textual content for output generation on the web. The major
0742f421caba Merged revisions 487-603 via svnmerge from
cmlenz
parents: 395
diff changeset
97 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
98 author = 'Edgewall Software',
a0a52cf4e4de Added changelog file, plus some README and setup tweaks.
cmlenz
parents: 145
diff changeset
99 author_email = 'info@edgewall.org',
a0a52cf4e4de Added changelog file, plus some README and setup tweaks.
cmlenz
parents: 145
diff changeset
100 license = 'BSD',
230
24757b771651 Renamed Markup to Genshi in repository.
cmlenz
parents: 215
diff changeset
101 url = 'http://genshi.edgewall.org/',
256
3ea3977c8c4d Fix download URL.
cmlenz
parents: 255
diff changeset
102 download_url = 'http://genshi.edgewall.org/wiki/Download',
148
a0a52cf4e4de Added changelog file, plus some README and setup tweaks.
cmlenz
parents: 145
diff changeset
103
124
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
104 classifiers = [
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
105 'Development Status :: 4 - Beta',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
106 'Environment :: Web Environment',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
107 'Intended Audience :: Developers',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
108 'License :: OSI Approved :: BSD License',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
109 'Operating System :: OS Independent',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
110 'Programming Language :: Python',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
111 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
112 'Topic :: Software Development :: Libraries :: Python Modules',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
113 'Topic :: Text Processing :: Markup :: HTML',
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
114 'Topic :: Text Processing :: Markup :: XML'
9a2acebe84f7 Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents: 84
diff changeset
115 ],
215
e92135672812 A couple of minor XPath fixes.
cmlenz
parents: 189
diff changeset
116 keywords = ['python.templating.engines'],
500
0742f421caba Merged revisions 487-603 via svnmerge from
cmlenz
parents: 395
diff changeset
117 packages = ['genshi', 'genshi.filters', 'genshi.template'],
230
24757b771651 Renamed Markup to Genshi in repository.
cmlenz
parents: 215
diff changeset
118 test_suite = 'genshi.tests.suite',
84
894576e2b813 Make dependency of the setup script on setuptools optional.
cmlenz
parents: 66
diff changeset
119
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
120 extras_require = {
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
121 'i18n': ['Babel>=0.8'],
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
122 'plugin': ['setuptools>=0.6a2']
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
123 },
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
124 entry_points = """
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
125 [babel.extractors]
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
126 genshi = genshi.filters.i18n:extract[i18n]
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
127
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
128 [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
129 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
130 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
131 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
132 """,
395
55cf81951686 inline branch: Merged [439:479/trunk].
cmlenz
parents: 336
diff changeset
133
820
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
134 features = {'speedups': speedups},
1837f39efd6f Sync (old) experimental inline branch with trunk@1027.
cmlenz
parents: 500
diff changeset
135 cmdclass = cmdclass
1
821114ec4f69 Initial import.
cmlenz
parents:
diff changeset
136 )
Copyright (C) 2012-2017 Edgewall Software