This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SQLObject development repository".
The branch, master has been updated
via 1c246013fbaeca294889747f26e373108e45a23e (commit)
via bf0225b9ee575b58ecbf85fadbd738359c9cfade (commit)
via a9bdbc239e63af404bbbbf36de071e8f8551d93b (commit)
via e0adc96809a68914ce47e4aac905b2a52fa67313 (commit)
via 39de25318a18606ab9226c3e10cc698dc1c7e95f (commit)
via c3b6d4c5e5b0393c8d313314cd05d69861d8a779 (commit)
from afcbff10a92d1364562313b51a9cb417064cae9b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/1c246013fbaeca294889747f26e373108e45a23e
commit 1c246013fbaeca294889747f26e373108e45a23e
Author: Oleg Broytman <ph...@ph...>
Date: Fri Nov 18 20:27:12 2016 +0300
Add support for PyMySQL
diff --git a/.travis.yml b/.travis.yml
index 1e314c2..8ab8400 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,6 +23,12 @@ env:
- TOXENV=py27-mysql-connector
- TOXENV=py34-mysql-connector
- TOXENV=py35-mysql-connector
+ - TOXENV=py26-oursql
+ - TOXENV=py27-oursql
+ - TOXENV=py26-pymysql
+ - TOXENV=py27-pymysql
+ - TOXENV=py34-pymysql
+ - TOXENV=py35-pymysql
- TOXENV=py26-postgres
- TOXENV=py27-postgres
- TOXENV=py34-postgres
@@ -31,8 +37,6 @@ env:
- TOXENV=py27-sqlite
- TOXENV=py34-sqlite
- TOXENV=py35-sqlite
- - TOXENV=py26-oursql
- - TOXENV=py27-oursql
- TOXENV=py27-flake8
- TOXENV=py34-flake8
@@ -46,6 +50,10 @@ matrix:
- env: TOXENV=py35-mysql-connector
- env: TOXENV=py26-oursql
- env: TOXENV=py27-oursql
+ - env: TOXENV=py26-pymysql
+ - env: TOXENV=py27-pymysql
+ - env: TOXENV=py34-pymysql
+ - env: TOXENV=py35-pymysql
fast_finish: true
script: tox -e ${TOXENV}
diff --git a/docs/News.rst b/docs/News.rst
index 4f4514e..7c5ab0e 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -25,8 +25,8 @@ Minor features
order.
* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
- 'connector' and 'oursql'. Default is to test for mysqldb only;
- (connector and oursql drivers still cause problems).
+ 'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only;
+ (connector, oursql and pymysql drivers still cause problems).
Work in progress
----------------
@@ -38,8 +38,12 @@ Work in progress
there are still problems).
* Add support for `oursql <https://github.com/python-oursql/oursql>`_ MySQL
- driver (Python 2.6 and 2.7 until oursql fixes python 3 compatibility; most
- tests are passed, but there are still problems).
+ driver (Python 2.6 and 2.7 until oursql fixes python 3 compatibility;
+ most tests are passed, but there are still problems).
+
+* Add support for `PyMySQL <https://github.com/PyMySQL/PyMySQL/>`_ - pure
+ python mysql interface; most tests are passed, but there are still
+ problems).
Documentation
-------------
diff --git a/docs/TODO.rst b/docs/TODO.rst
index 3fcfe50..54dc4ad 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,8 +68,6 @@ TODO
* Switch from setuptools to distribute.
-* Yet another pure python mysql interface: https://github.com/PyMySQL/PyMySQL/
-
* Ultramysql `for Python2 <https://github.com/esnme/ultramysql>`_ and
`Python3 <https://github.com/arpitbbhayani/umysql3>`_. See also `umysqldb
<https://github.com/hongqn/umysqldb>`_.
diff --git a/sqlobject/converters.py b/sqlobject/converters.py
index cddf52e..afb7e4d 100644
--- a/sqlobject/converters.py
+++ b/sqlobject/converters.py
@@ -81,7 +81,7 @@ def StringLikeConverter(value, db):
value = value.tounicode()
except ValueError:
value = value.tostring()
- elif isinstance(value, buffer_type):
+ elif isinstance(value, (bytearray, buffer_type)):
value = str(value)
if db in ('mysql', 'postgres', 'rdbhost'):
@@ -101,6 +101,7 @@ if PY2:
registerConverter(unicode, StringLikeConverter) # noqa
registerConverter(array, StringLikeConverter)
if PY2:
+ registerConverter(bytearray, StringLikeConverter)
registerConverter(buffer_type, StringLikeConverter)
else:
registerConverter(memoryview, StringLikeConverter)
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index ea14bff..149cd4c 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -27,17 +27,28 @@ class MySQLConnection(DBAPI):
if not driver:
continue
try:
- if driver.lower() == 'mysqldb':
+ if driver.lower() in ('mysqldb', 'pymysql'):
+ if driver.lower() == 'pymysql':
+ import pymysql
+ pymysql.install_as_MySQLdb()
import MySQLdb
- if MySQLdb.version_info[:3] < (1, 2, 2):
- raise ValueError(
- 'SQLObject requires MySQLdb 1.2.2 or later')
+ if driver.lower() == 'mysqldb':
+ if MySQLdb.version_info[:3] < (1, 2, 2):
+ raise ValueError(
+ 'SQLObject requires MySQLdb 1.2.2 or later')
import MySQLdb.constants.CR
import MySQLdb.constants.ER
self.module = MySQLdb
- self.CR_SERVER_GONE_ERROR = \
- MySQLdb.constants.CR.SERVER_GONE_ERROR
- self.CR_SERVER_LOST = MySQLdb.constants.CR.SERVER_LOST
+ if driver.lower() == 'mysqldb':
+ self.CR_SERVER_GONE_ERROR = \
+ MySQLdb.constants.CR.SERVER_GONE_ERROR
+ self.CR_SERVER_LOST = \
+ MySQLdb.constants.CR.SERVER_LOST
+ else:
+ self.CR_SERVER_GONE_ERROR = \
+ MySQLdb.constants.CR.CR_SERVER_GONE_ERROR
+ self.CR_SERVER_LOST = \
+ MySQLdb.constants.CR.CR_SERVER_LOST
self.ER_DUP_ENTRY = MySQLdb.constants.ER.DUP_ENTRY
elif driver == 'connector':
import mysql.connector
@@ -57,7 +68,8 @@ class MySQLConnection(DBAPI):
else:
raise ValueError(
'Unknown MySQL driver "%s", '
- 'expected mysqldb, connector or oursql' % driver)
+ 'expected mysqldb, connector, '
+ 'oursql or pymysql' % driver)
except ImportError:
pass
else:
diff --git a/tox.ini b/tox.ini
index f2f08da..60cbcac 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 1.8
-envlist = {py26,py27}-{mysqldb,oursql},{py34,py35}-mysqlclient,{py26,py27,py34,py35}-{mysql-connector,postgres,sqlite},{py27,py34}-flake8
+envlist = {py26,py27}-{mysqldb,oursql},{py34,py35}-mysqlclient,{py26,py27,py34,py35}-{mysql-connector,pymysql,postgres,sqlite},{py27,py34}-flake8
# Base test environment settings
[testenv]
@@ -17,6 +17,7 @@ deps =
mysqlclient: mysqlclient
mysql-connector: mysql-connector
py26,py27: oursql
+ pymysql: pymysql
postgres: psycopg2
passenv = CI TRAVIS TRAVIS_*
# Don't fail or warn on uninstalled commands
@@ -50,6 +51,24 @@ commands = {[mysqlclient]commands}
[testenv:py35-mysqlclient]
commands = {[mysqlclient]commands}
+[mysql-connector]
+commands =
+ mysql -e 'create database sqlobject_test;'
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=connector&charset=utf8
+ mysql -e 'drop database sqlobject_test;'
+
+[testenv:py26-mysql-connector]
+commands = {[mysql-connector]commands}
+
+[testenv:py27-mysql-connector]
+commands = {[mysql-connector]commands}
+
+[testenv:py34-mysql-connector]
+commands = {[mysql-connector]commands}
+
+[testenv:py35-mysql-connector]
+commands = {[mysql-connector]commands}
+
[oursql]
commands =
mysql -e 'create database sqlobject_test;'
@@ -62,23 +81,23 @@ commands = {[oursql]commands}
[testenv:py27-oursql]
commands = {[oursql]commands}
-[mysql-connector]
+[pymysql]
commands =
mysql -e 'create database sqlobject_test;'
- pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=connector&charset=utf8
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=pymysql&charset=utf8
mysql -e 'drop database sqlobject_test;'
-[testenv:py26-mysql-connector]
-commands = {[mysql-connector]commands}
+[testenv:py26-pymysql]
+commands = {[pymysql]commands}
-[testenv:py27-mysql-connector]
-commands = {[mysql-connector]commands}
+[testenv:py27-pymysql]
+commands = {[pymysql]commands}
-[testenv:py34-mysql-connector]
-commands = {[mysql-connector]commands}
+[testenv:py34-pymysql]
+commands = {[pymysql]commands}
-[testenv:py35-mysql-connector]
-commands = {[mysql-connector]commands}
+[testenv:py35-pymysql]
+commands = {[pymysql]commands}
# PostgreSQL test environments
[postgresql]
http://sourceforge.net/p/sqlobject/sqlobject/ci/bf0225b9ee575b58ecbf85fadbd738359c9cfade
commit bf0225b9ee575b58ecbf85fadbd738359c9cfade
Author: Oleg Broytman <ph...@ph...>
Date: Fri Nov 18 20:10:09 2016 +0300
TODO: remove MyPy
Seems to be unmaintained; last updated in 2012.
Also it's python 2 only.
[skip ci]
diff --git a/docs/TODO.rst b/docs/TODO.rst
index d96614c..3fcfe50 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,8 +68,6 @@ TODO
* Switch from setuptools to distribute.
-* Pure Python Mysql Interface: https://github.com/nasi/MyPy
-
* Yet another pure python mysql interface: https://github.com/PyMySQL/PyMySQL/
* Ultramysql `for Python2 <https://github.com/esnme/ultramysql>`_ and
http://sourceforge.net/p/sqlobject/sqlobject/ci/a9bdbc239e63af404bbbbf36de071e8f8551d93b
commit a9bdbc239e63af404bbbbf36de071e8f8551d93b
Author: Oleg Broytman <ph...@ph...>
Date: Fri Nov 18 20:02:29 2016 +0300
TODO: add PyMySQL and umysqldb
[skip ci]
diff --git a/docs/TODO.rst b/docs/TODO.rst
index 7c78877..d96614c 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -70,8 +70,11 @@ TODO
* Pure Python Mysql Interface: https://github.com/nasi/MyPy
+* Yet another pure python mysql interface: https://github.com/PyMySQL/PyMySQL/
+
* Ultramysql `for Python2 <https://github.com/esnme/ultramysql>`_ and
- `Python3 <https://github.com/arpitbbhayani/umysql3>`_.
+ `Python3 <https://github.com/arpitbbhayani/umysql3>`_. See also `umysqldb
+ <https://github.com/hongqn/umysqldb>`_.
* pg8000 driver: http://code.google.com/p/pg8000/
http://sourceforge.net/p/sqlobject/sqlobject/ci/e0adc96809a68914ce47e4aac905b2a52fa67313
commit e0adc96809a68914ce47e4aac905b2a52fa67313
Author: Oleg Broytman <ph...@ph...>
Date: Fri Nov 18 19:37:54 2016 +0300
Declare mysql-connector and oursql work in progress
[skip ci]
diff --git a/docs/News.rst b/docs/News.rst
index 1ca10c2..4f4514e 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -24,6 +24,13 @@ Minor features
or 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that
order.
+* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
+ 'connector' and 'oursql'. Default is to test for mysqldb only;
+ (connector and oursql drivers still cause problems).
+
+Work in progress
+----------------
+
* Add support for `MySQL Connector
<https://pypi.python.org/pypi/mysql-connector>`_ (pure python; `binary
packages <https://dev.mysql.com/doc/connector-python/en/>`_ are not at
@@ -31,12 +38,8 @@ Minor features
there are still problems).
* Add support for `oursql <https://github.com/python-oursql/oursql>`_ MySQL
- driver (Python 2.6 and 2.7; most tests are passed, but there are still
- problems).
-
-* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
- 'connector' and 'oursql'. Default is to test for mysqldb only;
- (connector and oursql drivers still cause problems).
+ driver (Python 2.6 and 2.7 until oursql fixes python 3 compatibility; most
+ tests are passed, but there are still problems).
Documentation
-------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/39de25318a18606ab9226c3e10cc698dc1c7e95f
commit 39de25318a18606ab9226c3e10cc698dc1c7e95f
Author: Oleg Broytman <ph...@ph...>
Date: Fri Nov 18 19:07:51 2016 +0300
Fix mysql-connector tests in tox.ini
diff --git a/tox.ini b/tox.ini
index 4d97831..f2f08da 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 1.8
-envlist = {py26,py27}-{mysqldb,oursql},{py34,py35}-mysqlclient,{py26,py27,py34,py35}-{postgres,sqlite},{py27,py34}-flake8
+envlist = {py26,py27}-{mysqldb,oursql},{py34,py35}-mysqlclient,{py26,py27,py34,py35}-{mysql-connector,postgres,sqlite},{py27,py34}-flake8
# Base test environment settings
[testenv]
@@ -15,6 +15,7 @@ deps =
py26,py27: egenix-mx-base
mysqldb: mysql-python
mysqlclient: mysqlclient
+ mysql-connector: mysql-connector
py26,py27: oursql
postgres: psycopg2
passenv = CI TRAVIS TRAVIS_*
http://sourceforge.net/p/sqlobject/sqlobject/ci/c3b6d4c5e5b0393c8d313314cd05d69861d8a779
commit c3b6d4c5e5b0393c8d313314cd05d69861d8a779
Author: Oleg Broytman <ph...@ph...>
Date: Fri Nov 18 19:05:14 2016 +0300
Do not ping using oursql driver
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index 729886a..ea14bff 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -121,8 +121,9 @@ class MySQLConnection(DBAPI):
conn = self.module.connect(
host=self.host, port=self.port, db=self.db,
user=self.user, passwd=self.password, **self.kw)
- # Attempt to reconnect. This setting is persistent.
- conn.ping(True)
+ if self.module.__name__ != 'oursql':
+ # Attempt to reconnect. This setting is persistent.
+ conn.ping(True)
except self.module.OperationalError as e:
conninfo = ("; used connection string: "
"host=%(host)s, port=%(port)s, "
-----------------------------------------------------------------------
Summary of changes:
.travis.yml | 12 ++++++++-
docs/News.rst | 17 ++++++++++----
docs/TODO.rst | 5 +--
sqlobject/converters.py | 3 +-
sqlobject/mysql/mysqlconnection.py | 33 +++++++++++++++++++--------
tox.ini | 42 ++++++++++++++++++++++++++---------
6 files changed, 80 insertions(+), 32 deletions(-)
hooks/post-receive
--
SQLObject development repository
|