Skip to content

Commit 39816cf

Browse files
authoredOct 29, 2017
Merge pull request #5493 from gacarrillor/bye_pyspatialite
Bye pyspatialite
2 parents cfba4c4 + 6415fad commit 39816cf

30 files changed

+29
-6051
lines changed
 

‎debian/copyright

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ License: public-domain
125125
is used when saving/restoring a QGIS project.
126126
This file is in the public domain
127127

128-
Files: python/ext-libs/pyspatialite/*
129-
Copyright: 2004-2010, Gerhard Häring <gh@ghaering.de>
130-
License: Zlib
131-
132128
Files: python/plugins/processing/modeler/ModelerArrowItem.py
133129
src/app/qgssettingstree.cpp
134130
src/app/qgssettingstree.h

‎ms-windows/osgeo4w/package-nightly.cmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ set PYTHONPATH=
9999
if exist "%PF86%\CMake\bin" path %PATH%;c:\cygwin\bin;%PF86%\CMake\bin
100100
if exist "%PROGRAMFILES%\CMake\bin" path %PATH%;c:\cygwin\bin;%PROGRAMFILES%\CMake\bin
101101

102-
PROMPT qgis%VERSION%$g
102+
PROMPT qgis%VERSION%$g
103103

104104
set BUILDCONF=RelWithDebInfo
105105

@@ -185,7 +185,6 @@ cmake -G Ninja ^
185185
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
186186
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
187187
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
188-
-D WITH_PYSPATIALITE=TRUE ^
189188
-D QCA_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\Qt5\include\QtCrypto ^
190189
-D QCA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qca-qt5.lib ^
191190
-D QSCINTILLA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qscintilla2.lib ^

‎ms-windows/osgeo4w/package.cmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ set GRASS_VERSIONS=%GRASS72_VERSION%
9292
set PYTHONPATH=
9393
path %PATH%;c:\cygwin\bin;%PF86%\CMake\bin
9494

95-
PROMPT qgis%VERSION%$g
95+
PROMPT qgis%VERSION%$g
9696

9797
set BUILDCONF=Release
9898

@@ -178,7 +178,6 @@ cmake -G Ninja ^
178178
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
179179
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
180180
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
181-
-D WITH_PYSPATIALITE=TRUE ^
182181
-D QCA_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\Qt5\include\QtCrypto ^
183182
-D QCA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qca-qt5.lib ^
184183
-D QSCINTILLA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qscintilla2.lib ^

‎python/ext-libs/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
SET (QGIS_PYTHON_DIR ${QGIS_DATA_DIR}/python)
44
SET (PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python)
55

6-
SET (WITH_PYSPATIALITE FALSE CACHE BOOL "Determines whether PYSPATIALITE should be built")
7-
IF (WITH_PYSPATIALITE)
8-
ADD_SUBDIRECTORY(pyspatialite)
9-
ENDIF (WITH_PYSPATIALITE)
10-
116
MACRO(EXT_PYLIB lib enable_by_default)
127
STRING(TOUPPER ${lib} ulib)
138
SET (WITH_INTERNAL_${ulib} ${enable_by_default} CACHE BOOL "Determines whether python ${lib} should be included")

‎python/ext-libs/pyspatialite/CMakeLists.txt

Lines changed: 0 additions & 66 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/LICENSE

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/lib/__init__.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/lib/dbapi2.py

Lines changed: 0 additions & 91 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/lib/dump.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/cache.c

Lines changed: 0 additions & 357 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/cache.h

Lines changed: 0 additions & 73 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/connection.c

Lines changed: 0 additions & 1835 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/connection.h

Lines changed: 0 additions & 142 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/cursor.c

Lines changed: 0 additions & 1130 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/cursor.h

Lines changed: 0 additions & 75 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/microprotocols.c

Lines changed: 0 additions & 154 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/microprotocols.h

Lines changed: 0 additions & 55 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/module.c

Lines changed: 0 additions & 498 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/module.h

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/prepare_protocol.c

Lines changed: 0 additions & 83 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/prepare_protocol.h

Lines changed: 0 additions & 41 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/row.c

Lines changed: 0 additions & 301 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/row.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/sqlitecompat.h

Lines changed: 0 additions & 57 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/statement.c

Lines changed: 0 additions & 571 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/statement.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/util.c

Lines changed: 0 additions & 172 deletions
This file was deleted.

‎python/ext-libs/pyspatialite/src/util.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎python/utils.py

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -590,38 +590,33 @@ def startServerPlugin(packageName):
590590

591591
def spatialite_connect(*args, **kwargs):
592592
"""returns a dbapi2.Connection to a SpatiaLite db
593-
either using pyspatialite if it is present
594-
or using the "mod_spatialite" extension (python3)"""
595-
try:
596-
from pyspatialite import dbapi2
597-
except ImportError:
598-
import sqlite3
599-
con = sqlite3.dbapi2.connect(*args, **kwargs)
600-
con.enable_load_extension(True)
601-
cur = con.cursor()
602-
libs = [
603-
# SpatiaLite >= 4.2 and Sqlite >= 3.7.17, should work on all platforms
604-
("mod_spatialite", "sqlite3_modspatialite_init"),
605-
# SpatiaLite >= 4.2 and Sqlite < 3.7.17 (Travis)
606-
("mod_spatialite.so", "sqlite3_modspatialite_init"),
607-
# SpatiaLite < 4.2 (linux)
608-
("libspatialite.so", "sqlite3_extension_init")
609-
]
610-
found = False
611-
for lib, entry_point in libs:
612-
try:
613-
cur.execute("select load_extension('{}', '{}')".format(lib, entry_point))
614-
except sqlite3.OperationalError:
615-
continue
616-
else:
617-
found = True
618-
break
619-
if not found:
620-
raise RuntimeError("Cannot find any suitable spatialite module")
621-
cur.close()
622-
con.enable_load_extension(False)
623-
return con
624-
return dbapi2.connect(*args, **kwargs)
593+
using the "mod_spatialite" extension (python3)"""
594+
import sqlite3
595+
con = sqlite3.dbapi2.connect(*args, **kwargs)
596+
con.enable_load_extension(True)
597+
cur = con.cursor()
598+
libs = [
599+
# SpatiaLite >= 4.2 and Sqlite >= 3.7.17, should work on all platforms
600+
("mod_spatialite", "sqlite3_modspatialite_init"),
601+
# SpatiaLite >= 4.2 and Sqlite < 3.7.17 (Travis)
602+
("mod_spatialite.so", "sqlite3_modspatialite_init"),
603+
# SpatiaLite < 4.2 (linux)
604+
("libspatialite.so", "sqlite3_extension_init")
605+
]
606+
found = False
607+
for lib, entry_point in libs:
608+
try:
609+
cur.execute("select load_extension('{}', '{}')".format(lib, entry_point))
610+
except sqlite3.OperationalError:
611+
continue
612+
else:
613+
found = True
614+
break
615+
if not found:
616+
raise RuntimeError("Cannot find any suitable spatialite module")
617+
cur.close()
618+
con.enable_load_extension(False)
619+
return con
625620

626621

627622
class OverrideCursor():

‎rpm/qgis.spec.template

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ Source5: %{name}-mime.xml
5151
# https://github.com/qgis/QGIS/commit/718581ffb12b723f9a3c0ae01b7ec2d8aed9d4bb.patch
5252
Patch0: %{name}-lib64.patch
5353

54-
# Some plug-ins need Pyspatialite (bundled)
55-
# The license is not totally clear, see:
56-
# http://code.google.com/p/pyspatialite/issues/detail?id=3
57-
# It also is sort of a fork of pysqlite, which is not elegant.
58-
5954
# Compiling stuff
6055
BuildRequires: bison
6156
BuildRequires: clang

0 commit comments

Comments
 (0)
Please sign in to comment.