root/livinglogic.python.xist/setup.py @ 3548:d823a65b9d3c

Revision 3548:d823a65b9d3c, 5.9 KB (checked in by Walter Doerwald <walter@…>, 11 years ago)

Fix cssutils version at 0.9.5.

Line 
1#! /usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Setup script for XIST
5
6
7try:
8    import setuptools as tools
9except ImportError:
10    from distutils import core as tools
11
12import textwrap, re
13
14
15DESCRIPTION = """
16XIST is an extensible HTML and XML generator. XIST is also a XML parser with a
17very simple and pythonesque tree API. Every XML element type corresponds to a
18Python class and these Python classes provide a conversion method to transform
19the XML tree (e.g. into HTML). XIST can be considered 'object oriented XSLT'.
20
21XIST also includes the following modules:
22
23*   :mod:`ll.astyle` can be used for colored terminal output (via ANSI escape
24    sequences).
25
26*   :mod:`ll.color` provides classes and functions for handling RGB color values.
27    This includes the ability to convert between different color models
28    (RGB, HSV, HLS) as well as to and from CSS format, and several functions
29    for modifying and mixing colors.
30
31*   :mod:`ll.make` is an object oriented make replacement. Like make it allows
32    you to specify dependencies between files and actions to be executed
33    when files don't exist or are out of date with respect to one
34    of their sources. But unlike make you can do this in a object oriented
35    way and targets are not only limited to files, but you can implement
36    e.g. dependencies on database records.
37
38*   :mod:`ll.misc` provides several small utility functions and classes.
39
40*   :mod:`ll.sisyphus` provides classes for running Python scripts as cron jobs.
41
42*   :mod:`ll.daemon` can be used on UNIX to fork a daemon process.
43
44*   :mod:`ll.url` provides classes for parsing and constructing RFC 2396
45    compliant URLs.
46
47*   :mod:`ll.xpit` is a module that makes it possible to embed Python
48    expressions in text (as XML style processing instructions).
49
50*   :mod:`ll.ul4c` is compiler for a templating language with similar capabilities
51    to `Django's templating language`__. ``UL4`` templates are compiled to an
52    internal bytecode format, which makes it possible to implement template
53    renderers in other languages and makes the template code "secure" (i.e.
54    template code can't open or delete files).
55
56    __ http://www.djangoproject.com/documentation/templates/
57
58*   :mod:`ll.xml_codec` contains a complete codec for encoding and decoding XML.
59"""
60
61CLASSIFIERS = """
62# Common
63Development Status :: 5 - Production/Stable
64Intended Audience :: Developers
65License :: OSI Approved :: MIT License
66Operating System :: OS Independent
67Programming Language :: Python
68Topic :: Software Development :: Libraries :: Python Modules
69
70# ansistyle
71Topic :: Terminals
72Topic :: Text Processing :: General
73
74# color
75Topic :: Multimedia :: Graphics
76
77# make
78Topic :: Software Development :: Build Tools
79
80# daemon
81Environment :: No Input/Output (Daemon)
82Operating System :: POSIX
83
84# url
85Topic :: Internet
86Topic :: Internet :: File Transfer Protocol (FTP)
87Topic :: Internet :: WWW/HTTP
88
89# ul4
90Topic :: Internet :: WWW/HTTP :: Dynamic Content
91Topic :: Text Processing :: General
92
93# xpit
94Topic :: Text Processing :: Filters
95
96# xml_codec
97Topic :: Text Processing :: Markup :: XML
98
99# XIST
100Environment :: Web Environment
101Topic :: Internet :: WWW/HTTP :: Dynamic Content
102Topic :: Internet :: WWW/HTTP :: Site Management
103Topic :: Text Processing :: Markup :: HTML
104Topic :: Text Processing :: Markup :: XML
105
106# TOXIC
107Topic :: Database
108"""
109
110KEYWORDS = """
111# misc
112property
113decorator
114iterator
115
116# ansistyle
117ANSI
118escape sequence
119color
120terminal
121
122# color
123RGB
124HSV
125HSB
126HLS
127CSS
128red
129green
130blue
131hue
132saturation
133value
134brightness
135luminance
136
137# make
138make
139build
140
141# sisyphus
142cron
143job
144
145# daemon
146daemon
147UNIX
148fork
149
150# url
151URL
152RFC 2396
153HTTP
154FTP
155ssh
156py.execnet
157
158# xpit
159text
160template
161processing instruction
162
163# xml_codec
164XML
165codec
166decoding
167
168# XIST
169XML
170HTML
171XHTML
172XSLT
173HSC
174XSL-FO
175SVG
176WML
177iHTML
178Relax NG
179
180# TOXIC
181Oracle
182user defined function
183PL/SQL
184XML
185HTML
186processing instruction
187PI
188embed
189
190# ul4
191template
192"""
193
194try:
195    news = list(open("NEWS.rst", "r"))
196except IOError:
197    description = DESCRIPTION.strip()
198else:
199    # Extract the first section (which are the changes for the current version)
200    underlines = [i for (i, line) in enumerate(news) if line.startswith("---")]
201    news = news[underlines[0]-1:underlines[1]-1]
202    news = "".join(news)
203    descr = "%s\n\n\n%s" % (DESCRIPTION.strip(), news)
204
205    # Get rid of text roles PyPI doesn't know about
206    descr = re.subn(":[a-z]+:`([a-zA-Z0-9_.]+)`", "``\\1``", descr)[0]
207
208    # Expand tabs (so they won't show up as 8 spacces in the Windows installer)
209    descr = descr.expandtabs(2)
210
211args = dict(
212    name="ll-xist",
213    version="3.4",
214    description="Extensible HTML/XML generator",
215    long_description=descr,
216    author="Walter Doerwald",
217    author_email="walter@livinglogic.de",
218    url="http://www.livinglogic.de/Python/xist/",
219    download_url="http://www.livinglogic.de/Python/Download.html#xist",
220    license="MIT",
221    classifiers=sorted(set(c for c in CLASSIFIERS.strip().splitlines() if c.strip() and not c.strip().startswith("#"))),
222    keywords=", ".join(sorted(set(k.strip() for k in KEYWORDS.strip().splitlines() if k.strip() and not k.strip().startswith("#")))),
223    package_dir={"": "src"},
224    packages=["ll", "ll.scripts", "ll.xist", "ll.xist.ns", "ll.xist.scripts"],
225    ext_modules=[
226        tools.Extension("ll._url", ["src/ll/_url.c"]),
227        tools.Extension("ll._ansistyle", ["src/ll/_ansistyle.c"]),
228        tools.Extension("ll._misc", ["src/ll/_misc.c", "src/ll/_misc_include.c"]),
229        tools.Extension("ll._xml_codec", ["src/ll/_xml_codec.c", "src/ll/_xml_codec_include.c"]),
230        tools.Extension("ll.xist.sgmlop", ["src/ll/xist/sgmlop.c"], define_macros=[("SGMLOP_UNICODE_SUPPORT", None)]),
231    ],
232    entry_points=dict(
233        console_scripts=[
234            "ucp = ll.scripts.ucp:main",
235            "dtd2xsc = ll.xist.scripts.dtd2xsc:main",
236            "tld2xsc = ll.xist.scripts.tld2xsc:main",
237            "doc2txt = ll.xist.scripts.doc2txt:main",
238            "xml2xsc = ll.xist.scripts.xml2xsc:main",
239        ]
240    ),
241    scripts=[
242        "scripts/ucp.py",
243        "scripts/dtd2xsc.py",
244        "scripts/tld2xsc.py",
245        "scripts/doc2txt.py",
246        "scripts/xml2xsc.py",
247    ],
248    install_requires=[
249        "cssutils == 0.9.5",
250    ],
251    namespace_packages=["ll"],
252    zip_safe=False,
253)
254
255
256if __name__ == "__main__":
257    tools.setup(**args)
Note: See TracBrowser for help on using the browser.