Comments (6)
(by mithrandi)
I don't think this matters on PyPy; does pysqlite2 even work there at all? On the other hand, on CPython, if pysqlite2 is installed, it seems likely that you want to use it in preference to the stdlib version.
from axiom.
(by lvh)
Pretty sure it does:
======== SNIP SNIP ========
tmp ❯ virtualenv -p pypy pypy-pysqlite2 && source pypy-pysqlite2/bin/activate && pip install pysqlite
Running virtualenv with interpreter /usr/local/bin/pypy
New pypy executable in pypy-pysqlite2/bin/pypy
Installing setuptools............done.
Installing pip...............done.
Downloading/unpacking pysqlite
Using download cache from /Users/lvh/.pip/cache/https%3A%2F%2Fpysqlite.googlecode.com%2Ffiles%2Fpysqlite-2.6.3.tar.gz
Running setup.py egg_info for package pysqlite
Installing collected packages: pysqlite
Running setup.py install for pysqlite
building 'pysqlite2.sqlite' extension
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/module.c -o build/temp.macosx-10.8-x86_64-2.7/src/module.o
src/module.c:132:10: warning: 'sqlite3_enable_shared_cache' is deprecated: first deprecated in OS X 10.7 [-Wdeprecated-declarations]
rc = sqlite3_enable_shared_cache(do_enable);
^
/usr/include/sqlite3.h:4671:16: note: 'sqlite3_enable_shared_cache' declared here
SQLITE_API int sqlite3_enable_shared_cache(int) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_7, __IPHONE_2_0, __IPHONE_5_0);
^
1 warning generated.
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/connection.c -o build/temp.macosx-10.8-x86_64-2.7/src/connection.o
src/connection.c:597:43: warning: passing 'const char *' to parameter of type 'char *_' discards qualifiers in nested pointer types [-Wincompatible-pointer-types]
if (PyObject_AsCharBuffer(py_val, &buffer, &buflen) != 0) {
^~~~~~~
/Users/lvh/tmp/pypy-pysqlite2/include/pypy_decl.h:278:62: note: passing argument to parameter 'arg1' here
PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject _arg0, char *arg1, Py_ssize_t arg2);
^
1 warning generated.
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/cursor.c -o build/temp.macosx-10.8-x86_64-2.7/src/cursor.o
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/cache.c -o build/temp.macosx-10.8-x86_64-2.7/src/cache.o
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/microprotocols.c -o build/temp.macosx-10.8-x86_64-2.7/src/microprotocols.o
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/prepare_protocol.c -o build/temp.macosx-10.8-x86_64-2.7/src/prepare_protocol.o
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/statement.c -o build/temp.macosx-10.8-x86_64-2.7/src/statement.o
src/statement.c:179:50: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers in nested pointer types [-Wincompatible-pointer-types]
if (PyObject_AsCharBuffer(parameter, &buffer, &buflen) == 0) {
^~~~~~~
/Users/lvh/tmp/pypy-pysqlite2/include/pypy_decl.h:278:62: note: passing argument to parameter 'arg1' here
PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *arg0, char *_arg1, Py_ssize_t *arg2);
^
1 warning generated.
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/util.c -o build/temp.macosx-10.8-x86_64-2.7/src/util.o
cc -arch x86_64 -fPIC -Wimplicit -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/Users/lvh/tmp/pypy-pysqlite2/include -c src/row.c -o build/temp.macosx-10.8-x86_64-2.7/src/row.o
cc -shared -undefined dynamic_lookup -arch x86_64 build/temp.macosx-10.8-x86_64-2.7/src/module.o build/temp.macosx-10.8-x86_64-2.7/src/connection.o build/temp.macosx-10.8-x86_64-2.7/src/cursor.o build/temp.macosx-10.8-x86_64-2.7/src/cache.o build/temp.macosx-10.8-x86_64-2.7/src/microprotocols.o build/temp.macosx-10.8-x86_64-2.7/src/prepare_protocol.o build/temp.macosx-10.8-x86_64-2.7/src/statement.o build/temp.macosx-10.8-x86_64-2.7/src/util.o build/temp.macosx-10.8-x86_64-2.7/src/row.o -lsqlite3 -o build/lib.macosx-10.8-x86_64-2.7/pysqlite2/_sqlite.pypy-20.so
Successfully installed pysqlite
Cleaning up...
======== SNIP SNIP ========
After which:
======== SNIP SNIP ========
(pypy-pysqlite2)tmp ❯ python
Python 2.7.3 (b9c3566aa017, May 09 2013, 15:27:31)
[PyPy 2.0.0 with GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``today we're faster than yesterday
(usually)''
from pysqlite2 import dbapi2 as sqlite3
db = sqlite3.connect("test.db")
db.execute("SELECT * FROM sqlite_master")
<pysqlite2.dbapi2.Cursor object at 0x0000000103c89c20>
list(_)
[]======== SNIP SNIP ========
Plus, sqlite3 on PyPy versions previous to 2.0 are, IIUC, pretty much just the same as they are on CPython :-) That is, cpyext's Python.h fakes CPython sufficiently well that the extension just works. However, this is the C API DBAPI2 sqlite thing, and you really want the stdlib one, because it's faster and better :)
from axiom.
(by exarkun)
I don't understand the issue. If you want to use stdlib sqlite3, then don't install pysqlite2?
from axiom.
(by lvh)
That doesn't appear to work, at least not when I'm pip-installing PyPI-released version of axiom. Redacted output follows, unredacted output in gist: https://gist.github.com/lvh/5999347
tmp ❯ pypy --version && virtualenv pypyvenv -p pypy && source pypyvenv/bin/activate
Python 2.7.3 (5acfe049a5b0, May 21 2013, 13:47:22)
[PyPy 2.0.2 with GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]
Running virtualenv with interpreter /usr/local/bin/pypy
...
(pypyvenv)tmp ❯ pip install Twisted && pip install Epsilon && pip install Axiom
Downloading/unpacking Twisted
...
Downloading/unpacking Epsilon
...
Downloading/unpacking Axiom
(pypyvenv)tmp ❯ python
Python 2.7.3 (5acfe049a5b0, May 21 2013, 13:47:22)
[PyPy 2.0.2 with GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``it's Sunday, again''
from axiom import store
Traceback (most recent call last):
File "", line 1, in
File "/Users/lvh/tmp/pypyvenv/site-packages/axiom/store.py", line 28, in
from axiom._pysqlite2 import Connection
File "/Users/lvh/tmp/pypyvenv/site-packages/axiom/_pysqlite2.py", line 11, in
from pysqlite2 import dbapi2
ImportError: No module named pysqlite2
from axiom import version; version
Version('axiom', 0, 6, 0)
from axiom.
(by exarkun)
trunk@HEAD tries pysqlite2 and falls back to sqlite3. However this appears to be unreleased behavior, so when pip install
finds the older version, the above failure is encountered.
Please try with trunk@HEAD!
from axiom.
(by lvh)
So, apparently, the released version of Axiom (0.6.0) doesn't have this behavior, trunk does. This makes this ticket less important: people using PyPy are probably less likely to have pysqlite2 installed, plus, not installing pysqlite2 is easier than installing it :)
from axiom.
Related Issues (20)
- Python 3 support HOT 5
- Release artifacts are broken
- `axiom.attributes.bytes` shadows builtin name
- In memory powerup is only able to register a single item.
- pyenv us a newer PyPy on Travis
- Switch to Codecov for coverage
- Helper for declaring legacy items HOT 1
- Intermittent failure in reactor selection tests
- Question: raw queries? HOT 1
- NEWS.txt isn't shipped in sdist
- Store API for setting the journal mode
- Decorator for installables HOT 4
- Default log rotation is bad
- Update PyPy
- Setting typeName to unicode produces bizarre errors
- axiomatic analyze
- axiomatic vacuum
- Store flags for journal_mode and autovacuum_mode
- Creating and deleting an item in the same transaction leaves a ghost item
- Store._loadedItem returns stale Item from Store.objectCache
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axiom.