-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·341 lines (281 loc) · 9.25 KB
/
setup.py
File metadata and controls
executable file
·341 lines (281 loc) · 9.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# cython: language_level=3, always_allow_keywords=True
# Setup script for XIST
import os, re
import setuptools
havecython = False
if "LL_USE_CYTHON" in os.environ:
try:
from Cython.Distutils import build_ext
havecython = True
except ImportError:
pass
DESCRIPTION = """
XIST provides an extensible HTML and XML generator. XIST is also a XML parser
with a very simple and pythonesque tree API. Every XML element type corresponds
to a Python class and these Python classes provide a conversion method to
transform the XML tree (e.g. into HTML). XIST can be considered
'object oriented XSLT'.
XIST also includes the following modules and packages:
* :mod:`ll.ul4c` is compiler for a cross-platform templating language with
similar capabilities to `Django's templating language`__. ``UL4`` templates
are compiled to an internal format, which makes it possible to implement
template renderers in other languages and makes the template code "secure"
(i.e. template code can't open or delete files).
__ https://docs.djangoproject.com/en/1.5/topics/templates/
There are implementations for Python, Java and Javascript.
* :mod:`ll.ul4on` provides functions for encoding and decoding a lightweight
machine-readable text-based format for serializing the object types supported
by UL4. It is extensible to allow encoding/decoding arbitrary instances
(i.e. it is basically a reimplementation of :mod:`pickle`, but with string
input/output instead of bytes and with an eye towards cross-plattform
support).
There are implementations for Python, Java and Javascript.
* :mod:`ll.orasql` provides utilities for working with oracledb_:
- It allows calling functions and procedures with keyword arguments.
- Query results will be put into Record objects, where database fields
are accessible as object attributes.
- The :class:`Connection` class provides methods for iterating through the
database metadata.
- Importing the modules adds support for URLs with the scheme ``oracle`` to
:mod:`ll.url`.
.. _oracledb: https://oracle.github.io/python-oracledb/
* :mod:`ll.vsql` provides a way to build Oracle SQL queries safely and
dynamically using UL4 expressions. Instead of manually concatenating strings,
you can express query logic with vSQL (a variant of UL4), which is then
compiled into proper SQL. This approach eliminates the risky parts of query
construction, effectively preventing SQL injection attacks, while offering
the expressive power of an ORM without the overhead.
* :mod:`ll.make` is an object oriented make replacement. Like make it allows
you to specify dependencies between files and actions to be executed
when files don't exist or are out of date with respect to one
of their sources. But unlike make you can do this in a object oriented
way and targets are not only limited to files.
* :mod:`ll.color` provides classes and functions for handling RGB color values.
This includes the ability to convert between different color models
(RGB, HSV, HLS) as well as to and from CSS format, and several functions
for modifying and mixing colors.
* :mod:`ll.sisyphus` provides classes for running Python scripts as cron jobs.
* :mod:`ll.url` provides classes for parsing and constructing RFC 2396
compliant URLs.
* :mod:`ll.nightshade` can be used to serve the output of PL/SQL
functions/procedures with CherryPy__.
* :mod:`ll.misc` provides several small utility functions and classes.
* :mod:`ll.astyle` can be used for colored terminal output (via ANSI escape
sequences).
* :mod:`ll.daemon` can be used on UNIX to fork a daemon process.
* :mod:`ll.xml_codec` contains a complete codec for encoding and decoding XML.
__ http://www.cherrypy.org/
"""
CLASSIFIERS = """
# Common
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.13
Topic :: Software Development :: Libraries :: Python Modules
# ansistyle
Topic :: Terminals
Topic :: Text Processing :: General
# color
Topic :: Multimedia :: Graphics
# make
Topic :: Software Development :: Build Tools
# daemon
Environment :: No Input/Output (Daemon)
Operating System :: POSIX
# url
Topic :: Internet
Topic :: Internet :: File Transfer Protocol (FTP)
Topic :: Internet :: WWW/HTTP
# ul4
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Text Processing :: General
# xml_codec
Topic :: Text Processing :: Markup :: XML
# XIST
Environment :: Web Environment
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Internet :: WWW/HTTP :: Site Management
Topic :: Text Processing :: Markup :: HTML
Topic :: Text Processing :: Markup :: XML
# TOXIC
Topic :: Database
# orasql
Topic :: Database
"""
KEYWORDS = """
# misc
property
decorator
iterator
# ansistyle
ANSI
escape sequence
color
terminal
# color
color
RGB
HSV
HSB
HLS
CSS
# make
make
build
# sisyphus
cron
job
# url
URL
RFC 2396
HTTP
FTP
ssh
execnet
# xml_codec
XML
codec
# XIST
XML
HTML
XHTML
XSLT
HSC
XSL-FO
SVG
# TOXIC
Oracle
user defined function
PL/SQL
XML
HTML
processing instruction
PI
# ul4
template
templating language
# vSQL
ORM
# orasql
Oracle
cx_Oracle
record
procedure
schema
# nightshade
CherryPy
toxic
Oracle
PL/SQL
"""
try:
news = list(open("docs/NEWS.rst", "r", encoding="utf-8"))
except IOError:
description = DESCRIPTION.strip()
else:
# Extract the first section (which are the changes for the current version)
underlines = [i for (i, line) in enumerate(news) if line.startswith("---")]
news = news[underlines[0]-1:underlines[1]-1]
news = "".join(news)
description = f"{DESCRIPTION.strip()}\n\n\n{news}"
# Get rid of text roles PyPI doesn't know about
description = re.subn(":[a-z]+:`~?([-a-zA-Z0-9_./]+)`", "``\\1``", description)[0]
# Expand tabs (so they won't show up as 8 spaces in the Windows installer)
description = description.expandtabs(2)
args = dict(
name="ll-xist",
version="5.83",
description="Extensible HTML/XML generator, cross-platform templating language, ORM, Oracle utilities and various other tools",
long_description=description,
author="Walter Doerwald",
author_email="walter@livinglogic.de",
url="http://python.livinglogic.de/",
download_url="http://python.livinglogic.de/DOWNLOAD.html",
license="MIT",
classifiers=sorted({c for c in CLASSIFIERS.strip().splitlines() if c.strip() and not c.strip().startswith("#")}),
keywords=", ".join(sorted({k.strip() for k in KEYWORDS.strip().splitlines() if k.strip() and not k.strip().startswith("#")})),
package_dir={"": "src"},
packages=["antlr3", "ll", "ll.scripts", "ll.xist", "ll.xist.ns", "ll.xist.scripts", "ll.orasql", "ll.orasql.scripts"],
package_data={"ll.xist": ["data/px/*.gif"]},
ext_modules=[
setuptools.Extension("ll._ansistyle", ["src/ll/_ansistyle.c"]),
setuptools.Extension("ll._misc", ["src/ll/_misc.c"]),
setuptools.Extension("ll._xml_codec", ["src/ll/_xml_codec.c", "src/ll/_xml_codec_include1.c", "src/ll/_xml_codec_include2.c"]),
setuptools.Extension("ll.xist.sgmlop", ["src/ll/xist/sgmlop.c"]),
],
entry_points=dict(
console_scripts=[
"uls = ll.scripts.uls:main",
"ucp = ll.scripts.ucp:main",
"ucat = ll.scripts.ucat:main",
"udiff = ll.scripts.udiff:main",
"uhpp = ll.xist.scripts.uhpp:main",
"rul4 = ll.scripts.rul4:main",
"dtd2xsc = ll.xist.scripts.dtd2xsc:main",
"tld2xsc = ll.xist.scripts.tld2xsc:main",
"doc2txt = ll.xist.scripts.doc2txt:main",
"xml2xsc = ll.xist.scripts.xml2xsc:main",
"oracreate = ll.orasql.scripts.oracreate:main [oracle]",
"oradrop = ll.orasql.scripts.oradrop:main [oracle]",
"oradelete = ll.orasql.scripts.oradelete:main [oracle]",
"orareindex = ll.orasql.scripts.orareindex:main [oracle]",
"oradiff = ll.orasql.scripts.oradiff:main [oracle]",
"oramerge = ll.orasql.scripts.oramerge:main [oracle]",
"oragrant = ll.orasql.scripts.oragrant:main [oracle]",
"orafind = ll.orasql.scripts.orafind:main [oracle]",
"oracycles = ll.orasql.scripts.oracycles:main [oracle]",
]
),
scripts=[
"scripts/uls.py",
"scripts/ucp.py",
"scripts/ucat.py",
"scripts/udiff.py",
"scripts/uhpp.py",
"scripts/rul4.py",
"scripts/dtd2xsc.py",
"scripts/tld2xsc.py",
"scripts/doc2txt.py",
"scripts/xml2xsc.py",
"scripts/oracreate.py",
"scripts/oradrop.py",
"scripts/oradelete.py",
"scripts/orareindex.py",
"scripts/oradiff.py",
"scripts/oramerge.py",
"scripts/oragrant.py",
"scripts/orafind.py",
"scripts/oracycles.py",
],
python_requires=">=3.10",
install_requires=[
"cssutils >= 2.6.0",
],
extras_require={
"oracle": ["oracledb >= 2.5.0"],
"postgres": ["psycopg[binary] >= 3.0.5"],
"proctitle": ["setproctitle >= 1.1.8"],
"html": ["lxml >= 4.3.4"],
"requests": ["requests >= 2.22.0"],
},
zip_safe=False,
)
if havecython:
args["cmdclass"] = {"build_ext": build_ext}
args["ext_modules"].extend([
# setuptools.Extension("ll.xist.xsc", ["src/ll/xist/xsc.py"]),
setuptools.Extension("ll.xist.parse", ["src/ll/xist/parse.py"]),
setuptools.Extension("ll.url", ["src/ll/url.py"]),
# setuptools.Extension("ll.ul4c", ["src/ll/ul4c.py"]),
setuptools.Extension("ll.misc", ["src/ll/misc.py"]),
# setuptools.Extension("ll.ul4on", ["src/ll/ul4on.py"]),
])
if __name__ == "__main__":
setuptools.setup(**args)