include MANIFEST.in
-include README.rst
+include README.md
include LICENSE
include setup.py
include src/*.h
Metadata-Version: 1.1
Name: pysqlite3
-Version: 0.2.0
+Version: 0.2.1
Summary: DB-API 2.0 interface for Sqlite 3.x
-Home-page: https://github.com/rigglemania/pysqlcipher3
+Home-page: https://github.com/coleifer/pysqlite3
Author: Charles Leifer
Author-email: coleifer@gmail.com
License: zlib/libpng
--- /dev/null
+pysqlite3
+=========
+
+This library takes the SQLite module from Python 3.6.4 and packages it as a
+separately-installable module.
+
+This may be useful for creating SQLite modules capable of working with other
+versions of SQLite (via the amalgamation option).
+
+Additional features:
+
+* Support for user-defined window functions (requires SQLite >= 3.25)
+* Support specifying flags when opening connection
+* Support specifying VFS when opening connection
+
+Building with System SQLite
+---------------------------
+
+To build `pysqlite3` linked against the system SQLite, run:
+
+```
+$ python setup.py build
+```
+
+Building a statically-linked library
+------------------------------------
+
+To build `pysqlite3` statically-linked against a particular version of SQLite,
+you need to obtain the SQLite3 source code and copy `sqlite3.c` and `sqlite3.h`
+into the source tree.
+
+```
+# Download the latest version of SQLite source code and build the source
+# amalgamation files (sqlite3.c and sqlite3.h).
+$ wget https://www.sqlite.org/src/tarball/sqlite.tar.gz
+$ tar xzf sqlite.tar.gz
+$ cd sqlite/
+$ ./configure
+$ make sqlite3.c
+
+# Copy the sqlite3 amalgamation files into the root of the pysqlite3 checkout
+# and run build_static + build:
+$ cp sqlite/sqlite3.[ch] pysqlite3/
+$ cd pysqlite3
+$ python setup.py build_static build
+```
+
+You now have a statically-linked, completely self-contained `pysqlite3`.
+
+<small>Original code (c) Gerhard Häring</small>
+++ /dev/null
-pysqlite3
-=========
-
-This library takes the SQLite module from Python 3.6.4 and packages it as a
-separately-installable module.
-
-This may be useful for creating SQLite modules capable of working with other
-versions of SQLite (via the amalgamation option).
-
-Additional features:
-
-* Support for user-defined window functions (requires SQLite >= 3.25)
-* Support specifying flags when opening connection
-* Support specifying VFS when opening connection
-
-Original code (c) Gerhard Häring
Metadata-Version: 1.1
Name: pysqlite3
-Version: 0.2.0
+Version: 0.2.1
Summary: DB-API 2.0 interface for Sqlite 3.x
-Home-page: https://github.com/rigglemania/pysqlcipher3
+Home-page: https://github.com/coleifer/pysqlite3
Author: Charles Leifer
Author-email: coleifer@gmail.com
License: zlib/libpng
LICENSE
MANIFEST.in
-README.rst
+README.md
setup.cfg
setup.py
lib/__init__.py
# If you need to change anything, it should be enough to change setup.cfg.
PACKAGE_NAME = 'pysqlite3'
-VERSION = '0.2.0'
+VERSION = '0.2.1'
# define sqlite sources
sources = [os.path.join('src', source)
class AmalgationLibSqliteBuilder(build_ext):
description = "Builds a C extension using a sqlite3 amalgamation"
- amalgamation_root = "amalgamation"
+ amalgamation_root = "."
amalgamation_header = os.path.join(amalgamation_root, 'sqlite3.h')
amalgamation_source = os.path.join(amalgamation_root, 'sqlite3.c')
- amalgamation_message = \
- """Sqlite amalgamation not found. Please download or build the
- amalgamation and make sure the following files are present in the
- amalgamation folder: sqlite3.h, sqlite3.c"""
+ amalgamation_message = ('Sqlite amalgamation not found. Please download '
+ 'or build the amalgamation and make sure the '
+ 'following files are present in the pysqlite3 '
+ 'folder: sqlite3.h, sqlite3.c')
def check_amalgamation(self):
if not os.path.exists(self.amalgamation_root):
for feature in features:
ext.define_macros.append(('SQLITE_%s' % feature, '1'))
- # Additional options
-
# Always use memory for temp store.
ext.define_macros.append(("SQLITE_TEMP_STORE", "3"))
ext.sources.append(os.path.join(self.amalgamation_root, "sqlite3.c"))
if sys.platform != "win32":
- # Include math library.
+ # Include math library, required for fts5.
ext.extra_link_args.append("-lm")
build_ext.build_extension(self, ext)
author_email="coleifer@gmail.com",
license="zlib/libpng",
platforms="ALL",
- url="https://github.com/rigglemania/pysqlcipher3",
+ url="https://github.com/coleifer/pysqlite3",
package_dir={PACKAGE_NAME: "lib"},
packages=packages,
ext_modules=[Extension(
"Topic :: Database :: Database Engines/Servers",
"Topic :: Software Development :: Libraries :: Python Modules"],
cmdclass={
- "build_amalgamation": AmalgationLibSqliteBuilder,
+ "build_static": AmalgationLibSqliteBuilder,
"build_ext": SystemLibSqliteBuilder
}
)
aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
if (!*aggregate_instance) {
- /* this branch is executed if there was an exception in the aggregate's
- * __init__ */
-
goto error;
}
- /* Keep the exception (if any) of the last call to step() */
+ /* Keep the exception (if any) of the last call to step() or inverse() */
PyErr_Fetch(&exception, &val, &tb);
restore = 1;
aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
if (!*aggregate_instance) {
- /* this branch is executed if there was an exception in the aggregate's
- * __init__ */
-
goto error;
}