3
4
from distutils.core import setup, Extension
7
# Excludes the assertions
8
define_macros.append( ('NDEBUG', '1') )
8
# We always want threadsafe
9
define_macros.append( ('SQLITE_THREADSAFE', '1') )
11
# We don't want assertions
12
if "--debug" not in sys.argv:
13
define_macros.append( ('NDEBUG', '1') )
10
15
# This includes the functionality marked as experimental in SQLite 3.
11
16
# Comment out the line to exclude them
12
17
define_macros.append( ('EXPERIMENTAL', '1') )
14
# SQLite 3.3.9 disables extension loading by default. If you have
15
# re-enabled it then comment out the following line:
16
define_macros.append( ('SQLITE_OMIT_LOAD_EXTENSION', 1) )
19
# If you compiled SQLite omitting functionality then specify the same
20
# defines here. For example this exlcudes loadable extensions.
22
# define_macros.append( ('SQLITE_OMIT_LOAD_EXTENSION', '1') )
21
# if there is a sqlite3 subdirectory then use that
22
if os.path.exists("sqlite3"):
23
include_dirs=["sqlite3"]
24
library_dirs=["sqlite3"]
27
# Look for amalgamation in our directory or in sqlite3 subdirectory
29
os.path.join(os.path.dirname(os.path.abspath(__file__)), "sqlite3.c"),
30
os.path.join(os.path.dirname(os.path.abspath(__file__)), "sqlite3", "sqlite3.c")
33
usingamalgamation=False
34
for path in amalgamation:
35
if os.path.exists(path):
36
if sys.platform=="win32":
37
# double quotes get consumed by windows arg processing
38
define_macros.append( ('APSW_USE_SQLITE_AMALGAMATION', '\\"'+path+'\\"') )
40
define_macros.append( ('APSW_USE_SQLITE_AMALGAMATION', '"'+path+'"') )
42
usingamalgamation=True
45
if not usingamalgamation:
46
# if there is a sqlite3 subdirectory then use that, otherwise
47
# the system sqlite will be used
48
if os.path.exists("sqlite3"):
49
include_dirs=["sqlite3"]
50
library_dirs=["sqlite3"]
54
# setuptools likes to define NDEBUG even when we want debug stuff
55
if "--debug" in sys.argv:
56
define_macros.append( ('APSW_NO_NDEBUG', 1) ) # double negatives are bad
57
define_macros.append( ('SQLITE_DEBUG', 1) ) # also does NDEBUG mangling
28
60
# work out version number
29
61
version=open("apswversion.h", "rtU").read().split()[2].strip('"')
65
description="Another Python SQLite Wrapper",
67
"""A Python wrapper for the SQLite embedded relational database engine.
68
In contrast to other wrappers such as pysqlite it focuses on being
69
a minimal layer over SQLite attempting just to translate the
70
complete SQLite API into Python.""",
34
71
author="Roger Binns",
35
72
author_email="rogerb@rogerbinns.com",
36
description="Another Python SQLite Wrapper",
73
url="http://code.google.com/p/apsw/",
74
download_url="http://code.google.com/p/apsw/downloads/list",
76
"Development Status :: 5 - Production/Stable",
77
"Intended Audience :: Developers",
78
"License :: OSI Approved :: zlib/libpng License",
79
"Operating System :: OS Independent",
80
"Programming Language :: C",
81
"Topic :: Database :: Front-Ends",
83
keywords=["database", "sqlite"],
84
license="OSI Approved :: zlib/libpng License",
38
86
ext_modules=[Extension("apsw",