Imported Upstream version 0.2.1 upstream/0.2.1
authorHyunjee Kim <hj0426.kim@samsung.com>
Fri, 10 Apr 2020 05:17:58 +0000 (14:17 +0900)
committerHyunjee Kim <hj0426.kim@samsung.com>
Fri, 10 Apr 2020 05:18:04 +0000 (14:18 +0900)
Change-Id: Ia79a620a5739235b97fdad605b1034f480470872
Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
MANIFEST.in
PKG-INFO
README.md [new file with mode: 0644]
README.rst [deleted file]
pysqlite3.egg-info/PKG-INFO
pysqlite3.egg-info/SOURCES.txt
setup.py
src/connection.c

index 979e8bf5ded1b26da085be7120dca3f90ed866b5..5b18d342c5fe91d7128b2c9eda9faa4733b6ab9e 100644 (file)
@@ -1,5 +1,5 @@
 include MANIFEST.in
-include README.rst
+include README.md
 include LICENSE
 include setup.py
 include src/*.h
index a57c84c2a837107fb166c31fd55ea7e70631eaa1..7ee19b4b1496c6451d242847bf985badc1610bc2 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,8 +1,8 @@
 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
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..b2680b1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,50 @@
+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>
diff --git a/README.rst b/README.rst
deleted file mode 100644 (file)
index d6a4b5b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-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
index a57c84c2a837107fb166c31fd55ea7e70631eaa1..7ee19b4b1496c6451d242847bf985badc1610bc2 100644 (file)
@@ -1,8 +1,8 @@
 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
index b1e3540636515c8e375d6b4146bd5385c7c1d7c3..8d2c21d9e3a8172d6a769655123e09d2d0bec1f6 100644 (file)
@@ -1,6 +1,6 @@
 LICENSE
 MANIFEST.in
-README.rst
+README.md
 setup.cfg
 setup.py
 lib/__init__.py
index e7c520395da79bb59fbb026a9c8fd0a55b2a5843..4529eb4f3f8016d9e5b6c9630e99b21024cdc16c 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ from setuptools import Extension
 # 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)
@@ -48,14 +48,14 @@ class SystemLibSqliteBuilder(build_ext):
 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):
@@ -90,8 +90,6 @@ class AmalgationLibSqliteBuilder(build_ext):
         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"))
 
@@ -99,7 +97,7 @@ class AmalgationLibSqliteBuilder(build_ext):
         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)
@@ -122,7 +120,7 @@ def get_setup_args():
         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(
@@ -142,7 +140,7 @@ def get_setup_args():
             "Topic :: Database :: Database Engines/Servers",
             "Topic :: Software Development :: Libraries :: Python Modules"],
         cmdclass={
-            "build_amalgamation": AmalgationLibSqliteBuilder,
+            "build_static": AmalgationLibSqliteBuilder,
             "build_ext": SystemLibSqliteBuilder
         }
     )
index 1a9098ef607e414a5e9b7d47103c75035d58bf6f..3a5e8912bb67b857dea65ed28fa9b78910dc7bfa 100644 (file)
@@ -768,13 +768,10 @@ void _pysqlite_value_callback(sqlite3_context* context)
 
     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;
 
@@ -817,9 +814,6 @@ static void _pysqlite_inverse_callback(sqlite3_context *context, int argc, sqlit
 
     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;
     }