sqlobject-cvs Mailing List for SQLObject (Page 8)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Oleg B. <no...@so...> - 2017-01-17 23:57:38
|
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 1c6f0a43ea6d29d84979687f4f0b6d1d1ab30c9c (commit)
via ab58e61a1b11e97a85cff7503b5936704b856175 (commit)
via f40463a8193c8479c19649c320763f340397a73e (commit)
via b313c1fb5d6c1fb1535dbc297f0dc71a2c8485d3 (commit)
via afe2ca4d6f07aaacd7aca8c238eff155ac5dbebb (commit)
via 3d86b18aff0e935e34c2489d3737ca35ae23ab00 (commit)
via f362e07698a017da0d7b63f685f5eddf123a676b (commit)
via 970d6e68dc1441dbbdd52de0c0e74081a2297542 (commit)
via 4e781b567ce07b65a9f559b529c2d61cc00f3713 (commit)
via a2b4c6ac06dbe68d188520d5b67bdabe978011d9 (commit)
from ac4a243bc2e029e29991b99a33d5fb5cb386b901 (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/1c6f0a43ea6d29d84979687f4f0b6d1d1ab30c9c
commit 1c6f0a43ea6d29d84979687f4f0b6d1d1ab30c9c
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 18 02:48:32 2017 +0300
Fix MSSQLConnection.server_version() under Py3
diff --git a/docs/News.rst b/docs/News.rst
index caf4dfe..4f2f853 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -68,6 +68,8 @@ Bug fix
* Fix concatenation operator for MSSQL/Sybase (it's ``+``, not ``||``).
+* Fix MSSQLConnection.server_version() under Py3 (decode version to str).
+
Documentation
-------------
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index 792298f..1350514 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -1,6 +1,7 @@
-from sqlobject.dbconnection import DBAPI
-from sqlobject import col
import re
+from sqlobject import col
+from sqlobject.dbconnection import DBAPI
+from sqlobject.compat import PY2
class MSSQLConnection(DBAPI):
@@ -347,6 +348,8 @@ class MSSQLConnection(DBAPI):
try:
server_version = self.queryOne(
"SELECT SERVERPROPERTY('productversion')")[0]
+ if not PY2 and isinstance(server_version, bytes):
+ server_version = server_version.decode('ascii')
server_version = server_version.split('.')[0]
server_version = int(server_version)
except:
http://sourceforge.net/p/sqlobject/sqlobject/ci/ab58e61a1b11e97a85cff7503b5936704b856175
commit ab58e61a1b11e97a85cff7503b5936704b856175
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 18 01:54:28 2017 +0300
Fix N-quoted values: under Py2 they must be bytes
diff --git a/sqlobject/col.py b/sqlobject/col.py
index a7741c9..26c9a51 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -623,7 +623,6 @@ class StringCol(Col):
class NQuoted(sqlbuilder.SQLExpression):
def __init__(self, value):
- assert isinstance(value, unicode_type)
self.value = value
def __hash__(self):
@@ -664,6 +663,8 @@ class UnicodeStringValidator(SOValidator):
pass
else:
if connection.dbName == 'mssql':
+ if PY2:
+ value = value.encode(self.getDbEncoding(state))
return NQuoted(value)
return value.encode(self.getDbEncoding(state))
if hasattr(value, '__unicode__'):
http://sourceforge.net/p/sqlobject/sqlobject/ci/f40463a8193c8479c19649c320763f340397a73e
commit f40463a8193c8479c19649c320763f340397a73e
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 18 00:18:32 2017 +0300
Document newer MS SQL server versions
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index 2c0647e..792298f 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -339,6 +339,8 @@ class MSSQLConnection(DBAPI):
9 - 2005
10 - 2008
11 - 2012
+ 12 - 2014
+ 13 - 2016
"""
if self._server_version is not None:
return self._server_version
http://sourceforge.net/p/sqlobject/sqlobject/ci/b313c1fb5d6c1fb1535dbc297f0dc71a2c8485d3
commit b313c1fb5d6c1fb1535dbc297f0dc71a2c8485d3
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 17 23:20:14 2017 +0300
Ignore error in case we don't have DROP permission
diff --git a/sqlobject/tests/test_auto.py b/sqlobject/tests/test_auto.py
index e201d4d..e58ab1a 100644
--- a/sqlobject/tests/test_auto.py
+++ b/sqlobject/tests/test_auto.py
@@ -191,7 +191,10 @@ class TestAuto:
dbName = conn.dbName
dropper = getattr(self, dbName + 'Drop', None)
if dropper:
- conn.query(dropper)
+ try:
+ conn.query(dropper)
+ except: # Perhaps we don't have DROP permission
+ pass
def test_classCreate(self):
class AutoTest(SQLObject):
http://sourceforge.net/p/sqlobject/sqlobject/ci/afe2ca4d6f07aaacd7aca8c238eff155ac5dbebb
commit afe2ca4d6f07aaacd7aca8c238eff155ac5dbebb
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 17 23:11:16 2017 +0300
Fix test_auto.py: turn off microseconds for MS SQL
diff --git a/sqlobject/tests/test_auto.py b/sqlobject/tests/test_auto.py
index f3aa6da..e201d4d 100644
--- a/sqlobject/tests/test_auto.py
+++ b/sqlobject/tests/test_auto.py
@@ -3,6 +3,7 @@ from pytest import raises
from sqlobject import KeyCol, MultipleJoin, SQLObject, StringCol, \
classregistry, sqlmeta
+from sqlobject.col import use_microseconds
from sqlobject.tests.dbtest import getConnection, setupClass
@@ -199,6 +200,8 @@ class TestAuto:
class sqlmeta(sqlmeta):
idName = 'auto_id'
fromDatabase = True
+ if AutoTest._connection.dbName == 'mssql':
+ use_microseconds(False)
john = AutoTest(firstName='john',
lastName='doe',
age=10,
@@ -221,3 +224,5 @@ class TestAuto:
columns = AutoTest.sqlmeta.columns
assert columns["lastName"].dbName == "last_name"
assert columns["wannahavefun"].dbName == "wannahavefun"
+ if AutoTest._connection.dbName == 'mssql':
+ use_microseconds(True)
http://sourceforge.net/p/sqlobject/sqlobject/ci/3d86b18aff0e935e34c2489d3737ca35ae23ab00
commit 3d86b18aff0e935e34c2489d3737ca35ae23ab00
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 17 22:37:59 2017 +0300
Fix concatenation operator for MSSQL/Sybase
diff --git a/docs/News.rst b/docs/News.rst
index 60866d8..caf4dfe 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -66,6 +66,8 @@ Bug fix
* Remove excessive NULLs for MSSQL/Sybase.
+* Fix concatenation operator for MSSQL/Sybase (it's ``+``, not ``||``).
+
Documentation
-------------
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index 76b982c..2b4cdc7 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -1067,6 +1067,8 @@ class _LikeQuoted:
values.append(quote_str(self.postfix, db))
if db == "mysql":
return "CONCAT(%s)" % ", ".join(values)
+ elif db in ("mssql", "sybase"):
+ return " + ".join(values)
else:
return " || ".join(values)
elif isinstance(s, string_type):
@@ -1096,6 +1098,8 @@ class CONCAT(SQLExpression):
values = [sqlrepr(expr, db) for expr in self.expressions]
if db == "mysql":
return "CONCAT(%s)" % ", ".join(values)
+ elif db in ("mssql", "sybase"):
+ return " + ".join(values)
else:
return " || ".join(values)
diff --git a/sqlobject/tests/test_sqlbuilder.py b/sqlobject/tests/test_sqlbuilder.py
index 64170b1..9a3b6e3 100644
--- a/sqlobject/tests/test_sqlbuilder.py
+++ b/sqlobject/tests/test_sqlbuilder.py
@@ -96,6 +96,7 @@ def test_CONCAT():
SOTestSQLBuilder(name='test', so_value=42)
assert sqlrepr(CONCAT('a', 'b'), 'mysql') == "CONCAT('a', 'b')"
+ assert sqlrepr(CONCAT('a', 'b'), 'mssql') == "'a' + 'b'"
assert sqlrepr(CONCAT('a', 'b'), 'sqlite') == "'a' || 'b'"
assert sqlrepr(CONCAT('prefix', SOTestSQLBuilder.q.name), 'mysql') == \
"CONCAT('prefix', so_test_sql_builder.name)"
http://sourceforge.net/p/sqlobject/sqlobject/ci/f362e07698a017da0d7b63f685f5eddf123a676b
commit f362e07698a017da0d7b63f685f5eddf123a676b
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 17 22:24:23 2017 +0300
Remove excessive NULLs for MSSQL/Sybase
diff --git a/docs/News.rst b/docs/News.rst
index 089ad2f..60866d8 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -64,6 +64,8 @@ Bug fix
* Fix MSSQLConnection and SybaseConnection: insert default values into a table
with just one IDENTITY column.
+* Remove excessive NULLs for MSSQL/Sybase.
+
Documentation
-------------
diff --git a/sqlobject/col.py b/sqlobject/col.py
index c919e59..a7741c9 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -540,8 +540,6 @@ class SOStringLikeCol(SOCol):
def _sybaseType(self):
self._check_case_sensitive("SYBASE")
type = self._sqlType()
- if not self.notNone and not self.alternateID:
- type += ' NULL'
return type
def _mssqlType(self):
@@ -556,8 +554,6 @@ class SOStringLikeCol(SOCol):
type = 'VARCHAR(%i)' % self.length
else:
type = 'CHAR(%i)' % self.length
- if not self.notNone and not self.alternateID:
- type += ' NULL'
return type
def _firebirdType(self):
@@ -895,11 +891,11 @@ class SOKeyCol(SOCol):
return self.key_type[self._idType()]
def _sybaseType(self):
- key_type = {int: "NUMERIC(18,0) NULL", str: "TEXT"}
+ key_type = {int: "NUMERIC(18,0)", str: "TEXT"}
return key_type[self._idType()]
def _mssqlType(self):
- key_type = {int: "INT NULL", str: "TEXT"}
+ key_type = {int: "INT", str: "TEXT"}
return key_type[self._idType()]
def _firebirdType(self):
http://sourceforge.net/p/sqlobject/sqlobject/ci/970d6e68dc1441dbbdd52de0c0e74081a2297542
commit 970d6e68dc1441dbbdd52de0c0e74081a2297542
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 17 21:43:43 2017 +0300
Fix MSSQLConnection and SybaseConnection
Insert default values into a table with just one IDENTITY column.
diff --git a/docs/News.rst b/docs/News.rst
index 7ad5582..089ad2f 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -61,6 +61,9 @@ Bug fix
* Fix MSSQLConnection.columnsFromSchema: remove () from default value.
+* Fix MSSQLConnection and SybaseConnection: insert default values into a table
+ with just one IDENTITY column.
+
Documentation
-------------
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index 633fe24..2c0647e 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -169,7 +169,10 @@ class MSSQLConnection(DBAPI):
else:
c.execute('SET IDENTITY_INSERT %s OFF' % table)
- q = self._insertSQL(table, names, values)
+ if names and values:
+ q = self._insertSQL(table, names, values)
+ else:
+ q = "INSERT INTO %s DEFAULT VALUES" % table
if self.debug:
self.printDebug(conn, q, 'QueryIns')
c.execute(q)
diff --git a/sqlobject/sybase/sybaseconnection.py b/sqlobject/sybase/sybaseconnection.py
index 15e8914..f79441a 100644
--- a/sqlobject/sybase/sybaseconnection.py
+++ b/sqlobject/sybase/sybaseconnection.py
@@ -84,7 +84,10 @@ class SybaseConnection(DBAPI):
identity_insert_on = True
c.execute('SET IDENTITY_INSERT %s ON' % table)
- q = self._insertSQL(table, names, values)
+ if names and values:
+ q = self._insertSQL(table, names, values)
+ else:
+ q = "INSERT INTO %s DEFAULT VALUES" % table
if self.debug:
self.printDebug(conn, q, 'QueryIns')
c.execute(q)
http://sourceforge.net/p/sqlobject/sqlobject/ci/4e781b567ce07b65a9f559b529c2d61cc00f3713
commit 4e781b567ce07b65a9f559b529c2d61cc00f3713
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 17 21:33:11 2017 +0300
Fix MSSQLConnection.columnsFromSchema: remove () from default value
diff --git a/docs/News.rst b/docs/News.rst
index f0e3466..7ad5582 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -56,6 +56,11 @@ Drivers (work in progress)
* Add support for `pyfirebirdsql <https://pypi.python.org/pypi/firebirdsql>`_.
+Bug fix
+-------
+
+* Fix MSSQLConnection.columnsFromSchema: remove () from default value.
+
Documentation
-------------
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index af7aa48..633fe24 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -271,6 +271,9 @@ class MSSQLConnection(DBAPI):
if defaultText[0] == "'":
defaultText = defaultText[1:-1]
else:
+ if t in ("int", "float", "numeric") and \
+ defaultText[0] == "(":
+ defaultText = defaultText[1:-1]
if t == "int":
defaultText = int(defaultText)
if t == "float":
http://sourceforge.net/p/sqlobject/sqlobject/ci/a2b4c6ac06dbe68d188520d5b67bdabe978011d9
commit a2b4c6ac06dbe68d188520d5b67bdabe978011d9
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 17 00:02:28 2017 +0300
Add parameter ``timeout`` for MSSQLConnection (only for pymssql)
diff --git a/docs/News.rst b/docs/News.rst
index 0d60aee..f0e3466 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -38,6 +38,9 @@ Minor features
* Add support for `PyMySQL <https://github.com/PyMySQL/PyMySQL/>`_ - pure
python mysql interface).
+* Add parameter ``timeout`` for MSSQLConnection (usable only with pymssql
+ driver); timeouts are in seconds.
+
Drivers (work in progress)
--------------------------
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index 3ec7366..af7aa48 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -60,8 +60,8 @@ class MSSQLConnection(DBAPI):
self.make_conn_str = lambda keys: conn_str % (
keys.host, keys.db, keys.user, keys.password)
- kw.pop("sspi", None)
kw.pop("ncli", None)
+ kw.pop("sspi", None)
else: # pymssql
self.dbconnection = sqlmodule.connect
@@ -69,14 +69,20 @@ class MSSQLConnection(DBAPI):
# don't know whether pymssql uses unicode
self.usingUnicodeStrings = False
+ timeout = kw.pop('timeout', None)
+ if timeout:
+ timeout = int(timeout)
+ self.timeout = timeout
+
def _make_conn_str(keys):
keys_dict = {}
for attr, value in (
+ ('database', keys.db),
('user', keys.user),
('password', keys.password),
('host', keys.host),
('port', keys.port),
- ('database', keys.db),
+ ('timeout', keys.timeout),
):
if value:
keys_dict[attr] = value
diff --git a/tox.ini b/tox.ini
index 7f86236..cf0066a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -25,7 +25,6 @@ deps =
firebirdsql: firebirdsql
postgres-pg8000: pg8000
mssql: pymssql
- mssql: pytest-timeout
passenv = CI TRAVIS TRAVIS_* PGPASSWORD
# Don't fail or warn on uninstalled commands
whitelist_externals =
@@ -272,7 +271,7 @@ commands = flake8 .
commands =
-sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "CREATE DATABASE sqlobject_test"
- pytest --timeout=30 --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql&debug=1" tests include/tests inheritance/tests versioning/test
+ pytest --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql&timeout=30&debug=1" tests include/tests inheritance/tests versioning/test
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
-----------------------------------------------------------------------
Summary of changes:
docs/News.rst | 17 +++++++++++++++++
sqlobject/col.py | 11 ++++-------
sqlobject/mssql/mssqlconnection.py | 27 ++++++++++++++++++++++-----
sqlobject/sqlbuilder.py | 4 ++++
sqlobject/sybase/sybaseconnection.py | 5 ++++-
sqlobject/tests/test_auto.py | 10 +++++++++-
sqlobject/tests/test_sqlbuilder.py | 1 +
tox.ini | 3 +--
8 files changed, 62 insertions(+), 16 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-14 18:16:34
|
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
discards a349d7391a6a868758553cf6a3efa9d72e532dec (commit)
discards 42354eecb64659544f8efa80b04da466eac76989 (commit)
via ac4a243bc2e029e29991b99a33d5fb5cb386b901 (commit)
via 94fbfc6ccfba12e66b280ce9718dc4d480e16278 (commit)
via f5a10076a404097d8dae92a7a1694ed63b0887c7 (commit)
via 05471b88131b94a6c8fdd75d48c95e8a9ab538aa (commit)
via da5a72be1c6295c5f643dfe9241851549370900f (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (a349d7391a6a868758553cf6a3efa9d72e532dec)
\
N -- N -- N (ac4a243bc2e029e29991b99a33d5fb5cb386b901)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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/ac4a243bc2e029e29991b99a33d5fb5cb386b901
commit ac4a243bc2e029e29991b99a33d5fb5cb386b901
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 20:37:46 2017 +0300
pyfirebirdsql driver is tested but has problems
diff --git a/docs/News.rst b/docs/News.rst
index a043ed6..0d60aee 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -22,7 +22,7 @@ Minor features
* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb'
or 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that
- order. pyfirebirdsql is supported but untested.
+ order. pyfirebirdsql is supported but has problems.
* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only.
http://sourceforge.net/p/sqlobject/sqlobject/ci/94fbfc6ccfba12e66b280ce9718dc4d480e16278
commit 94fbfc6ccfba12e66b280ce9718dc4d480e16278
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 20:23:37 2017 +0300
Fix string.find - it returns -1 on error
diff --git a/sqlobject/tests/test_converters.py b/sqlobject/tests/test_converters.py
index f43da5e..0468a75 100644
--- a/sqlobject/tests/test_converters.py
+++ b/sqlobject/tests/test_converters.py
@@ -111,19 +111,19 @@ def test_bool():
def test_datetime():
from datetime import datetime, date, time
- if SODateTimeCol.datetimeFormat.find('.%f'):
+ if SODateTimeCol.datetimeFormat.find('.%f') > 0:
assert sqlrepr(datetime(2005, 7, 14, 13, 31, 2)) == \
"'2005-07-14 13:31:02.000000'"
else:
assert sqlrepr(datetime(2005, 7, 14, 13, 31, 2)) == \
"'2005-07-14 13:31:02'"
assert sqlrepr(date(2005, 7, 14)) == "'2005-07-14'"
- if SOTimeCol.timeFormat.find('.%f'):
+ if SOTimeCol.timeFormat.find('.%f') > 0:
assert sqlrepr(time(13, 31, 2)) == "'13:31:02.000000'"
else:
assert sqlrepr(time(13, 31, 2)) == "'13:31:02'"
# now dates before 1900
- if SODateTimeCol.datetimeFormat.find('.%f'):
+ if SODateTimeCol.datetimeFormat.find('.%f') > 0:
assert sqlrepr(datetime(1428, 7, 14, 13, 31, 2)) == \
"'1428-07-14 13:31:02.000000'"
else:
http://sourceforge.net/p/sqlobject/sqlobject/ci/f5a10076a404097d8dae92a7a1694ed63b0887c7
commit f5a10076a404097d8dae92a7a1694ed63b0887c7
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 20:02:47 2017 +0300
Run SQLite tests with in-memory DB
diff --git a/.travis.yml b/.travis.yml
index a1d309b..0f83b96 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -56,6 +56,10 @@ env:
- TOXENV=py27-sqlite
- TOXENV=py34-sqlite
- TOXENV=py35-sqlite
+ - TOXENV=py26-sqlite-memory
+ - TOXENV=py27-sqlite-memory
+ - TOXENV=py34-sqlite-memory
+ - TOXENV=py35-sqlite-memory
- TOXENV=py27-flake8
- TOXENV=py34-flake8
- TOXENV=py27-firebird-fdb
diff --git a/appveyor.yml b/appveyor.yml
index 2cba27b..a92631c 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -55,6 +55,10 @@ environment:
TOX_ENV: "pywin27-sqlite"
- PYTHON: "C:\\Python34"
TOX_ENV: "pywin34-sqlite"
+ - PYTHON: "C:\\Python27"
+ TOX_ENV: "pywin27-sqlite-memory"
+ - PYTHON: "C:\\Python34"
+ TOX_ENV: "pywin34-sqlite-memory"
install:
# Ensure we use the right python version
diff --git a/tox.ini b/tox.ini
index 8ef632a..7f86236 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 1.8
-envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35}-{mysqlclient,pypostgresql},py{26,27,34,35}-{mysql-connector,pymysql,postgres-psycopg,postgres-pygresql,postgres-pg8000,sqlite},py{27,34,35}-{firebird-fdb,firebirdsql},py{27,34}-flake8,pywin{27,34}-{mssql,postgres-psycopg,sqlite}
+envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35}-{mysqlclient,pypostgresql},py{26,27,34,35}-{mysql-connector,pymysql,postgres-psycopg,postgres-pygresql,postgres-pg8000,sqlite,sqlite-memory},py{27,34,35}-{firebird-fdb,firebirdsql},py{27,34}-flake8,pywin{27,34}-{mssql,postgres-psycopg,sqlite,sqlite-memory}
# Base test environment settings
[testenv]
@@ -205,6 +205,22 @@ commands = {[sqlite]commands}
[testenv:py35-sqlite]
commands = {[sqlite]commands}
+[sqlite-memory]
+commands =
+ pytest --cov=sqlobject -D sqlite:/:memory:?debug=1
+
+[testenv:py26-sqlite-memory]
+commands = {[sqlite-memory]commands}
+
+[testenv:py27-sqlite-memory]
+commands = {[sqlite-memory]commands}
+
+[testenv:py34-sqlite-memory]
+commands = {[sqlite-memory]commands}
+
+[testenv:py35-sqlite-memory]
+commands = {[sqlite-memory]commands}
+
# Firebird database test environments
[fdb]
commands =
@@ -288,3 +304,13 @@ commands = {[sqlite-w32]commands}
[testenv:pywin34-sqlite]
commands = {[sqlite-w32]commands}
+
+[sqlite-memory-w32]
+commands =
+ pytest --cov=sqlobject -D sqlite:/:memory:?debug=1
+
+[testenv:pywin27-sqlite-memory]
+commands = {[sqlite-memory-w32]commands}
+
+[testenv:pywin34-sqlite-memory]
+commands = {[sqlite-memory-w32]commands}
http://sourceforge.net/p/sqlobject/sqlobject/ci/05471b88131b94a6c8fdd75d48c95e8a9ab538aa
commit 05471b88131b94a6c8fdd75d48c95e8a9ab538aa
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 18:22:19 2017 +0300
Refactor skipping DB-specific test
Skip the entire modules instead of skipping tests one by one.
diff --git a/sqlobject/tests/test_decimal.py b/sqlobject/tests/test_decimal.py
index 82c67e9..c7388e0 100644
--- a/sqlobject/tests/test_decimal.py
+++ b/sqlobject/tests/test_decimal.py
@@ -13,9 +13,10 @@ try:
support_decimal_column = supports('decimalColumn')
except NameError:
# The module was imported during documentation building
- support_decimal_column = True
-if not support_decimal_column:
- pytestmark = pytest.mark.skip('')
+ pass
+else:
+ if not support_decimal_column:
+ pytestmark = pytest.mark.skip('')
class DecimalTable(SQLObject):
diff --git a/sqlobject/tests/test_mysql.py b/sqlobject/tests/test_mysql.py
index 59c21ca..d712ed0 100644
--- a/sqlobject/tests/test_mysql.py
+++ b/sqlobject/tests/test_mysql.py
@@ -3,20 +3,24 @@ from sqlobject import SQLObject
from sqlobject.tests.dbtest import getConnection, setupClass
+try:
+ connection = getConnection()
+except NameError:
+ # The module was imported during documentation building
+ pass
+else:
+ if connection.dbName != "mysql":
+ pytestmark = pytest.mark.skip('')
+
+
class SOTestSOListMySQL(SQLObject):
pass
def test_list_databases():
- connection = getConnection()
- if connection.dbName != "mysql":
- pytest.skip("These tests require MySQL")
assert connection.db in connection.listDatabases()
def test_list_tables():
- connection = getConnection()
- if connection.dbName != "mysql":
- pytest.skip("These tests require MySQL")
setupClass(SOTestSOListMySQL)
assert SOTestSOListMySQL.sqlmeta.table in connection.listTables()
diff --git a/sqlobject/tests/test_postgres.py b/sqlobject/tests/test_postgres.py
index b2b8895..ab01717 100644
--- a/sqlobject/tests/test_postgres.py
+++ b/sqlobject/tests/test_postgres.py
@@ -9,6 +9,16 @@ from sqlobject.tests.dbtest import getConnection, setupClass
########################################
+try:
+ connection = getConnection()
+except NameError:
+ # The module was imported during documentation building
+ pass
+else:
+ if connection.dbName != "postgres":
+ pytestmark = pytest.mark.skip('')
+
+
class SOTestSSLMode(SQLObject):
test = StringCol()
@@ -16,8 +26,7 @@ class SOTestSSLMode(SQLObject):
def test_sslmode():
setupClass(SOTestSSLMode)
connection = SOTestSSLMode._connection
- if (connection.dbName != 'postgres') or \
- (not connection.module.__name__.startswith('psycopg')) or \
+ if (not connection.module.__name__.startswith('psycopg')) or \
(os.name == 'nt'):
pytest.skip("The test requires PostgreSQL, psycopg and ssl mode; "
"also it doesn't work on w32")
@@ -41,15 +50,9 @@ class SOTestSOList(SQLObject):
def test_list_databases():
- connection = getConnection()
- if connection.dbName != "postgres":
- pytest.skip("These tests require PostgreSQL")
assert connection.db in connection.listDatabases()
def test_list_tables():
- connection = getConnection()
- if connection.dbName != "postgres":
- pytest.skip("These tests require PostgreSQL")
setupClass(SOTestSOList)
assert SOTestSOList.sqlmeta.table in connection.listTables()
diff --git a/sqlobject/tests/test_sqlite.py b/sqlobject/tests/test_sqlite.py
index 7b3f11d..b782eea 100644
--- a/sqlobject/tests/test_sqlite.py
+++ b/sqlobject/tests/test_sqlite.py
@@ -7,6 +7,16 @@ from sqlobject.tests.dbtest import setSQLiteConnectionFactory
from .test_basic import SOTestSO1
+try:
+ connection = getConnection()
+except NameError:
+ # The module was imported during documentation building
+ pass
+else:
+ if connection.dbName != "sqlite":
+ pytestmark = pytest.mark.skip('')
+
+
class SQLiteFactoryTest(SQLObject):
name = StringCol()
@@ -14,8 +24,6 @@ class SQLiteFactoryTest(SQLObject):
def test_sqlite_factory():
setupClass(SQLiteFactoryTest)
- if SQLiteFactoryTest._connection.dbName != "sqlite":
- pytest.skip("These tests require SQLite")
if not SQLiteFactoryTest._connection.using_sqlite2:
pytest.skip("These tests require SQLite v2+")
@@ -37,8 +45,6 @@ def test_sqlite_factory():
def test_sqlite_factory_str():
setupClass(SQLiteFactoryTest)
- if SQLiteFactoryTest._connection.dbName != "sqlite":
- pytest.skip("These tests require SQLite")
if not SQLiteFactoryTest._connection.using_sqlite2:
pytest.skip("These tests require SQLite v2+")
@@ -64,8 +70,6 @@ def test_sqlite_factory_str():
def test_sqlite_aggregate():
setupClass(SQLiteFactoryTest)
- if SQLiteFactoryTest._connection.dbName != "sqlite":
- pytest.skip("These tests require SQLite")
if not SQLiteFactoryTest._connection.using_sqlite2:
pytest.skip("These tests require SQLite v2+")
@@ -125,9 +129,6 @@ def test_empty_string():
def test_memorydb():
if not supports("memorydb"):
pytest.skip("memorydb isn't supported")
- connection = getConnection()
- if connection.dbName != "sqlite":
- pytest.skip("These tests require SQLite")
if not connection._memory:
pytest.skip("The connection isn't memorydb")
setupClass(SOTestSO1)
@@ -137,15 +138,9 @@ def test_memorydb():
def test_list_databases():
- connection = getConnection()
- if connection.dbName != "sqlite":
- pytest.skip("These tests require SQLite")
assert connection.listDatabases() == ['main']
def test_list_tables():
- connection = getConnection()
- if connection.dbName != "sqlite":
- pytest.skip("These tests require SQLite")
setupClass(SOTestSO1)
assert SOTestSO1.sqlmeta.table in connection.listTables()
diff --git a/sqlobject/tests/test_transactions.py b/sqlobject/tests/test_transactions.py
index d469d7e..0fbac42 100644
--- a/sqlobject/tests/test_transactions.py
+++ b/sqlobject/tests/test_transactions.py
@@ -8,6 +8,16 @@ from sqlobject.tests.dbtest import raises, setupClass, supports
########################################
+try:
+ support_transactions = supports('transactions')
+except NameError:
+ # The module was imported during documentation building
+ pass
+else:
+ if not support_transactions:
+ pytestmark = pytest.mark.skip('')
+
+
class SOTestSOTrans(SQLObject):
class sqlmeta:
defaultOrder = 'name'
@@ -15,8 +25,6 @@ class SOTestSOTrans(SQLObject):
def test_transaction():
- if not supports('transactions'):
- pytest.skip("Transactions aren't supported")
setupClass(SOTestSOTrans)
SOTestSOTrans(name='bob')
SOTestSOTrans(name='tim')
@@ -41,8 +49,6 @@ def test_transaction():
def test_transaction_commit_sync():
- if not supports('transactions'):
- pytest.skip("Transactions aren't supported")
setupClass(SOTestSOTrans)
trans = SOTestSOTrans._connection.transaction()
try:
@@ -58,8 +64,6 @@ def test_transaction_commit_sync():
def test_transaction_delete(close=False):
- if not supports('transactions'):
- pytest.skip("Transactions aren't supported")
setupClass(SOTestSOTrans)
connection = SOTestSOTrans._connection
if (connection.dbName == 'sqlite') and connection._memory:
http://sourceforge.net/p/sqlobject/sqlobject/ci/da5a72be1c6295c5f643dfe9241851549370900f
commit da5a72be1c6295c5f643dfe9241851549370900f
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 17:34:06 2017 +0300
Fix flake8 warning: change indent due to shorter class name
diff --git a/sqlobject/inheritance/tests/test_indexes.py b/sqlobject/inheritance/tests/test_indexes.py
index 085725c..5142425 100644
--- a/sqlobject/inheritance/tests/test_indexes.py
+++ b/sqlobject/inheritance/tests/test_indexes.py
@@ -25,9 +25,9 @@ def test_index_get_1():
setupClass([InhPersonIdxGet, InhEmployeeIdxGet, InhSalesManIdxGet])
InhSalesManIdxGet(first_name='Michael', last_name='Pallin', age=65,
- security_number=2304, experience=2, skill=10)
+ security_number=2304, experience=2, skill=10)
InhEmployeeIdxGet(first_name='Eric', last_name='Idle', age=63,
- security_number=3402, experience=9)
+ security_number=3402, experience=9)
InhPersonIdxGet(first_name='Terry', last_name='Guilliam', age=64)
InhPersonIdxGet.pk.get('Michael', 'Pallin')
diff --git a/sqlobject/tests/test_cyclic_reference.py b/sqlobject/tests/test_cyclic_reference.py
index be22989..e8e1510 100644
--- a/sqlobject/tests/test_cyclic_reference.py
+++ b/sqlobject/tests/test_cyclic_reference.py
@@ -40,10 +40,10 @@ def test_cyclic_reference():
assert not conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
constraints = SOTestCyclicRefA.createTable(ifNotExists=True,
- applyConstraints=False)
+ applyConstraints=False)
assert conn.tableExists(SOTestCyclicRefA.sqlmeta.table)
constraints += SOTestCyclicRefB.createTable(ifNotExists=True,
- applyConstraints=False)
+ applyConstraints=False)
assert conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
for constraint in constraints:
-----------------------------------------------------------------------
Summary of changes:
.travis.yml | 4 ++++
appveyor.yml | 4 ++++
docs/News.rst | 8 ++++----
sqlobject/firebird/firebirdconnection.py | 2 +-
sqlobject/tests/test_converters.py | 6 +++---
sqlobject/tests/test_decimal.py | 7 ++++---
sqlobject/tests/test_mysql.py | 16 ++++++++++------
sqlobject/tests/test_postgres.py | 19 +++++++++++--------
sqlobject/tests/test_sqlite.py | 25 ++++++++++---------------
sqlobject/tests/test_transactions.py | 16 ++++++++++------
tox.ini | 28 +++++++++++++++++++++++++++-
11 files changed, 88 insertions(+), 47 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-14 14:36:11
|
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 a349d7391a6a868758553cf6a3efa9d72e532dec (commit)
from 42354eecb64659544f8efa80b04da466eac76989 (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/a349d7391a6a868758553cf6a3efa9d72e532dec
commit a349d7391a6a868758553cf6a3efa9d72e532dec
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 17:34:06 2017 +0300
Fix flake8 warning: change indent due to shorter class name
diff --git a/sqlobject/inheritance/tests/test_indexes.py b/sqlobject/inheritance/tests/test_indexes.py
index 085725c..5142425 100644
--- a/sqlobject/inheritance/tests/test_indexes.py
+++ b/sqlobject/inheritance/tests/test_indexes.py
@@ -25,9 +25,9 @@ def test_index_get_1():
setupClass([InhPersonIdxGet, InhEmployeeIdxGet, InhSalesManIdxGet])
InhSalesManIdxGet(first_name='Michael', last_name='Pallin', age=65,
- security_number=2304, experience=2, skill=10)
+ security_number=2304, experience=2, skill=10)
InhEmployeeIdxGet(first_name='Eric', last_name='Idle', age=63,
- security_number=3402, experience=9)
+ security_number=3402, experience=9)
InhPersonIdxGet(first_name='Terry', last_name='Guilliam', age=64)
InhPersonIdxGet.pk.get('Michael', 'Pallin')
diff --git a/sqlobject/tests/test_cyclic_reference.py b/sqlobject/tests/test_cyclic_reference.py
index be22989..e8e1510 100644
--- a/sqlobject/tests/test_cyclic_reference.py
+++ b/sqlobject/tests/test_cyclic_reference.py
@@ -40,10 +40,10 @@ def test_cyclic_reference():
assert not conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
constraints = SOTestCyclicRefA.createTable(ifNotExists=True,
- applyConstraints=False)
+ applyConstraints=False)
assert conn.tableExists(SOTestCyclicRefA.sqlmeta.table)
constraints += SOTestCyclicRefB.createTable(ifNotExists=True,
- applyConstraints=False)
+ applyConstraints=False)
assert conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
for constraint in constraints:
-----------------------------------------------------------------------
Summary of changes:
sqlobject/inheritance/tests/test_indexes.py | 4 ++--
sqlobject/tests/test_cyclic_reference.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-14 11:43:24
|
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 42354eecb64659544f8efa80b04da466eac76989 (commit)
via c479b9ba6f114c37364981b0c0ce1bb9cc826516 (commit)
via c029aa68148b403cf070eb868235af714b236708 (commit)
via e527ceb9b765e2fa5cc24c7d2e1a260390786f69 (commit)
via 9404c1087898390d1cec4d916cb6ce564984ef39 (commit)
from a02ae6f0c4823d55b556e0d692ea48b3ceb537f8 (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/42354eecb64659544f8efa80b04da466eac76989
commit 42354eecb64659544f8efa80b04da466eac76989
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 14:32:38 2017 +0300
Add firebirdsql to the list of default drivers for Firebird
diff --git a/docs/News.rst b/docs/News.rst
index a043ed6..436fe15 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -20,9 +20,9 @@ Minor features
* Remove ``driver`` keyword from RdbhostConnection as it allows one driver
``rdbhdb``.
-* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb'
- or 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that
- order. pyfirebirdsql is supported but untested.
+* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb',
+ 'kinterbasdb' or 'firebirdsql'. Default is to test 'fdb', 'kinterbasdb' and
+ 'firebirdsql' in that order.
* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only.
@@ -77,7 +77,7 @@ Tests
* Drop ``Circle CI``.
* Run at Travis CI tests with Firebird backend (server version 2.5; drivers fdb
- and firebirdsql). There are problems with tests.
+ and firebirdsql). There are some problems with tests.
* Add AppVeyor for windows testing. Run tests with Postgres and MS SQL. There
are problems with MS SQL.
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index 3bf3fb5..41e1a31 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -16,7 +16,7 @@ class FirebirdConnection(DBAPI):
def __init__(self, host, db, port='3050', user='sysdba',
password='masterkey', autoCommit=1,
dialect=None, role=None, charset=None, **kw):
- drivers = kw.pop('driver', None) or 'fdb,kinterbasdb'
+ drivers = kw.pop('driver', None) or 'fdb,kinterbasdb,firebirdsql'
for driver in drivers.split(','):
driver = driver.strip()
if not driver:
http://sourceforge.net/p/sqlobject/sqlobject/ci/c479b9ba6f114c37364981b0c0ce1bb9cc826516
commit c479b9ba6f114c37364981b0c0ce1bb9cc826516
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 13:48:53 2017 +0300
Fix test: convert mx.DateTime to date
diff --git a/sqlobject/tests/test_datetime.py b/sqlobject/tests/test_datetime.py
index 7aade08..58c43f9 100644
--- a/sqlobject/tests/test_datetime.py
+++ b/sqlobject/tests/test_datetime.py
@@ -105,7 +105,7 @@ if mxdatetime_available:
def test_mxDateTime():
setupClass(DateTime2)
_now = now()
- dt2 = DateTime2(col1=_now, col2=_now,
+ dt2 = DateTime2(col1=_now, col2=_now.pydate(),
col3=Time(_now.hour, _now.minute, _now.second))
assert isinstance(dt2.col1, col.DateTimeType)
@@ -120,14 +120,9 @@ if mxdatetime_available:
assert dt2.col2.year == _now.year
assert dt2.col2.month == _now.month
assert dt2.col2.day == _now.day
- if getConnection().dbName == "sqlite":
- assert dt2.col2.hour == _now.hour
- assert dt2.col2.minute == _now.minute
- assert dt2.col2.second == int(_now.second)
- else:
- assert dt2.col2.hour == 0
- assert dt2.col2.minute == 0
- assert dt2.col2.second == 0
+ assert dt2.col2.hour == 0
+ assert dt2.col2.minute == 0
+ assert dt2.col2.second == 0
assert isinstance(dt2.col3, (col.DateTimeType, col.TimeType))
assert dt2.col3.hour == _now.hour
http://sourceforge.net/p/sqlobject/sqlobject/ci/c029aa68148b403cf070eb868235af714b236708
commit c029aa68148b403cf070eb868235af714b236708
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 13:11:35 2017 +0300
Fix TEXT type in id/foreign keys: Firebird doesn't have TEXT type
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 2385e09..c919e59 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -902,6 +902,10 @@ class SOKeyCol(SOCol):
key_type = {int: "INT NULL", str: "TEXT"}
return key_type[self._idType()]
+ def _firebirdType(self):
+ key_type = {int: "INT", str: "VARCHAR(255)"}
+ return key_type[self._idType()]
+
class KeyCol(Col):
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index ba60123..3bf3fb5 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -169,7 +169,7 @@ class FirebirdConnection(DBAPI):
return col.firebirdCreateSQL()
def createIDColumn(self, soClass):
- key_type = {int: "INT", str: "TEXT"}[soClass.sqlmeta.idType]
+ key_type = {int: "INT", str: "VARCHAR(255)"}[soClass.sqlmeta.idType]
return '%s %s NOT NULL PRIMARY KEY' % (soClass.sqlmeta.idName,
key_type)
http://sourceforge.net/p/sqlobject/sqlobject/ci/e527ceb9b765e2fa5cc24c7d2e1a260390786f69
commit e527ceb9b765e2fa5cc24c7d2e1a260390786f69
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 12:05:57 2017 +0300
Fix tests for Firebird: shorten table names
Firebird doesn't allow table/column names to be longer than 31 characters.
diff --git a/sqlobject/inheritance/tests/test_foreignKey.py b/sqlobject/inheritance/tests/test_foreignKey.py
index c1f70e1..3e63c26 100644
--- a/sqlobject/inheritance/tests/test_foreignKey.py
+++ b/sqlobject/inheritance/tests/test_foreignKey.py
@@ -79,16 +79,16 @@ def test_foreignKey():
assert employee.count() == 2
-class SOTestInheritableBase(InheritableSQLObject):
+class SOTestInhBase(InheritableSQLObject):
pass
-class SOTestInheritableForeignKey(SOTestInheritableBase):
- base = ForeignKey("SOTestInheritableBase")
+class SOTestInhFKey(SOTestInhBase):
+ base = ForeignKey("SOTestInhBase")
def test_foreignKey2():
- setupClass([SOTestInheritableBase, SOTestInheritableForeignKey])
+ setupClass([SOTestInhBase, SOTestInhFKey])
- test = SOTestInheritableBase()
- SOTestInheritableForeignKey(base=test)
+ test = SOTestInhBase()
+ SOTestInhFKey(base=test)
diff --git a/sqlobject/inheritance/tests/test_indexes.py b/sqlobject/inheritance/tests/test_indexes.py
index f2ed38a..085725c 100644
--- a/sqlobject/inheritance/tests/test_indexes.py
+++ b/sqlobject/inheritance/tests/test_indexes.py
@@ -3,41 +3,40 @@ from sqlobject.tests.dbtest import setupClass
from sqlobject.inheritance import InheritableSQLObject
-class InheritedPersonIndexGet(InheritableSQLObject):
+class InhPersonIdxGet(InheritableSQLObject):
first_name = StringCol(notNone=True, length=100)
last_name = StringCol(notNone=True, length=100)
age = IntCol()
pk = DatabaseIndex(first_name, last_name, unique=True)
-class InheritedEmployeeIndexGet(InheritedPersonIndexGet):
+class InhEmployeeIdxGet(InhPersonIdxGet):
security_number = IntCol()
experience = IntCol()
sec_index = DatabaseIndex(security_number, unique=True)
-class InheritedSalesManIndexGet(InheritedEmployeeIndexGet):
+class InhSalesManIdxGet(InhEmployeeIdxGet):
_inheritable = False
skill = IntCol()
def test_index_get_1():
- setupClass([InheritedPersonIndexGet, InheritedEmployeeIndexGet,
- InheritedSalesManIndexGet])
+ setupClass([InhPersonIdxGet, InhEmployeeIdxGet, InhSalesManIdxGet])
- InheritedSalesManIndexGet(first_name='Michael', last_name='Pallin', age=65,
+ InhSalesManIdxGet(first_name='Michael', last_name='Pallin', age=65,
security_number=2304, experience=2, skill=10)
- InheritedEmployeeIndexGet(first_name='Eric', last_name='Idle', age=63,
+ InhEmployeeIdxGet(first_name='Eric', last_name='Idle', age=63,
security_number=3402, experience=9)
- InheritedPersonIndexGet(first_name='Terry', last_name='Guilliam', age=64)
-
- InheritedPersonIndexGet.pk.get('Michael', 'Pallin')
- InheritedEmployeeIndexGet.pk.get('Michael', 'Pallin')
- InheritedSalesManIndexGet.pk.get('Michael', 'Pallin')
- InheritedPersonIndexGet.pk.get('Eric', 'Idle')
- InheritedEmployeeIndexGet.pk.get('Eric', 'Idle')
- InheritedPersonIndexGet.pk.get(first_name='Terry', last_name='Guilliam')
- InheritedEmployeeIndexGet.sec_index.get(2304)
- InheritedEmployeeIndexGet.sec_index.get(3402)
- InheritedSalesManIndexGet.sec_index.get(2304)
- InheritedSalesManIndexGet.sec_index.get(3402)
+ InhPersonIdxGet(first_name='Terry', last_name='Guilliam', age=64)
+
+ InhPersonIdxGet.pk.get('Michael', 'Pallin')
+ InhEmployeeIdxGet.pk.get('Michael', 'Pallin')
+ InhSalesManIdxGet.pk.get('Michael', 'Pallin')
+ InhPersonIdxGet.pk.get('Eric', 'Idle')
+ InhEmployeeIdxGet.pk.get('Eric', 'Idle')
+ InhPersonIdxGet.pk.get(first_name='Terry', last_name='Guilliam')
+ InhEmployeeIdxGet.sec_index.get(2304)
+ InhEmployeeIdxGet.sec_index.get(3402)
+ InhSalesManIdxGet.sec_index.get(2304)
+ InhSalesManIdxGet.sec_index.get(3402)
diff --git a/sqlobject/tests/test_cyclic_reference.py b/sqlobject/tests/test_cyclic_reference.py
index 7350216..be22989 100644
--- a/sqlobject/tests/test_cyclic_reference.py
+++ b/sqlobject/tests/test_cyclic_reference.py
@@ -4,52 +4,52 @@ from sqlobject import BLOBCol, DateTimeCol, ForeignKey, IntCol, SQLObject, \
from sqlobject.tests.dbtest import getConnection, supports
-class SOTestCyclicReferenceA(SQLObject):
+class SOTestCyclicRefA(SQLObject):
class sqlmeta(sqlmeta):
idName = 'test_id_here'
- table = 'test_cyclic_reference_a_table'
+ table = 'test_cyclic_ref_a_table'
name = StringCol()
number = IntCol()
so_time = DateTimeCol()
short = StringCol(length=10)
blobcol = BLOBCol()
- fkeyb = ForeignKey('SOTestCyclicReferenceB')
+ fkeyb = ForeignKey('SOTestCyclicRefB')
-class SOTestCyclicReferenceB(SQLObject):
+class SOTestCyclicRefB(SQLObject):
class sqlmeta(sqlmeta):
idName = 'test_id_here'
- table = 'test_cyclic_reference_b_table'
+ table = 'test_cyclic_ref_b_table'
name = StringCol()
number = IntCol()
so_time = DateTimeCol()
short = StringCol(length=10)
blobcol = BLOBCol()
- fkeya = ForeignKey('SOTestCyclicReferenceA')
+ fkeya = ForeignKey('SOTestCyclicRefA')
def test_cyclic_reference():
if not supports('dropTableCascade'):
pytest.skip("dropTableCascade isn't supported")
conn = getConnection()
- SOTestCyclicReferenceA.setConnection(conn)
- SOTestCyclicReferenceB.setConnection(conn)
- SOTestCyclicReferenceA.dropTable(ifExists=True, cascade=True)
- assert not conn.tableExists(SOTestCyclicReferenceA.sqlmeta.table)
- SOTestCyclicReferenceB.dropTable(ifExists=True, cascade=True)
- assert not conn.tableExists(SOTestCyclicReferenceB.sqlmeta.table)
-
- constraints = SOTestCyclicReferenceA.createTable(ifNotExists=True,
+ SOTestCyclicRefA.setConnection(conn)
+ SOTestCyclicRefB.setConnection(conn)
+ SOTestCyclicRefA.dropTable(ifExists=True, cascade=True)
+ assert not conn.tableExists(SOTestCyclicRefA.sqlmeta.table)
+ SOTestCyclicRefB.dropTable(ifExists=True, cascade=True)
+ assert not conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
+
+ constraints = SOTestCyclicRefA.createTable(ifNotExists=True,
applyConstraints=False)
- assert conn.tableExists(SOTestCyclicReferenceA.sqlmeta.table)
- constraints += SOTestCyclicReferenceB.createTable(ifNotExists=True,
+ assert conn.tableExists(SOTestCyclicRefA.sqlmeta.table)
+ constraints += SOTestCyclicRefB.createTable(ifNotExists=True,
applyConstraints=False)
- assert conn.tableExists(SOTestCyclicReferenceB.sqlmeta.table)
+ assert conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
for constraint in constraints:
conn.query(constraint)
- SOTestCyclicReferenceA.dropTable(ifExists=True, cascade=True)
- assert not conn.tableExists(SOTestCyclicReferenceA.sqlmeta.table)
- SOTestCyclicReferenceB.dropTable(ifExists=True, cascade=True)
- assert not conn.tableExists(SOTestCyclicReferenceB.sqlmeta.table)
+ SOTestCyclicRefA.dropTable(ifExists=True, cascade=True)
+ assert not conn.tableExists(SOTestCyclicRefA.sqlmeta.table)
+ SOTestCyclicRefB.dropTable(ifExists=True, cascade=True)
+ assert not conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
diff --git a/sqlobject/tests/test_new_joins.py b/sqlobject/tests/test_new_joins.py
index a70e1dc..3a97e98 100644
--- a/sqlobject/tests/test_new_joins.py
+++ b/sqlobject/tests/test_new_joins.py
@@ -9,16 +9,16 @@ from sqlobject.tests.dbtest import setupClass
########################################
-class PersonJoinerNew(SQLObject):
+class PersonJNew(SQLObject):
name = StringCol(length=40, alternateID=True)
- addressJoiners = ManyToMany('AddressJoinerNew')
+ addressJs = ManyToMany('AddressJNew')
-class AddressJoinerNew(SQLObject):
+class AddressJNew(SQLObject):
zip = StringCol(length=5, alternateID=True)
- personJoiners = ManyToMany('PersonJoinerNew')
+ personJs = ManyToMany('PersonJNew')
class ImplicitJoiningSONew(SQLObject):
@@ -32,29 +32,29 @@ class ExplicitJoiningSONew(SQLObject):
class TestJoin:
def setup_method(self, meth):
- setupClass(PersonJoinerNew)
- setupClass(AddressJoinerNew)
+ setupClass(PersonJNew)
+ setupClass(AddressJNew)
for n in ['bob', 'tim', 'jane', 'joe', 'fred', 'barb']:
- PersonJoinerNew(name=n)
+ PersonJNew(name=n)
for z in ['11111', '22222', '33333', '44444']:
- AddressJoinerNew(zip=z)
+ AddressJNew(zip=z)
def test_join(self):
- b = PersonJoinerNew.byName('bob')
- assert list(b.addressJoiners) == []
- z = AddressJoinerNew.byZip('11111')
- b.addressJoiners.add(z)
- self.assertZipsEqual(b.addressJoiners, ['11111'])
- print(str(z.personJoiners), repr(z.personJoiners))
- self.assertNamesEqual(z.personJoiners, ['bob'])
- z2 = AddressJoinerNew.byZip('22222')
- b.addressJoiners.add(z2)
- print(str(b.addressJoiners))
- self.assertZipsEqual(b.addressJoiners, ['11111', '22222'])
- self.assertNamesEqual(z2.personJoiners, ['bob'])
- b.addressJoiners.remove(z)
- self.assertZipsEqual(b.addressJoiners, ['22222'])
- self.assertNamesEqual(z.personJoiners, [])
+ b = PersonJNew.byName('bob')
+ assert list(b.addressJs) == []
+ z = AddressJNew.byZip('11111')
+ b.addressJs.add(z)
+ self.assertZipsEqual(b.addressJs, ['11111'])
+ print(str(z.personJs), repr(z.personJs))
+ self.assertNamesEqual(z.personJs, ['bob'])
+ z2 = AddressJNew.byZip('22222')
+ b.addressJs.add(z2)
+ print(str(b.addressJs))
+ self.assertZipsEqual(b.addressJs, ['11111', '22222'])
+ self.assertNamesEqual(z2.personJs, ['bob'])
+ b.addressJs.remove(z)
+ self.assertZipsEqual(b.addressJs, ['22222'])
+ self.assertNamesEqual(z.personJs, [])
def assertZipsEqual(self, zips, dest):
assert [a.zip for a in zips] == dest
@@ -72,94 +72,94 @@ class TestJoin:
assert not hasattr(ExplicitJoiningSONew, 'bars')
-class PersonJoinerNew2(SQLObject):
+class PersonJNew2(SQLObject):
name = StringCol('name', length=40, alternateID=True)
- addressJoiner2s = OneToMany('AddressJoinerNew2')
+ addressJ2s = OneToMany('AddressJNew2')
-class AddressJoinerNew2(SQLObject):
+class AddressJNew2(SQLObject):
class sqlmeta:
defaultOrder = ['-zip', 'plus4']
zip = StringCol(length=5)
plus4 = StringCol(length=4, default=None)
- personJoinerNew2 = ForeignKey('PersonJoinerNew2')
+ personJNew2 = ForeignKey('PersonJNew2')
class TestJoin2:
def setup_method(self, meth):
- setupClass([PersonJoinerNew2, AddressJoinerNew2])
- p1 = PersonJoinerNew2(name='bob')
- p2 = PersonJoinerNew2(name='sally')
+ setupClass([PersonJNew2, AddressJNew2])
+ p1 = PersonJNew2(name='bob')
+ p2 = PersonJNew2(name='sally')
for z in ['11111', '22222', '33333']:
- AddressJoinerNew2(zip=z, personJoinerNew2=p1)
- AddressJoinerNew2(zip='00000', personJoinerNew2=p2)
+ AddressJNew2(zip=z, personJNew2=p1)
+ AddressJNew2(zip='00000', personJNew2=p2)
def test_basic(self):
- bob = PersonJoinerNew2.byName('bob')
- sally = PersonJoinerNew2.byName('sally')
- print(bob.addressJoiner2s)
+ bob = PersonJNew2.byName('bob')
+ sally = PersonJNew2.byName('sally')
+ print(bob.addressJ2s)
print(bob)
- assert len(list(bob.addressJoiner2s)) == 3
- assert len(list(sally.addressJoiner2s)) == 1
- bob.addressJoiner2s[0].destroySelf()
- assert len(list(bob.addressJoiner2s)) == 2
- z = bob.addressJoiner2s[0]
+ assert len(list(bob.addressJ2s)) == 3
+ assert len(list(sally.addressJ2s)) == 1
+ bob.addressJ2s[0].destroySelf()
+ assert len(list(bob.addressJ2s)) == 2
+ z = bob.addressJ2s[0]
z.zip = 'xxxxx'
id = z.id
del z
- z = AddressJoinerNew2.get(id)
+ z = AddressJNew2.get(id)
assert z.zip == 'xxxxx'
def test_defaultOrder(self):
- p1 = PersonJoinerNew2.byName('bob')
- assert ([i.zip for i in p1.addressJoiner2s] ==
+ p1 = PersonJNew2.byName('bob')
+ assert ([i.zip for i in p1.addressJ2s] ==
['33333', '22222', '11111'])
-_personJoiner3_getters = []
-_personJoiner3_setters = []
+_personJ3_getters = []
+_personJ3_setters = []
-class PersonJoinerNew3(SQLObject):
+class PersonJNew3(SQLObject):
name = StringCol('name', length=40, alternateID=True)
- addressJoinerNew3s = OneToMany('AddressJoinerNew3')
+ addressJNew3s = OneToMany('AddressJNew3')
-class AddressJoinerNew3(SQLObject):
+class AddressJNew3(SQLObject):
zip = StringCol(length=5)
- personJoinerNew3 = ForeignKey('PersonJoinerNew3')
+ personJNew3 = ForeignKey('PersonJNew3')
- def _get_personJoinerNew3(self):
- value = self._SO_get_personJoinerNew3()
- _personJoiner3_getters.append((self, value))
+ def _get_personJNew3(self):
+ value = self._SO_get_personJNew3()
+ _personJ3_getters.append((self, value))
return value
- def _set_personJoinerNew3(self, value):
- self._SO_set_personJoinerNew3(value)
- _personJoiner3_setters.append((self, value))
+ def _set_personJNew3(self, value):
+ self._SO_set_personJNew3(value)
+ _personJ3_setters.append((self, value))
class TestJoin3:
... 156 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-13 23:47:23
|
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 a02ae6f0c4823d55b556e0d692ea48b3ceb537f8 (commit)
via 6795deff456d99be97533b2292cc051d410fb6be (commit)
via f7765c9d1d4e9c75ef8f44239b6df00bd62af5fe (commit)
via 3c3ff7fc1d49db18db27ad24ce91f1910f7f6248 (commit)
via 1e0411e48a6a99f33d0f4df287bcf6e60e3d1289 (commit)
via a526639480b5943f6397c925be144e6271b793d7 (commit)
via 270599a9da489846534e14a665c380ad96f24815 (commit)
from 105482c683f49316620c7ff64396192c8abb3942 (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/a02ae6f0c4823d55b556e0d692ea48b3ceb537f8
commit a02ae6f0c4823d55b556e0d692ea48b3ceb537f8
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 01:56:14 2017 +0300
Force debugging output in tests: append debug=1 to DB URIs
diff --git a/tox.ini b/tox.ini
index 7276e95..8ef632a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -42,7 +42,7 @@ whitelist_externals =
commands =
-mysql -e 'drop database sqlobject_test;'
mysql -e 'create database sqlobject_test;'
- pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=mysqldb
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=mysqldb&debug=1
mysql -e 'drop database sqlobject_test;'
[testenv:py26-mysqldb]
@@ -55,7 +55,7 @@ commands = {[mysqldb]commands}
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
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=mysqldb&charset=utf8&debug=1
mysql -e 'drop database sqlobject_test;'
[testenv:py34-mysqlclient]
@@ -68,7 +68,7 @@ commands = {[mysqlclient]commands}
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
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=connector&charset=utf8&debug=1
mysql -e 'drop database sqlobject_test;'
[testenv:py26-mysql-connector]
@@ -87,7 +87,7 @@ commands = {[mysql-connector]commands}
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
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=oursql&charset=utf8&debug=1
mysql -e 'drop database sqlobject_test;'
[testenv:py26-mysql-oursql]
@@ -100,7 +100,7 @@ commands = {[oursql]commands}
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
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=pymysql&charset=utf8&debug=1
mysql -e 'drop database sqlobject_test;'
[testenv:py26-pymysql]
@@ -120,7 +120,7 @@ commands = {[pymysql]commands}
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
+ pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=psycopg&charset=utf-8&debug=1 tests include/tests inheritance/tests versioning/test
dropdb -U postgres sqlobject_test
[testenv:py26-postgres-psycopg]
@@ -139,7 +139,7 @@ commands = {[psycopg]commands}
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
+ pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pygresql&charset=utf-8&debug=1 tests include/tests inheritance/tests versioning/test
dropdb -U postgres sqlobject_test
[testenv:py26-postgres-pygresql]
@@ -158,7 +158,7 @@ commands = {[pygresql]commands}
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
+ pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pypostgresql&charset=utf-8&debug=1 tests include/tests inheritance/tests versioning/test
dropdb -U postgres sqlobject_test
[testenv:py34-pypostgresql]
@@ -171,7 +171,7 @@ commands = {[pypostgresql]commands}
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
+ pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pg8000&charset=utf-8&debug=1 tests include/tests inheritance/tests versioning/test
dropdb -U postgres sqlobject_test
[testenv:py26-postgres-pg8000]
@@ -190,7 +190,7 @@ commands = {[pg8000]commands}
[sqlite]
commands =
-rm /tmp/sqlobject_test.sqdb
- pytest --cov=sqlobject -D sqlite:///tmp/sqlobject_test.sqdb
+ pytest --cov=sqlobject -D sqlite:///tmp/sqlobject_test.sqdb?debug=1
rm /tmp/sqlobject_test.sqdb
[testenv:py26-sqlite]
@@ -210,7 +210,7 @@ commands = {[sqlite]commands}
commands =
sudo rm -f /tmp/test.fdb
isql-fb -u test -p test -i /var/lib/firebird/create_test_db
- pytest --cov=sqlobject -D 'firebird://test:test@localhost/tmp/test.fdb'
+ pytest --cov=sqlobject -D 'firebird://test:test@localhost/tmp/test.fdb?debug=1'
sudo rm /tmp/test.fdb
[testenv:py27-firebird-fdb]
@@ -226,7 +226,7 @@ commands = {[fdb]commands}
commands =
sudo rm -f /tmp/test.fdb
isql-fb -u test -p test -i /var/lib/firebird/create_test_db
- pytest --cov=sqlobject -D 'firebird://test:test@localhost:3050/tmp/test.fdb?driver=firebirdsql&charset=utf8'
+ pytest --cov=sqlobject -D 'firebird://test:test@localhost:3050/tmp/test.fdb?driver=firebirdsql&charset=utf8&debug=1'
sudo rm /tmp/test.fdb
[testenv:py27-firebirdsql]
@@ -256,7 +256,7 @@ commands = flake8 .
commands =
-sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "CREATE DATABASE sqlobject_test"
- pytest --timeout=30 --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql" tests include/tests inheritance/tests versioning/test
+ pytest --timeout=30 --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql&debug=1" tests include/tests inheritance/tests versioning/test
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
@@ -264,7 +264,7 @@ commands =
commands =
-dropdb -w -U postgres sqlobject_test
createdb -w -U postgres sqlobject_test
- pytest --cov=sqlobject -D "postgres://postgres:Password12!@localhost/sqlobject_test?driver=psycopg2&charset=utf-8" tests include/tests inheritance/tests versioning/test
+ pytest --cov=sqlobject -D "postgres://postgres:Password12!@localhost/sqlobject_test?driver=psycopg2&charset=utf-8&debug=1" tests include/tests inheritance/tests versioning/test
dropdb -w -U postgres sqlobject_test
[testenv:pywin27-postgres-psycopg]
@@ -281,7 +281,7 @@ commands = {[winmssql]commands}
[sqlite-w32]
commands =
- pytest --cov=sqlobject -D sqlite:/C:/projects/sqlobject/sqlobject_test.sqdb
+ pytest --cov=sqlobject -D sqlite:/C:/projects/sqlobject/sqlobject_test.sqdb?debug=1
[testenv:pywin27-sqlite]
commands = {[sqlite-w32]commands}
http://sourceforge.net/p/sqlobject/sqlobject/ci/6795deff456d99be97533b2292cc051d410fb6be
commit 6795deff456d99be97533b2292cc051d410fb6be
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 01:52:34 2017 +0300
Add debug print in _executeRetry in MySQLConnection
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index 01d24c9..cffb7d5 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -165,6 +165,8 @@ class MySQLConnection(DBAPI):
conn.autocommit = auto
def _executeRetry(self, conn, cursor, query):
+ if self.debug:
+ self.printDebug(conn, query, 'QueryR')
dbEncoding = self.dbEncoding
if dbEncoding and not isinstance(query, bytes) and (
self.driver == 'connector'):
http://sourceforge.net/p/sqlobject/sqlobject/ci/f7765c9d1d4e9c75ef8f44239b6df00bd62af5fe
commit f7765c9d1d4e9c75ef8f44239b6df00bd62af5fe
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 00:37:07 2017 +0300
Update DeveloperGuide: we now use AppVeyor
Postgres and sqlite tests were fixed.
[skip ci]
diff --git a/docs/DeveloperGuide.rst b/docs/DeveloperGuide.rst
index ce89c86..517bbcc 100644
--- a/docs/DeveloperGuide.rst
+++ b/docs/DeveloperGuide.rst
@@ -257,11 +257,14 @@ forced to write the test. That's no fun for us, to just be writing
tests. So please, write tests; everything at least needs to be
exercised, even if the tests are absolutely complete.
-We now use Travis CI to run tests. See the statuses:
+We now use Travis CI and AppVeyor to run tests. See the statuses:
.. image:: https://travis-ci.org/sqlobject/sqlobject.svg?branch=master
:target: https://travis-ci.org/sqlobject/sqlobject
+.. image:: https://ci.appveyor.com/api/projects/status/github/sqlobject/sqlobject?branch=master
+ :target: https://ci.appveyor.com/project/phdru/sqlobject
+
To avoid triggering unnecessary test run at CI services add text `[skip ci]
<https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build>`_ or
``[ci skip]`` anywhere in your commit messages for commits that don't change
diff --git a/docs/News.rst b/docs/News.rst
index 1ecee0a..a043ed6 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -80,7 +80,7 @@ Tests
and firebirdsql). There are problems with tests.
* Add AppVeyor for windows testing. Run tests with Postgres and MS SQL. There
- are problems.
+ are problems with MS SQL.
* Run sqlite tests at AppVeyor.
http://sourceforge.net/p/sqlobject/sqlobject/ci/3c3ff7fc1d49db18db27ad24ce91f1910f7f6248
commit 3c3ff7fc1d49db18db27ad24ce91f1910f7f6248
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 00:09:41 2017 +0300
Skip test_sslmode on w32
diff --git a/sqlobject/tests/test_postgres.py b/sqlobject/tests/test_postgres.py
index 06c8835..b2b8895 100644
--- a/sqlobject/tests/test_postgres.py
+++ b/sqlobject/tests/test_postgres.py
@@ -1,3 +1,4 @@
+import os
import pytest
from sqlobject import SQLObject, StringCol
from sqlobject.tests.dbtest import getConnection, setupClass
@@ -16,8 +17,10 @@ def test_sslmode():
setupClass(SOTestSSLMode)
connection = SOTestSSLMode._connection
if (connection.dbName != 'postgres') or \
- (not connection.module.__name__.startswith('psycopg')):
- pytest.skip("The test requires PostgreSQL, psycopg and ssl mode")
+ (not connection.module.__name__.startswith('psycopg')) or \
+ (os.name == 'nt'):
+ pytest.skip("The test requires PostgreSQL, psycopg and ssl mode; "
+ "also it doesn't work on w32")
connection = getConnection(sslmode='require')
SOTestSSLMode._connection = connection
http://sourceforge.net/p/sqlobject/sqlobject/ci/1e0411e48a6a99f33d0f4df287bcf6e60e3d1289
commit 1e0411e48a6a99f33d0f4df287bcf6e60e3d1289
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 00:06:33 2017 +0300
Fix test_parse_uri.py on w32
diff --git a/sqlobject/tests/test_parse_uri.py b/sqlobject/tests/test_parse_uri.py
index bcb0671..8b68c64 100644
--- a/sqlobject/tests/test_parse_uri.py
+++ b/sqlobject/tests/test_parse_uri.py
@@ -88,7 +88,7 @@ def test_parse():
assert password is None
assert host is None
assert port is None
- assert path == "/C:/full/path/to/database"
+ assert path == "C:/full/path/to/database"
assert args == {}
user, password, host, port, path, args = \
@@ -97,7 +97,7 @@ def test_parse():
assert password is None
assert host is None
assert port is None
- assert path == "/C:/full/path/to/database"
+ assert path == "C:/full/path/to/database"
assert args == {}
@@ -144,4 +144,4 @@ def test_uri():
if os.name == 'nt':
connection.filename = 'C:/full/path/to/database'
- assert connection.uri() == "sqlite:///C:/full/path/to/database"
+ assert connection.uri() == "sqlite:///C%3A/full/path/to/database"
http://sourceforge.net/p/sqlobject/sqlobject/ci/a526639480b5943f6397c925be144e6271b793d7
commit a526639480b5943f6397c925be144e6271b793d7
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 00:03:55 2017 +0300
Run sqlite tests at AppVeyor
diff --git a/appveyor.yml b/appveyor.yml
index 3fb0c11..2cba27b 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -51,6 +51,10 @@ environment:
# db: mssql2014
#- PYTHON: "C:\\Python36-x64"
# db: postgresql
+ - PYTHON: "C:\\Python27"
+ TOX_ENV: "pywin27-sqlite"
+ - PYTHON: "C:\\Python34"
+ TOX_ENV: "pywin34-sqlite"
install:
# Ensure we use the right python version
diff --git a/docs/News.rst b/docs/News.rst
index f83bee3..1ecee0a 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -79,9 +79,11 @@ Tests
* Run at Travis CI tests with Firebird backend (server version 2.5; drivers fdb
and firebirdsql). There are problems with tests.
-* Add appveyor for windows testing. Run tests with Postgres and MS SQL. There
+* Add AppVeyor for windows testing. Run tests with Postgres and MS SQL. There
are problems.
+* Run sqlite tests at AppVeyor.
+
SQLObject 3.1.0
===============
diff --git a/tox.ini b/tox.ini
index f79e283..7276e95 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 1.8
-envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35}-{mysqlclient,pypostgresql},py{26,27,34,35}-{mysql-connector,pymysql,postgres-psycopg,postgres-pygresql,postgres-pg8000,sqlite},py{27,34,35}-{firebird-fdb,firebirdsql},py{27,34}-flake8,pywin{27,34}-{postgres-psycopg,mssql}
+envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35}-{mysqlclient,pypostgresql},py{26,27,34,35}-{mysql-connector,pymysql,postgres-psycopg,postgres-pygresql,postgres-pg8000,sqlite},py{27,34,35}-{firebird-fdb,firebirdsql},py{27,34}-flake8,pywin{27,34}-{mssql,postgres-psycopg,sqlite}
# Base test environment settings
[testenv]
@@ -278,3 +278,13 @@ commands = {[winpsycopg]commands}
[testenv:pywin34-mssql]
commands = {[winmssql]commands}
+
+[sqlite-w32]
+commands =
+ pytest --cov=sqlobject -D sqlite:/C:/projects/sqlobject/sqlobject_test.sqdb
+
+[testenv:pywin27-sqlite]
+commands = {[sqlite-w32]commands}
+
+[testenv:pywin34-sqlite]
+commands = {[sqlite-w32]commands}
http://sourceforge.net/p/sqlobject/sqlobject/ci/270599a9da489846534e14a665c380ad96f24815
commit 270599a9da489846534e14a665c380ad96f24815
Author: Oleg Broytman <ph...@ph...>
Date: Fri Jan 13 23:44:58 2017 +0300
Remove excessive spaces and blank lines
diff --git a/appveyor.yml b/appveyor.yml
index 4f017cf..3fb0c11 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -7,7 +7,7 @@ version: 3.2.{build}
clone_depth: 50
services:
- - postgresql
+ - postgresql
environment:
PGUSER: "postgres"
@@ -52,16 +52,15 @@ environment:
#- PYTHON: "C:\\Python36-x64"
# db: postgresql
-
install:
- # Ensure we use the right python version
- - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;C:\\Program Files\\PostgreSQL\\9.5\\bin\\;%PATH%"
- - "python --version"
- - "pip install -r requirements.txt"
- - "pip install tox"
- # Enable TCP for mssql
- # (from appveyor documentation)
- - ps: |
+ # Ensure we use the right python version
+ - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;C:\\Program Files\\PostgreSQL\\9.5\\bin\\;%PATH%"
+ - "python --version"
+ - "pip install -r requirements.txt"
+ - "pip install tox"
+ # Enable TCP for mssql
+ # (from appveyor documentation)
+ - ps: |
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null
$serverName = $env:COMPUTERNAME
@@ -80,4 +79,4 @@ install:
build: false
test_script:
- - "tox -e %TOX_ENV%"
+ - "tox -e %TOX_ENV%"
diff --git a/tox.ini b/tox.ini
index ed162c5..f79e283 100644
--- a/tox.ini
+++ b/tox.ini
@@ -251,7 +251,6 @@ deps =
flake8
commands = flake8 .
-
# Windows testing
[winmssql]
commands =
-----------------------------------------------------------------------
Summary of changes:
appveyor.yml | 25 ++++++++++++---------
docs/DeveloperGuide.rst | 5 +++-
docs/News.rst | 6 +++-
sqlobject/mysql/mysqlconnection.py | 2 +
sqlobject/tests/test_parse_uri.py | 6 ++--
sqlobject/tests/test_postgres.py | 7 ++++-
tox.ini | 41 ++++++++++++++++++++++--------------
7 files changed, 57 insertions(+), 35 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-13 19:12:32
|
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 105482c683f49316620c7ff64396192c8abb3942 (commit)
via 0f4fb0fa1f774e6f2ec531c67ba4e97fb9ff6939 (commit)
via ee15cd6bd42ec42eaa0d00e1058d6ebc7dd0aafe (commit)
via ee704768917d455c0f90a763082494ad94634385 (commit)
via d0ec9104a802b6f8491b9ba3cc5813e7b81edda5 (commit)
via 966f671ec2d5f52ea98f36205476a039eafc56ea (commit)
via f1dea2688494b18b939641b4b3af2670cab88935 (commit)
via 7a8467679c84b4299b0f98961211756c8b09fc65 (commit)
via 4825b7585632b421d6b594a169387e29cff69b5a (commit)
via be944d0c2a185d49b0578bf5b86e1c2e4e5c1b0c (commit)
from 54828276f33faf5bfb476ab88435a5f797a0a870 (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/105482c683f49316620c7ff64396192c8abb3942
commit 105482c683f49316620c7ff64396192c8abb3942
Author: Oleg Broytman <ph...@ph...>
Date: Fri Jan 13 21:53:11 2017 +0300
Update News: add appveyor for windows testing
[skip ci]
diff --git a/docs/News.rst b/docs/News.rst
index 0ec2c98..f83bee3 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -25,8 +25,7 @@ Minor features
order. pyfirebirdsql is supported but untested.
* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
- 'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only;
- (connector, oursql and pymysql drivers still cause problems).
+ 'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only.
* Add support for `MySQL Connector
<https://pypi.python.org/pypi/mysql-connector>`_ (pure python; `binary
@@ -49,10 +48,10 @@ Drivers (work in progress)
are still problems with the driver.
* Add support for `pg8000 <https://pypi.python.org/pypi/pg8000>`_
- PostgreSQL driver. There are major problems with the driver.
+ PostgreSQL driver. There are major problems with the driver caused by both
+ the driver and SQLObject.
-* Add support for `pyfirebirdsql
- <https://pypi.python.org/pypi/firebirdsql>`_ (untested).
+* Add support for `pyfirebirdsql <https://pypi.python.org/pypi/firebirdsql>`_.
Documentation
-------------
@@ -80,6 +79,9 @@ Tests
* Run at Travis CI tests with Firebird backend (server version 2.5; drivers fdb
and firebirdsql). There are problems with tests.
+* Add appveyor for windows testing. Run tests with Postgres and MS SQL. There
+ are problems.
+
SQLObject 3.1.0
===============
http://sourceforge.net/p/sqlobject/sqlobject/ci/0f4fb0fa1f774e6f2ec531c67ba4e97fb9ff6939
commit 0f4fb0fa1f774e6f2ec531c67ba4e97fb9ff6939
Merge: 5482827 ee15cd6
Author: Oleg Broytman <ph...@ph...>
Date: Fri Jan 13 22:49:57 2017 +0400
Merge pull request #132 from drnlm/feature/add_appveyor_for_windows_testing
Add appveyor for windows testing
http://sourceforge.net/p/sqlobject/sqlobject/ci/ee15cd6bd42ec42eaa0d00e1058d6ebc7dd0aafe
commit ee15cd6bd42ec42eaa0d00e1058d6ebc7dd0aafe
Author: Neil <drn...@gm...>
Date: Fri Jan 13 20:05:01 2017 +0200
Drop -v for pymssql. Use postgres test order so more tests are run before timeout issues kick in
diff --git a/tox.ini b/tox.ini
index 116c698..ed162c5 100644
--- a/tox.ini
+++ b/tox.ini
@@ -257,7 +257,8 @@ commands = flake8 .
commands =
-sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "CREATE DATABASE sqlobject_test"
- pytest -v --timeout=30 --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql"
+ pytest --timeout=30 --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql" tests include/tests inheritance/tests versioning/test
+
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
[winpsycopg]
http://sourceforge.net/p/sqlobject/sqlobject/ci/ee704768917d455c0f90a763082494ad94634385
commit ee704768917d455c0f90a763082494ad94634385
Author: Neil <drn...@gm...>
Date: Fri Jan 13 19:34:56 2017 +0200
Longer timeout
diff --git a/tox.ini b/tox.ini
index f9d7460..116c698 100644
--- a/tox.ini
+++ b/tox.ini
@@ -257,7 +257,7 @@ commands = flake8 .
commands =
-sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "CREATE DATABASE sqlobject_test"
- pytest -v --timeout=10 --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql"
+ pytest -v --timeout=30 --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql"
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
[winpsycopg]
http://sourceforge.net/p/sqlobject/sqlobject/ci/d0ec9104a802b6f8491b9ba3cc5813e7b81edda5
commit d0ec9104a802b6f8491b9ba3cc5813e7b81edda5
Author: Neil <drn...@gm...>
Date: Fri Jan 13 15:44:02 2017 +0200
Use pytest-timeout to avoid mssql tests hanging
diff --git a/tox.ini b/tox.ini
index dbd9db3..f9d7460 100644
--- a/tox.ini
+++ b/tox.ini
@@ -25,6 +25,7 @@ deps =
firebirdsql: firebirdsql
postgres-pg8000: pg8000
mssql: pymssql
+ mssql: pytest-timeout
passenv = CI TRAVIS TRAVIS_* PGPASSWORD
# Don't fail or warn on uninstalled commands
whitelist_externals =
@@ -256,7 +257,7 @@ commands = flake8 .
commands =
-sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "CREATE DATABASE sqlobject_test"
- pytest --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql" tests
+ pytest -v --timeout=10 --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql"
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
[winpsycopg]
http://sourceforge.net/p/sqlobject/sqlobject/ci/966f671ec2d5f52ea98f36205476a039eafc56ea
commit 966f671ec2d5f52ea98f36205476a039eafc56ea
Author: Neil <drn...@gm...>
Date: Fri Jan 13 15:30:08 2017 +0200
reduce number of tests run for now.
Also make test failures verbose
diff --git a/tox.ini b/tox.ini
index 20bba1d..dbd9db3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -256,7 +256,7 @@ commands = flake8 .
commands =
-sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "CREATE DATABASE sqlobject_test"
- pytest --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql"
+ pytest --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql" tests
sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
[winpsycopg]
http://sourceforge.net/p/sqlobject/sqlobject/ci/f1dea2688494b18b939641b4b3af2670cab88935
commit f1dea2688494b18b939641b4b3af2670cab88935
Author: Neil <drn...@gm...>
Date: Fri Jan 13 13:18:11 2017 +0200
Trying to get ms sql tests running
diff --git a/appveyor.yml b/appveyor.yml
index cf238fc..4f017cf 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -7,7 +7,6 @@ version: 3.2.{build}
clone_depth: 50
services:
- - mssql2014
- postgresql
environment:
@@ -60,6 +59,22 @@ install:
- "python --version"
- "pip install -r requirements.txt"
- "pip install tox"
+ # Enable TCP for mssql
+ # (from appveyor documentation)
+ - ps: |
+ [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
+ [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null
+ $serverName = $env:COMPUTERNAME
+ $instanceName = 'SQL2014'
+ $smo = 'Microsoft.SqlServer.Management.Smo.'
+ $wmi = new-object ($smo + 'Wmi.ManagedComputer')
+ $uri = "ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']"
+ $Tcp = $wmi.GetSmoObject($uri)
+ $Tcp.IsEnabled = $true
+ $TCP.alter()
+ Set-Service SQLBrowser -StartupType Manual
+ Start-Service SQLBrowser
+ Start-Service "MSSQL`$$instanceName"
# Not a C project, so no build step
build: false
diff --git a/tox.ini b/tox.ini
index aacbc70..20bba1d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -19,12 +19,12 @@ deps =
mysql-oursql: oursql
pymysql: pymysql
postgres-psycopg: psycopg2
- winpsycopg: psycopg2
postgres-pygresql: pygresql
pypostgresql: py-postgresql
firebird-fdb: fdb
firebirdsql: firebirdsql
postgres-pg8000: pg8000
+ mssql: pymssql
passenv = CI TRAVIS TRAVIS_* PGPASSWORD
# Don't fail or warn on uninstalled commands
whitelist_externals =
@@ -34,6 +34,7 @@ whitelist_externals =
rm
sudo
isql-fb
+ sqlcmd
# MySQL test environments
[mysqldb]
@@ -253,7 +254,10 @@ commands = flake8 .
# Windows testing
[winmssql]
commands =
- here
+ -sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
+ sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "CREATE DATABASE sqlobject_test"
+ pytest --cov=sqlobject -D "mssql://sa:Password12!@localhost\SQL2014/sqlobject_test?driver=pymssql"
+ sqlcmd -U sa -P "Password12!" -S .\SQL2014 -Q "DROP DATABASE sqlobject_test"
[winpsycopg]
commands =
http://sourceforge.net/p/sqlobject/sqlobject/ci/7a8467679c84b4299b0f98961211756c8b09fc65
commit 7a8467679c84b4299b0f98961211756c8b09fc65
Author: Neil <drn...@gm...>
Date: Fri Jan 13 12:37:10 2017 +0200
Whitelist PGPASSWORD for windows
diff --git a/appveyor.yml b/appveyor.yml
index 636a1e3..cf238fc 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -21,7 +21,7 @@ environment:
TOX_ENV: "pywin27-mssql"
- PYTHON: "C:\\Python27"
db: postgresql
- TOX_ENV: "pywin27-postgres"
+ TOX_ENV: "pywin27-postgres-psycopg"
#- PYTHON: "C:\\Python27-x64"
# db: mssql2014
#- PYTHON: "C:\\Python27-x64"
@@ -31,7 +31,7 @@ environment:
TOX_ENV: "pywin34-mssql"
- PYTHON: "C:\\Python34"
db: postgresql
- TOX_ENV: "pywin34-postgres"
+ TOX_ENV: "pywin34-postgres-psycopg"
#- PYTHON: "C:\\Python34-x64"
# db: mssql2014
#- PYTHON: "C:\\Python34-x64"
@@ -60,8 +60,6 @@ install:
- "python --version"
- "pip install -r requirements.txt"
- "pip install tox"
- - "pip install psycopg2"
- - "echo %PGPASSWORD%"
# Not a C project, so no build step
build: false
diff --git a/tox.ini b/tox.ini
index 8d40d7b..aacbc70 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 1.8
-envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35}-{mysqlclient,pypostgresql},py{26,27,34,35}-{mysql-connector,pymysql,postgres-psycopg,postgres-pygresql,postgres-pg8000,sqlite},py{27,34,35}-{firebird-fdb,firebirdsql},py{27,34}-flake8,pywin{27,34}-{postgres,mssql}
+envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35}-{mysqlclient,pypostgresql},py{26,27,34,35}-{mysql-connector,pymysql,postgres-psycopg,postgres-pygresql,postgres-pg8000,sqlite},py{27,34,35}-{firebird-fdb,firebirdsql},py{27,34}-flake8,pywin{27,34}-{postgres-psycopg,mssql}
# Base test environment settings
[testenv]
@@ -19,12 +19,13 @@ deps =
mysql-oursql: oursql
pymysql: pymysql
postgres-psycopg: psycopg2
+ winpsycopg: psycopg2
postgres-pygresql: pygresql
pypostgresql: py-postgresql
firebird-fdb: fdb
firebirdsql: firebirdsql
postgres-pg8000: pg8000
-passenv = CI TRAVIS TRAVIS_*
+passenv = CI TRAVIS TRAVIS_* PGPASSWORD
# Don't fail or warn on uninstalled commands
whitelist_externals =
mysql
@@ -33,7 +34,6 @@ whitelist_externals =
rm
sudo
isql-fb
- set
# MySQL test environments
[mysqldb]
@@ -257,20 +257,18 @@ commands =
[winpsycopg]
commands =
- set
- set PGPASSWORD="Password12!"
-dropdb -w -U postgres sqlobject_test
createdb -w -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
+ pytest --cov=sqlobject -D "postgres://postgres:Password12!@localhost/sqlobject_test?driver=psycopg2&charset=utf-8" tests include/tests inheritance/tests versioning/test
dropdb -w -U postgres sqlobject_test
-[testenv:pywin27-postgres]
+[testenv:pywin27-postgres-psycopg]
commands = {[winpsycopg]commands}
[testenv:pywin27-mssql]
commands = {[winmssql]commands}
-[testenv:pywin34-postgres]
+[testenv:pywin34-postgres-psycopg]
commands = {[winpsycopg]commands}
[testenv:pywin34-mssql]
http://sourceforge.net/p/sqlobject/sqlobject/ci/4825b7585632b421d6b594a169387e29cff69b5a
commit 4825b7585632b421d6b594a169387e29cff69b5a
Author: Neil <drn...@gm...>
Date: Fri Jan 13 12:20:34 2017 +0200
Add -w flags so postgres password issues fail
diff --git a/appveyor.yml b/appveyor.yml
index fec1e5a..636a1e3 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -11,8 +11,8 @@ services:
- postgresql
environment:
- PGUSER: postgres
- PGPASSWORD: Password12!
+ PGUSER: "postgres"
+ PGPASSWORD: "Password12!"
matrix:
# from https://www.appveyor.com/docs/installed-software/#python
@@ -61,6 +61,7 @@ install:
- "pip install -r requirements.txt"
- "pip install tox"
- "pip install psycopg2"
+ - "echo %PGPASSWORD%"
# Not a C project, so no build step
build: false
diff --git a/tox.ini b/tox.ini
index 1e5cb00..8d40d7b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -33,6 +33,7 @@ whitelist_externals =
rm
sudo
isql-fb
+ set
# MySQL test environments
[mysqldb]
@@ -254,14 +255,23 @@ commands = flake8 .
commands =
here
+[winpsycopg]
+commands =
+ set
+ set PGPASSWORD="Password12!"
+ -dropdb -w -U postgres sqlobject_test
+ createdb -w -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 -w -U postgres sqlobject_test
+
[testenv:pywin27-postgres]
-commands = {[psycopg]commands}
+commands = {[winpsycopg]commands}
[testenv:pywin27-mssql]
commands = {[winmssql]commands}
[testenv:pywin34-postgres]
-commands = {[psycopg]commands}
+commands = {[winpsycopg]commands}
[testenv:pywin34-mssql]
commands = {[winmssql]commands}
http://sourceforge.net/p/sqlobject/sqlobject/ci/be944d0c2a185d49b0578bf5b86e1c2e4e5c1b0c
commit be944d0c2a185d49b0578bf5b86e1c2e4e5c1b0c
Author: Neil <drn...@gm...>
Date: Fri Jan 13 11:35:16 2017 +0200
Trying to make appveyor work
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..fec1e5a
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,69 @@
+# Install SQLObject on windows and test against MS SQL server and postgres
+# Heavily inspired by Oliver Grisel's appveyor-demo (https://github.com/ogrisel/python-appveyor-demo)
+# and Michael Sverdlik's appveyor-utils (https://github.com/cloudify-cosmo/appveyor-utils)
+version: 3.2.{build}
+
+# Match travis
+clone_depth: 50
+
+services:
+ - mssql2014
+ - postgresql
+
+environment:
+ PGUSER: postgres
+ PGPASSWORD: Password12!
+
+ matrix:
+ # from https://www.appveyor.com/docs/installed-software/#python
+ - PYTHON: "C:\\Python27"
+ db: mssql2014
+ TOX_ENV: "pywin27-mssql"
+ - PYTHON: "C:\\Python27"
+ db: postgresql
+ TOX_ENV: "pywin27-postgres"
+ #- PYTHON: "C:\\Python27-x64"
+ # db: mssql2014
+ #- PYTHON: "C:\\Python27-x64"
+ # db: postgresql
+ - PYTHON: "C:\\Python34"
+ db: mssql2014
+ TOX_ENV: "pywin34-mssql"
+ - PYTHON: "C:\\Python34"
+ db: postgresql
+ TOX_ENV: "pywin34-postgres"
+ #- PYTHON: "C:\\Python34-x64"
+ # db: mssql2014
+ #- PYTHON: "C:\\Python34-x64"
+ # db: postgresql
+ #- PYTHON: "C:\\Python35"
+ # db: mssql2014
+ #- PYTHON: "C:\\Python35"
+ # db: postgresql
+ #- PYTHON: "C:\\Python35-x64"
+ # db: mssql2014
+ #- PYTHON: "C:\\Python35-x64"
+ # db: postgresql
+ #- PYTHON: "C:\\Python36"
+ # db: mssql2014
+ #- PYTHON: "C:\\Python36"
+ # db: postgresql
+ #- PYTHON: "C:\\Python36-x64"
+ # db: mssql2014
+ #- PYTHON: "C:\\Python36-x64"
+ # db: postgresql
+
+
+install:
+ # Ensure we use the right python version
... 54 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-13 08:57:56
|
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 54828276f33faf5bfb476ab88435a5f797a0a870 (commit)
via 2ac082b1dd5facb42206677a1f6517a7f6a57d1d (commit)
via 2c11b31c0add7cd0607e7375278d19f75f3dd9d6 (commit)
via d9c46b2010e877b223253b8d33253e1946d64a23 (commit)
via ff90c16c89b379eedae276eaa84e4dd754dfd2de (commit)
via 85672d51645f3cd7cf1c380cb54bb87a55c29dab (commit)
via 355c1ca4fb54aacf11d8b5f30d56809ab6c53782 (commit)
via bdab935943ed4e182aa2f58a4dc26e8a77d21faf (commit)
via 4eebc57e1127273ba563c6049eef778fcbf9df0f (commit)
via 61f740796b2ca8dc5aa288e9722018dc255e8ec9 (commit)
via a06445434cef5fcf6d63bb757d766c73ff731a19 (commit)
via 780cb7c10b02fe895438ca83d09b8c0613107ff1 (commit)
via 710697321ab41ecccccdcbba35d491d3ac31eb9e (commit)
via 005e8f5ba435c68badd84742236e23af5c46eddc (commit)
from 057147e8b54498e8e464ced5187257637f9583da (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/54828276f33faf5bfb476ab88435a5f797a0a870
commit 54828276f33faf5bfb476ab88435a5f797a0a870
Author: Oleg Broytman <ph...@ph...>
Date: Fri Jan 13 11:02:08 2017 +0300
Fix test for Firebird: skip RLIKE test
Firebird doesn't support RLIKE.
diff --git a/sqlobject/tests/dbtest.py b/sqlobject/tests/dbtest.py
index 4279628..e4c8d29 100644
--- a/sqlobject/tests/dbtest.py
+++ b/sqlobject/tests/dbtest.py
@@ -32,16 +32,17 @@ and you can use it like::
pytest.skip("Doesn't support featureX")
"""
supportsMatrix = {
- '+exceptions': 'mysql postgres sqlite',
- '-transactions': 'mysql rdbhost',
- '-dropTableCascade': 'sybase mssql mysql',
- '-expressionIndex': 'mysql sqlite firebird mssql',
'-blobData': 'mssql rdbhost',
'-decimalColumn': 'mssql',
+ '-dropTableCascade': 'sybase mssql mysql',
'-emptyTable': 'mssql',
+ '+exceptions': 'mysql postgres sqlite',
+ '-expressionIndex': 'mysql sqlite firebird mssql',
'-limitSelect': 'mssql',
- '+schema': 'postgres',
'+memorydb': 'sqlite',
+ '+rlike': 'mysql postgres sqlite',
+ '+schema': 'postgres',
+ '-transactions': 'mysql rdbhost',
}
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index 2a1f19b..41ef0ef 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -177,6 +177,9 @@ def test_select_LIKE():
def test_select_RLIKE():
+ if not supports('rlike'):
+ pytest.skip("rlike isn't supported")
+
setupClass(IterTest)
if IterTest._connection.dbName == "sqlite":
http://sourceforge.net/p/sqlobject/sqlobject/ci/2ac082b1dd5facb42206677a1f6517a7f6a57d1d
commit 2ac082b1dd5facb42206677a1f6517a7f6a57d1d
Author: Oleg Broytman <ph...@ph...>
Date: Fri Jan 13 10:32:04 2017 +0300
Fix tests for Firebird
Rename columns whose names are reserved keywords in Firebird.
Make BLOB column 256 bytes long.
diff --git a/docs/News.rst b/docs/News.rst
index 61c5905..0ec2c98 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -78,8 +78,7 @@ Tests
* Drop ``Circle CI``.
* Run at Travis CI tests with Firebird backend (server version 2.5; drivers fdb
- and firebirdsql). There are major problems due to SQLObject tests use
- table/column names that are reserver words in FB.
+ and firebirdsql). There are problems with tests.
SQLObject 3.1.0
===============
diff --git a/sqlobject/include/tests/test_hashcol.py b/sqlobject/include/tests/test_hashcol.py
index 58bf23d..38b208a 100644
--- a/sqlobject/include/tests/test_hashcol.py
+++ b/sqlobject/include/tests/test_hashcol.py
@@ -23,7 +23,7 @@ else:
class HashTest(SQLObject):
- count = IntCol(alternateID=True)
+ so_count = IntCol(alternateID=True)
col1 = hashcol.HashCol()
col2 = hashcol.HashCol(hashMethod=sha256_str)
@@ -37,7 +37,7 @@ def setup():
items = []
setupClass(HashTest)
for i, s in enumerate(data):
- items.append(HashTest(count=i, col1=s, col2=s))
+ items.append(HashTest(so_count=i, col1=s, col2=s))
def test_create():
@@ -48,13 +48,13 @@ def test_create():
conn = HashTest._connection
rows = conn.queryAll("""
- SELECT count, col1, col2
+ SELECT so_count, col1, col2
FROM hash_test
- ORDER BY count
+ ORDER BY so_count
""")
- for count, col1, col2 in rows:
- assert md5_str(data[count]) == col1
- assert sha256_str(data[count]) == col2
+ for so_count, col1, col2 in rows:
+ assert md5_str(data[so_count]) == col1
+ assert sha256_str(data[so_count]) == col2
def test_select():
diff --git a/sqlobject/inheritance/tests/test_asdict.py b/sqlobject/inheritance/tests/test_asdict.py
index fadc433..5129ac2 100644
--- a/sqlobject/inheritance/tests/test_asdict.py
+++ b/sqlobject/inheritance/tests/test_asdict.py
@@ -18,7 +18,7 @@ class ManagerAD(InheritablePersonAD):
class EmployeeAD(InheritablePersonAD):
_inheritable = False
- position = StringCol()
+ so_position = StringCol()
def test_getColumns():
@@ -27,7 +27,7 @@ def test_getColumns():
for klass, columns in (
(InheritablePersonAD, ['firstName', 'lastName']),
(ManagerAD, ['department', 'firstName', 'lastName']),
- (EmployeeAD, ['firstName', 'lastName', 'position'])):
+ (EmployeeAD, ['firstName', 'lastName', 'so_position'])):
_columns = sorted(klass.sqlmeta.getColumns().keys())
assert _columns == columns
@@ -37,7 +37,7 @@ def test_asDict():
InheritablePersonAD(firstName='Oneof', lastName='Authors')
ManagerAD(firstName='ManagerAD', lastName='The', department='Dep')
EmployeeAD(firstName='Project', lastName='Leader',
- position='Project leader')
+ so_position='Project leader')
assert InheritablePersonAD.get(1).sqlmeta.asDict() == \
dict(firstName='Oneof', lastName='Authors', id=1)
@@ -45,4 +45,4 @@ def test_asDict():
dict(firstName='ManagerAD', lastName='The', department='Dep', id=2)
assert InheritablePersonAD.get(3).sqlmeta.asDict() == \
dict(firstName='Project', lastName='Leader',
- position='Project leader', id=3)
+ so_position='Project leader', id=3)
diff --git a/sqlobject/inheritance/tests/test_deep_inheritance.py b/sqlobject/inheritance/tests/test_deep_inheritance.py
index f4e3fe5..411beb2 100644
--- a/sqlobject/inheritance/tests/test_deep_inheritance.py
+++ b/sqlobject/inheritance/tests/test_deep_inheritance.py
@@ -15,7 +15,7 @@ class DIPerson(InheritableSQLObject):
class DIEmployee(DIPerson):
- position = StringCol(unique=True, length=100)
+ so_position = StringCol(unique=True, length=100)
class DIManager(DIEmployee):
@@ -47,13 +47,13 @@ def test_creation_fail2():
setupClass([DIManager, DIEmployee, DIPerson])
kwargs = {'firstName': 'John', 'lastName': 'Doe',
- 'position': 'Project Manager'}
+ 'so_position': 'Project Manager'}
DIManager(**kwargs)
persons = DIEmployee.select(DIPerson.q.firstName == 'John')
assert persons.count() == 1
kwargs = {'firstName': 'John', 'lastName': 'Doe II',
- 'position': 'Project Manager'}
+ 'so_position': 'Project Manager'}
raises(Exception, DIManager, **kwargs)
persons = DIPerson.select(DIPerson.q.firstName == 'John')
assert persons.count() == 1
@@ -62,7 +62,7 @@ def test_creation_fail2():
skip("Transactions aren't supported")
transaction = DIPerson._connection.transaction()
kwargs = {'firstName': 'John', 'lastName': 'Doe III',
- 'position': 'Project Manager'}
+ 'so_position': 'Project Manager'}
raises(Exception, DIManager, connection=transaction, **kwargs)
transaction.rollback()
transaction.begin()
@@ -75,10 +75,10 @@ def test_deep_inheritance():
setupClass([DIManager, DIEmployee, DIPerson])
manager = DIManager(firstName='Project', lastName='Manager',
- position='Project Manager')
+ so_position='Project Manager')
manager_id = manager.id
employee_id = DIEmployee(firstName='Project', lastName='Leader',
- position='Project leader', manager=manager).id
+ so_position='Project leader', manager=manager).id
DIPerson(firstName='Oneof', lastName='Authors', manager=manager)
conn = getConnection()
diff --git a/sqlobject/inheritance/tests/test_inheritance.py b/sqlobject/inheritance/tests/test_inheritance.py
index 898c6be..e1d51fa 100644
--- a/sqlobject/inheritance/tests/test_inheritance.py
+++ b/sqlobject/inheritance/tests/test_inheritance.py
@@ -15,14 +15,15 @@ class InheritablePerson(InheritableSQLObject):
class Employee(InheritablePerson):
_inheritable = False
- position = StringCol()
+ so_position = StringCol()
def setup():
setupClass(InheritablePerson)
setupClass(Employee)
- Employee(firstName='Project', lastName='Leader', position='Project leader')
+ Employee(firstName='Project', lastName='Leader',
+ so_position='Project leader')
InheritablePerson(firstName='Oneof', lastName='Authors')
@@ -66,7 +67,7 @@ def test_inheritance_select():
assert employees.count() == 0
# comparison to None needed to build the right SQL expression
- employees = Employee.select(Employee.q.position != None) # noqa
+ employees = Employee.select(Employee.q.so_position != None) # noqa
assert employees.count() == 1
persons = InheritablePerson.selectBy(firstName="Project")
@@ -104,10 +105,10 @@ def test_inheritance_select():
Employee.q.firstName)))
assert len(persons) == 1
- persons = list(Employee.select(orderBy=Employee.q.position))
+ persons = list(Employee.select(orderBy=Employee.q.so_position))
assert len(persons) == 1
- persons = list(Employee.select(orderBy=(Employee.q.position,
+ persons = list(Employee.select(orderBy=(Employee.q.so_position,
Employee.q.lastName)))
assert len(persons) == 1
diff --git a/sqlobject/tests/test_aggregates.py b/sqlobject/tests/test_aggregates.py
index 9f72300..9692632 100644
--- a/sqlobject/tests/test_aggregates.py
+++ b/sqlobject/tests/test_aggregates.py
@@ -6,28 +6,28 @@ from sqlobject.tests.dbtest import setupClass
class IntAccumulator(SQLObject):
- value = IntCol()
+ so_value = IntCol()
class FloatAccumulator(SQLObject):
- value = FloatCol()
+ so_value = FloatCol()
def test_integer():
setupClass(IntAccumulator)
- IntAccumulator(value=1)
- IntAccumulator(value=2)
- IntAccumulator(value=3)
+ IntAccumulator(so_value=1)
+ IntAccumulator(so_value=2)
+ IntAccumulator(so_value=3)
- assert IntAccumulator.select().min(IntAccumulator.q.value) == 1
- assert IntAccumulator.select().avg(IntAccumulator.q.value) == 2
- assert IntAccumulator.select().max(IntAccumulator.q.value) == 3
- assert IntAccumulator.select().sum(IntAccumulator.q.value) == 6
+ assert IntAccumulator.select().min(IntAccumulator.q.so_value) == 1
+ assert IntAccumulator.select().avg(IntAccumulator.q.so_value) == 2
+ assert IntAccumulator.select().max(IntAccumulator.q.so_value) == 3
+ assert IntAccumulator.select().sum(IntAccumulator.q.so_value) == 6
- assert IntAccumulator.select(IntAccumulator.q.value > 1).\
- max(IntAccumulator.q.value) == 3
- assert IntAccumulator.select(IntAccumulator.q.value > 1).\
- sum(IntAccumulator.q.value) == 5
+ assert IntAccumulator.select(IntAccumulator.q.so_value > 1).\
+ max(IntAccumulator.q.so_value) == 3
+ assert IntAccumulator.select(IntAccumulator.q.so_value > 1).\
+ sum(IntAccumulator.q.so_value) == 5
def floatcmp(f1, f2):
@@ -40,30 +40,30 @@ def floatcmp(f1, f2):
def test_float():
setupClass(FloatAccumulator)
- FloatAccumulator(value=1.2)
- FloatAccumulator(value=2.4)
- FloatAccumulator(value=3.8)
+ FloatAccumulator(so_value=1.2)
+ FloatAccumulator(so_value=2.4)
+ FloatAccumulator(so_value=3.8)
assert floatcmp(
- FloatAccumulator.select().min(FloatAccumulator.q.value), 1.2) == 0
+ FloatAccumulator.select().min(FloatAccumulator.q.so_value), 1.2) == 0
assert floatcmp(
- FloatAccumulator.select().avg(FloatAccumulator.q.value), 2.5) == 0
+ FloatAccumulator.select().avg(FloatAccumulator.q.so_value), 2.5) == 0
assert floatcmp(
- FloatAccumulator.select().max(FloatAccumulator.q.value), 3.8) == 0
+ FloatAccumulator.select().max(FloatAccumulator.q.so_value), 3.8) == 0
assert floatcmp(
- FloatAccumulator.select().sum(FloatAccumulator.q.value), 7.4) == 0
+ FloatAccumulator.select().sum(FloatAccumulator.q.so_value), 7.4) == 0
def test_many():
setupClass(IntAccumulator)
- IntAccumulator(value=1)
- IntAccumulator(value=1)
- IntAccumulator(value=2)
- IntAccumulator(value=2)
- IntAccumulator(value=3)
- IntAccumulator(value=3)
-
- attribute = IntAccumulator.q.value
+ IntAccumulator(so_value=1)
+ IntAccumulator(so_value=1)
+ IntAccumulator(so_value=2)
+ IntAccumulator(so_value=2)
+ IntAccumulator(so_value=3)
+ IntAccumulator(so_value=3)
+
+ attribute = IntAccumulator.q.so_value
assert list(IntAccumulator.select().accumulateMany(
("MIN", attribute), ("AVG", attribute), ("MAX", attribute),
("COUNT", attribute), ("SUM", attribute)
diff --git a/sqlobject/tests/test_basic.py b/sqlobject/tests/test_basic.py
index c44eb24..d9d1a2e 100644
--- a/sqlobject/tests/test_basic.py
+++ b/sqlobject/tests/test_basic.py
@@ -320,13 +320,13 @@ def test_nonexisting_attr():
class SOTestSO12(SQLObject):
name = StringCol()
- value = IntCol(defaultSQL='1')
+ so_value = IntCol(defaultSQL='1')
def test_defaultSQL():
setupClass(SOTestSO12)
test = SOTestSO12(name="test")
- assert test.value == 1
+ assert test.so_value == 1
def test_connection_override():
diff --git a/sqlobject/tests/test_blob.py b/sqlobject/tests/test_blob.py
index b8c2e3c..8c43d8a 100644
--- a/sqlobject/tests/test_blob.py
+++ b/sqlobject/tests/test_blob.py
@@ -10,7 +10,7 @@ from sqlobject.tests.dbtest import setupClass, supports
class ImageData(SQLObject):
- image = BLOBCol(default=b'emptydata', length=65535)
+ image = BLOBCol(default=b'emptydata', length=256)
def test_BLOBCol():
diff --git a/sqlobject/tests/test_create_drop.py b/sqlobject/tests/test_create_drop.py
index c0f6638..9f2e694 100644
--- a/sqlobject/tests/test_create_drop.py
+++ b/sqlobject/tests/test_create_drop.py
@@ -9,7 +9,7 @@ class SOTestCreateDrop(SQLObject):
table = 'test_create_drop_table'
name = StringCol()
number = IntCol()
- time = DateTimeCol()
+ so_time = DateTimeCol()
short = StringCol(length=10)
blobcol = BLOBCol()
diff --git a/sqlobject/tests/test_cyclic_reference.py b/sqlobject/tests/test_cyclic_reference.py
index 5a4fede..7350216 100644
--- a/sqlobject/tests/test_cyclic_reference.py
+++ b/sqlobject/tests/test_cyclic_reference.py
@@ -10,7 +10,7 @@ class SOTestCyclicReferenceA(SQLObject):
table = 'test_cyclic_reference_a_table'
name = StringCol()
number = IntCol()
- time = DateTimeCol()
+ so_time = DateTimeCol()
short = StringCol(length=10)
blobcol = BLOBCol()
fkeyb = ForeignKey('SOTestCyclicReferenceB')
@@ -22,7 +22,7 @@ class SOTestCyclicReferenceB(SQLObject):
table = 'test_cyclic_reference_b_table'
name = StringCol()
number = IntCol()
- time = DateTimeCol()
+ so_time = DateTimeCol()
short = StringCol(length=10)
blobcol = BLOBCol()
fkeya = ForeignKey('SOTestCyclicReferenceA')
diff --git a/sqlobject/tests/test_groupBy.py b/sqlobject/tests/test_groupBy.py
index e92d98e..4291c03 100644
--- a/sqlobject/tests/test_groupBy.py
+++ b/sqlobject/tests/test_groupBy.py
@@ -10,18 +10,18 @@ from sqlobject.tests.dbtest import getConnection, setupClass
class GroupbyTest(SQLObject):
name = StringCol()
- value = IntCol()
+ so_value = IntCol()
def test_groupBy():
setupClass(GroupbyTest)
- GroupbyTest(name='a', value=1)
- GroupbyTest(name='a', value=2)
- GroupbyTest(name='b', value=1)
+ GroupbyTest(name='a', so_value=1)
+ GroupbyTest(name='a', so_value=2)
+ GroupbyTest(name='b', so_value=1)
connection = getConnection()
select = Select(
- [GroupbyTest.q.name, func.COUNT(GroupbyTest.q.value)],
+ [GroupbyTest.q.name, func.COUNT(GroupbyTest.q.so_value)],
groupBy=GroupbyTest.q.name,
orderBy=GroupbyTest.q.name)
sql = connection.sqlrepr(select)
@@ -31,15 +31,15 @@ def test_groupBy():
def test_groupBy_list():
setupClass(GroupbyTest)
- GroupbyTest(name='a', value=1)
- GroupbyTest(name='a', value=2)
- GroupbyTest(name='b', value=1)
+ GroupbyTest(name='a', so_value=1)
+ GroupbyTest(name='a', so_value=2)
+ GroupbyTest(name='b', so_value=1)
connection = getConnection()
select = Select(
- [GroupbyTest.q.name, GroupbyTest.q.value],
- groupBy=[GroupbyTest.q.name, GroupbyTest.q.value],
- orderBy=[GroupbyTest.q.name, GroupbyTest.q.value])
+ [GroupbyTest.q.name, GroupbyTest.q.so_value],
+ groupBy=[GroupbyTest.q.name, GroupbyTest.q.so_value],
+ orderBy=[GroupbyTest.q.name, GroupbyTest.q.so_value])
sql = connection.sqlrepr(select)
rows = list(connection.queryAll(sql))
assert [tuple(t) for t in rows] == [('a', 1), ('a', 2), ('b', 1)]
diff --git a/sqlobject/tests/test_picklecol.py b/sqlobject/tests/test_picklecol.py
index f4eb932..d589c69 100644
--- a/sqlobject/tests/test_picklecol.py
+++ b/sqlobject/tests/test_picklecol.py
@@ -18,7 +18,7 @@ class PickleData:
class PickleContainer(SQLObject):
- pickledata = PickleCol(default=None, length=65535)
+ pickledata = PickleCol(default=None, length=256)
def test_pickleCol():
diff --git a/sqlobject/tests/test_sqlbuilder.py b/sqlobject/tests/test_sqlbuilder.py
index f4e51dd..64170b1 100644
--- a/sqlobject/tests/test_sqlbuilder.py
+++ b/sqlobject/tests/test_sqlbuilder.py
@@ -7,7 +7,7 @@ from sqlobject.tests.dbtest import getConnection, raises, setupClass
... 919 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-04 14:14:04
|
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
|
|
From: Oleg B. <no...@so...> - 2017-01-03 19:09:58
|
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
discards 5dd17da20cc4b264893bed3b21aab7da0bb1ebb2 (commit)
via 5a910d136eacf3b104210a7c00e9164630c25e71 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (5dd17da20cc4b264893bed3b21aab7da0bb1ebb2)
\
N -- N -- N (5a910d136eacf3b104210a7c00e9164630c25e71)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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/5a910d136eacf3b104210a7c00e9164630c25e71
commit 5a910d136eacf3b104210a7c00e9164630c25e71
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 3 22:02:04 2017 +0300
Drop Circle CI
[skip ci]
diff --git a/circle.yml b/circle.yml
deleted file mode 100644
index 4c9174e..0000000
--- a/circle.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-dependencies:
- cache_directories:
- - ~/.cache/pip
- override:
- - sudo apt-get -qq update
- - sudo apt-get install -y python-egenix-mxdatetime python-mysqldb python-psycopg2 python3-psycopg2
- - pip install -U pip
- - pip install -U tox tox-pyenv
- - pyenv local 2.6.8 2.7.10 3.4.3 3.5.0
-
-test:
- override:
- - ?
- case $CIRCLE_NODE_INDEX in
- 0) tox -e '{py26,py27}-mysqldb,{py34,py35}-mysqlclient' ;;
- 1) tox -e '{py26,py27,py34,py35}-psycopg' ;;
- 2) tox -e '{py26,py27,py34,py35}-sqlite' ;;
- 3) tox -e '{py27,py34}-flake8' ;;
- esac
- :
- parallel: true
diff --git a/docs/DeveloperGuide.rst b/docs/DeveloperGuide.rst
index e4dd096..ce89c86 100644
--- a/docs/DeveloperGuide.rst
+++ b/docs/DeveloperGuide.rst
@@ -257,18 +257,15 @@ forced to write the test. That's no fun for us, to just be writing
tests. So please, write tests; everything at least needs to be
exercised, even if the tests are absolutely complete.
-We now use Travis CI and Circle CI to run tests. See the statuses:
+We now use Travis CI to run tests. See the statuses:
.. image:: https://travis-ci.org/sqlobject/sqlobject.svg?branch=master
:target: https://travis-ci.org/sqlobject/sqlobject
-.. image:: https://circleci.com/gh/sqlobject/sqlobject.svg?style=shield
- :target: https://circleci.com/gh/sqlobject/sqlobject
-
To avoid triggering unnecessary test run at CI services add text `[skip ci]
<https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build>`_ or
-`[ci skip] <https://circleci.com/docs/skip-a-build/>`_ anywhere in your commit
-messages for commits that don't change code (documentation updates and such).
+``[ci skip]`` anywhere in your commit messages for commits that don't change
+code (documentation updates and such).
We use `coverage.py <https://pypi.python.org/pypi/coverage>`_
to measures code coverage by tests and upload the result for analyzis to
diff --git a/docs/News.rst b/docs/News.rst
index b1fd213..4c2dc9e 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -78,7 +78,7 @@ Tests
* Tests are now run at CIs with ``python3.5``.
-* Tests are split at ``Circle CI`` in 4 parallel containers.
+* Drop ``Circle CI``.
SQLObject 3.1.0
===============
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-03 19:07:12
|
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 5dd17da20cc4b264893bed3b21aab7da0bb1ebb2 (commit)
via 657191177616bc12a96295970458b1049541e96c (commit)
via ffb3e4c721d678ee618dbcc008a6008a3536dbd1 (commit)
via 09c0d9a37eebc4b1befd76abc0ff741c5115088c (commit)
via 707461ab20794ad12825311ac7448584d2c528ab (commit)
from 54fa5fcb29c035a7d074c21d154933c17743da2e (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/5dd17da20cc4b264893bed3b21aab7da0bb1ebb2
commit 5dd17da20cc4b264893bed3b21aab7da0bb1ebb2
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 3 22:02:04 2017 +0300
Drop Circle CI
[skip si]
diff --git a/circle.yml b/circle.yml
deleted file mode 100644
index 4c9174e..0000000
--- a/circle.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-dependencies:
- cache_directories:
- - ~/.cache/pip
- override:
- - sudo apt-get -qq update
- - sudo apt-get install -y python-egenix-mxdatetime python-mysqldb python-psycopg2 python3-psycopg2
- - pip install -U pip
- - pip install -U tox tox-pyenv
- - pyenv local 2.6.8 2.7.10 3.4.3 3.5.0
-
-test:
- override:
- - ?
- case $CIRCLE_NODE_INDEX in
- 0) tox -e '{py26,py27}-mysqldb,{py34,py35}-mysqlclient' ;;
- 1) tox -e '{py26,py27,py34,py35}-psycopg' ;;
- 2) tox -e '{py26,py27,py34,py35}-sqlite' ;;
- 3) tox -e '{py27,py34}-flake8' ;;
- esac
- :
- parallel: true
diff --git a/docs/DeveloperGuide.rst b/docs/DeveloperGuide.rst
index e4dd096..ce89c86 100644
--- a/docs/DeveloperGuide.rst
+++ b/docs/DeveloperGuide.rst
@@ -257,18 +257,15 @@ forced to write the test. That's no fun for us, to just be writing
tests. So please, write tests; everything at least needs to be
exercised, even if the tests are absolutely complete.
-We now use Travis CI and Circle CI to run tests. See the statuses:
+We now use Travis CI to run tests. See the statuses:
.. image:: https://travis-ci.org/sqlobject/sqlobject.svg?branch=master
:target: https://travis-ci.org/sqlobject/sqlobject
-.. image:: https://circleci.com/gh/sqlobject/sqlobject.svg?style=shield
- :target: https://circleci.com/gh/sqlobject/sqlobject
-
To avoid triggering unnecessary test run at CI services add text `[skip ci]
<https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build>`_ or
-`[ci skip] <https://circleci.com/docs/skip-a-build/>`_ anywhere in your commit
-messages for commits that don't change code (documentation updates and such).
+``[ci skip]`` anywhere in your commit messages for commits that don't change
+code (documentation updates and such).
We use `coverage.py <https://pypi.python.org/pypi/coverage>`_
to measures code coverage by tests and upload the result for analyzis to
diff --git a/docs/News.rst b/docs/News.rst
index b1fd213..4c2dc9e 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -78,7 +78,7 @@ Tests
* Tests are now run at CIs with ``python3.5``.
-* Tests are split at ``Circle CI`` in 4 parallel containers.
+* Drop ``Circle CI``.
SQLObject 3.1.0
===============
http://sourceforge.net/p/sqlobject/sqlobject/ci/657191177616bc12a96295970458b1049541e96c
commit 657191177616bc12a96295970458b1049541e96c
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 3 21:59:30 2017 +0300
There are major problems with pg8000 driver
[skip ci]
diff --git a/docs/News.rst b/docs/News.rst
index 58bbc27..b1fd213 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -52,7 +52,7 @@ Drivers (work in progress)
are still problems with the driver.
* Add support for `pg8000 <https://pypi.python.org/pypi/pg8000>`_
- PostgreSQL driver. There are still some problems.
+ PostgreSQL driver. There are major problems with the driver.
* Add support for `pyfirebirdsql
<https://pypi.python.org/pypi/firebirdsql>`_ (untested).
http://sourceforge.net/p/sqlobject/sqlobject/ci/ffb3e4c721d678ee618dbcc008a6008a3536dbd1
commit ffb3e4c721d678ee618dbcc008a6008a3536dbd1
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 3 20:56:15 2017 +0300
Set charset=utf8 for test DB URIs for oursql
diff --git a/tox.ini b/tox.ini
index 51c497d..ba72491 100644
--- a/tox.ini
+++ b/tox.ini
@@ -75,7 +75,7 @@ commands = {[mysql-connector]commands}
[oursql]
commands =
mysql -e 'create database sqlobject_test;'
- pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=oursql
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=oursql&charset=utf8
mysql -e 'drop database sqlobject_test;'
[testenv:py26-oursql]
http://sourceforge.net/p/sqlobject/sqlobject/ci/09c0d9a37eebc4b1befd76abc0ff741c5115088c
commit 09c0d9a37eebc4b1befd76abc0ff741c5115088c
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 3 20:53:56 2017 +0300
MySQL: call set_character_set(dbEncoding) for all drivers
For oursql set charset property.
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index 39b6417..c6fc133 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -121,7 +121,7 @@ class MySQLConnection(DBAPI):
def makeConnection(self):
dbEncoding = self.dbEncoding
if dbEncoding:
- if self.driver.lower() == 'mysqldb':
+ if self.driver.lower() in ('mysqldb', 'pymysql'):
from MySQLdb.connections import Connection
if not hasattr(Connection, 'set_character_set'):
# monkeypatch pre MySQLdb 1.2.1
@@ -145,10 +145,12 @@ class MySQLConnection(DBAPI):
self._setAutoCommit(conn, bool(self.autoCommit))
- if dbEncoding and self.driver.lower() == 'mysqldb':
- if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
+ if dbEncoding:
+ if hasattr(conn, 'set_character_set'):
conn.set_character_set(dbEncoding)
- else: # pre MySQLdb 1.2.1
+ elif self.driver == 'oursql':
+ conn.charset = dbEncoding
+ elif hasattr(conn, 'query'):
# works along with monkeypatching code above
conn.query("SET NAMES %s" % dbEncoding)
http://sourceforge.net/p/sqlobject/sqlobject/ci/707461ab20794ad12825311ac7448584d2c528ab
commit 707461ab20794ad12825311ac7448584d2c528ab
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 3 20:47:37 2017 +0300
MySQL: use driver instead of module.__name__
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index 149cd4c..39b6417 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -100,6 +100,7 @@ class MySQLConnection(DBAPI):
self.dbEncoding = self.kw["charset"] = kw.pop("charset")
else:
self.dbEncoding = None
+ self.driver = driver
global mysql_Bin
if not PY2 and mysql_Bin is None:
@@ -120,20 +121,20 @@ class MySQLConnection(DBAPI):
def makeConnection(self):
dbEncoding = self.dbEncoding
if dbEncoding:
- if self.module.__name__ == 'MySQLdb':
+ if self.driver.lower() == 'mysqldb':
from MySQLdb.connections import Connection
if not hasattr(Connection, 'set_character_set'):
# monkeypatch pre MySQLdb 1.2.1
def character_set_name(self):
return dbEncoding + '_' + dbEncoding
Connection.character_set_name = character_set_name
- if self.module.__name__ == 'mysql.connector':
+ if self.driver == 'connector':
self.kw['consume_results'] = True
try:
conn = self.module.connect(
host=self.host, port=self.port, db=self.db,
user=self.user, passwd=self.password, **self.kw)
- if self.module.__name__ != 'oursql':
+ if self.driver != 'oursql':
# Attempt to reconnect. This setting is persistent.
conn.ping(True)
except self.module.OperationalError as e:
@@ -144,7 +145,7 @@ class MySQLConnection(DBAPI):
self._setAutoCommit(conn, bool(self.autoCommit))
- if dbEncoding and self.module.__name__ == 'MySQLdb':
+ if dbEncoding and self.driver.lower() == 'mysqldb':
if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
conn.set_character_set(dbEncoding)
else: # pre MySQLdb 1.2.1
-----------------------------------------------------------------------
Summary of changes:
circle.yml | 21 ---------------------
docs/DeveloperGuide.rst | 9 +++------
docs/News.rst | 4 ++--
sqlobject/mysql/mysqlconnection.py | 15 +++++++++------
tox.ini | 2 +-
5 files changed, 15 insertions(+), 36 deletions(-)
delete mode 100644 circle.yml
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2017-01-02 00:42:42
|
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 54fa5fcb29c035a7d074c21d154933c17743da2e (commit)
via 7bc573abf52344822cc9c865739892f0e31569d3 (commit)
via 4622536c2c68ad1d39df1e85f196a4240bf0c937 (commit)
via cbfc236ed77f7e8de8cc2f8fee3fe56896ff9a35 (commit)
via b6ac85a087f0647cc50907df1e55d11bc219d8c8 (commit)
via 070bb647e0da7a1edafbf81c21cac57d79344bd9 (commit)
via d0c71ae303c01d748bebaa320481088cf6436c9d (commit)
via 83dd268319ea156674a9212d04c029d9bb56d6af (commit)
via 12e52446bc2f3668531d5930a475521c20eb8d2d (commit)
via 20e730152e8781482a2d8ea7de5f9d39de7e516c (commit)
from 29ddb111df870457a1a79fd83a4457f872d815e0 (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/54fa5fcb29c035a7d074c21d154933c17743da2e
commit 54fa5fcb29c035a7d074c21d154933c17743da2e
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 2 03:18:57 2017 +0300
We fixed most problems with py-postgresql
diff --git a/docs/News.rst b/docs/News.rst
index f3bff9b..58bbc27 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -49,7 +49,7 @@ Drivers (work in progress)
* Add support for `py-postgresql
<https://pypi.python.org/pypi/py-postgresql>`_ PostgreSQL driver. There
- are major problems with the driver.
+ are still problems with the driver.
* Add support for `pg8000 <https://pypi.python.org/pypi/pg8000>`_
PostgreSQL driver. There are still some problems.
http://sourceforge.net/p/sqlobject/sqlobject/ci/7bc573abf52344822cc9c865739892f0e31569d3
commit 7bc573abf52344822cc9c865739892f0e31569d3
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 2 03:17:24 2017 +0300
Fix DuplicateEntryError in py-postgresql
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 0455635..08e5390 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -15,7 +15,8 @@ class ErrorMessage(str):
obj.code = getattr(e, 'pgcode', None)
obj.error = getattr(e, 'pgerror', None)
else:
- obj.code = obj.error = None
+ obj.code = getattr(e, 'code', None)
+ obj.error = getattr(e, 'error', None)
obj.module = e.__module__
obj.exception = e.__class__.__name__
return obj
@@ -210,7 +211,8 @@ class PostgresConnection(DBAPI):
raise dberrors.OperationalError(ErrorMessage(e))
except self.module.IntegrityError as e:
msg = ErrorMessage(e)
- if getattr(e, 'pgcode', -1) == '23505' or \
+ if getattr(e, 'code', -1) == '23505' or \
+ getattr(e, 'pgcode', -1) == '23505' or \
getattr(e, 'sqlstate', -1) == '23505':
raise dberrors.DuplicateEntryError(msg)
else:
http://sourceforge.net/p/sqlobject/sqlobject/ci/4622536c2c68ad1d39df1e85f196a4240bf0c937
commit 4622536c2c68ad1d39df1e85f196a4240bf0c937
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 2 03:16:14 2017 +0300
Fix py-postgresql: register a converter for bytes
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 2efb128..0455635 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -140,6 +140,9 @@ class PostgresConnection(DBAPI):
else:
if "unix" in dsn_dict:
del dsn_dict["unix"]
+ # Register a converter for bytes
+ registerConverter(type(self.module.Binary(b'')),
+ PostgresBinaryConverter)
if driver == 'pg8000':
if host and host.startswith('/'):
dsn_dict["host"] = None
http://sourceforge.net/p/sqlobject/sqlobject/ci/cbfc236ed77f7e8de8cc2f8fee3fe56896ff9a35
commit cbfc236ed77f7e8de8cc2f8fee3fe56896ff9a35
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 2 02:10:56 2017 +0300
Fix pg8000: DuplicateEntryError is a kind of ProgrammingError
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 91d3dce..2efb128 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -215,7 +215,11 @@ class PostgresConnection(DBAPI):
except self.module.InternalError as e:
raise dberrors.InternalError(ErrorMessage(e))
except self.module.ProgrammingError as e:
- raise dberrors.ProgrammingError(ErrorMessage(e))
+ msg = ErrorMessage(e)
+ if (len(e.args) >= 2) and e.args[1] == '23505':
+ raise dberrors.DuplicateEntryError(msg)
+ else:
+ raise dberrors.ProgrammingError(msg)
except self.module.DataError as e:
raise dberrors.DataError(ErrorMessage(e))
except self.module.NotSupportedError as e:
http://sourceforge.net/p/sqlobject/sqlobject/ci/b6ac85a087f0647cc50907df1e55d11bc219d8c8
commit b6ac85a087f0647cc50907df1e55d11bc219d8c8
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 2 01:26:46 2017 +0300
Force utf-8 charset for tests
diff --git a/tox.ini b/tox.ini
index 4b545c8..51c497d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -106,7 +106,7 @@ commands = {[pymysql]commands}
[psycopg]
commands =
createdb -U postgres sqlobject_test
- pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=psycopg tests include/tests inheritance/tests versioning/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
[testenv:py26-psycopg]
@@ -124,7 +124,7 @@ commands = {[psycopg]commands}
[pygresql]
commands =
createdb -U postgres sqlobject_test
- pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pygresql tests include/tests inheritance/tests versioning/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
[testenv:py26-pygresql]
@@ -142,7 +142,7 @@ commands = {[pygresql]commands}
[pypostgresql]
commands =
createdb -U postgres sqlobject_test
- pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pypostgresql tests include/tests inheritance/tests versioning/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
[testenv:py34-pypostgresql]
@@ -154,7 +154,7 @@ commands = {[pypostgresql]commands}
[pg8000]
commands =
createdb -U postgres sqlobject_test
- pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pg8000 tests include/tests inheritance/tests versioning/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
[testenv:py26-pg8000]
http://sourceforge.net/p/sqlobject/sqlobject/ci/070bb647e0da7a1edafbf81c21cac57d79344bd9
commit 070bb647e0da7a1edafbf81c21cac57d79344bd9
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 2 01:26:13 2017 +0300
Register a converter for pg8000 Bytea type
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index e45e82a..91d3dce 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -76,7 +76,7 @@ class PostgresConnection(DBAPI):
if driver == 'pygresql' and type(self.module.Binary) is type:
# Register a converter for pygresql Binary type.
registerConverter(type(self.module.Binary(b'')),
- PygresBinaryConverter)
+ PostgresBinaryConverter)
self.user = user
self.host = host
@@ -146,6 +146,9 @@ class PostgresConnection(DBAPI):
dsn_dict["unix_sock"] = host
if user is None:
dsn_dict["user"] = getuser()
+ # Register a converter for pg8000 Bytea type.
+ registerConverter(type(self.module.Binary(b'')),
+ PostgresBinaryConverter)
self.driver = driver
self.dsn = dsn
self.unicodeCols = kw.pop('unicodeCols', False)
@@ -504,10 +507,10 @@ def PsycoBinaryConverter(value, db):
if PY2:
- def PygresBinaryConverter(value, db):
+ def PostgresBinaryConverter(value, db):
assert db == 'postgres'
return sqlrepr(bytes(value), db)
else:
- def PygresBinaryConverter(value, db):
+ def PostgresBinaryConverter(value, db):
assert db == 'postgres'
return sqlrepr(value.decode('latin1'), db)
http://sourceforge.net/p/sqlobject/sqlobject/ci/d0c71ae303c01d748bebaa320481088cf6436c9d
commit d0c71ae303c01d748bebaa320481088cf6436c9d
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 2 01:25:33 2017 +0300
Fix pg8000 driver: no need to replace password
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index cba6ec7..e45e82a 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -146,8 +146,6 @@ class PostgresConnection(DBAPI):
dsn_dict["unix_sock"] = host
if user is None:
dsn_dict["user"] = getuser()
- if password is None:
- dsn_dict["password"] = ''
self.driver = driver
self.dsn = dsn
self.unicodeCols = kw.pop('unicodeCols', False)
http://sourceforge.net/p/sqlobject/sqlobject/ci/83dd268319ea156674a9212d04c029d9bb56d6af
commit 83dd268319ea156674a9212d04c029d9bb56d6af
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 1 23:47:42 2017 +0300
Fix tests: convert data to lists and tuples
Tuples and lists are never compared equal.
diff --git a/sqlobject/tests/test_aggregates.py b/sqlobject/tests/test_aggregates.py
index 83b41cd..9f72300 100644
--- a/sqlobject/tests/test_aggregates.py
+++ b/sqlobject/tests/test_aggregates.py
@@ -64,12 +64,12 @@ def test_many():
IntAccumulator(value=3)
attribute = IntAccumulator.q.value
- assert IntAccumulator.select().accumulateMany(
+ assert list(IntAccumulator.select().accumulateMany(
("MIN", attribute), ("AVG", attribute), ("MAX", attribute),
("COUNT", attribute), ("SUM", attribute)
- ) == (1, 2, 3, 6, 12)
+ )) == [1, 2, 3, 6, 12]
- assert IntAccumulator.select(distinct=True).accumulateMany(
+ assert list(IntAccumulator.select(distinct=True).accumulateMany(
("MIN", attribute), ("AVG", attribute), ("MAX", attribute),
("COUNT", attribute), ("SUM", attribute)
- ) == (1, 2, 3, 3, 6)
+ )) == [1, 2, 3, 3, 6]
diff --git a/sqlobject/tests/test_groupBy.py b/sqlobject/tests/test_groupBy.py
index 7437425..e92d98e 100644
--- a/sqlobject/tests/test_groupBy.py
+++ b/sqlobject/tests/test_groupBy.py
@@ -25,8 +25,8 @@ def test_groupBy():
groupBy=GroupbyTest.q.name,
orderBy=GroupbyTest.q.name)
sql = connection.sqlrepr(select)
- rows = connection.queryAll(sql)
- assert list(rows) == [('a', 2), ('b', 1)]
+ rows = list(connection.queryAll(sql))
+ assert [tuple(t) for t in rows] == [('a', 2), ('b', 1)]
def test_groupBy_list():
@@ -41,5 +41,5 @@ def test_groupBy_list():
groupBy=[GroupbyTest.q.name, GroupbyTest.q.value],
orderBy=[GroupbyTest.q.name, GroupbyTest.q.value])
sql = connection.sqlrepr(select)
- rows = connection.queryAll(sql)
- assert list(rows) == [('a', 1), ('a', 2), ('b', 1)]
+ rows = list(connection.queryAll(sql))
+ assert [tuple(t) for t in rows] == [('a', 1), ('a', 2), ('b', 1)]
http://sourceforge.net/p/sqlobject/sqlobject/ci/12e52446bc2f3668531d5930a475521c20eb8d2d
commit 12e52446bc2f3668531d5930a475521c20eb8d2d
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 1 03:01:59 2017 +0300
Remove temporary apt-key workarounds from circle.yml
diff --git a/circle.yml b/circle.yml
index e5c04ce..4c9174e 100644
--- a/circle.yml
+++ b/circle.yml
@@ -2,8 +2,6 @@ dependencies:
cache_directories:
- ~/.cache/pip
override:
- - sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- - sudo apt-key update
- sudo apt-get -qq update
- sudo apt-get install -y python-egenix-mxdatetime python-mysqldb python-psycopg2 python3-psycopg2
- pip install -U pip
http://sourceforge.net/p/sqlobject/sqlobject/ci/20e730152e8781482a2d8ea7de5f9d39de7e516c
commit 20e730152e8781482a2d8ea7de5f9d39de7e516c
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 1 03:00:16 2017 +0300
Reformat case statement in circle.yml
Make long case statement multiline to be more readable.
Use "? " YAML operator to denote a complex mapping key.
diff --git a/circle.yml b/circle.yml
index afc12aa..e5c04ce 100644
--- a/circle.yml
+++ b/circle.yml
@@ -12,5 +12,12 @@ dependencies:
test:
override:
- - case $CIRCLE_NODE_INDEX in 0) tox -e '{py26,py27}-mysqldb,{py34,py35}-mysqlclient' ;; 1) tox -e '{py26,py27,py34,py35}-psycopg' ;; 2) tox -e '{py26,py27,py34,py35}-sqlite' ;; 3) tox -e '{py27,py34}-flake8' ;; esac:
+ - ?
+ case $CIRCLE_NODE_INDEX in
+ 0) tox -e '{py26,py27}-mysqldb,{py34,py35}-mysqlclient' ;;
+ 1) tox -e '{py26,py27,py34,py35}-psycopg' ;;
+ 2) tox -e '{py26,py27,py34,py35}-sqlite' ;;
+ 3) tox -e '{py27,py34}-flake8' ;;
+ esac
+ :
parallel: true
-----------------------------------------------------------------------
Summary of changes:
circle.yml | 11 ++++++++---
docs/News.rst | 2 +-
sqlobject/postgres/pgconnection.py | 26 ++++++++++++++++++--------
sqlobject/tests/test_aggregates.py | 8 ++++----
sqlobject/tests/test_groupBy.py | 8 ++++----
tox.ini | 8 ++++----
6 files changed, 39 insertions(+), 24 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-12-28 19:48:44
|
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 29ddb111df870457a1a79fd83a4457f872d815e0 (commit)
via f0311b04364b381df864352cc5a26328f297a9ab (commit)
via 4218b9c6bddc5c0206a14325d2a61d80a1d51ac8 (commit)
from 30fae4d4bdf41e056d8bb871450ebbe0206c64e0 (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/29ddb111df870457a1a79fd83a4457f872d815e0
commit 29ddb111df870457a1a79fd83a4457f872d815e0
Author: Oleg Broytman <ph...@ph...>
Date: Wed Dec 28 21:48:45 2016 +0300
Fix pg8000 driver
Pass the current OS user if not provided in the DB URI.
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index feebb1d..cba6ec7 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -1,3 +1,4 @@
+from getpass import getuser
import re
from sqlobject import col
from sqlobject import dberrors
@@ -140,11 +141,11 @@ class PostgresConnection(DBAPI):
if "unix" in dsn_dict:
del dsn_dict["unix"]
if driver == 'pg8000':
- if host.startswith('/'):
+ if host and host.startswith('/'):
dsn_dict["host"] = None
dsn_dict["unix_sock"] = host
if user is None:
- dsn_dict["user"] = ''
+ dsn_dict["user"] = getuser()
if password is None:
dsn_dict["password"] = ''
self.driver = driver
http://sourceforge.net/p/sqlobject/sqlobject/ci/f0311b04364b381df864352cc5a26328f297a9ab
commit f0311b04364b381df864352cc5a26328f297a9ab
Author: Oleg Broytman <ph...@ph...>
Date: Wed Dec 28 21:43:28 2016 +0300
Fix py-postgresql driver
Select next id from the sequence instead of using RETURNING id.
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 0ae219e..feebb1d 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -132,12 +132,13 @@ class PostgresConnection(DBAPI):
if sslmode:
dsn.append('sslmode=%s' % sslmode)
dsn = ' '.join(dsn)
- if driver == 'pypostgresql':
- if host.startswith('/'):
+ if driver in ('py-postgresql', 'pypostgresql'):
+ if host and host.startswith('/'):
dsn_dict["host"] = dsn_dict["port"] = None
dsn_dict["unix"] = host
else:
- dsn_dict["unix"] = None
+ if "unix" in dsn_dict:
+ del dsn_dict["unix"]
if driver == 'pg8000':
if host.startswith('/'):
dsn_dict["host"] = None
@@ -234,6 +235,11 @@ class PostgresConnection(DBAPI):
table = soInstance.sqlmeta.table
idName = soInstance.sqlmeta.idName
c = conn.cursor()
+ if id is None and self.driver in ('py-postgresql', 'pypostgresql'):
+ sequenceName = soInstance.sqlmeta.idSequence or \
+ '%s_%s_seq' % (table, idName)
+ self._executeRetry(conn, c, "SELECT NEXTVAL('%s')" % sequenceName)
+ id = c.fetchone()[0]
if id is not None:
names = [idName] + names
values = [id] + values
http://sourceforge.net/p/sqlobject/sqlobject/ci/4218b9c6bddc5c0206a14325d2a61d80a1d51ac8
commit 4218b9c6bddc5c0206a14325d2a61d80a1d51ac8
Author: Oleg Broytman <ph...@ph...>
Date: Wed Dec 28 21:25:53 2016 +0300
Upgrade ez_setup.py
diff --git a/ez_setup.py b/ez_setup.py
index 950e120..83c0595 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -366,12 +366,13 @@ def _resolve_version(version):
meta_url = urljoin(DEFAULT_URL, '/pypi/setuptools/json')
resp = urlopen(meta_url)
+ fallback = 'UTF-8'
with contextlib.closing(resp):
try:
- charset = resp.info().get_content_charset()
+ charset = resp.info().get_content_charset(fallback)
except Exception:
- # Python 2 compat; assume UTF-8
- charset = 'UTF-8'
+ # Python 2 compat
+ charset = fallback
reader = codecs.getreader(charset)
doc = json.load(reader(resp))
-----------------------------------------------------------------------
Summary of changes:
ez_setup.py | 7 ++++---
sqlobject/postgres/pgconnection.py | 17 ++++++++++++-----
2 files changed, 16 insertions(+), 8 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-24 16:33:05
|
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 30fae4d4bdf41e056d8bb871450ebbe0206c64e0 (commit)
via 00f835ee7ca115ca17065fee5eb14786069ebc1c (commit)
from 859dbffe446aaef2a408066d28ad959f9c20e17a (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/30fae4d4bdf41e056d8bb871450ebbe0206c64e0
commit 30fae4d4bdf41e056d8bb871450ebbe0206c64e0
Author: Oleg Broytman <ph...@ph...>
Date: Thu Nov 24 19:27:58 2016 +0300
Fix DevGuide: we use Sphinx instead of pudge
[skip ci]
diff --git a/docs/DeveloperGuide.rst b/docs/DeveloperGuide.rst
index 9d62805..e4dd096 100644
--- a/docs/DeveloperGuide.rst
+++ b/docs/DeveloperGuide.rst
@@ -285,9 +285,8 @@ Documentation
=============
Please write documentation. Documentation should live in the docs/
-directory. Pudge converts documentation from Restructured Text to
-HTML. It presently requires kid 0.9.6, which must be obtained
-separately (for instance, from https://pypi.python.org/pypi/kid/0.9.6).
+directory in reStructuredText format. We use Sphinx to convert docs to
+HTML.
.. image:: https://sourceforge.net/sflogo.php?group_id=74338&type=10
:target: https://sourceforge.net/projects/sqlobject
http://sourceforge.net/p/sqlobject/sqlobject/ci/00f835ee7ca115ca17065fee5eb14786069ebc1c
commit 00f835ee7ca115ca17065fee5eb14786069ebc1c
Author: Oleg Broytman <ph...@ph...>
Date: Wed Nov 23 19:59:11 2016 +0300
Upgrade ez_setup.py
diff --git a/ez_setup.py b/ez_setup.py
index 4ef3ee0..950e120 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -40,6 +40,8 @@ DEFAULT_VERSION = LATEST
DEFAULT_URL = "https://pypi.io/packages/source/s/setuptools/"
DEFAULT_SAVE_DIR = os.curdir
+MEANINGFUL_INVALID_ZIP_ERR_MSG = 'Maybe {0} is corrupted, delete it and try again.'
+
def _python_cmd(*args):
"""
@@ -104,8 +106,16 @@ def archive_context(filename):
old_wd = os.getcwd()
try:
os.chdir(tmpdir)
- with ContextualZipFile(filename) as archive:
- archive.extractall()
+ try:
+ with ContextualZipFile(filename) as archive:
+ archive.extractall()
+ except zipfile.BadZipfile as err:
+ if not err.args:
+ err.args = ('', )
+ err.args = err.args + (
+ MEANINGFUL_INVALID_ZIP_ERR_MSG.format(filename),
+ )
+ raise
# going in the directory
subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
-----------------------------------------------------------------------
Summary of changes:
docs/DeveloperGuide.rst | 5 ++---
ez_setup.py | 14 ++++++++++++--
2 files changed, 14 insertions(+), 5 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-23 15:39:47
|
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 859dbffe446aaef2a408066d28ad959f9c20e17a (commit)
via 0c1368bb74070570d1f775fd4452189c9f59717a (commit)
via 6e31c371db753b199a4ddc2f720cb2d1a2b53e42 (commit)
via 6113e3abe33afb39d702001fc36d228ec955dcf1 (commit)
via ae47156624f77e329d0b5a1f6a6fcdbde2d0e6b8 (commit)
via 0b512866eb3f8f2babacea1a907d78e83b06fedb (commit)
from 8aaccf7e191f5a9e15e63b15fb252db83357cbbf (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/859dbffe446aaef2a408066d28ad959f9c20e17a
commit 859dbffe446aaef2a408066d28ad959f9c20e17a
Author: Oleg Broytman <ph...@ph...>
Date: Wed Nov 23 18:04:44 2016 +0300
Add support for pyfirebirdsql driver
diff --git a/docs/News.rst b/docs/News.rst
index f292559..f3bff9b 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -22,14 +22,14 @@ Minor features
* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb'
or 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that
- order.
+ order. pyfirebirdsql is supported but untested.
* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only;
(connector, oursql and pymysql drivers still cause problems).
-Work in progress
-----------------
+Drivers (work in progress)
+--------------------------
* Add support for `MySQL Connector
<https://pypi.python.org/pypi/mysql-connector>`_ (pure python; `binary
@@ -54,6 +54,9 @@ Work in progress
* Add support for `pg8000 <https://pypi.python.org/pypi/pg8000>`_
PostgreSQL driver. There are still some problems.
+* Add support for `pyfirebirdsql
+ <https://pypi.python.org/pypi/firebirdsql>`_ (untested).
+
Documentation
-------------
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index 324c116..e9e4bc4 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -47,10 +47,13 @@ Requirements
============
Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
-mysqlclient_ for Python 3) or `MySQL Connector`_ or oursql_ or PyMySQL_,
-PostgreSQL_ via psycopg2_ or psycopg1 or PyGreSQL_ or py-postgresql_ or
-pg8000_, SQLite_ via PySQLite_, Firebird_ via fdb_ or kinterbasdb_, `MAX
-DB`_ (also known as SAP DB) via sapdb_, Sybase via Sybase_, and `MSSQL
+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
+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).
.. _MySQL: https://www.mysql.com/
@@ -69,6 +72,7 @@ Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_ (Win32).
.. _Firebird: http://www.firebirdsql.org/en/python-driver/
.. _fdb: http://www.firebirdsql.org/en/devel-python-driver/
.. _kinterbasdb: http://kinterbasdb.sourceforge.net/
+.. _pyfirebirdsql: https://pypi.python.org/pypi/firebirdsql
.. _`MAX DB`: http://maxdb.sap.com/
.. _sapdb: http://maxdb.sap.com/doc/7_8/50/01923f25b842438a408805774f6989/frameset.htm
.. _Sybase: http://www.object-craft.com.au/projects/sybase/
diff --git a/docs/TODO.rst b/docs/TODO.rst
index 047aee1..9c31d87 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -71,8 +71,6 @@ TODO
* Switch from setuptools to distribute.
-* `pyfirebirdsql <https://pypi.python.org/pypi/firebirdsql>`_.
-
* `dbms <https://pypi.python.org/pypi/dbms>`_ is a DB API wrapper for DB
API drivers for IBM DB2, Firebird, MSSQL Server, MySQL, Oracle,
PostgreSQL, SQLite and ODBC.
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index cf4aed3..ba60123 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -33,10 +33,13 @@ class FirebirdConnection(DBAPI):
# unicode.
kinterbasdb.init(type_conv=200)
self.module = kinterbasdb
+ elif driver in ('firebirdsql', 'pyfirebirdsql'):
+ import firebirdsql
+ self.module = firebirdsql
else:
raise ValueError(
'Unknown FireBird driver "%s", '
- 'expected fdb or kinterbasdb' % driver)
+ 'expected fdb, kinterbasdb or firebirdsql' % driver)
except ImportError:
pass
else:
http://sourceforge.net/p/sqlobject/sqlobject/ci/0c1368bb74070570d1f775fd4452189c9f59717a
commit 0c1368bb74070570d1f775fd4452189c9f59717a
Author: Oleg Broytman <ph...@ph...>
Date: Wed Nov 23 17:10:51 2016 +0300
Add support for py-postgresql driver
diff --git a/.travis.yml b/.travis.yml
index ce66e2e..36d6f85 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,6 +37,8 @@ env:
- TOXENV=py27-pygresql
- TOXENV=py34-pygresql
- TOXENV=py35-pygresql
+ - TOXENV=py34-pypostgresql
+ - TOXENV=py35-pypostgresql
- TOXENV=py26-pg8000
- TOXENV=py27-pg8000
- TOXENV=py34-pg8000
@@ -66,6 +68,8 @@ matrix:
- env: TOXENV=py27-pygresql
- env: TOXENV=py34-pygresql
- env: TOXENV=py35-pygresql
+ - env: TOXENV=py34-pypostgresql
+ - env: TOXENV=py35-pypostgresql
- env: TOXENV=py26-pg8000
- env: TOXENV=py27-pg8000
- env: TOXENV=py34-pg8000
diff --git a/docs/News.rst b/docs/News.rst
index 40d4ac5..f292559 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -47,6 +47,10 @@ Work in progress
* Extend support for PyGreSQL driver. There are still some problems.
+* Add support for `py-postgresql
+ <https://pypi.python.org/pypi/py-postgresql>`_ PostgreSQL driver. There
+ are major problems with the driver.
+
* Add support for `pg8000 <https://pypi.python.org/pypi/pg8000>`_
PostgreSQL driver. There are still some problems.
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index eab3759..324c116 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -48,10 +48,10 @@ Requirements
Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
mysqlclient_ for Python 3) or `MySQL Connector`_ or oursql_ or PyMySQL_,
-PostgreSQL_ via psycopg2_ or psycopg1 or PyGreSQL_ or pg8000_, SQLite_ via
-PySQLite_, Firebird_ via fdb_ or kinterbasdb_, `MAX DB`_ (also known as SAP
-DB) via sapdb_, Sybase via Sybase_, and `MSSQL Server`_ via pymssql_ (+
-FreeTDS_) or adodbapi_ (Win32).
+PostgreSQL_ via psycopg2_ or psycopg1 or PyGreSQL_ or py-postgresql_ or
+pg8000_, SQLite_ via PySQLite_, Firebird_ via fdb_ or kinterbasdb_, `MAX
+DB`_ (also known as SAP DB) via sapdb_, Sybase via Sybase_, and `MSSQL
+Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_ (Win32).
.. _MySQL: https://www.mysql.com/
.. _MySQLdb: https://sourceforge.net/projects/mysql-python/
@@ -62,6 +62,7 @@ FreeTDS_) or adodbapi_ (Win32).
.. _PostgreSQL: https://postgresql.org
.. _psycopg2: http://initd.org/psycopg/
.. _PyGreSQL: http://www.pygresql.org/
+.. _py-postgresql: https://pypi.python.org/pypi/py-postgresql
.. _pg8000: https://pypi.python.org/pypi/pg8000
.. _SQLite: https://sqlite.org/
.. _PySQLite: https://github.com/ghaering/pysqlite
diff --git a/docs/TODO.rst b/docs/TODO.rst
index 3f343be..047aee1 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -71,8 +71,6 @@ TODO
* Switch from setuptools to distribute.
-* `py-postgresql driver <https://pypi.python.org/pypi/py-postgresql>`_.
-
* `pyfirebirdsql <https://pypi.python.org/pypi/firebirdsql>`_.
* `dbms <https://pypi.python.org/pypi/dbms>`_ is a DB API wrapper for DB
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index e3e14eb..0ae219e 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -49,6 +49,9 @@ class PostgresConnection(DBAPI):
elif driver == 'pygresql':
import pgdb
self.module = pgdb
+ elif driver in ('py-postgresql', 'pypostgresql'):
+ from postgresql.driver import dbapi20
+ self.module = dbapi20
elif driver == 'pg8000':
import pg8000
self.module = pg8000
@@ -56,7 +59,7 @@ class PostgresConnection(DBAPI):
raise ValueError(
'Unknown PostgreSQL driver "%s", '
'expected psycopg2, psycopg1, '
- 'pygresql or pg8000' % driver)
+ 'pygresql, pg8000 or pypostgresql' % driver)
except ImportError:
pass
else:
@@ -129,6 +132,12 @@ class PostgresConnection(DBAPI):
if sslmode:
dsn.append('sslmode=%s' % sslmode)
dsn = ' '.join(dsn)
+ if driver == 'pypostgresql':
+ if host.startswith('/'):
+ dsn_dict["host"] = dsn_dict["port"] = None
+ dsn_dict["unix"] = host
+ else:
+ dsn_dict["unix"] = None
if driver == 'pg8000':
if host.startswith('/'):
dsn_dict["host"] = None
diff --git a/tox.ini b/tox.ini
index 77d6291..4b545c8 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,pymysql,psycopg,pygresql,pg8000,sqlite},{py27,py34}-flake8
+envlist = {py26,py27}-{mysqldb,oursql},{py34,py35}-{mysqlclient,pypostgresql},{py26,py27,py34,py35}-{mysql-connector,pymysql,psycopg,pygresql,pg8000,sqlite},{py27,py34}-flake8
# Base test environment settings
[testenv]
@@ -20,6 +20,7 @@ deps =
pymysql: pymysql
psycopg: psycopg2
pygresql: pygresql
+ pypostgresql: py-postgresql
pg8000: pg8000
passenv = CI TRAVIS TRAVIS_*
# Don't fail or warn on uninstalled commands
@@ -138,6 +139,18 @@ commands = {[pygresql]commands}
[testenv:py35-pygresql]
commands = {[pygresql]commands}
+[pypostgresql]
+commands =
+ createdb -U postgres sqlobject_test
+ pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pypostgresql tests include/tests inheritance/tests versioning/test
+ dropdb -U postgres sqlobject_test
+
+[testenv:py34-pypostgresql]
+commands = {[pypostgresql]commands}
+
+[testenv:py35-pypostgresql]
+commands = {[pypostgresql]commands}
+
[pg8000]
commands =
createdb -U postgres sqlobject_test
http://sourceforge.net/p/sqlobject/sqlobject/ci/6e31c371db753b199a4ddc2f720cb2d1a2b53e42
commit 6e31c371db753b199a4ddc2f720cb2d1a2b53e42
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 22 18:44:26 2016 +0300
Add support for pg8000 PostgreSQL driver
diff --git a/.travis.yml b/.travis.yml
index a46110b..ce66e2e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,6 +37,10 @@ env:
- TOXENV=py27-pygresql
- TOXENV=py34-pygresql
- TOXENV=py35-pygresql
+ - TOXENV=py26-pg8000
+ - TOXENV=py27-pg8000
+ - TOXENV=py34-pg8000
+ - TOXENV=py35-pg8000
- TOXENV=py26-sqlite
- TOXENV=py27-sqlite
- TOXENV=py34-sqlite
@@ -62,6 +66,10 @@ matrix:
- env: TOXENV=py27-pygresql
- env: TOXENV=py34-pygresql
- env: TOXENV=py35-pygresql
+ - env: TOXENV=py26-pg8000
+ - env: TOXENV=py27-pg8000
+ - env: TOXENV=py34-pg8000
+ - env: TOXENV=py35-pg8000
fast_finish: true
script: tox -e ${TOXENV}
diff --git a/docs/News.rst b/docs/News.rst
index 1054ffb..40d4ac5 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -47,6 +47,9 @@ Work in progress
* Extend support for PyGreSQL driver. There are still some problems.
+* Add support for `pg8000 <https://pypi.python.org/pypi/pg8000>`_
+ PostgreSQL driver. There are still some problems.
+
Documentation
-------------
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index 73cc0bc..eab3759 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -48,10 +48,10 @@ Requirements
Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
mysqlclient_ for Python 3) or `MySQL Connector`_ or oursql_ or PyMySQL_,
-PostgreSQL_ via psycopg2_ or psycopg1 or PyGreSQL_, SQLite_ via PySQLite_,
-Firebird_ via fdb_ or kinterbasdb_, `MAX DB`_ (also known as SAP DB) via
-sapdb_, Sybase via Sybase_, and `MSSQL Server`_ via pymssql_ (+ FreeTDS_)
-or adodbapi_ (Win32).
+PostgreSQL_ via psycopg2_ or psycopg1 or PyGreSQL_ or pg8000_, SQLite_ via
+PySQLite_, Firebird_ via fdb_ or kinterbasdb_, `MAX DB`_ (also known as SAP
+DB) via sapdb_, Sybase via Sybase_, and `MSSQL Server`_ via pymssql_ (+
+FreeTDS_) or adodbapi_ (Win32).
.. _MySQL: https://www.mysql.com/
.. _MySQLdb: https://sourceforge.net/projects/mysql-python/
@@ -62,6 +62,7 @@ or adodbapi_ (Win32).
.. _PostgreSQL: https://postgresql.org
.. _psycopg2: http://initd.org/psycopg/
.. _PyGreSQL: http://www.pygresql.org/
+.. _pg8000: https://pypi.python.org/pypi/pg8000
.. _SQLite: https://sqlite.org/
.. _PySQLite: https://github.com/ghaering/pysqlite
.. _Firebird: http://www.firebirdsql.org/en/python-driver/
diff --git a/docs/TODO.rst b/docs/TODO.rst
index ca28588..3f343be 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -71,8 +71,6 @@ TODO
* Switch from setuptools to distribute.
-* `pg8000 driver <https://pypi.python.org/pypi/pg8000>`_.
-
* `py-postgresql driver <https://pypi.python.org/pypi/py-postgresql>`_.
* `pyfirebirdsql <https://pypi.python.org/pypi/firebirdsql>`_.
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 28b50ac..e3e14eb 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -49,10 +49,14 @@ class PostgresConnection(DBAPI):
elif driver == 'pygresql':
import pgdb
self.module = pgdb
+ elif driver == 'pg8000':
+ import pg8000
+ self.module = pg8000
else:
raise ValueError(
'Unknown PostgreSQL driver "%s", '
- 'expected psycopg2, psycopg1 or pygresql' % driver)
+ 'expected psycopg2, psycopg1, '
+ 'pygresql or pg8000' % driver)
except ImportError:
pass
else:
@@ -125,6 +129,14 @@ class PostgresConnection(DBAPI):
if sslmode:
dsn.append('sslmode=%s' % sslmode)
dsn = ' '.join(dsn)
+ if driver == 'pg8000':
+ if host.startswith('/'):
+ dsn_dict["host"] = None
+ dsn_dict["unix_sock"] = host
+ if user is None:
+ dsn_dict["user"] = ''
+ if password is None:
+ dsn_dict["password"] = ''
self.driver = driver
self.dsn = dsn
self.unicodeCols = kw.pop('unicodeCols', False)
diff --git a/tox.ini b/tox.ini
index b466378..77d6291 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,pymysql,psycopg,pygresql,sqlite},{py27,py34}-flake8
+envlist = {py26,py27}-{mysqldb,oursql},{py34,py35}-mysqlclient,{py26,py27,py34,py35}-{mysql-connector,pymysql,psycopg,pygresql,pg8000,sqlite},{py27,py34}-flake8
# Base test environment settings
[testenv]
@@ -20,6 +20,7 @@ deps =
pymysql: pymysql
psycopg: psycopg2
pygresql: pygresql
+ pg8000: pg8000
passenv = CI TRAVIS TRAVIS_*
# Don't fail or warn on uninstalled commands
whitelist_externals =
@@ -137,6 +138,24 @@ commands = {[pygresql]commands}
[testenv:py35-pygresql]
commands = {[pygresql]commands}
+[pg8000]
+commands =
+ createdb -U postgres sqlobject_test
+ pytest --cov=sqlobject -D postgres://postgres:@localhost/sqlobject_test?driver=pg8000 tests include/tests inheritance/tests versioning/test
+ dropdb -U postgres sqlobject_test
+
+[testenv:py26-pg8000]
+commands = {[pg8000]commands}
+
+[testenv:py27-pg8000]
+commands = {[pg8000]commands}
+
+[testenv:py34-pg8000]
+commands = {[pg8000]commands}
+
+[testenv:py35-pg8000]
+commands = {[pg8000]commands}
+
# SQLite test environments
[sqlite]
commands =
http://sourceforge.net/p/sqlobject/sqlobject/ci/6113e3abe33afb39d702001fc36d228ec955dcf1
commit 6113e3abe33afb39d702001fc36d228ec955dcf1
Author: Oleg Broytman <ph...@ph...>
Date: Wed Nov 23 06:18:54 2016 +0300
Extend support for PyGreSQL driver
diff --git a/.travis.yml b/.travis.yml
index 79c956b..a46110b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,6 +33,10 @@ env:
- TOXENV=py27-psycopg
- TOXENV=py34-psycopg
- TOXENV=py35-psycopg
+ - TOXENV=py26-pygresql
+ - TOXENV=py27-pygresql
+ - TOXENV=py34-pygresql
+ - TOXENV=py35-pygresql
- TOXENV=py26-sqlite
- TOXENV=py27-sqlite
- TOXENV=py34-sqlite
@@ -54,6 +58,10 @@ matrix:
- env: TOXENV=py27-pymysql
- env: TOXENV=py34-pymysql
- env: TOXENV=py35-pymysql
+ - env: TOXENV=py26-pygresql
+ - env: TOXENV=py27-pygresql
+ - env: TOXENV=py34-pygresql
+ - env: TOXENV=py35-pygresql
fast_finish: true
script: tox -e ${TOXENV}
diff --git a/docs/News.rst b/docs/News.rst
index 7c5ab0e..1054ffb 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -45,6 +45,8 @@ Work in progress
python mysql interface; most tests are passed, but there are still
problems).
+* Extend support for PyGreSQL driver. There are still some problems.
+
Documentation
-------------
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index d86305c..73cc0bc 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -47,11 +47,11 @@ Requirements
============
... 331 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-20 18:22:26
|
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 8aaccf7e191f5a9e15e63b15fb252db83357cbbf (commit)
via 75e6a7233eb757f400825bbd9c739f33ce566ca5 (commit)
via 5ba20f58a0a64a29292f8c14761e173ade86bff3 (commit)
via 624df0a46dcc64882e6ce88dfd3f440956b0ce4d (commit)
from f0b0085ef16194976fbf5d70f93dfeee6263283c (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/8aaccf7e191f5a9e15e63b15fb252db83357cbbf
commit 8aaccf7e191f5a9e15e63b15fb252db83357cbbf
Author: Oleg Broytman <ph...@ph...>
Date: Sun Nov 20 21:17:24 2016 +0300
TODO: add dbms - a DB API wrapper for DB API drivers
[skip ci]
diff --git a/docs/TODO.rst b/docs/TODO.rst
index 7791279..ca28588 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -77,6 +77,10 @@ TODO
* `pyfirebirdsql <https://pypi.python.org/pypi/firebirdsql>`_.
+* `dbms <https://pypi.python.org/pypi/dbms>`_ is a DB API wrapper for DB
+ API drivers for IBM DB2, Firebird, MSSQL Server, MySQL, Oracle,
+ PostgreSQL, SQLite and ODBC.
+
* dict API: use getitem interface for column access instead of getattr;
reserve getattr for internal attributes only; this helps to avoid
collisions with internal attributes.
http://sourceforge.net/p/sqlobject/sqlobject/ci/75e6a7233eb757f400825bbd9c739f33ce566ca5
commit 75e6a7233eb757f400825bbd9c739f33ce566ca5
Author: Oleg Broytman <ph...@ph...>
Date: Sun Nov 20 21:17:00 2016 +0300
TODO: reformat reST
[skip ci]
diff --git a/docs/TODO.rst b/docs/TODO.rst
index 611bb27..7791279 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -25,8 +25,8 @@ TODO
* Cached join results.
-* Invert tests isinstance(obj, (tuple, list)) to not isinstance(obj, basestr)
- to allow any iterable.
+* Invert tests isinstance(obj, (tuple, list)) to not isinstance(obj,
+ basestr) to allow any iterable.
* Always use .lazyIter().
@@ -34,13 +34,15 @@ TODO
* Generators instead of loops (fetchall => fetchone).
-* Cache columns in sqlmeta.getColumns(); reset the cache on add/del Column/Join.
+* Cache columns in sqlmeta.getColumns(); reset the cache on add/del
+ Column/Join.
* Make ConnectionHub a context manager instead of .doInTransaction().
* Make version_info a namedtuple.
-* Expression columns - in SELECT but not in INSERT/UPDATE. Something like this::
+* Expression columns - in SELECT but not in INSERT/UPDATE. Something like
+ this::
class MyClass(SQLObject):
function1 = ExpressionCol(func.my_function(MyClass.q.col1))
@@ -56,13 +58,14 @@ TODO
* PREPARE/EXECUTE.
-* Protect all .encode(), catch UnicodeEncode exceptions and reraise Invalid.
+* Protect all .encode(), catch UnicodeEncode exceptions and reraise
+ Invalid.
* More kinds of joins, and more powerful join results (closer to how
`select` works).
-* Better joins - automatic joins in .select()
- based on ForeignKey/MultipleJoin/RelatedJoin.
+* Better joins - automatic joins in .select() based on
+ ForeignKey/MultipleJoin/RelatedJoin.
* Deprecate, then remove connectionForOldURI.
@@ -74,9 +77,9 @@ TODO
* `pyfirebirdsql <https://pypi.python.org/pypi/firebirdsql>`_.
-* dict API: use getitem interface for column access instead of getattr; reserve
- getattr for internal attributes only; this helps to avoid collisions with
- internal attributes.
+* dict API: use getitem interface for column access instead of getattr;
+ reserve getattr for internal attributes only; this helps to avoid
+ collisions with internal attributes.
* Or move column values access to a separate namespace, e.g. .c:
row.c.column.
@@ -89,16 +92,16 @@ TODO
.. _DBUtils: https://pypi.python.org/pypi/DBUtils
-* ``_fromDatabase`` currently doesn't support IDs that don't fit into
- the normal naming scheme. It should do so. You can still use
- ``_idName`` with ``_fromDatabase``.
+* ``_fromDatabase`` currently doesn't support IDs that don't fit into the
+ normal naming scheme. It should do so. You can still use ``_idName``
+ with ``_fromDatabase``.
-* More databases supported. There has been interest and some work in
- the progress for Oracle. IWBN to have Informix and DB2 drivers.
+* More databases supported. There has been interest and some work in the
+ progress for Oracle. IWBN to have Informix and DB2 drivers.
-* Better transaction support -- right now you can use transactions
- for the database, but objects aren't transaction-aware, so
- non-database persistence won't be able to be rolled back.
+* Better transaction support -- right now you can use transactions for the
+ database, but objects aren't transaction-aware, so non-database
+ persistence won't be able to be rolled back.
* Optimistic locking and other techniques to handle concurrency.
http://sourceforge.net/p/sqlobject/sqlobject/ci/5ba20f58a0a64a29292f8c14761e173ade86bff3
commit 5ba20f58a0a64a29292f8c14761e173ade86bff3
Author: Oleg Broytman <ph...@ph...>
Date: Sun Nov 20 20:05:33 2016 +0300
Change URLs to PyPI in TODO
We need PyPI URLs to install modules using pip.
[skip ci]
diff --git a/docs/TODO.rst b/docs/TODO.rst
index dde8748..611bb27 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,11 +68,11 @@ TODO
* Switch from setuptools to distribute.
-* pg8000 driver: http://code.google.com/p/pg8000/
+* `pg8000 driver <https://pypi.python.org/pypi/pg8000>`_.
-* py-postgresql driver: http://python.projects.postgresql.org/
+* `py-postgresql driver <https://pypi.python.org/pypi/py-postgresql>`_.
-* pyfirebirdsql: https://github.com/nakagami/pyfirebirdsql
+* `pyfirebirdsql <https://pypi.python.org/pypi/firebirdsql>`_.
* dict API: use getitem interface for column access instead of getattr; reserve
getattr for internal attributes only; this helps to avoid collisions with
@@ -87,7 +87,7 @@ TODO
* Use DBUtils_, especially SolidConnection.
-.. _DBUtils: http://www.webwareforpython.org/DBUtils
+.. _DBUtils: https://pypi.python.org/pypi/DBUtils
* ``_fromDatabase`` currently doesn't support IDs that don't fit into
the normal naming scheme. It should do so. You can still use
http://sourceforge.net/p/sqlobject/sqlobject/ci/624df0a46dcc64882e6ce88dfd3f440956b0ce4d
commit 624df0a46dcc64882e6ce88dfd3f440956b0ce4d
Author: Oleg Broytman <ph...@ph...>
Date: Sun Nov 20 19:42:56 2016 +0300
TODO: remove ultramysql
It doesn't seem to support DB API (PEP 249).
[skip ci]
diff --git a/docs/TODO.rst b/docs/TODO.rst
index 54dc4ad..dde8748 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,10 +68,6 @@ TODO
* Switch from setuptools to distribute.
-* Ultramysql `for Python2 <https://github.com/esnme/ultramysql>`_ and
- `Python3 <https://github.com/arpitbbhayani/umysql3>`_. See also `umysqldb
- <https://github.com/hongqn/umysqldb>`_.
-
* pg8000 driver: http://code.google.com/p/pg8000/
* py-postgresql driver: http://python.projects.postgresql.org/
-----------------------------------------------------------------------
Summary of changes:
docs/TODO.rst | 53 ++++++++++++++++++++++++++++-------------------------
1 files changed, 28 insertions(+), 25 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-18 20:01:08
|
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
discards 1c246013fbaeca294889747f26e373108e45a23e (commit)
via f0b0085ef16194976fbf5d70f93dfeee6263283c (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (1c246013fbaeca294889747f26e373108e45a23e)
\
N -- N -- N (f0b0085ef16194976fbf5d70f93dfeee6263283c)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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/f0b0085ef16194976fbf5d70f93dfeee6263283c
commit f0b0085ef16194976fbf5d70f93dfeee6263283c
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/SQLObject.rst b/docs/SQLObject.rst
index 8680097..d86305c 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -47,7 +47,7 @@ Requirements
============
Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
-mysqlclient_ for Python 3) or `MySQL Connector`_ or oursql_, PostgreSQL_
+mysqlclient_ for Python 3) or `MySQL Connector`_ or oursql_ or PyMySQL_, PostgreSQL_
via psycopg2_ or psycopg1, SQLite_ via PySQLite_, Firebird_ via fdb_ or
kinterbasdb_, `MAX DB`_ (also known as SAP DB) via sapdb_, Sybase via
Sybase_, and `MSSQL Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_
@@ -58,6 +58,7 @@ Sybase_, and `MSSQL Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_
.. _mysqlclient: https://pypi.python.org/pypi/mysqlclient
.. _`MySQL Connector`: https://pypi.python.org/pypi/mysql-connector
.. _oursql: https://github.com/python-oursql/oursql
+.. _PyMySQL: https://github.com/PyMySQL/PyMySQL/
.. _PostgreSQL: https://postgresql.org
.. _psycopg2: http://initd.org/psycopg/
.. _SQLite: https://sqlite.org/
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]
-----------------------------------------------------------------------
Summary of changes:
docs/SQLObject.rst | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-18 18:32:43
|
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
|
|
From: Oleg B. <no...@so...> - 2016-11-17 21:45:09
|
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
discards eaa996cb589e2d740dadd94c2c10a0e91d2811fe (commit)
discards 9ef9f2e420cdfd623002f9327c9510a4933ab06b (commit)
via afcbff10a92d1364562313b51a9cb417064cae9b (commit)
via 2f477e94e751126c9e661406f74aa8dc14e8a6fc (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (eaa996cb589e2d740dadd94c2c10a0e91d2811fe)
\
N -- N -- N (afcbff10a92d1364562313b51a9cb417064cae9b)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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/afcbff10a92d1364562313b51a9cb417064cae9b
commit afcbff10a92d1364562313b51a9cb417064cae9b
Author: Oleg Broytman <ph...@ph...>
Date: Fri Nov 18 00:39:46 2016 +0300
Add support for mysql-connector
diff --git a/.travis.yml b/.travis.yml
index bf2d010..1e314c2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,10 @@ env:
- TOXENV=py27-mysqldb
- TOXENV=py34-mysqlclient
- TOXENV=py35-mysqlclient
+ - TOXENV=py26-mysql-connector
+ - TOXENV=py27-mysql-connector
+ - TOXENV=py34-mysql-connector
+ - TOXENV=py35-mysql-connector
- TOXENV=py26-postgres
- TOXENV=py27-postgres
- TOXENV=py34-postgres
@@ -36,6 +40,10 @@ 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
fast_finish: true
diff --git a/docs/News.rst b/docs/News.rst
index 1353f2c..1ca10c2 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -13,30 +13,38 @@ SQLObject 3.2.0 (master)
Minor features
--------------
-* Drop table name from ``VACUUM`` command in SQLiteConnection:
- SQLite doesn't vacuum a single table and SQLite 3.15 uses the supplied name
- as the name of the attached database to vacuum.
+* Drop table name from ``VACUUM`` command in SQLiteConnection: SQLite
+ doesn't vacuum a single table and SQLite 3.15 uses the supplied name as
+ the name of the attached database to vacuum.
* Remove ``driver`` keyword from RdbhostConnection as it allows one driver
``rdbhdb``.
-* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or
- 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that order.
+* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb'
+ or 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that
+ order.
+
+* 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).
* 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 values are 'mysqldb' and
- 'oursql'. Default is to test for mysqldb only (oursql still causes 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).
Documentation
-------------
* The docs are now generated with Sphinx.
-* Move ``docs/LICENSE`` to the top-level directory so that Github recognizes
- it.
+* Move ``docs/LICENSE`` to the top-level directory so that Github
+ recognizes it.
Tests
-----
@@ -46,8 +54,8 @@ Tests
* Great Renaming: fix ``pytest`` warnings by renaming ``TestXXX`` classes
to ``SOTestXXX`` to prevent ``pytest`` to recognize them as test classes.
-* Fix ``pytest`` warnings by converting yield tests to plain calls:
- yield tests were deprecated in ``pytest``.
+* Fix ``pytest`` warnings by converting yield tests to plain calls: yield
+ tests were deprecated in ``pytest``.
* Tests are now run at CIs with ``python3.5``.
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index 074d0ad..8680097 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -47,14 +47,16 @@ Requirements
============
Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
-mysqlclient_ for Python 3) or oursql_, PostgreSQL_ via psycopg2_ or
-psycopg1, SQLite_ via PySQLite_, Firebird_ via fdb_ or kinterbasdb_, `MAX
-DB`_ (also known as SAP DB) via sapdb_, Sybase via Sybase_, and `MSSQL
-Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_ (Win32).
+mysqlclient_ for Python 3) or `MySQL Connector`_ or oursql_, PostgreSQL_
+via psycopg2_ or psycopg1, SQLite_ via PySQLite_, Firebird_ via fdb_ or
+kinterbasdb_, `MAX DB`_ (also known as SAP DB) via sapdb_, Sybase via
+Sybase_, and `MSSQL Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_
+(Win32).
.. _MySQL: https://www.mysql.com/
.. _MySQLdb: https://sourceforge.net/projects/mysql-python/
.. _mysqlclient: https://pypi.python.org/pypi/mysqlclient
+.. _`MySQL Connector`: https://pypi.python.org/pypi/mysql-connector
.. _oursql: https://github.com/python-oursql/oursql
.. _PostgreSQL: https://postgresql.org
.. _psycopg2: http://initd.org/psycopg/
diff --git a/docs/TODO.rst b/docs/TODO.rst
index f8038cd..7c78877 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,8 +68,6 @@ TODO
* Switch from setuptools to distribute.
-* MySQL Connector/Python: https://dev.mysql.com/doc/connector-python/en/
-
* Pure Python Mysql Interface: https://github.com/nasi/MyPy
* Ultramysql `for Python2 <https://github.com/esnme/ultramysql>`_ and
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 0a3f783..7eb5a82 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -599,8 +599,15 @@ class StringValidator(SOValidator):
return value
if hasattr(value, '__unicode__'):
return unicode(value).encode(dbEncoding)
- if dbName == 'mysql' and not PY2 and isinstance(value, bytes):
- return value.decode('ascii', errors='surrogateescape')
+ if dbName == 'mysql':
+ if isinstance(value, bytearray):
+ if PY2:
+ value = value.decode(dbEncoding)
+ return value.encode(dbEncoding) # convrt to bytes
+ else:
+ return value.decode(dbEncoding, errors='surrogateescape')
+ if not PY2 and isinstance(value, bytes):
+ return value.decode('ascii', errors='surrogateescape')
raise validators.Invalid(
"expected a str in the StringCol '%s', got %s %r instead" % (
self.name, type(value), value), value, state)
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index ecfeb4d..729886a 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -39,6 +39,14 @@ class MySQLConnection(DBAPI):
MySQLdb.constants.CR.SERVER_GONE_ERROR
self.CR_SERVER_LOST = MySQLdb.constants.CR.SERVER_LOST
self.ER_DUP_ENTRY = MySQLdb.constants.ER.DUP_ENTRY
+ elif driver == 'connector':
+ import mysql.connector
+ self.module = mysql.connector
+ self.CR_SERVER_GONE_ERROR = \
+ mysql.connector.errorcode.CR_SERVER_GONE_ERROR
+ self.CR_SERVER_LOST = \
+ mysql.connector.errorcode.CR_SERVER_LOST
+ self.ER_DUP_ENTRY = mysql.connector.errorcode.ER_DUP_ENTRY
elif driver == 'oursql':
import oursql
self.module = oursql
@@ -49,7 +57,7 @@ class MySQLConnection(DBAPI):
else:
raise ValueError(
'Unknown MySQL driver "%s", '
- 'expected mysqldb or oursql' % driver)
+ 'expected mysqldb, connector or oursql' % driver)
except ImportError:
pass
else:
@@ -58,7 +66,7 @@ class MySQLConnection(DBAPI):
raise ImportError(
'Cannot find a MySQL driver, tried %s' % drivers)
self.host = host
- self.port = port
+ self.port = port or 3306
self.db = db
self.user = user
self.password = password
@@ -95,7 +103,7 @@ class MySQLConnection(DBAPI):
def _connectionFromParams(cls, user, password, host, port, path, args):
return cls(db=path.strip('/'),
user=user or '', password=password or '',
- host=host or 'localhost', port=port or 0, **args)
+ host=host or 'localhost', port=port, **args)
def makeConnection(self):
dbEncoding = self.dbEncoding
@@ -107,21 +115,21 @@ class MySQLConnection(DBAPI):
def character_set_name(self):
return dbEncoding + '_' + dbEncoding
Connection.character_set_name = character_set_name
+ if self.module.__name__ == 'mysql.connector':
+ self.kw['consume_results'] = True
try:
conn = self.module.connect(
host=self.host, port=self.port, db=self.db,
user=self.user, passwd=self.password, **self.kw)
- if self.module.__name__ == 'MySQLdb':
- # Attempt to reconnect. This setting is persistent.
- conn.ping(True)
+ # 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, "
"db=%(db)s, user=%(user)s" % self.__dict__)
raise dberrors.OperationalError(ErrorMessage(e, conninfo))
- if hasattr(conn, 'autocommit'):
- conn.autocommit(bool(self.autoCommit))
+ self._setAutoCommit(conn, bool(self.autoCommit))
if dbEncoding and self.module.__name__ == 'MySQLdb':
if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
@@ -134,7 +142,11 @@ class MySQLConnection(DBAPI):
def _setAutoCommit(self, conn, auto):
if hasattr(conn, 'autocommit'):
- conn.autocommit(auto)
+ try:
+ conn.autocommit(auto)
+ except TypeError:
+ # mysql-connector has autocommit as a property
+ conn.autocommit = auto
def _executeRetry(self, conn, cursor, query):
# When a server connection is lost and a query is attempted, most of
diff --git a/tox.ini b/tox.ini
index 65b3fd5..4d97831 100644
--- a/tox.ini
+++ b/tox.ini
@@ -61,6 +61,24 @@ commands = {[oursql]commands}
[testenv:py27-oursql]
commands = {[oursql]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}
+
# PostgreSQL test environments
[postgresql]
commands =
http://sourceforge.net/p/sqlobject/sqlobject/ci/2f477e94e751126c9e661406f74aa8dc14e8a6fc
commit 2f477e94e751126c9e661406f74aa8dc14e8a6fc
Author: Oleg Broytman <ph...@ph...>
Date: Wed Nov 16 23:11:16 2016 +0300
Add support for oursql MySQL driver
diff --git a/.travis.yml b/.travis.yml
index fc8002b..bf2d010 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,24 +15,29 @@ addons:
postgresql: "9.4"
env:
- - TOXENV=py26-mysql
+ - TOXENV=py26-mysqldb
+ - TOXENV=py27-mysqldb
+ - TOXENV=py34-mysqlclient
+ - TOXENV=py35-mysqlclient
- TOXENV=py26-postgres
- - TOXENV=py26-sqlite
- - TOXENV=py27-mysql
- TOXENV=py27-postgres
- - TOXENV=py27-sqlite
- - TOXENV=py34-mysqlclient
- TOXENV=py34-postgres
- - TOXENV=py34-sqlite
- - TOXENV=py35-mysqlclient
- TOXENV=py35-postgres
+ - TOXENV=py26-sqlite
+ - TOXENV=py27-sqlite
+ - TOXENV=py34-sqlite
- TOXENV=py35-sqlite
+ - TOXENV=py26-oursql
+ - TOXENV=py27-oursql
- TOXENV=py27-flake8
- TOXENV=py34-flake8
install: pip install tox coveralls codecov
matrix:
+ allow_failures:
+ - env: TOXENV=py26-oursql
+ - env: TOXENV=py27-oursql
fast_finish: true
script: tox -e ${TOXENV}
diff --git a/circle.yml b/circle.yml
index 9e7c927..f3b9ff0 100644
--- a/circle.yml
+++ b/circle.yml
@@ -12,5 +12,5 @@ dependencies:
test:
override:
- - case $CIRCLE_NODE_INDEX in 0) tox -e '{py26,py27}-mysql,{py34,py35}-mysqlclient' ;; 1) tox -e '{py26,py27,py34,py35}-postgres' ;; 2) tox -e '{py26,py27,py34,py35}-sqlite' ;; 3) tox -e '{py27,py34}-flake8' ;; esac:
+ - case $CIRCLE_NODE_INDEX in 0) tox -e '{py26,py27}-mysqldb,{py34,py35}-mysqlclient' ;; 1) tox -e '{py26,py27,py34,py35}-postgres' ;; 2) tox -e '{py26,py27,py34,py35}-sqlite' ;; 3) tox -e '{py27,py34}-flake8' ;; esac:
parallel: true
diff --git a/docs/News.rst b/docs/News.rst
index 35c5e46..1353f2c 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -23,7 +23,12 @@ Minor features
* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or
'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that order.
-* Add ``driver`` keyword for MySQLConnection. Allowed value is 'mysqldb'.
+* 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 values are 'mysqldb' and
+ 'oursql'. Default is to test for mysqldb only (oursql still causes problems).
Documentation
-------------
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index d207a0a..074d0ad 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -46,14 +46,16 @@ used with the same query syntax.
Requirements
============
-Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python,
-PostgreSQL_ via psycopg2_ or psycopg1, SQLite_ via PySQLite_, Firebird_
-via fdb_ or kinterbasdb_, `MAX DB`_ (also known as SAP DB) via sapdb_,
-Sybase via Sybase_, and `MSSQL Server`_ via pymssql_ (+ FreeTDS_) or
-adodbapi_ (Win32).
+Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
+mysqlclient_ for Python 3) or oursql_, PostgreSQL_ via psycopg2_ or
+psycopg1, SQLite_ via PySQLite_, Firebird_ via fdb_ or kinterbasdb_, `MAX
+DB`_ (also known as SAP DB) via sapdb_, Sybase via Sybase_, and `MSSQL
+Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_ (Win32).
.. _MySQL: https://www.mysql.com/
.. _MySQLdb: https://sourceforge.net/projects/mysql-python/
+.. _mysqlclient: https://pypi.python.org/pypi/mysqlclient
+.. _oursql: https://github.com/python-oursql/oursql
.. _PostgreSQL: https://postgresql.org
.. _psycopg2: http://initd.org/psycopg/
.. _SQLite: https://sqlite.org/
diff --git a/docs/TODO.rst b/docs/TODO.rst
index ba8c7d4..f8038cd 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,8 +68,6 @@ TODO
* Switch from setuptools to distribute.
-* oursql MySQL bindings: https://github.com/python-oursql/oursql
-
* MySQL Connector/Python: https://dev.mysql.com/doc/connector-python/en/
* Pure Python Mysql Interface: https://github.com/nasi/MyPy
diff --git a/sqlobject/col.py b/sqlobject/col.py
index e405127..0a3f783 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1879,6 +1879,8 @@ class UuidValidator(SOValidator):
def to_python(self, value, state):
if value is None:
return None
+ if PY2 and isinstance(value, unicode):
+ value = value.encode('ascii')
if isinstance(value, str):
return UUID(value)
raise validators.Invalid(
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index df26f20..ecfeb4d 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -39,10 +39,17 @@ class MySQLConnection(DBAPI):
MySQLdb.constants.CR.SERVER_GONE_ERROR
self.CR_SERVER_LOST = MySQLdb.constants.CR.SERVER_LOST
self.ER_DUP_ENTRY = MySQLdb.constants.ER.DUP_ENTRY
+ elif driver == 'oursql':
+ import oursql
+ self.module = oursql
+ self.CR_SERVER_GONE_ERROR = \
+ oursql.errnos['CR_SERVER_GONE_ERROR']
+ self.CR_SERVER_LOST = oursql.errnos['CR_SERVER_LOST']
+ self.ER_DUP_ENTRY = oursql.errnos['ER_DUP_ENTRY']
else:
raise ValueError(
'Unknown MySQL driver "%s", '
- 'expected mysqldb' % driver)
+ 'expected mysqldb or oursql' % driver)
except ImportError:
pass
else:
@@ -163,7 +170,8 @@ class MySQLConnection(DBAPI):
except self.module.InternalError as e:
raise dberrors.InternalError(ErrorMessage(e))
except self.module.ProgrammingError as e:
- raise dberrors.ProgrammingError(ErrorMessage(e))
+ if e.args[0] is not None:
+ raise dberrors.ProgrammingError(ErrorMessage(e))
except self.module.DataError as e:
raise dberrors.DataError(ErrorMessage(e))
except self.module.NotSupportedError as e:
diff --git a/sqlobject/tests/test_validation.py b/sqlobject/tests/test_validation.py
index ef61178..86f1a10 100644
--- a/sqlobject/tests/test_validation.py
+++ b/sqlobject/tests/test_validation.py
@@ -34,7 +34,7 @@ class SOValidation(SQLObject):
name = StringCol(validator=validators.PlainText(),
default='x', dbName='name_col')
- name2 = StringCol(validator=validators.ConfirmType(type=str), default='y')
+ name2 = StringCol(validator2=validators.ConfirmType(type=str), default='y')
name3 = IntCol(validator=validators.Wrapper(fromPython=int), default=100)
name4 = FloatCol(default=2.718)
name5 = PickleCol(default=None)
diff --git a/tox.ini b/tox.ini
index e6f632f..65b3fd5 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 1.8
-envlist = {py26,py27}-mysql,{py26,py27,py34,py35}-postgres,{py26,py27,py34,py35}-sqlite,{py34,py35}-mysqlclient,{py27,py34}-flake8
+envlist = {py26,py27}-{mysqldb,oursql},{py34,py35}-mysqlclient,{py26,py27,py34,py35}-{postgres,sqlite},{py27,py34}-flake8
# Base test environment settings
[testenv]
@@ -13,8 +13,9 @@ deps =
py34,py35: FormEncode >= 1.3.1
PyDispatcher>=2.0.4
py26,py27: egenix-mx-base
- mysql: mysql-python
+ mysqldb: mysql-python
mysqlclient: mysqlclient
+ py26,py27: oursql
postgres: psycopg2
passenv = CI TRAVIS TRAVIS_*
# Don't fail or warn on uninstalled commands
@@ -24,17 +25,41 @@ whitelist_externals =
dropdb
# MySQL test environments
-[mysql]
... 70 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-17 21:11:18
|
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
discards a038cb0153ffa2ed2c95d9d70db255ca8919dfe6 (commit)
via eaa996cb589e2d740dadd94c2c10a0e91d2811fe (commit)
via 9ef9f2e420cdfd623002f9327c9510a4933ab06b (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (a038cb0153ffa2ed2c95d9d70db255ca8919dfe6)
\
N -- N -- N (eaa996cb589e2d740dadd94c2c10a0e91d2811fe)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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/eaa996cb589e2d740dadd94c2c10a0e91d2811fe
commit eaa996cb589e2d740dadd94c2c10a0e91d2811fe
Author: Oleg Broytman <ph...@ph...>
Date: Thu Nov 17 23:02:11 2016 +0300
Add support for mysql-connector
diff --git a/.travis.yml b/.travis.yml
index bf2d010..1e314c2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,10 @@ env:
- TOXENV=py27-mysqldb
- TOXENV=py34-mysqlclient
- TOXENV=py35-mysqlclient
+ - TOXENV=py26-mysql-connector
+ - TOXENV=py27-mysql-connector
+ - TOXENV=py34-mysql-connector
+ - TOXENV=py35-mysql-connector
- TOXENV=py26-postgres
- TOXENV=py27-postgres
- TOXENV=py34-postgres
@@ -36,6 +40,10 @@ 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
fast_finish: true
diff --git a/docs/News.rst b/docs/News.rst
index 4f3f97b..27d29b5 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -13,29 +13,38 @@ SQLObject 3.2.0 (master)
Minor features
--------------
-* Drop table name from ``VACUUM`` command in SQLiteConnection:
- SQLite doesn't vacuum a single table and SQLite 3.15 uses the supplied name
- as the name of the attached database to vacuum.
+* Drop table name from ``VACUUM`` command in SQLiteConnection: SQLite
+ doesn't vacuum a single table and SQLite 3.15 uses the supplied name as
+ the name of the attached database to vacuum.
* Remove ``driver`` keyword from RdbhostConnection as it allows one driver
``rdbhdb``.
-* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or
- 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that order.
+* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb'
+ or 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that
+ order.
+
+* 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).
* Add support for `oursql <https://github.com/python-oursql/oursql>_` MySQL
- driver (Python 2.6 and 2.7).
+ driver (Python 2.6 and 2.7; most tests are passed, but there are still
+ problems).
-* Add ``driver`` keyword for MySQLConnection. Allowed values are 'mysqldb' and
- 'oursql'. Default is to test 'mysqldb' and 'oursql' in that order.
+* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
+ 'connector' and 'oursql'. Default is to test mysqldb' only;
+ (connector and oursql drivers still cause problems).
Documentation
-------------
* The docs are now generated with Sphinx.
-* Move ``docs/LICENSE`` to the top-level directory so that Github recognizes
- it.
+* Move ``docs/LICENSE`` to the top-level directory so that Github
+ recognizes it.
Tests
-----
@@ -45,8 +54,8 @@ Tests
* Great Renaming: fix ``pytest`` warnings by renaming ``TestXXX`` classes
to ``SOTestXXX`` to prevent ``pytest`` to recognize them as test classes.
-* Fix ``pytest`` warnings by converting yield tests to plain calls:
- yield tests were deprecated in ``pytest``.
+* Fix ``pytest`` warnings by converting yield tests to plain calls: yield
+ tests were deprecated in ``pytest``.
* Tests are now run at CIs with ``python3.5``.
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index 4719f22..2711691 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -47,13 +47,15 @@ Requirements
============
Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
-mysqlconnector for Python 3) or oursql_, PostgreSQL_ via psycopg2_ or
-psycopg1, SQLite_ via PySQLite_, Firebird_ via fdb_ or kinterbasdb_, `MAX
-DB`_ (also known as SAP DB) via sapdb_, Sybase via Sybase_, and `MSSQL
-Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_ (Win32).
+mysqlconnector for Python 3) or `MySQL Connector`_ or oursql_, PostgreSQL_
+via psycopg2_ or psycopg1, SQLite_ via PySQLite_, Firebird_ via fdb_ or
+kinterbasdb_, `MAX DB`_ (also known as SAP DB) via sapdb_, Sybase via
+Sybase_, and `MSSQL Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_
+(Win32).
.. _MySQL: https://www.mysql.com/
.. _MySQLdb: https://sourceforge.net/projects/mysql-python/
+.. _`MySQL Connector`: https://pypi.python.org/pypi/mysql-connector
.. _oursql: https://github.com/python-oursql/oursql>_
.. _PostgreSQL: https://postgresql.org
.. _psycopg2: http://initd.org/psycopg/
diff --git a/docs/TODO.rst b/docs/TODO.rst
index f8038cd..7c78877 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,8 +68,6 @@ TODO
* Switch from setuptools to distribute.
-* MySQL Connector/Python: https://dev.mysql.com/doc/connector-python/en/
-
* Pure Python Mysql Interface: https://github.com/nasi/MyPy
* Ultramysql `for Python2 <https://github.com/esnme/ultramysql>`_ and
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 0a3f783..7eb5a82 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -599,8 +599,15 @@ class StringValidator(SOValidator):
return value
if hasattr(value, '__unicode__'):
return unicode(value).encode(dbEncoding)
- if dbName == 'mysql' and not PY2 and isinstance(value, bytes):
- return value.decode('ascii', errors='surrogateescape')
+ if dbName == 'mysql':
+ if isinstance(value, bytearray):
+ if PY2:
+ value = value.decode(dbEncoding)
+ return value.encode(dbEncoding) # convrt to bytes
+ else:
+ return value.decode(dbEncoding, errors='surrogateescape')
+ if not PY2 and isinstance(value, bytes):
+ return value.decode('ascii', errors='surrogateescape')
raise validators.Invalid(
"expected a str in the StringCol '%s', got %s %r instead" % (
self.name, type(value), value), value, state)
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index 6f6cf03..729886a 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -21,7 +21,7 @@ class MySQLConnection(DBAPI):
schemes = [dbName]
def __init__(self, db, user, password='', host='localhost', port=0, **kw):
- drivers = kw.pop('driver', None) or 'mysqldb,oursql'
+ drivers = kw.pop('driver', None) or 'mysqldb'
for driver in drivers.split(','):
driver = driver.strip()
if not driver:
@@ -39,6 +39,14 @@ class MySQLConnection(DBAPI):
MySQLdb.constants.CR.SERVER_GONE_ERROR
self.CR_SERVER_LOST = MySQLdb.constants.CR.SERVER_LOST
self.ER_DUP_ENTRY = MySQLdb.constants.ER.DUP_ENTRY
+ elif driver == 'connector':
+ import mysql.connector
+ self.module = mysql.connector
+ self.CR_SERVER_GONE_ERROR = \
+ mysql.connector.errorcode.CR_SERVER_GONE_ERROR
+ self.CR_SERVER_LOST = \
+ mysql.connector.errorcode.CR_SERVER_LOST
+ self.ER_DUP_ENTRY = mysql.connector.errorcode.ER_DUP_ENTRY
elif driver == 'oursql':
import oursql
self.module = oursql
@@ -49,7 +57,7 @@ class MySQLConnection(DBAPI):
else:
raise ValueError(
'Unknown MySQL driver "%s", '
- 'expected mysqldb or oursql' % driver)
+ 'expected mysqldb, connector or oursql' % driver)
except ImportError:
pass
else:
@@ -58,7 +66,7 @@ class MySQLConnection(DBAPI):
raise ImportError(
'Cannot find a MySQL driver, tried %s' % drivers)
self.host = host
- self.port = port
+ self.port = port or 3306
self.db = db
self.user = user
self.password = password
@@ -95,7 +103,7 @@ class MySQLConnection(DBAPI):
def _connectionFromParams(cls, user, password, host, port, path, args):
return cls(db=path.strip('/'),
user=user or '', password=password or '',
- host=host or 'localhost', port=port or 0, **args)
+ host=host or 'localhost', port=port, **args)
def makeConnection(self):
dbEncoding = self.dbEncoding
@@ -107,21 +115,21 @@ class MySQLConnection(DBAPI):
def character_set_name(self):
return dbEncoding + '_' + dbEncoding
Connection.character_set_name = character_set_name
+ if self.module.__name__ == 'mysql.connector':
+ self.kw['consume_results'] = True
try:
conn = self.module.connect(
host=self.host, port=self.port, db=self.db,
user=self.user, passwd=self.password, **self.kw)
- if self.module.__name__ == 'MySQLdb':
- # Attempt to reconnect. This setting is persistent.
- conn.ping(True)
+ # 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, "
"db=%(db)s, user=%(user)s" % self.__dict__)
raise dberrors.OperationalError(ErrorMessage(e, conninfo))
- if hasattr(conn, 'autocommit'):
- conn.autocommit(bool(self.autoCommit))
+ self._setAutoCommit(conn, bool(self.autoCommit))
if dbEncoding and self.module.__name__ == 'MySQLdb':
if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
@@ -134,7 +142,11 @@ class MySQLConnection(DBAPI):
def _setAutoCommit(self, conn, auto):
if hasattr(conn, 'autocommit'):
- conn.autocommit(auto)
+ try:
+ conn.autocommit(auto)
+ except TypeError:
+ # mysql-connector has autocommit as a property
+ conn.autocommit = auto
def _executeRetry(self, conn, cursor, query):
# When a server connection is lost and a query is attempted, most of
diff --git a/tox.ini b/tox.ini
index 8527d24..f2f08da 100644
--- a/tox.ini
+++ b/tox.ini
@@ -65,7 +65,7 @@ commands = {[oursql]commands}
[mysql-connector]
commands =
mysql -e 'create database sqlobject_test;'
- pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=connector
+ pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=connector&charset=utf8
mysql -e 'drop database sqlobject_test;'
[testenv:py26-mysql-connector]
http://sourceforge.net/p/sqlobject/sqlobject/ci/9ef9f2e420cdfd623002f9327c9510a4933ab06b
commit 9ef9f2e420cdfd623002f9327c9510a4933ab06b
Author: Oleg Broytman <ph...@ph...>
Date: Wed Nov 16 23:11:16 2016 +0300
Add support for oursql MySQL driver
diff --git a/.travis.yml b/.travis.yml
index fc8002b..bf2d010 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,24 +15,29 @@ addons:
postgresql: "9.4"
env:
- - TOXENV=py26-mysql
+ - TOXENV=py26-mysqldb
+ - TOXENV=py27-mysqldb
+ - TOXENV=py34-mysqlclient
+ - TOXENV=py35-mysqlclient
- TOXENV=py26-postgres
- - TOXENV=py26-sqlite
- - TOXENV=py27-mysql
- TOXENV=py27-postgres
- - TOXENV=py27-sqlite
- - TOXENV=py34-mysqlclient
- TOXENV=py34-postgres
- - TOXENV=py34-sqlite
- - TOXENV=py35-mysqlclient
- TOXENV=py35-postgres
+ - TOXENV=py26-sqlite
+ - TOXENV=py27-sqlite
+ - TOXENV=py34-sqlite
- TOXENV=py35-sqlite
+ - TOXENV=py26-oursql
+ - TOXENV=py27-oursql
- TOXENV=py27-flake8
- TOXENV=py34-flake8
install: pip install tox coveralls codecov
matrix:
+ allow_failures:
+ - env: TOXENV=py26-oursql
+ - env: TOXENV=py27-oursql
fast_finish: true
script: tox -e ${TOXENV}
diff --git a/circle.yml b/circle.yml
index 9e7c927..f3b9ff0 100644
--- a/circle.yml
+++ b/circle.yml
@@ -12,5 +12,5 @@ dependencies:
test:
override:
- - case $CIRCLE_NODE_INDEX in 0) tox -e '{py26,py27}-mysql,{py34,py35}-mysqlclient' ;; 1) tox -e '{py26,py27,py34,py35}-postgres' ;; 2) tox -e '{py26,py27,py34,py35}-sqlite' ;; 3) tox -e '{py27,py34}-flake8' ;; esac:
+ - case $CIRCLE_NODE_INDEX in 0) tox -e '{py26,py27}-mysqldb,{py34,py35}-mysqlclient' ;; 1) tox -e '{py26,py27,py34,py35}-postgres' ;; 2) tox -e '{py26,py27,py34,py35}-sqlite' ;; 3) tox -e '{py27,py34}-flake8' ;; esac:
parallel: true
diff --git a/docs/News.rst b/docs/News.rst
index 35c5e46..4f3f97b 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -23,7 +23,11 @@ Minor features
* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or
'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that order.
-* Add ``driver`` keyword for MySQLConnection. Allowed value is 'mysqldb'.
+* Add support for `oursql <https://github.com/python-oursql/oursql>_` MySQL
+ driver (Python 2.6 and 2.7).
+
+* Add ``driver`` keyword for MySQLConnection. Allowed values are 'mysqldb' and
+ 'oursql'. Default is to test 'mysqldb' and 'oursql' in that order.
Documentation
-------------
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index d207a0a..4719f22 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -46,14 +46,15 @@ used with the same query syntax.
Requirements
============
-Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python,
-PostgreSQL_ via psycopg2_ or psycopg1, SQLite_ via PySQLite_, Firebird_
-via fdb_ or kinterbasdb_, `MAX DB`_ (also known as SAP DB) via sapdb_,
-Sybase via Sybase_, and `MSSQL Server`_ via pymssql_ (+ FreeTDS_) or
-adodbapi_ (Win32).
+Currently SQLObject supports MySQL_ via MySQLdb_ aka MySQL-python (called
+mysqlconnector for Python 3) or oursql_, PostgreSQL_ via psycopg2_ or
+psycopg1, SQLite_ via PySQLite_, Firebird_ via fdb_ or kinterbasdb_, `MAX
+DB`_ (also known as SAP DB) via sapdb_, Sybase via Sybase_, and `MSSQL
+Server`_ via pymssql_ (+ FreeTDS_) or adodbapi_ (Win32).
.. _MySQL: https://www.mysql.com/
.. _MySQLdb: https://sourceforge.net/projects/mysql-python/
+.. _oursql: https://github.com/python-oursql/oursql>_
.. _PostgreSQL: https://postgresql.org
.. _psycopg2: http://initd.org/psycopg/
.. _SQLite: https://sqlite.org/
diff --git a/docs/TODO.rst b/docs/TODO.rst
index ba8c7d4..f8038cd 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,8 +68,6 @@ TODO
* Switch from setuptools to distribute.
-* oursql MySQL bindings: https://github.com/python-oursql/oursql
-
* MySQL Connector/Python: https://dev.mysql.com/doc/connector-python/en/
* Pure Python Mysql Interface: https://github.com/nasi/MyPy
diff --git a/sqlobject/col.py b/sqlobject/col.py
index e405127..0a3f783 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1879,6 +1879,8 @@ class UuidValidator(SOValidator):
def to_python(self, value, state):
if value is None:
return None
+ if PY2 and isinstance(value, unicode):
+ value = value.encode('ascii')
if isinstance(value, str):
return UUID(value)
raise validators.Invalid(
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index df26f20..6f6cf03 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -21,7 +21,7 @@ class MySQLConnection(DBAPI):
schemes = [dbName]
def __init__(self, db, user, password='', host='localhost', port=0, **kw):
- drivers = kw.pop('driver', None) or 'mysqldb'
+ drivers = kw.pop('driver', None) or 'mysqldb,oursql'
for driver in drivers.split(','):
driver = driver.strip()
if not driver:
@@ -39,10 +39,17 @@ class MySQLConnection(DBAPI):
MySQLdb.constants.CR.SERVER_GONE_ERROR
self.CR_SERVER_LOST = MySQLdb.constants.CR.SERVER_LOST
self.ER_DUP_ENTRY = MySQLdb.constants.ER.DUP_ENTRY
+ elif driver == 'oursql':
+ import oursql
+ self.module = oursql
+ self.CR_SERVER_GONE_ERROR = \
+ oursql.errnos['CR_SERVER_GONE_ERROR']
+ self.CR_SERVER_LOST = oursql.errnos['CR_SERVER_LOST']
+ self.ER_DUP_ENTRY = oursql.errnos['ER_DUP_ENTRY']
else:
raise ValueError(
'Unknown MySQL driver "%s", '
- 'expected mysqldb' % driver)
+ 'expected mysqldb or oursql' % driver)
except ImportError:
pass
else:
@@ -163,7 +170,8 @@ class MySQLConnection(DBAPI):
except self.module.InternalError as e:
raise dberrors.InternalError(ErrorMessage(e))
except self.module.ProgrammingError as e:
- raise dberrors.ProgrammingError(ErrorMessage(e))
+ if e.args[0] is not None:
+ raise dberrors.ProgrammingError(ErrorMessage(e))
except self.module.DataError as e:
raise dberrors.DataError(ErrorMessage(e))
except self.module.NotSupportedError as e:
diff --git a/sqlobject/tests/test_validation.py b/sqlobject/tests/test_validation.py
index ef61178..86f1a10 100644
--- a/sqlobject/tests/test_validation.py
+++ b/sqlobject/tests/test_validation.py
@@ -34,7 +34,7 @@ class SOValidation(SQLObject):
name = StringCol(validator=validators.PlainText(),
default='x', dbName='name_col')
- name2 = StringCol(validator=validators.ConfirmType(type=str), default='y')
+ name2 = StringCol(validator2=validators.ConfirmType(type=str), default='y')
name3 = IntCol(validator=validators.Wrapper(fromPython=int), default=100)
name4 = FloatCol(default=2.718)
name5 = PickleCol(default=None)
diff --git a/tox.ini b/tox.ini
index e6f632f..8527d24 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 1.8
-envlist = {py26,py27}-mysql,{py26,py27,py34,py35}-postgres,{py26,py27,py34,py35}-sqlite,{py34,py35}-mysqlclient,{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]
@@ -13,8 +13,10 @@ deps =
py34,py35: FormEncode >= 1.3.1
PyDispatcher>=2.0.4
py26,py27: egenix-mx-base
- mysql: mysql-python
+ mysqldb: mysql-python
mysqlclient: mysqlclient
+ mysql-connector: mysql-connector
+ py26,py27: oursql
postgres: psycopg2
passenv = CI TRAVIS TRAVIS_*
# Don't fail or warn on uninstalled commands
@@ -24,17 +26,59 @@ whitelist_externals =
dropdb
# MySQL test environments
-[mysql]
... 94 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-16 22:06:11
|
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 a038cb0153ffa2ed2c95d9d70db255ca8919dfe6 (commit)
via a631ca22d539e106f92f087cfafdeeb39203c735 (commit)
from e1d4f413811961e75bcfb924fdaf4dd92e074847 (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/a038cb0153ffa2ed2c95d9d70db255ca8919dfe6
commit a038cb0153ffa2ed2c95d9d70db255ca8919dfe6
Author: Oleg Broytman <ph...@ph...>
Date: Thu Nov 17 00:47:17 2016 +0300
oursql MySQL driver: tried but failed
[skip ci]
diff --git a/docs/TODO.rst b/docs/TODO.rst
index ba8c7d4..f8038cd 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -68,8 +68,6 @@ TODO
* Switch from setuptools to distribute.
-* oursql MySQL bindings: https://github.com/python-oursql/oursql
-
* MySQL Connector/Python: https://dev.mysql.com/doc/connector-python/en/
* Pure Python Mysql Interface: https://github.com/nasi/MyPy
http://sourceforge.net/p/sqlobject/sqlobject/ci/a631ca22d539e106f92f087cfafdeeb39203c735
commit a631ca22d539e106f92f087cfafdeeb39203c735
Author: Oleg Broytman <ph...@ph...>
Date: Thu Nov 17 00:46:16 2016 +0300
Prepare MySQLConnection to use different drivers
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index 3372ef1..df26f20 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -29,9 +29,16 @@ class MySQLConnection(DBAPI):
try:
if driver.lower() == 'mysqldb':
import 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
+ self.ER_DUP_ENTRY = MySQLdb.constants.ER.DUP_ENTRY
else:
raise ValueError(
'Unknown MySQL driver "%s", '
@@ -69,13 +76,10 @@ class MySQLConnection(DBAPI):
global mysql_Bin
if not PY2 and mysql_Bin is None:
- mysql_Bin = MySQLdb.Binary
- MySQLdb.Binary = lambda x: mysql_Bin(x).decode(
+ mysql_Bin = self.module.Binary
+ self.module.Binary = lambda x: mysql_Bin(x).decode(
'ascii', errors='surrogateescape')
- if self.module.version_info[:3] < (1, 2, 2):
- raise ValueError('SQLObject requires MySQLdb 1.2.2 or later')
-
self._server_version = None
self._can_use_microseconds = None
DBAPI.__init__(self, **kw)
@@ -89,17 +93,18 @@ class MySQLConnection(DBAPI):
def makeConnection(self):
dbEncoding = self.dbEncoding
if dbEncoding:
- from MySQLdb.connections import Connection
- if not hasattr(Connection, 'set_character_set'):
- # monkeypatch pre MySQLdb 1.2.1
- def character_set_name(self):
- return dbEncoding + '_' + dbEncoding
- Connection.character_set_name = character_set_name
+ if self.module.__name__ == 'MySQLdb':
+ from MySQLdb.connections import Connection
+ if not hasattr(Connection, 'set_character_set'):
+ # monkeypatch pre MySQLdb 1.2.1
+ def character_set_name(self):
+ return dbEncoding + '_' + dbEncoding
+ Connection.character_set_name = character_set_name
try:
conn = self.module.connect(
host=self.host, port=self.port, db=self.db,
user=self.user, passwd=self.password, **self.kw)
- if self.module.version_info[:3] >= (1, 2, 2):
+ if self.module.__name__ == 'MySQLdb':
# Attempt to reconnect. This setting is persistent.
conn.ping(True)
except self.module.OperationalError as e:
@@ -111,7 +116,7 @@ class MySQLConnection(DBAPI):
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if dbEncoding:
+ if dbEncoding and self.module.__name__ == 'MySQLdb':
if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
conn.set_character_set(dbEncoding)
else: # pre MySQLdb 1.2.1
@@ -141,8 +146,8 @@ class MySQLConnection(DBAPI):
try:
return cursor.execute(query)
except self.module.OperationalError as e:
- if e.args[0] in (self.module.constants.CR.SERVER_GONE_ERROR,
- self.module.constants.CR.SERVER_LOST):
+ if e.args[0] in (self.CR_SERVER_GONE_ERROR,
+ self.CR_SERVER_LOST):
if count == 2:
raise dberrors.OperationalError(ErrorMessage(e))
if self.debug:
@@ -151,7 +156,7 @@ class MySQLConnection(DBAPI):
raise dberrors.OperationalError(ErrorMessage(e))
except self.module.IntegrityError as e:
msg = ErrorMessage(e)
- if e.args[0] == self.module.constants.ER.DUP_ENTRY:
+ if e.args[0] == self.ER_DUP_ENTRY:
raise dberrors.DuplicateEntryError(msg)
else:
raise dberrors.IntegrityError(msg)
-----------------------------------------------------------------------
Summary of changes:
docs/TODO.rst | 2 -
sqlobject/mysql/mysqlconnection.py | 37 ++++++++++++++++++++---------------
2 files changed, 21 insertions(+), 18 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-15 20:28:47
|
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
discards 88f667cd6018b937beb21402b661e068f02f595c (commit)
discards 9a6e7646290decbb44a5759a2383765d46e14eb2 (commit)
discards a97208cd54a168d5e41f155c3a44eb17dc9a4471 (commit)
discards 512aa49fd39427157dbbfc724cc065bd405eba9b (commit)
via e1d4f413811961e75bcfb924fdaf4dd92e074847 (commit)
via 52b2e9d81c9905d60c71ffcdfa574aa78a1735ba (commit)
via 7b08fb1e0b8f3ef61f7fb3840fb74b5da36feb29 (commit)
via 61ce6b11d001e08f97885a7733248707f18622ff (commit)
via a34503c6f26a1c1ebcc5e919d298fc590ad4bc7d (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (88f667cd6018b937beb21402b661e068f02f595c)
\
N -- N -- N (e1d4f413811961e75bcfb924fdaf4dd92e074847)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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/e1d4f413811961e75bcfb924fdaf4dd92e074847
commit e1d4f413811961e75bcfb924fdaf4dd92e074847
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 21:17:32 2016 +0300
Ignore flake8 E305 error
E305: expected 2 blank lines after class or function definition, found 1.
We often group related statements separated with only one blank line.
diff --git a/setup.cfg b/setup.cfg
index de55225..4c5fd41 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -5,6 +5,8 @@ tag_svn_revision = 0
[flake8]
exclude = .git,.tox,docs/europython/*.py,ez_setup.py
+# E305: expected 2 blank lines after class or function definition, found 1
+ignore = E305
[bdist_wheel]
universal = 1
http://sourceforge.net/p/sqlobject/sqlobject/ci/52b2e9d81c9905d60c71ffcdfa574aa78a1735ba
commit 52b2e9d81c9905d60c71ffcdfa574aa78a1735ba
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 20:40:31 2016 +0300
Add ``driver`` keyword for MySQLConnection
Allowed value is 'mysqldb'.
diff --git a/docs/News.rst b/docs/News.rst
index 688d0bc..35c5e46 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -23,6 +23,8 @@ Minor features
* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or
'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that order.
+* Add ``driver`` keyword for MySQLConnection. Allowed value is 'mysqldb'.
+
Documentation
-------------
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index ccc4908..3372ef1 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -21,8 +21,28 @@ class MySQLConnection(DBAPI):
schemes = [dbName]
def __init__(self, db, user, password='', host='localhost', port=0, **kw):
- import MySQLdb, MySQLdb.constants.CR, MySQLdb.constants.ER # noqa
- self.module = MySQLdb
+ drivers = kw.pop('driver', None) or 'mysqldb'
+ for driver in drivers.split(','):
+ driver = driver.strip()
+ if not driver:
+ continue
+ try:
+ if driver.lower() == 'mysqldb':
+ import MySQLdb
+ import MySQLdb.constants.CR
+ import MySQLdb.constants.ER
+ self.module = MySQLdb
+ else:
+ raise ValueError(
+ 'Unknown MySQL driver "%s", '
+ 'expected mysqldb' % driver)
+ except ImportError:
+ pass
+ else:
+ break
+ else:
+ raise ImportError(
+ 'Cannot find a MySQL driver, tried %s' % drivers)
self.host = host
self.port = port
self.db = db
http://sourceforge.net/p/sqlobject/sqlobject/ci/7b08fb1e0b8f3ef61f7fb3840fb74b5da36feb29
commit 7b08fb1e0b8f3ef61f7fb3840fb74b5da36feb29
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 20:25:42 2016 +0300
Add ``driver`` keyword for FirebirdConnection
Allowed values are 'fdb' or 'kinterbasdb'.
Default is to test 'fdb' and 'kinterbasdb' in that order.
[skip ci] we do not have tests for Firebird.
diff --git a/docs/News.rst b/docs/News.rst
index 45b9ce4..688d0bc 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -20,6 +20,9 @@ Minor features
* Remove ``driver`` keyword from RdbhostConnection as it allows one driver
``rdbhdb``.
+* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or
+ 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that order.
+
Documentation
-------------
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index 2118bb4..cf4aed3 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -16,17 +16,34 @@ class FirebirdConnection(DBAPI):
def __init__(self, host, db, port='3050', user='sysdba',
password='masterkey', autoCommit=1,
dialect=None, role=None, charset=None, **kw):
- try:
- import fdb
- self.module = fdb
- except ImportError:
- import kinterbasdb
- # See http://kinterbasdb.sourceforge.net/dist_docs/usage.html
- # for an explanation; in short: use datetime, decimal and
- # unicode.
- kinterbasdb.init(type_conv=200)
- self.module = kinterbasdb
-
+ drivers = kw.pop('driver', None) or 'fdb,kinterbasdb'
+ for driver in drivers.split(','):
+ driver = driver.strip()
+ if not driver:
+ continue
+ try:
+ if driver == 'fdb':
+ import fdb
+ self.module = fdb
+ elif driver == 'kinterbasdb':
+ import kinterbasdb
+ # See
+ # http://kinterbasdb.sourceforge.net/dist_docs/usage.html
+ # for an explanation; in short: use datetime, decimal and
+ # unicode.
+ kinterbasdb.init(type_conv=200)
+ self.module = kinterbasdb
+ else:
+ raise ValueError(
+ 'Unknown FireBird driver "%s", '
+ 'expected fdb or kinterbasdb' % driver)
+ except ImportError:
+ pass
+ else:
+ break
+ else:
+ raise ImportError(
+ 'Cannot find an FireBird driver, tried %s' % drivers)
self.host = host
self.port = port
self.db = db
http://sourceforge.net/p/sqlobject/sqlobject/ci/61ce6b11d001e08f97885a7733248707f18622ff
commit 61ce6b11d001e08f97885a7733248707f18622ff
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 23:20:08 2016 +0300
Update news.
diff --git a/docs/News.rst b/docs/News.rst
index 7866d0b..45b9ce4 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -25,27 +25,23 @@ Documentation
* The docs are now generated with Sphinx.
-* Move docs/LICENSE to the top-level directory so that Github recognizes it.
+* Move ``docs/LICENSE`` to the top-level directory so that Github recognizes
+ it.
Tests
-----
-* Rename py.test -> pytest in tests and docs.
+* Rename ``py.test`` -> ``pytest`` in tests and docs.
-* Great Renaming: fix pytest warnings by renaming TestXXX classes
- to SOTestXXX to prevent pytest to recognize them as test classes.
+* Great Renaming: fix ``pytest`` warnings by renaming ``TestXXX`` classes
+ to ``SOTestXXX`` to prevent ``pytest`` to recognize them as test classes.
-* Fix pytest warnings by converting yield test to plain calls:
- yield test were deprecated in pytest.
+* Fix ``pytest`` warnings by converting yield tests to plain calls:
+ yield tests were deprecated in ``pytest``.
-* Tests are now run at CIs with python3.5.
+* Tests are now run at CIs with ``python3.5``.
-* Tests are split at Circle CI in 4 parallel containers.
-
-* Fix a problem in tests related to test order when running on PostgreSQL.
-
-* Restore mxDateTime installation in tox.ini
- (was removed while egenix.com was down).
+* Tests are split at ``Circle CI`` in 4 parallel containers.
SQLObject 3.1.0
===============
http://sourceforge.net/p/sqlobject/sqlobject/ci/a34503c6f26a1c1ebcc5e919d298fc590ad4bc7d
commit a34503c6f26a1c1ebcc5e919d298fc590ad4bc7d
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 20:11:55 2016 +0300
RdbhostConnection allows one driver ``rdbhdb``
No need to pass ``driver`` keyword, no need to loop
over a list of drivers of one driver.
[skip ci] we do not have tests for rdbhost.
diff --git a/docs/News.rst b/docs/News.rst
index 7804d70..7866d0b 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -13,10 +13,13 @@ SQLObject 3.2.0 (master)
Minor features
--------------
-* Dropped table name from ``VACUUM`` command in SQLiteConnection:
+* Drop table name from ``VACUUM`` command in SQLiteConnection:
SQLite doesn't vacuum a single table and SQLite 3.15 uses the supplied name
as the name of the attached database to vacuum.
+* Remove ``driver`` keyword from RdbhostConnection as it allows one driver
+ ``rdbhdb``.
+
Documentation
-------------
diff --git a/sqlobject/rdbhost/rdbhostconnection.py b/sqlobject/rdbhost/rdbhostconnection.py
index 1e67fa3..25200e9 100644
--- a/sqlobject/rdbhost/rdbhostconnection.py
+++ b/sqlobject/rdbhost/rdbhostconnection.py
@@ -15,34 +15,19 @@ class RdbhostConnection(PostgresConnection):
schemes = [dbName]
def __init__(self, dsn=None, host=None, port=None, db=None,
- user=None, password=None, unicodeCols=False, driver='rdbhost',
- **kw):
- drivers = driver
- for driver in drivers.split(','):
- driver = driver.strip()
- if not driver:
- continue
- try:
- if driver == 'rdbhost':
- from rdbhdb import rdbhdb as rdb
- # monkey patch % escaping into Cursor._execute
- old_execute = getattr(rdb.Cursor, '_execute')
- setattr(rdb.Cursor, '_old_execute', old_execute)
+ user=None, password=None, unicodeCols=False, **kw):
+ from rdbhdb import rdbhdb as rdb
+ # monkey patch % escaping into Cursor._execute
+ old_execute = getattr(rdb.Cursor, '_execute')
+ setattr(rdb.Cursor, '_old_execute', old_execute)
- def _execute(self, query, *args):
- assert not any([a for a in args])
- query = query.replace('%', '%%')
- self._old_execute(query, (), (), ())
- setattr(rdb.Cursor, '_execute', _execute)
- self.module = rdb
- else:
- raise ValueError('Unknown Rdbhost driver %s' % driver)
- except ImportError:
- pass
- else:
- break
- else:
- raise ImportError('Cannot find the Rdbhost driver')
+ def _execute(self, query, *args):
+ assert not any([a for a in args])
+ query = query.replace('%', '%%')
+ self._old_execute(query, (), (), ())
+ setattr(rdb.Cursor, '_execute', _execute)
+
+ self.module = rdb
self.user = user
self.host = host
self.port = port
-----------------------------------------------------------------------
Summary of changes:
docs/News.rst | 24 ++++++++++--------------
1 files changed, 10 insertions(+), 14 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-15 19:26:20
|
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 88f667cd6018b937beb21402b661e068f02f595c (commit)
via 9a6e7646290decbb44a5759a2383765d46e14eb2 (commit)
via a97208cd54a168d5e41f155c3a44eb17dc9a4471 (commit)
via 512aa49fd39427157dbbfc724cc065bd405eba9b (commit)
from 0ff72eaf5a436ba92bd037cd8f53d9acf241a7aa (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/88f667cd6018b937beb21402b661e068f02f595c
commit 88f667cd6018b937beb21402b661e068f02f595c
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 21:17:32 2016 +0300
Ignore flake8 E305 error
E305: expected 2 blank lines after class or function definition, found 1.
We often group related statements separated with only one blank line.
diff --git a/setup.cfg b/setup.cfg
index de55225..4c5fd41 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -5,6 +5,8 @@ tag_svn_revision = 0
[flake8]
exclude = .git,.tox,docs/europython/*.py,ez_setup.py
+# E305: expected 2 blank lines after class or function definition, found 1
+ignore = E305
[bdist_wheel]
universal = 1
http://sourceforge.net/p/sqlobject/sqlobject/ci/9a6e7646290decbb44a5759a2383765d46e14eb2
commit 9a6e7646290decbb44a5759a2383765d46e14eb2
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 20:40:31 2016 +0300
Add ``driver`` keyword for MySQLConnection
Allowed value is 'mysqldb'.
diff --git a/docs/News.rst b/docs/News.rst
index 8f2bc98..ac9c288 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -23,6 +23,8 @@ Minor features
* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or
'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that order.
+* Add ``driver`` keyword for MySQLConnection. Allowed value is 'mysqldb'.
+
Documentation
-------------
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index ccc4908..3372ef1 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -21,8 +21,28 @@ class MySQLConnection(DBAPI):
schemes = [dbName]
def __init__(self, db, user, password='', host='localhost', port=0, **kw):
- import MySQLdb, MySQLdb.constants.CR, MySQLdb.constants.ER # noqa
- self.module = MySQLdb
+ drivers = kw.pop('driver', None) or 'mysqldb'
+ for driver in drivers.split(','):
+ driver = driver.strip()
+ if not driver:
+ continue
+ try:
+ if driver.lower() == 'mysqldb':
+ import MySQLdb
+ import MySQLdb.constants.CR
+ import MySQLdb.constants.ER
+ self.module = MySQLdb
+ else:
+ raise ValueError(
+ 'Unknown MySQL driver "%s", '
+ 'expected mysqldb' % driver)
+ except ImportError:
+ pass
+ else:
+ break
+ else:
+ raise ImportError(
+ 'Cannot find a MySQL driver, tried %s' % drivers)
self.host = host
self.port = port
self.db = db
http://sourceforge.net/p/sqlobject/sqlobject/ci/a97208cd54a168d5e41f155c3a44eb17dc9a4471
commit a97208cd54a168d5e41f155c3a44eb17dc9a4471
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 20:25:42 2016 +0300
Add ``driver`` keyword for FirebirdConnection
Allowed values are 'fdb' or 'kinterbasdb'.
Default is to test 'fdb' and 'kinterbasdb' in that order.
[skip ci] we do not have tests for Firebird.
diff --git a/docs/News.rst b/docs/News.rst
index 06e61a8..8f2bc98 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -20,6 +20,9 @@ Minor features
* Remove ``driver`` keyword from RdbhostConnection as it allows one driver
``rdbhost``.
+* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or
+ 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that order.
+
Documentation
-------------
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index 2118bb4..cf4aed3 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -16,17 +16,34 @@ class FirebirdConnection(DBAPI):
def __init__(self, host, db, port='3050', user='sysdba',
password='masterkey', autoCommit=1,
dialect=None, role=None, charset=None, **kw):
- try:
- import fdb
- self.module = fdb
- except ImportError:
- import kinterbasdb
- # See http://kinterbasdb.sourceforge.net/dist_docs/usage.html
- # for an explanation; in short: use datetime, decimal and
- # unicode.
- kinterbasdb.init(type_conv=200)
- self.module = kinterbasdb
-
+ drivers = kw.pop('driver', None) or 'fdb,kinterbasdb'
+ for driver in drivers.split(','):
+ driver = driver.strip()
+ if not driver:
+ continue
+ try:
+ if driver == 'fdb':
+ import fdb
+ self.module = fdb
+ elif driver == 'kinterbasdb':
+ import kinterbasdb
+ # See
+ # http://kinterbasdb.sourceforge.net/dist_docs/usage.html
+ # for an explanation; in short: use datetime, decimal and
+ # unicode.
+ kinterbasdb.init(type_conv=200)
+ self.module = kinterbasdb
+ else:
+ raise ValueError(
+ 'Unknown FireBird driver "%s", '
+ 'expected fdb or kinterbasdb' % driver)
+ except ImportError:
+ pass
+ else:
+ break
+ else:
+ raise ImportError(
+ 'Cannot find an FireBird driver, tried %s' % drivers)
self.host = host
self.port = port
self.db = db
http://sourceforge.net/p/sqlobject/sqlobject/ci/512aa49fd39427157dbbfc724cc065bd405eba9b
commit 512aa49fd39427157dbbfc724cc065bd405eba9b
Author: Oleg Broytman <ph...@ph...>
Date: Tue Nov 15 20:11:55 2016 +0300
RdbhostConnection allows one driver ``rdbhost``
No need to pass ``driver`` keyword, no need to loop
over a list of drivers of one driver.
[skip ci] we do not have tests for rdbhost.
diff --git a/docs/News.rst b/docs/News.rst
index 7804d70..06e61a8 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -13,10 +13,13 @@ SQLObject 3.2.0 (master)
Minor features
--------------
-* Dropped table name from ``VACUUM`` command in SQLiteConnection:
+* Drop table name from ``VACUUM`` command in SQLiteConnection:
SQLite doesn't vacuum a single table and SQLite 3.15 uses the supplied name
as the name of the attached database to vacuum.
+* Remove ``driver`` keyword from RdbhostConnection as it allows one driver
+ ``rdbhost``.
+
Documentation
-------------
diff --git a/sqlobject/rdbhost/rdbhostconnection.py b/sqlobject/rdbhost/rdbhostconnection.py
index 1e67fa3..25200e9 100644
--- a/sqlobject/rdbhost/rdbhostconnection.py
+++ b/sqlobject/rdbhost/rdbhostconnection.py
@@ -15,34 +15,19 @@ class RdbhostConnection(PostgresConnection):
schemes = [dbName]
def __init__(self, dsn=None, host=None, port=None, db=None,
- user=None, password=None, unicodeCols=False, driver='rdbhost',
- **kw):
- drivers = driver
- for driver in drivers.split(','):
- driver = driver.strip()
- if not driver:
- continue
- try:
- if driver == 'rdbhost':
- from rdbhdb import rdbhdb as rdb
- # monkey patch % escaping into Cursor._execute
- old_execute = getattr(rdb.Cursor, '_execute')
- setattr(rdb.Cursor, '_old_execute', old_execute)
+ user=None, password=None, unicodeCols=False, **kw):
+ from rdbhdb import rdbhdb as rdb
+ # monkey patch % escaping into Cursor._execute
+ old_execute = getattr(rdb.Cursor, '_execute')
+ setattr(rdb.Cursor, '_old_execute', old_execute)
- def _execute(self, query, *args):
- assert not any([a for a in args])
- query = query.replace('%', '%%')
- self._old_execute(query, (), (), ())
- setattr(rdb.Cursor, '_execute', _execute)
- self.module = rdb
- else:
- raise ValueError('Unknown Rdbhost driver %s' % driver)
- except ImportError:
- pass
- else:
- break
- else:
- raise ImportError('Cannot find the Rdbhost driver')
+ def _execute(self, query, *args):
+ assert not any([a for a in args])
+ query = query.replace('%', '%%')
+ self._old_execute(query, (), (), ())
+ setattr(rdb.Cursor, '_execute', _execute)
+
+ self.module = rdb
self.user = user
self.host = host
self.port = port
-----------------------------------------------------------------------
Summary of changes:
docs/News.rst | 10 +++++++-
setup.cfg | 2 +
sqlobject/firebird/firebirdconnection.py | 39 +++++++++++++++++++++--------
sqlobject/mysql/mysqlconnection.py | 24 +++++++++++++++++-
sqlobject/rdbhost/rdbhostconnection.py | 39 +++++++++--------------------
5 files changed, 73 insertions(+), 41 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-06 16:29:54
|
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 0ff72eaf5a436ba92bd037cd8f53d9acf241a7aa (commit)
from a53bf5cf67d28063ae04c1359ca250b62af14f77 (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/0ff72eaf5a436ba92bd037cd8f53d9acf241a7aa
commit 0ff72eaf5a436ba92bd037cd8f53d9acf241a7aa
Author: Oleg Broytman <ph...@ph...>
Date: Sun Nov 6 19:20:59 2016 +0300
Fix indent in circle.yml
diff --git a/circle.yml b/circle.yml
index c491717..9e7c927 100644
--- a/circle.yml
+++ b/circle.yml
@@ -12,5 +12,5 @@ dependencies:
test:
override:
- - case $CIRCLE_NODE_INDEX in 0) tox -e '{py26,py27}-mysql,{py34,py35}-mysqlclient' ;; 1) tox -e '{py26,py27,py34,py35}-postgres' ;; 2) tox -e '{py26,py27,py34,py35}-sqlite' ;; 3) tox -e '{py27,py34}-flake8' ;; esac:
+ - case $CIRCLE_NODE_INDEX in 0) tox -e '{py26,py27}-mysql,{py34,py35}-mysqlclient' ;; 1) tox -e '{py26,py27,py34,py35}-postgres' ;; 2) tox -e '{py26,py27,py34,py35}-sqlite' ;; 3) tox -e '{py27,py34}-flake8' ;; esac:
parallel: true
-----------------------------------------------------------------------
Summary of changes:
circle.yml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-06 06:55:52
|
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 a53bf5cf67d28063ae04c1359ca250b62af14f77 (commit)
from 480a4b74efd7ebc159d35c51fbf004be0ed35000 (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/a53bf5cf67d28063ae04c1359ca250b62af14f77
commit a53bf5cf67d28063ae04c1359ca250b62af14f77
Author: Oleg Broytman <ph...@ph...>
Date: Sun Nov 6 09:48:51 2016 +0300
Declarative dependencies for Travis CI
diff --git a/.travis.yml b/.travis.yml
index 35efcec..fc8002b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,12 @@ language: python
cache: pip
addons:
+ apt:
+ packages:
+ - python-egenix-mxdatetime
+ - python-mysqldb
+ - python-psycopg2
+ - python3-psycopg2
postgresql: "9.4"
env:
@@ -24,10 +30,6 @@ env:
- TOXENV=py27-flake8
- TOXENV=py34-flake8
-before_install:
- - sudo apt-get -qq update
- - sudo apt-get install -y python-egenix-mxdatetime python-mysqldb python-psycopg2 python3-psycopg2
-
install: pip install tox coveralls codecov
matrix:
-----------------------------------------------------------------------
Summary of changes:
.travis.yml | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2016-11-03 20:04:29
|
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 480a4b74efd7ebc159d35c51fbf004be0ed35000 (commit)
from f1daa34948d7df70b150dc3a635f8ce9a41007c7 (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/480a4b74efd7ebc159d35c51fbf004be0ed35000
commit 480a4b74efd7ebc159d35c51fbf004be0ed35000
Author: Oleg Broytman <ph...@ph...>
Date: Thu Nov 3 23:02:36 2016 +0300
Fix reST links
diff --git a/docs/TODO.rst b/docs/TODO.rst
index 7a72de4..ba8c7d4 100644
--- a/docs/TODO.rst
+++ b/docs/TODO.rst
@@ -74,8 +74,8 @@ TODO
* Pure Python Mysql Interface: https://github.com/nasi/MyPy
-* Ultramysql `for Python2 <https://github.com/esnme/ultramysql>` and
- `Python3 <https://github.com/arpitbbhayani/umysql3>`.
+* Ultramysql `for Python2 <https://github.com/esnme/ultramysql>`_ and
+ `Python3 <https://github.com/arpitbbhayani/umysql3>`_.
* pg8000 driver: http://code.google.com/p/pg8000/
-----------------------------------------------------------------------
Summary of changes:
docs/TODO.rst | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
SQLObject development repository
|