root/livinglogic.python.xist/setup.py @ 4533:35aca9b50120

Revision 4533:35aca9b50120, 7.4 KB (checked in by Walter Doerwald <walter@…>, 8 years ago)

Replace ll.xist.xsc.AttrProcInst? with ll.xist.xsc.AttrElement?.

This makes it possible to have a useful output for the new element outside of
attributes.

Make ll.xist.ns.ul4.attr_if an AttrElement? subclass.

Remove ll.xist.ns.ul4.attr_ifnn.

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 and packages:
23
24*   :mod:`ll.make` is an object oriented make replacement. Like make it allows
25    you to specify dependencies between files and actions to be executed
26    when files don't exist or are out of date with respect to one
27    of their sources. But unlike make you can do this in a object oriented
28    way and targets are not only limited to files.
29
30*   :mod:`ll.url` provides classes for parsing and constructing RFC 2396
31    compliant URLs.
32
33*   :mod:`ll.orasql` provides utilities for working with cx_Oracle_:
34
35    -   It allows calling functions and procedures with keyword arguments.
36
37    -   Query results will be put into Record objects, where database fields
38        are accessible as object attributes.
39
40    -   The :class:`Connection` class provides methods for iterating through the
41        database metadata.
42
43    -   Importing the modules adds support for URLs with the scheme ``oracle`` to
44        :mod:`ll.url`.
45
46    .. _cx_Oracle: http://cx-oracle.sourceforge.net/
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 (Java and Javascript are supported) and makes
52    the template code "secure" (i.e. template code can't open or delete files).
53
54    __ http://www.djangoproject.com/documentation/templates/
55
56*   :mod:`ll.astyle` can be used for colored terminal output (via ANSI escape
57    sequences).
58
59*   :mod:`ll.color` provides classes and functions for handling RGB color values.
60    This includes the ability to convert between different color models
61    (RGB, HSV, HLS) as well as to and from CSS format, and several functions
62    for modifying and mixing colors.
63
64*   :mod:`ll.misc` provides several small utility functions and classes.
65
66*   :mod:`ll.sisyphus` provides classes for running Python scripts as cron jobs.
67
68*   :mod:`ll.daemon` can be used on UNIX to fork a daemon process.
69
70*   :mod:`ll.xml_codec` contains a complete codec for encoding and decoding XML.
71
72*   :mod:`ll.nightshade` can be used to serve the output of PL/SQL
73    functions/procedures with CherryPy__.
74
75__ http://www.cherrypy.org/
76"""
77
78CLASSIFIERS = """
79# Common
80Development Status :: 5 - Production/Stable
81Intended Audience :: Developers
82License :: OSI Approved :: MIT License
83Operating System :: OS Independent
84Programming Language :: Python
85Topic :: Software Development :: Libraries :: Python Modules
86
87# ansistyle
88Topic :: Terminals
89Topic :: Text Processing :: General
90
91# color
92Topic :: Multimedia :: Graphics
93
94# make
95Topic :: Software Development :: Build Tools
96
97# daemon
98Environment :: No Input/Output (Daemon)
99Operating System :: POSIX
100
101# url
102Topic :: Internet
103Topic :: Internet :: File Transfer Protocol (FTP)
104Topic :: Internet :: WWW/HTTP
105
106# ul4
107Topic :: Internet :: WWW/HTTP :: Dynamic Content
108Topic :: Text Processing :: General
109
110# xml_codec
111Topic :: Text Processing :: Markup :: XML
112
113# XIST
114Environment :: Web Environment
115Topic :: Internet :: WWW/HTTP :: Dynamic Content
116Topic :: Internet :: WWW/HTTP :: Site Management
117Topic :: Text Processing :: Markup :: HTML
118Topic :: Text Processing :: Markup :: XML
119
120# TOXIC
121Topic :: Database
122
123# orasql
124Topic :: Database
125"""
126
127KEYWORDS = """
128# misc
129property
130decorator
131iterator
132
133# ansistyle
134ANSI
135escape sequence
136color
137terminal
138
139# color
140color
141RGB
142HSV
143HSB
144HLS
145CSS
146
147# make
148make
149build
150
151# sisyphus
152cron
153job
154
155# daemon
156daemon
157UNIX
158fork
159
160# url
161URL
162RFC 2396
163HTTP
164FTP
165ssh
166execnet
167
168# xml_codec
169XML
170codec
171
172# XIST
173XML
174HTML
175XHTML
176XSLT
177HSC
178XSL-FO
179SVG
180WML
181iHTML
182Relax NG
183
184# TOXIC
185Oracle
186user defined function
187PL/SQL
188XML
189HTML
190processing instruction
191PI
192
193# ul4
194template
195templating language
196
197# orasql
198Oracle
199cx_Oracle
200record
201procedure
202schema
203
204# nightshade
205CherryPy
206toxic
207Oracle
208PL/SQL
209"""
210
211try:
212    news = list(open("NEWS.rst", "r"))
213except IOError:
214    description = DESCRIPTION.strip()
215else:
216    # Extract the first section (which are the changes for the current version)
217    underlines = [i for (i, line) in enumerate(news) if line.startswith("---")]
218    news = news[underlines[0]-1:underlines[1]-1]
219    news = "".join(news)
220    description = "{}\n\n\n{}".format(DESCRIPTION.strip(), news)
221
222    # Get rid of text roles PyPI doesn't know about
223    description = re.subn(":[a-z]+:`([-a-zA-Z0-9_.]+)`", "``\\1``", description)[0]
224
225    # Expand tabs (so they won't show up as 8 spaces in the Windows installer)
226    description = description.expandtabs(2)
227
228args = dict(
229    name="ll-xist",
230    version="3.24",
231    description="Extensible HTML/XML generator, cross-platform templating language, Oracle utilities and various other tools",
232    long_description=description,
233    author="Walter Doerwald",
234    author_email="walter@livinglogic.de",
235    url="http://www.livinglogic.de/Python/xist/",
236    download_url="http://www.livinglogic.de/Python/Download.html#xist",
237    license="MIT",
238    classifiers=sorted({c for c in CLASSIFIERS.strip().splitlines() if c.strip() and not c.strip().startswith("#")}),
239    keywords=", ".join(sorted({k.strip() for k in KEYWORDS.strip().splitlines() if k.strip() and not k.strip().startswith("#")})),
240    package_dir={"": "src"},
241    packages=["ll", "ll.scripts", "ll.xist", "ll.xist.ns", "ll.xist.scripts", "ll.orasql", "ll.orasql.scripts"],
242    package_data={"ll.xist": ["data/js/*.js", "data/px/*.gif"]},
243    ext_modules=[
244        tools.Extension("ll._url", ["src/ll/_url.c"]),
245        tools.Extension("ll._ansistyle", ["src/ll/_ansistyle.c"]),
246        tools.Extension("ll._misc", ["src/ll/_misc.c", "src/ll/_misc_include.c"]),
247        tools.Extension("ll._xml_codec", ["src/ll/_xml_codec.c", "src/ll/_xml_codec_include.c"]),
248        tools.Extension("ll.xist.sgmlop", ["src/ll/xist/sgmlop.c"], define_macros=[("SGMLOP_UNICODE_SUPPORT", None)]),
249    ],
250    entry_points=dict(
251        console_scripts=[
252            "uls = ll.scripts.uls:main",
253            "ucp = ll.scripts.ucp:main",
254            "ucat = ll.scripts.ucat:main",
255            "db2ul4 = ll.scripts.db2ul4:main",
256            "dtd2xsc = ll.xist.scripts.dtd2xsc:main",
257            "tld2xsc = ll.xist.scripts.tld2xsc:main",
258            "doc2txt = ll.xist.scripts.doc2txt:main",
259            "xml2xsc = ll.xist.scripts.xml2xsc:main",
260            "oracreate = ll.orasql.scripts.oracreate:main [oracle]",
261            "oradrop = ll.orasql.scripts.oradrop:main [oracle]",
262            "oradelete = ll.orasql.scripts.oradelete:main [oracle]",
263            "oradiff = ll.orasql.scripts.oradiff:main [oracle]",
264            "oramerge = ll.orasql.scripts.oramerge:main [oracle]",
265            "oragrant = ll.orasql.scripts.oragrant:main [oracle]",
266            "orafind = ll.orasql.scripts.orafind:main [oracle]",
267        ]
268    ),
269    scripts=[
270        "scripts/uls.py",
271        "scripts/ucp.py",
272        "scripts/ucat.py",
273        "scripts/db2ul4.py",
274        "scripts/dtd2xsc.py",
275        "scripts/tld2xsc.py",
276        "scripts/doc2txt.py",
277        "scripts/xml2xsc.py",
278        "scripts/oracreate.py",
279        "scripts/oradrop.py",
280        "scripts/oradelete.py",
281        "scripts/oradiff.py",
282        "scripts/oramerge.py",
283        "scripts/oragrant.py",
284        "scripts/orafind.py",
285    ],
286    install_requires=[
287        "cssutils == 0.9.7",
288    ],
289    extras_require = {
290        "oracle":  ["cx_Oracle >= 5.1, < 5.2"],
291    },
292    namespace_packages=["ll"],
293    zip_safe=False,
294    dependency_links=[
295        "http://cx-oracle.sourceforge.net/", # cx_Oracle
296    ],
297)
298
299
300if __name__ == "__main__":
301    tools.setup(**args)
Note: See TracBrowser for help on using the browser.