root/livinglogic.python.xist/setup.py @ 3708:5fb0da6822fd

Revision 3708:5fb0da6822fd, 5.8 KB (checked in by Walter Doerwald <walter@…>, 10 years ago)

Bump version number. Fix release date.

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