[SQL-CVS] SQLObject development repository branch master updated. 3.3.0-7-g4c812a1
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <no...@so...> - 2017-05-16 22:25:36
|
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 4c812a1f79509ff84d254d253aabdac7747d4c1b (commit) via 7570514647628f6663e6fb35d8b1fa1b9f8cb2bd (commit) via c825a7874ed6f2506193f593fb09dc87cb55d5bd (commit) via 96bf0e6bfb88a71fe818ee6e27ea8c8f584c20d8 (commit) via bd45fb11ae33d224ef0eda473c63fcf064bce0d4 (commit) via 3d2bf5ad78eb1c58c8648f2d483377a6946d22cf (commit) from 1ba596182f377939a9b907d262d6ea9a40c1ea76 (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/4c812a1f79509ff84d254d253aabdac7747d4c1b commit 4c812a1f79509ff84d254d253aabdac7747d4c1b Author: Oleg Broytman <ph...@ph...> Date: Tue May 16 23:28:45 2017 +0300 Encode/decode binary values for PyGreSQL driver diff --git a/docs/News.rst b/docs/News.rst index 8ac2a86..0c10a22 100644 --- a/docs/News.rst +++ b/docs/News.rst @@ -13,6 +13,8 @@ SQLObject 3.4.0 (master) * Python 2.6 is no longer supported. The minimal supported version is Python 2.7. +* Encode/decode binary values for PyGreSQL driver. + SQLObject 3.3.0 =============== diff --git a/sqlobject/col.py b/sqlobject/col.py index 0f35862..6ee5e98 100644 --- a/sqlobject/col.py +++ b/sqlobject/col.py @@ -1770,6 +1770,9 @@ class BinaryValidator(SOValidator): if isinstance(value, str): if not PY2 and dbName == "mysql": value = value.encode('ascii', errors='surrogateescape') + if dbName == "postgres" and connection.driver == 'pygresql': + from pg import unescape_bytea + value = unescape_bytea(value) if dbName == "sqlite": if not PY2: value = bytes(value, 'ascii') diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py index bf22a9c..855a5cf 100644 --- a/sqlobject/postgres/pgconnection.py +++ b/sqlobject/postgres/pgconnection.py @@ -85,6 +85,10 @@ class PostgresConnection(DBAPI): # Register a converter for psycopg Binary type. registerConverter(type(self.module.Binary('')), PsycoBinaryConverter) + elif driver == 'pygresql': + from pg import escape_bytea + self.createBinary = \ + lambda value, escape_bytea=escape_bytea: escape_bytea(value) elif type(self.module.Binary) in ( type, type(PostgresBinaryConverter)) and \ type(self.module.Binary(b'')) not in (bytes, unicode_type): http://sourceforge.net/p/sqlobject/sqlobject/ci/7570514647628f6663e6fb35d8b1fa1b9f8cb2bd commit 7570514647628f6663e6fb35d8b1fa1b9f8cb2bd Author: Oleg Broytman <ph...@ph...> Date: Tue May 16 23:28:11 2017 +0300 Micro refactoring in BinaryValidator.to_python diff --git a/sqlobject/col.py b/sqlobject/col.py index e5f5301..0f35862 100644 --- a/sqlobject/col.py +++ b/sqlobject/col.py @@ -1768,12 +1768,12 @@ class BinaryValidator(SOValidator): dbName = connection.dbName binaryType = connection._binaryType if isinstance(value, str): + if not PY2 and dbName == "mysql": + value = value.encode('ascii', errors='surrogateescape') if dbName == "sqlite": if not PY2: value = bytes(value, 'ascii') value = connection.module.decode(value) - if dbName == "mysql" and not PY2: - value = value.encode('ascii', errors='surrogateescape') return value if isinstance(value, bytes): return value http://sourceforge.net/p/sqlobject/sqlobject/ci/c825a7874ed6f2506193f593fb09dc87cb55d5bd commit c825a7874ed6f2506193f593fb09dc87cb55d5bd Author: Oleg Broytman <ph...@ph...> Date: Tue May 16 00:26:09 2017 +0300 Fix: Do not register PostgresBinaryConverter for bytes and unicode Avoid recursion in sqlrepr(Binary(value), 'postgres'). diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py index 63bd17a..bf22a9c 100644 --- a/sqlobject/postgres/pgconnection.py +++ b/sqlobject/postgres/pgconnection.py @@ -2,7 +2,7 @@ import re from sqlobject import col from sqlobject import dberrors from sqlobject import sqlbuilder -from sqlobject.compat import PY2 +from sqlobject.compat import PY2, unicode_type from sqlobject.converters import registerConverter, sqlrepr from sqlobject.dbconnection import DBAPI @@ -85,7 +85,9 @@ class PostgresConnection(DBAPI): # Register a converter for psycopg Binary type. registerConverter(type(self.module.Binary('')), PsycoBinaryConverter) - elif type(self.module.Binary) in (type, type(PostgresBinaryConverter)): + elif type(self.module.Binary) in ( + type, type(PostgresBinaryConverter)) and \ + type(self.module.Binary(b'')) not in (bytes, unicode_type): # Register a converter for Binary type. registerConverter(type(self.module.Binary(b'')), PostgresBinaryConverter) http://sourceforge.net/p/sqlobject/sqlobject/ci/96bf0e6bfb88a71fe818ee6e27ea8c8f584c20d8 commit 96bf0e6bfb88a71fe818ee6e27ea8c8f584c20d8 Author: Oleg Broytman <ph...@ph...> Date: Sun May 7 14:53:05 2017 +0300 Move hard requirements from tox.ini to requirements.txt Move test requirements to requirements_tests.txt. diff --git a/tox.ini b/tox.ini index 792dde2..6cf2dea 100644 --- a/tox.ini +++ b/tox.ini @@ -15,11 +15,7 @@ commands = {envpython} --version {envpython} -c "import struct; print(struct.calcsize('P') * 8)" deps = - pytest - pytest-cov - py27: FormEncode >= 1.1.1, != 1.3.0 - py{34,35,36}: FormEncode >= 1.3.1 - PyDispatcher>=2.0.4 + -rdevscripts/requirements/requirements_tests.txt py27: egenix-mx-base mssql-pyodbc: pytest-timeout mysqldb: mysql-python http://sourceforge.net/p/sqlobject/sqlobject/ci/bd45fb11ae33d224ef0eda473c63fcf064bce0d4 commit bd45fb11ae33d224ef0eda473c63fcf064bce0d4 Author: Oleg Broytman <ph...@ph...> Date: Sun May 7 14:42:47 2017 +0300 Move requirements.txt to devscripts/ Rename requirements_dev.txt to requirements_test.txt. Split requirements_test.txt intto requirements_tox.txt. [skip ci] diff --git a/requirements.txt b/devscripts/requirements/requirements.txt similarity index 100% rename from requirements.txt rename to devscripts/requirements/requirements.txt diff --git a/requirements_docs.txt b/devscripts/requirements/requirements_docs.txt similarity index 100% rename from requirements_docs.txt rename to devscripts/requirements/requirements_docs.txt diff --git a/requirements_dev.txt b/devscripts/requirements/requirements_tests.txt similarity index 78% rename from requirements_dev.txt rename to devscripts/requirements/requirements_tests.txt index ca2ff5d..8e890d8 100644 --- a/requirements_dev.txt +++ b/devscripts/requirements/requirements_tests.txt @@ -2,4 +2,3 @@ pytest pytest-cov -tox >= 1.8 diff --git a/devscripts/requirements/requirements_tox.txt b/devscripts/requirements/requirements_tox.txt new file mode 100644 index 0000000..9927ea4 --- /dev/null +++ b/devscripts/requirements/requirements_tox.txt @@ -0,0 +1 @@ +tox >= 1.8 http://sourceforge.net/p/sqlobject/sqlobject/ci/3d2bf5ad78eb1c58c8648f2d483377a6946d22cf commit 3d2bf5ad78eb1c58c8648f2d483377a6946d22cf Author: Oleg Broytman <ph...@ph...> Date: Sun May 7 17:43:42 2017 +0300 Stop supporting Python 2.6 diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst index 46dc308..2bf4927 100644 --- a/ANNOUNCE.rst +++ b/ANNOUNCE.rst @@ -38,7 +38,7 @@ easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). -Python 2.6, 2.7 or 3.4+ is required. +Python 2.7 or 3.4+ is required. Where is SQLObject diff --git a/README.rst b/README.rst index 0ba1341..43c457d 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -SQLObject 3.3.0 -=============== +SQLObject 3.4.0a0 +================= Thanks for looking at SQLObject. SQLObject is an object-relational mapper, i.e., a library that will wrap your database tables in Python @@ -7,7 +7,7 @@ classes, and your rows in Python instances. It currently supports MySQL through the `MySQLdb` package, PostgreSQL through the `psycopg` package, SQLite, Firebird, MaxDB (SAP DB), MS SQL, -Sybase and Rdbhost. Python 2.6, 2.7 or 3.4+ is required. +Sybase and Rdbhost. Python 2.7 or 3.4+ is required. For more information please see the documentation in `<docs/SQLObject.rst>`_, or online at http://sqlobject.org/ diff --git a/devscripts/release b/devscripts/release index 0e24a8a..6c92d3a 100755 --- a/devscripts/release +++ b/devscripts/release @@ -11,7 +11,7 @@ python setup.py build_py && python setup.py build --executable '/usr/bin/env python' && python setup.py sdist && -for py in 2.6 2.7 3.4 3.5 3.6; do +for py in 2.7 3.4 3.5 3.6; do find build -name '*.py[co]' -delete && python$py setup.py build_py && python$py setup.py build --executable '/usr/bin/env python' && diff --git a/devscripts/run-all-tests b/devscripts/run-all-tests index 80b2e1a..da6dbe4 100755 --- a/devscripts/run-all-tests +++ b/devscripts/run-all-tests @@ -3,7 +3,7 @@ cd "`dirname \"$0\"`"/SQLObject && SO_DIR="`dirname $0`" -for py_ver in 2.6 2.7 3.4 3.5 3.6; do +for py_ver in 2.7 3.4 3.5 3.6; do echo "---------- PYTHON $py_ver "$1" ----------" "$SO_DIR"/cleanup && PY_VER=$py_ver "$SO_DIR"/run-tests-"$1" \ diff --git a/devscripts/setup b/devscripts/setup index 946696e..4edd679 100755 --- a/devscripts/setup +++ b/devscripts/setup @@ -3,7 +3,6 @@ umask 022 # -rwxr-xr-x cd "`dirname \"$0\"`"/SQLObject && -python2.6 setup.py install -O2 && for py_ver in 2.7 3.4 3.5 3.6; do python$py_ver -m pip install --install-option=-O2 --upgrade . done && diff --git a/docs/News.rst b/docs/News.rst index b307bee..8ac2a86 100644 --- a/docs/News.rst +++ b/docs/News.rst @@ -10,6 +10,9 @@ News SQLObject 3.4.0 (master) ======================== +* Python 2.6 is no longer supported. The minimal supported version is + Python 2.7. + SQLObject 3.3.0 =============== diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst index e1b9622..e1f9b43 100644 --- a/docs/SQLObject.rst +++ b/docs/SQLObject.rst @@ -82,7 +82,7 @@ FreeTDS_) or adodbapi_ (Win32). .. _FreeTDS: http://www.freetds.org/ .. _adodbapi: http://adodbapi.sourceforge.net/ -Python 2.6, 2.7 or 3.4+ is required. +Python 2.7 or 3.4+ is required. Compared To Other Database Wrappers =================================== diff --git a/docs/TODO.rst b/docs/TODO.rst index 3bf6a66..2ae19ac 100644 --- a/docs/TODO.rst +++ b/docs/TODO.rst @@ -1,8 +1,6 @@ TODO ---- -* Stop supporting Python 2.6. Fix dbconnection.py and joins.py. - * PyPy. * Quote table/column names that are reserved keywords (order => "order", diff --git a/requirements.txt b/requirements.txt index 220e308..b8113c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ --install-option=-O2 -FormEncode >= 1.1.1, != 1.3.0; python_version >= '2.6' and python_version < '3.0' +FormEncode >= 1.1.1, != 1.3.0; python_version >= '2.7' and python_version < '3.0' FormEncode >= 1.3.1; python_version >= '3.4' PyDispatcher >= 2.0.4 diff --git a/setup.py b/setup.py index 640ab22..ad3814c 100755 --- a/setup.py +++ b/setup.py @@ -28,12 +28,12 @@ if is_setuptools: main = sqlobject.wsgi_middleware:make_middleware """ install_requires = [] - if (sys.version_info[0] == 2) and (sys.version_info[:2] >= (2, 6)): + if (sys.version_info[:2] == (2, 7)): install_requires.append("FormEncode>=1.1.1,!=1.3.0") elif (sys.version_info[0] == 3) and (sys.version_info[:2] >= (3, 4)): install_requires.append("FormEncode>=1.3.1") else: - raise ImportError("SQLObject requires Python 2.6, 2.7 or 3.4+") + raise ImportError("SQLObject requires Python 2.7 or 3.4+") install_requires.append("PyDispatcher>=2.0.4") kw['install_requires'] = install_requires kw['extras_require'] = { @@ -59,7 +59,7 @@ more abstract, and provides substantial database independence for applications. Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (SAPDB). -Python 2.6, 2.7 or 3.4+ is required. +Python 2.7 or 3.4+ is required. For development see the projects at `SourceForge <https://sourceforge.net/projects/sqlobject/>`_ @@ -75,7 +75,6 @@ and `GitHub <https://github.com/sqlobject>`_. "GNU Library or Lesser General Public License (LGPL)", "Programming Language :: Python", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", @@ -161,7 +160,7 @@ easy to use and quick to get started with. It currently supports MySQL through the `MySQLdb` package, PostgreSQL through the `psycopg` package, SQLite, Firebird, MaxDB (SAP DB), MS SQL -Sybase and Rdbhost. Python 2.6, 2.7 or 3.4+ is required. +Sybase and Rdbhost. Python 2.7 or 3.4+ is required. Where is SQLObject diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py index 89f4382..ff905f6 100644 --- a/sqlobject/dbconnection.py +++ b/sqlobject/dbconnection.py @@ -210,12 +210,6 @@ class DBConnection: @staticmethod def _parseURI(uri): parsed = urlparse(uri) - if sys.version_info[0:2] == (2, 6): - # In python 2.6, urlparse only parses the uri completely - # for certain schemes, so we force the scheme to - # something that will be parsed correctly - scheme = parsed.scheme - parsed = urlparse(uri.replace(scheme, 'http', 1)) host, path = parsed.hostname, parsed.path user, password, port = None, None, None if parsed.username: diff --git a/sqlobject/joins.py b/sqlobject/joins.py index 675beb7..c847e21 100644 --- a/sqlobject/joins.py +++ b/sqlobject/joins.py @@ -102,8 +102,7 @@ class SOJoin(object): class MinType(object): """Sort less than everything, for handling None's in the results""" - # functools.total_ordering would simplify this, but isn't available - # for python 2.6 + # functools.total_ordering would simplify this def __lt__(self, other): if self is other: diff --git a/sqlobject/main.py b/sqlobject/main.py index cb262ad..88b3c0c 100644 --- a/sqlobject/main.py +++ b/sqlobject/main.py @@ -43,9 +43,9 @@ from .sresults import SelectResults from .util.threadinglocal import local from sqlobject.compat import PY2, with_metaclass, string_type, unicode_type -if ((sys.version_info[0] == 2) and (sys.version_info[:2] < (2, 6))) or \ +if ((sys.version_info[0] == 2) and (sys.version_info[:2] < (2, 7))) or \ ((sys.version_info[0] == 3) and (sys.version_info[:2] < (3, 4))): - raise ImportError("SQLObject requires Python 2.6, 2.7 or 3.4+") + raise ImportError("SQLObject requires Python 2.7 or 3.4+") if not PY2: # alias for python 3 compatability @@ -693,9 +693,9 @@ def deprecated(message, level=1, stacklevel=2): if warnings_level is not None and warnings_level <= level: warnings.warn(message, DeprecationWarning, stacklevel=stacklevel) -if sys.version_info[:2] < (2, 7): - deprecated("Support for Python 2.6 has been declared obsolete " - "and will be removed in the next release of SQLObject") +# if sys.version_info[:2] < (2, 7): +# deprecated("Support for Python 2.6 has been declared obsolete " +# "and will be removed in the next release of SQLObject") def setDeprecationLevel(warning=1, exception=None): diff --git a/tox.ini b/tox.ini index 36a5422..792dde2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,12 @@ [tox] minversion = 1.8 -envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35,36}-{mysqlclient,pypostgresql},py{26,27,34,35,36}-{mysql-connector,pymysql,mysql-pyodbc,mysql-pypyodbc,postgres-psycopg,postgres-pygresql,postgres-pyodbc,postgres-pypyodbc,sqlite,sqlite-memory},py{27,34,35,36}-{firebird-fdb,firebirdsql},py{27,34}-flake8,py{27,34,35,36}-{mssql-pyodbc,mysql-connector,mysql-pyodbc,mysql-pypyodbc,postgres-psycopg,postgres-pyodbc,postgres-pypyodbc,sqlite,sqlite-memory}-w32 +envlist = py27-{mysqldb,mysql-oursql},py{34,35,36}-{mysqlclient,pypostgresql},py{27,34,35,36}-{mysql-connector,pymysql,mysql-pyodbc,mysql-pypyodbc,postgres-psycopg,postgres-pygresql,postgres-pyodbc,postgres-pypyodbc,sqlite,sqlite-memory},py{27,34,35,36}-{firebird-fdb,firebirdsql},py{27,34}-flake8,py{27,34,35,36}-{mssql-pyodbc,mysql-connector,mysql-pyodbc,mysql-pypyodbc,postgres-psycopg,postgres-pyodbc,postgres-pypyodbc,sqlite,sqlite-memory}-w32 # Base test environment settings [testenv] # Ensure we cd into sqlobject before running the tests changedir = ./sqlobject/ basepython = - py26: {env:TOXPYTHON:python2.6} py27: {env:TOXPYTHON:python2.7} py34: {env:TOXPYTHON:python3.4} py35: {env:TOXPYTHON:python3.5} @@ -18,10 +17,10 @@ commands = deps = pytest pytest-cov - py{26,27}: FormEncode >= 1.1.1, != 1.3.0 + py27: FormEncode >= 1.1.1, != 1.3.0 py{34,35,36}: FormEncode >= 1.3.1 PyDispatcher>=2.0.4 - py{26,27}: egenix-mx-base + py27: egenix-mx-base mssql-pyodbc: pytest-timeout mysqldb: mysql-python mysqlclient: mysqlclient @@ -55,9 +54,6 @@ commands = pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=mysqldb&debug=1 mysql -e 'drop database sqlobject_test;' -[testenv:py26-mysqldb] -commands = {[mysqldb]commands} - [testenv:py27-mysqldb] commands = {[mysqldb]commands} @@ -86,9 +82,6 @@ commands = 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] -commands = {[mysql-connector]commands} - [testenv:py27-mysql-connector] commands = {[mysql-connector]commands} @@ -109,9 +102,6 @@ commands = 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] -commands = {[oursql]commands} - [testenv:py27-mysql-oursql] commands = {[oursql]commands} @@ -123,9 +113,6 @@ commands = pytest --cov=sqlobject -D mysql://root:@localhost/sqlobject_test?driver=pymysql&charset=utf8&debug=1 mysql -e 'drop database sqlobject_test;' -[testenv:py26-pymysql] -commands = {[pymysql]commands} ... 132 lines suppressed ... hooks/post-receive -- SQLObject development repository |