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 057147e8b54498e8e464ced5187257637f9583da (commit)
via 2828e4039c1334ae0ebed3d559aca818ce502e3a (commit)
via 0c039e4735bf5ac81beb46915c15a5bbacfdff61 (commit)
via 53d55b91bf1f41e2664354260cc9b860fc992bf9 (commit)
via eca92f170393fda5624671ac0e4fa88953e05bad (commit)
via f70883e1048f1b1bab3cf2ef1adc2e664074e077 (commit)
via e1e6d18525ac2e978379b649229c40af6f67184d (commit)
from 5a910d136eacf3b104210a7c00e9164630c25e71 (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/057147e8b54498e8e464ced5187257637f9583da
commit 057147e8b54498e8e464ced5187257637f9583da
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 4 17:09:55 2017 +0300
Fixed mysql-connector, oursql, pymysql
diff --git a/.travis.yml b/.travis.yml
index 36d6f85..68b3276 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -54,16 +54,6 @@ install: pip install tox coveralls codecov
matrix:
allow_failures:
- - env: TOXENV=py26-mysql-connector
- - env: TOXENV=py27-mysql-connector
- - env: TOXENV=py34-mysql-connector
- - 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
- env: TOXENV=py26-pygresql
- env: TOXENV=py27-pygresql
- env: TOXENV=py34-pygresql
diff --git a/docs/News.rst b/docs/News.rst
index 4c2dc9e..0bf1c7a 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -28,22 +28,19 @@ Minor features
'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only;
(connector, oursql and pymysql drivers still cause problems).
-Drivers (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
- PyPI and hence are hard to install and test; most tests are passed, but
- there are still problems).
+ PyPI and hence are hard to install and test).
* 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).
* Add support for `PyMySQL <https://github.com/PyMySQL/PyMySQL/>`_ - pure
- python mysql interface; most tests are passed, but there are still
- problems).
+ python mysql interface).
+
+Drivers (work in progress)
+--------------------------
* Extend support for PyGreSQL driver. There are still some problems.
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index e9e4bc4..6f02661 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -47,14 +47,13 @@ Requirements
============
Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
-mysqlclient_ for Python 3); `MySQL Connector`_, oursql_ and PyMySQL_ are
-supported but have problems (not all tests passed). For PostgreSQL_
-psycopg2_ or psycopg1 are recommended; PyGreSQL_, py-postgresql_ and
-pg8000_ are supported but have problems (not all tests passed). SQLite_ has
+mysqlclient_ for Python 3), `MySQL Connector`_, oursql_ and PyMySQL_. For
+PostgreSQL_ psycopg2_ or psycopg1 are recommended; PyGreSQL_, py-postgresql_
+and pg8000_ are supported but have problems (not all tests passed). SQLite_ has
a built-in driver or PySQLite_. Firebird_ is supported via fdb_ or
-kinterbasdb_; pyfirebirdsql_ is supported but untested. `MAX DB`_ (also
-known as SAP DB) is supported via sapdb_. Sybase via Sybase_. `MSSQL
-Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_ (Win32).
+kinterbasdb_; pyfirebirdsql_ is supported but untested. `MAX DB`_ (also known
+as SAP DB) is supported via sapdb_. Sybase via Sybase_. `MSSQL Server`_ via
+pymssql_ (+ FreeTDS_) or adodbapi_ (Win32).
.. _MySQL: https://www.mysql.com/
.. _MySQLdb: https://sourceforge.net/projects/mysql-python/
http://sourceforge.net/p/sqlobject/sqlobject/ci/2828e4039c1334ae0ebed3d559aca818ce502e3a
commit 2828e4039c1334ae0ebed3d559aca818ce502e3a
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 4 16:38:21 2017 +0300
Fix non-standard port for Postgres drivers
Code for psycopg1 shadowed setting port for other drivers.
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 08e5390..d0caaf3 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -90,11 +90,11 @@ class PostgresConnection(DBAPI):
if port:
if driver == 'pygresql':
dsn_dict["host"] = "%s:%d" % (host, port)
+ elif driver.startswith('psycopg') and \
+ psycopg.__version__.split('.')[0] == '1':
+ dsn_dict["port"] = str(port)
else:
- if psycopg.__version__.split('.')[0] == '1':
- dsn_dict["port"] = str(port)
- else:
- dsn_dict["port"] = port
+ dsn_dict["port"] = port
if db:
dsn_dict["database"] = db
if user:
http://sourceforge.net/p/sqlobject/sqlobject/ci/0c039e4735bf5ac81beb46915c15a5bbacfdff61
commit 0c039e4735bf5ac81beb46915c15a5bbacfdff61
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 4 10:39:44 2017 +0300
Fix mysql-connector driver: encode unicode query with surrogate escape
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index c6fc133..01d24c9 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -165,6 +165,10 @@ class MySQLConnection(DBAPI):
conn.autocommit = auto
def _executeRetry(self, conn, cursor, query):
+ dbEncoding = self.dbEncoding
+ if dbEncoding and not isinstance(query, bytes) and (
+ self.driver == 'connector'):
+ query = query.encode(dbEncoding, 'surrogateescape')
# When a server connection is lost and a query is attempted, most of
# the time the query will raise a SERVER_LOST exception, then at the
# second attempt to execute it, the mysql lib will reconnect and
http://sourceforge.net/p/sqlobject/sqlobject/ci/53d55b91bf1f41e2664354260cc9b860fc992bf9
commit 53d55b91bf1f41e2664354260cc9b860fc992bf9
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 4 10:10:53 2017 +0300
Fix unicode test: convert everything to bytes under Py2
diff --git a/sqlobject/tests/test_unicode.py b/sqlobject/tests/test_unicode.py
index 3551735..a8b8b1d 100644
--- a/sqlobject/tests/test_unicode.py
+++ b/sqlobject/tests/test_unicode.py
@@ -38,6 +38,8 @@ def test_create():
ORDER BY count
""")
for count, col in rows:
+ if not isinstance(col, bytes):
+ col = col.encode('utf-8')
assert data[count].encode('utf-8') == col
else:
rows = conn.queryAll("""
http://sourceforge.net/p/sqlobject/sqlobject/ci/eca92f170393fda5624671ac0e4fa88953e05bad
commit eca92f170393fda5624671ac0e4fa88953e05bad
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 4 09:45:48 2017 +0300
Remove test where dbEncoding for a column differs from database
diff --git a/sqlobject/tests/test_unicode.py b/sqlobject/tests/test_unicode.py
index 1c97f25..3551735 100644
--- a/sqlobject/tests/test_unicode.py
+++ b/sqlobject/tests/test_unicode.py
@@ -1,7 +1,6 @@
-import pytest
-from sqlobject import AND, IntCol, OR, SQLObject, UnicodeCol
+from sqlobject import IntCol, SQLObject, UnicodeCol
from sqlobject.compat import PY2
-from sqlobject.tests.dbtest import raises, setupClass
+from sqlobject.tests.dbtest import setupClass
########################################
@@ -11,9 +10,7 @@ from sqlobject.tests.dbtest import raises, setupClass
class SOTestUnicode(SQLObject):
count = IntCol(alternateID=True)
- col1 = UnicodeCol(alternateID=True, length=100)
- if PY2:
- col2 = UnicodeCol(dbEncoding='latin1')
+ col = UnicodeCol(alternateID=True, length=100)
data = [u'\u00f0', u'test', 'ascii test']
@@ -24,118 +21,62 @@ def setup():
global items
items = []
setupClass(SOTestUnicode)
- if SOTestUnicode._connection.dbName == 'postgres':
- if PY2:
- dbEncoding = 'latin1'
- else:
- dbEncoding = 'utf8'
- SOTestUnicode._connection.query(
- 'SET client_encoding TO %s' % dbEncoding)
- if PY2:
- for i, s in enumerate(data):
- items.append(SOTestUnicode(count=i, col1=s, col2=s))
- else:
- for i, s in enumerate(data):
- items.append(SOTestUnicode(count=i, col1=s))
+ for i, s in enumerate(data):
+ items.append(SOTestUnicode(count=i, col=s))
def test_create():
setup()
for s, item in zip(data, items):
- assert item.col1 == s
- if PY2:
- assert item.col2 == s
+ assert item.col == s
conn = SOTestUnicode._connection
if PY2:
rows = conn.queryAll("""
- SELECT count, col1, col2
+ SELECT count, col
FROM so_test_unicode
ORDER BY count
""")
- for count, col1, col2 in rows:
- assert data[count].encode('utf-8') == col1
- assert data[count].encode('latin1') == col2
+ for count, col in rows:
+ assert data[count].encode('utf-8') == col
else:
rows = conn.queryAll("""
- SELECT count, col1
+ SELECT count, col
FROM so_test_unicode
ORDER BY count
""")
# On python 3, everthings already decoded to unicode
- for count, col1 in rows:
- assert data[count] == col1
+ for count, col in rows:
+ assert data[count] == col
-def _test_select():
+def test_select():
+ setup()
for i, value in enumerate(data):
- rows = list(SOTestUnicode.select(SOTestUnicode.q.col1 == value))
+ rows = list(SOTestUnicode.select(SOTestUnicode.q.col == value))
assert len(rows) == 1
if PY2:
- rows = list(SOTestUnicode.select(SOTestUnicode.q.col2 == value))
+ rows = list(SOTestUnicode.select(SOTestUnicode.q.col == value))
assert len(rows) == 1
- rows = list(SOTestUnicode.select(AND(
- SOTestUnicode.q.col1 == value,
- SOTestUnicode.q.col2 == value
- )))
- assert len(rows) == 1
- rows = list(SOTestUnicode.selectBy(col1=value))
+ rows = list(SOTestUnicode.selectBy(col=value))
assert len(rows) == 1
if PY2:
- rows = list(SOTestUnicode.selectBy(col2=value))
- assert len(rows) == 1
- rows = list(SOTestUnicode.selectBy(col1=value, col2=value))
+ rows = list(SOTestUnicode.selectBy(col=value))
assert len(rows) == 1
- row = SOTestUnicode.byCol1(value)
+ row = SOTestUnicode.byCol(value)
assert row.count == i
- if PY2:
- rows = list(SOTestUnicode.select(OR(
- SOTestUnicode.q.col1 == u'\u00f0',
- SOTestUnicode.q.col2 == u'test'
- )))
- assert len(rows) == 2
- rows = list(SOTestUnicode.selectBy(col1=u'\u00f0', col2=u'test'))
- assert len(rows) == 0
# starts/endswith/contains
- rows = list(SOTestUnicode.select(SOTestUnicode.q.col1.startswith("test")))
+ rows = list(SOTestUnicode.select(SOTestUnicode.q.col.startswith("test")))
assert len(rows) == 1
- rows = list(SOTestUnicode.select(SOTestUnicode.q.col1.endswith("test")))
+ rows = list(SOTestUnicode.select(SOTestUnicode.q.col.endswith("test")))
assert len(rows) == 2
- rows = list(SOTestUnicode.select(SOTestUnicode.q.col1.contains("test")))
+ rows = list(SOTestUnicode.select(SOTestUnicode.q.col.contains("test")))
assert len(rows) == 2
rows = list(SOTestUnicode.select(
- SOTestUnicode.q.col1.startswith(u"\u00f0")))
+ SOTestUnicode.q.col.startswith(u"\u00f0")))
assert len(rows) == 1
- rows = list(SOTestUnicode.select(SOTestUnicode.q.col1.endswith(u"\u00f0")))
+ rows = list(SOTestUnicode.select(SOTestUnicode.q.col.endswith(u"\u00f0")))
assert len(rows) == 1
- rows = list(SOTestUnicode.select(SOTestUnicode.q.col1.contains(u"\u00f0")))
+ rows = list(SOTestUnicode.select(SOTestUnicode.q.col.contains(u"\u00f0")))
assert len(rows) == 1
-
-
-def test_select():
- setup()
- _test_select()
-
-
-def test_dbEncoding():
- if not PY2:
- # Python 3 mostly ignores dbEncoding
- pytest.skip("This test is for python 2")
- setup()
- SOTestUnicode.sqlmeta.dbEncoding = 'utf-8'
- _test_select()
- SOTestUnicode.sqlmeta.dbEncoding = 'latin-1'
- raises(AssertionError, _test_select)
- SOTestUnicode.sqlmeta.dbEncoding = 'ascii'
- raises(UnicodeEncodeError, _test_select)
- SOTestUnicode.sqlmeta.dbEncoding = None
-
- SOTestUnicode._connection.dbEncoding = 'utf-8'
- _test_select()
- SOTestUnicode._connection.dbEncoding = 'latin-1'
- raises(AssertionError, _test_select)
- SOTestUnicode._connection.dbEncoding = 'ascii'
- raises(UnicodeEncodeError, _test_select)
- del SOTestUnicode.sqlmeta.dbEncoding
- SOTestUnicode._connection.dbEncoding = 'utf-8'
http://sourceforge.net/p/sqlobject/sqlobject/ci/f70883e1048f1b1bab3cf2ef1adc2e664074e077
commit f70883e1048f1b1bab3cf2ef1adc2e664074e077
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 4 08:43:51 2017 +0300
Fix oursql dependencies
diff --git a/tox.ini b/tox.ini
index 2e57a49..15d3dcc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,7 +16,7 @@ deps =
mysqldb: mysql-python
mysqlclient: mysqlclient
mysql-connector: mysql-connector
- py26,py27: oursql
+ oursql: oursql
pymysql: pymysql
psycopg: psycopg2
pygresql: pygresql
http://sourceforge.net/p/sqlobject/sqlobject/ci/e1e6d18525ac2e978379b649229c40af6f67184d
commit e1e6d18525ac2e978379b649229c40af6f67184d
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 4 07:26:28 2017 +0300
Drop database before tests; just in case
diff --git a/tox.ini b/tox.ini
index ba72491..2e57a49 100644
--- a/tox.ini
+++ b/tox.ini
@@ -28,10 +28,12 @@ whitelist_externals =
mysql
createdb
dropdb
+ rm
# MySQL test environments
[mysqldb]
commands =
+ -mysql -e 'drop database sqlobject_test;'
mysql -e 'create database sqlobject_test;'
pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=mysqldb
mysql -e 'drop database sqlobject_test;'
@@ -44,6 +46,7 @@ commands = {[mysqldb]commands}
[mysqlclient]
commands =
+ -mysql -e 'drop database sqlobject_test;'
mysql -e 'create database sqlobject_test;'
pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=mysqldb&charset=utf8
mysql -e 'drop database sqlobject_test;'
@@ -56,6 +59,7 @@ commands = {[mysqlclient]commands}
[mysql-connector]
commands =
+ -mysql -e 'drop database sqlobject_test;'
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;'
@@ -74,6 +78,7 @@ commands = {[mysql-connector]commands}
[oursql]
commands =
+ -mysql -e 'drop database sqlobject_test;'
mysql -e 'create database sqlobject_test;'
pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=oursql&charset=utf8
mysql -e 'drop database sqlobject_test;'
@@ -86,6 +91,7 @@ commands = {[oursql]commands}
[pymysql]
commands =
+ -mysql -e 'drop database sqlobject_test;'
mysql -e 'create database sqlobject_test;'
pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=pymysql&charset=utf8
mysql -e 'drop database sqlobject_test;'
@@ -105,6 +111,7 @@ commands = {[pymysql]commands}
# PostgreSQL test environments
[psycopg]
commands =
+ -dropdb -U postgres sqlobject_test
createdb -U postgres sqlobject_test
pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=psycopg&charset=utf-8 tests include/tests inheritance/tests versioning/test
dropdb -U postgres sqlobject_test
@@ -123,6 +130,7 @@ commands = {[psycopg]commands}
[pygresql]
commands =
+ -dropdb -U postgres sqlobject_test
createdb -U postgres sqlobject_test
pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pygresql&charset=utf-8 tests include/tests inheritance/tests versioning/test
dropdb -U postgres sqlobject_test
@@ -141,6 +149,7 @@ commands = {[pygresql]commands}
[pypostgresql]
commands =
+ -dropdb -U postgres sqlobject_test
createdb -U postgres sqlobject_test
pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pypostgresql&charset=utf-8 tests include/tests inheritance/tests versioning/test
dropdb -U postgres sqlobject_test
@@ -153,6 +162,7 @@ commands = {[pypostgresql]commands}
[pg8000]
commands =
+ -dropdb -U postgres sqlobject_test
createdb -U postgres sqlobject_test
pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pg8000&charset=utf-8 tests include/tests inheritance/tests versioning/test
dropdb -U postgres sqlobject_test
@@ -172,7 +182,9 @@ commands = {[pg8000]commands}
# SQLite test environments
[sqlite]
commands =
+ -rm /tmp/sqlobject_test.sqdb
pytest --cov=sqlobject -D sqlite:///tmp/sqlobject_test.sqdb
+ rm /tmp/sqlobject_test.sqdb
[testenv:py26-sqlite]
commands = {[sqlite]commands}
-----------------------------------------------------------------------
Summary of changes:
.travis.yml | 10 ---
docs/News.rst | 15 ++---
docs/SQLObject.rst | 13 ++--
sqlobject/mysql/mysqlconnection.py | 4 +
sqlobject/postgres/pgconnection.py | 8 +-
sqlobject/tests/test_unicode.py | 111 +++++++++---------------------------
tox.ini | 14 ++++-
7 files changed, 60 insertions(+), 115 deletions(-)
hooks/post-receive
--
SQLObject development repository
|