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 bfcc0f135bb0008692bf57ad3e31e8aeb08b8c8a (commit)
via 9429cdd5f33d7293fb1f751f9e88a61d3071674e (commit)
via 48eb837ded57b314f73d2dc7f4bf1defcdc2ec9a (commit)
via 07e74e51d5877217aa6af5413371a6e5ac1055b6 (commit)
via 8fb726180c7c0a1a60003efc8ba45edcc79b5e20 (commit)
via cf96c5e4974cd2241f182e61abd955bdc189fa8c (commit)
via d365886888d1fcde1c7886a09493b5f1ec7ad8a7 (commit)
via ba965063611f185dff46d0bb27659408efef1c6c (commit)
from f34450feec071f0b9495d0919b929d06204b4eea (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/bfcc0f135bb0008692bf57ad3e31e8aeb08b8c8a
commit bfcc0f135bb0008692bf57ad3e31e8aeb08b8c8a
Author: Oleg Broytman <ph...@ph...>
Date: Thu Sep 26 13:45:50 2024 +0300
Build(requirements): Fix Python version at 2.7
There will never be 2.8.
[skip ci]
diff --git a/devscripts/requirements/requirements.txt b/devscripts/requirements/requirements.txt
index befc10e..ce36de2 100644
--- a/devscripts/requirements/requirements.txt
+++ b/devscripts/requirements/requirements.txt
@@ -1,7 +1,7 @@
# DateTime from Zope
DateTime
-FormEncode >= 1.1.1, != 1.3.0; python_version >= '2.7' and python_version < '3.0'
+FormEncode >= 1.1.1, != 1.3.0; python_version == '2.7'
FormEncode >= 1.3.1; python_version >= '3.4' and python_version < '3.13'
git+https://github.com/formencode/formencode.git; python_version >= '3.13'
http://sourceforge.net/p/sqlobject/sqlobject/ci/9429cdd5f33d7293fb1f751f9e88a61d3071674e
commit 9429cdd5f33d7293fb1f751f9e88a61d3071674e
Author: Oleg Broytman <ph...@ph...>
Date: Wed Sep 25 18:37:46 2024 +0300
Tests(test_exceptions): Fix under SQLite
diff --git a/docs/News.rst b/docs/News.rst
index a4c11e1..6685d9c 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -21,7 +21,7 @@ Tests
* Run tests with Python 3.13.
-* Fix ``test_exceptions.py``: MariaDB returns a different error code.
+* Fix ``test_exceptions.py`` under MariaDB, PostgreSQL and SQLite.
CI
--
diff --git a/sqlobject/tests/test_exceptions.py b/sqlobject/tests/test_exceptions.py
index 7299191..169ca18 100644
--- a/sqlobject/tests/test_exceptions.py
+++ b/sqlobject/tests/test_exceptions.py
@@ -1,6 +1,7 @@
import pytest
from sqlobject import SQLObject, StringCol
-from sqlobject.dberrors import DuplicateEntryError, ProgrammingError
+from sqlobject.dberrors import DuplicateEntryError, OperationalError, \
+ ProgrammingError
from sqlobject.tests.dbtest import getConnection, raises, setupClass, supports
@@ -30,5 +31,7 @@ def test_exceptions():
list(SOTestExceptionWithNonexistingTable.select())
except ProgrammingError as e:
assert e.args[0].code in (1146, '42P01')
+ except OperationalError:
+ assert connection.dbName == 'sqlite'
else:
assert False, "DID NOT RAISE"
http://sourceforge.net/p/sqlobject/sqlobject/ci/48eb837ded57b314f73d2dc7f4bf1defcdc2ec9a
commit 48eb837ded57b314f73d2dc7f4bf1defcdc2ec9a
Author: Oleg Broytman <ph...@ph...>
Date: Wed Sep 25 18:12:16 2024 +0300
Fix(Pg): Minor fix in getting error code from PyGreSQL
diff --git a/docs/News.rst b/docs/News.rst
index fd0fbdf..a4c11e1 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -14,6 +14,8 @@ Drivers
* Separate ``psycopg`` and ``psycopg2``;
``psycopg`` is actually ``psycopg3`` now.
+* Minor fix in getting error code from PyGreSQL.
+
Tests
-----
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 87921c2..bb76afa 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -21,6 +21,9 @@ class ErrorMessage(str):
# pg8000 for Python 3.5+
ecode = eargs0['C']
eerror = emessage = eargs0['M']
+ elif e.__module__ == 'pg': # PyGreSQL
+ ecode = e.sqlstate
+ eerror = emessage = e.args[0]
elif hasattr(e, 'pgcode'): # psycopg2 or psycopg2.errors
ecode = getattr(e, 'pgcode', None)
eerror = getattr(e, 'pgerror', None)
http://sourceforge.net/p/sqlobject/sqlobject/ci/07e74e51d5877217aa6af5413371a6e5ac1055b6
commit 07e74e51d5877217aa6af5413371a6e5ac1055b6
Author: Oleg Broytman <ph...@ph...>
Date: Wed Sep 25 17:45:32 2024 +0300
Tests(test_exceptions): MariaDB returns a different error code
diff --git a/docs/News.rst b/docs/News.rst
index 6e4fbeb..fd0fbdf 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -19,6 +19,8 @@ Tests
* Run tests with Python 3.13.
+* Fix ``test_exceptions.py``: MariaDB returns a different error code.
+
CI
--
diff --git a/sqlobject/tests/test_exceptions.py b/sqlobject/tests/test_exceptions.py
index 86559ef..7299191 100644
--- a/sqlobject/tests/test_exceptions.py
+++ b/sqlobject/tests/test_exceptions.py
@@ -29,6 +29,6 @@ def test_exceptions():
try:
list(SOTestExceptionWithNonexistingTable.select())
except ProgrammingError as e:
- assert e.args[0].code == '42P01'
+ assert e.args[0].code in (1146, '42P01')
else:
assert False, "DID NOT RAISE"
http://sourceforge.net/p/sqlobject/sqlobject/ci/8fb726180c7c0a1a60003efc8ba45edcc79b5e20
commit 8fb726180c7c0a1a60003efc8ba45edcc79b5e20
Author: Oleg Broytman <ph...@ph...>
Date: Wed Sep 25 16:53:58 2024 +0300
Feat(Pg): Separate `psycopg` and `psycopg2`
diff --git a/docs/News.rst b/docs/News.rst
index 631d418..6e4fbeb 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -8,6 +8,12 @@ News
SQLObject (master)
==================
+Drivers
+-------
+
+* Separate ``psycopg`` and ``psycopg2``;
+ ``psycopg`` is actually ``psycopg3`` now.
+
Tests
-----
diff --git a/docs/SQLObject.rst b/docs/SQLObject.rst
index e67aea2..94a4142 100644
--- a/docs/SQLObject.rst
+++ b/docs/SQLObject.rst
@@ -49,13 +49,13 @@ Requirements
Currently SQLObject supports MySQL_ and MariaDB_ via MySQLdb_ aka
MySQL-python (called mysqlclient_ for Python 3), `MySQL Connector`_,
oursql_, PyMySQL_, `mariadb connector`_, PyODBC_ and PyPyODBC_. For
-PostgreSQL_ psycopg2_ is recommended; PyGreSQL_, py-postgresql_ and pg8000_
-are supported; SQLite_ has a built-in driver or PySQLite_.
-Firebird_ is supported via fdb_ or kinterbasdb_; pyfirebirdsql_ is
-supported but has problems. `MAX DB`_ (also known as SAP DB) is supported
-via sapdb_. Sybase via Sybase_. `MSSQL Server`_ via pymssql_ (+ FreeTDS_)
-or adodbapi_ (Win32). PyODBC_ and PyPyODBC_ are supported for MySQL,
-PostgreSQL and MSSQL but have problems (not all tests passed).
+PostgreSQL_ psycopg_ and psycopg2_ are recommended; PyGreSQL_,
+py-postgresql_ and pg8000_ are supported; SQLite_ has a built-in driver or
+PySQLite_. Firebird_ is supported via fdb_ or kinterbasdb_; pyfirebirdsql_
+is supported but has problems. `MAX DB`_ (also known as SAP DB) is
+supported via sapdb_. Sybase via Sybase_. `MSSQL Server`_ via pymssql_ (+
+FreeTDS_) or adodbapi_ (Win32). PyODBC_ and PyPyODBC_ are supported for
+MySQL, PostgreSQL and MSSQL but have problems (not all tests passed).
.. _MySQL: https://www.mysql.com/
.. _MariaDB: https://mariadb.org/
@@ -66,7 +66,8 @@ PostgreSQL and MSSQL but have problems (not all tests passed).
.. _PyMySQL: https://github.com/PyMySQL/PyMySQL/
.. _mariadb connector: https://pypi.org/project/mariadb/
.. _PostgreSQL: https://postgresql.org
-.. _psycopg2: http://initd.org/psycopg/
+.. _psycopg: https://pypi.org/project/psycopg/
+.. _psycopg2: https://www.psycopg.org/
.. _PyGreSQL: http://www.pygresql.org/
.. _py-postgresql: https://pypi.org/project/py-postgresql/
.. _pg8000: https://pypi.org/project/pg8000/
@@ -1843,9 +1844,9 @@ PostgresConnection supports transactions and all other features.
The user can choose a DB API driver for PostgreSQL by using a ``driver``
parameter in DB URI or PostgresConnection that can be a comma-separated
-list of driver names. Possible drivers are: ``psycopg2``,
-``psycopg`` (alias for ``psycopg2``), ``pygresql``, ``pypostgresql``,
-``pg8000``, ``pyodbc``, ``pypyodbc`` or ``odbc`` (try ``pyodbc`` and
+list of driver names. Possible drivers are: ``psycopg``, ``psycopg2``,
+``pygresql``, ``pypostgresql``, ``pg8000``,
+``pyodbc``, ``pypyodbc`` or ``odbc`` (try ``pyodbc`` and
``pypyodbc``). Default is ``psycopg``.
Connection-specific parameters are: ``sslmode``, ``unicodeCols``,
diff --git a/docs/download.rst b/docs/download.rst
index 77f4615..bc28315 100644
--- a/docs/download.rst
+++ b/docs/download.rst
@@ -73,7 +73,8 @@ pyodbc pypyodbc odbc (synonym for pyodbc)
PostgreSQL
^^^^^^^^^^
-psycopg2 psycopg postgres postgresql (synonyms for psycopg2)
+psycopg
+psycopg2 postgres postgresql (synonyms for psycopg2)
pygresql pypostgresql py-postgresql pg8000
SQLite
diff --git a/setup.py b/setup.py
index 356331c..e90c10f 100755
--- a/setup.py
+++ b/setup.py
@@ -134,8 +134,8 @@ and `GitHub <https://github.com/sqlobject>`_.
'pyodbc': ['pyodbc'],
'pypyodbc': ['pypyodbc'],
# PostgreSQL
+ 'psycopg:python_version>="3.6"': ['psycopg[binary]'],
'psycopg2': ['psycopg2'],
- 'psycopg': ['psycopg2'],
'postgres': ['psycopg2'],
'postgresql': ['psycopg2'],
'pygresql': ['pygresql'],
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 5bc6778..87921c2 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -60,9 +60,12 @@ class PostgresConnection(DBAPI):
if not driver:
continue
try:
- if driver in ('psycopg', 'psycopg2'):
- import psycopg2 as psycopg
+ if driver == 'psycopg':
+ import psycopg
self.module = psycopg
+ elif driver == 'psycopg2':
+ import psycopg2
+ self.module = psycopg2
elif driver == 'pygresql':
import pgdb
self.module = pgdb
@@ -133,7 +136,10 @@ class PostgresConnection(DBAPI):
else:
dsn_dict["port"] = port
if db:
- dsn_dict["database"] = db
+ if driver == 'psycopg':
+ dsn_dict["dbname"] = db
+ else:
+ dsn_dict["database"] = db
if user:
dsn_dict["user"] = user
if password:
diff --git a/sqlobject/tests/test_exceptions.py b/sqlobject/tests/test_exceptions.py
index 42dd134..86559ef 100644
--- a/sqlobject/tests/test_exceptions.py
+++ b/sqlobject/tests/test_exceptions.py
@@ -25,8 +25,6 @@ def test_exceptions():
raises(DuplicateEntryError, SOTestException, name="test")
connection = getConnection()
- if connection.module.__name__ != 'psycopg2':
- return
SOTestExceptionWithNonexistingTable.setConnection(connection)
try:
list(SOTestExceptionWithNonexistingTable.select())
diff --git a/tox.ini b/tox.ini
index 91dce16..1b64b4c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -22,8 +22,9 @@ deps =
mysql-oursql3: git+https://github.com/sqlobject/oursql.git@py3k#egg=oursql
pymysql: -rdevscripts/requirements/requirements_pymysql.txt
mariadb: mariadb
- py34-psycopg: psycopg2-binary==2.8.4
- !py34-psycopg: psycopg2-binary
+ psycopg: psycopg[binary]
+ py34-psycopg2: psycopg2-binary==2.8.4
+ !py34-psycopg2: psycopg2-binary
pygresql: -rdevscripts/requirements/requirements_pygresql.txt
pypostgresql: git+https://github.com/sqlobject/py-postgresql.git@combined-fixes#egg=py-postgresql
pg8000: -rdevscripts/requirements/requirements_pg8000.txt
@@ -200,13 +201,24 @@ commands =
pytest -D "postgres://runner:test@localhost/sqlobject_test?driver=psycopg&charset=utf-8&debug=1"
dropdb --username=runner --no-password sqlobject_test
-[testenv:py27-postgres-psycopg]
+[testenv:py3{6,7,8,9,10,11,12}-postgres-psycopg-noauto]
+commands = {[psycopg]commands}
+
+[psycopg2]
+commands =
+ {[testenv]commands}
+ -dropdb --username=runner --no-password sqlobject_test
+ createdb --username=runner --no-password sqlobject_test
+ pytest -D "postgres://runner:test@localhost/sqlobject_test?driver=psycopg2&charset=utf-8&debug=1"
+ dropdb --username=runner --no-password sqlobject_test
+
+[testenv:py27-postgres-psycopg2]
commands =
easy_install -i https://downloads.egenix.com/python/index/ucs2/ egenix-mx-base
- {[psycopg]commands}
+ {[psycopg2]commands}
-[testenv:py3{4,5,6,7,8,9,10,11,12}-postgres-psycopg]
-commands = {[psycopg]commands}
+[testenv:py3{4,5,6,7,8,9,10,11,12}-postgres-psycopg2]
+commands = {[psycopg2]commands}
[pygresql]
commands =
@@ -485,6 +497,19 @@ commands = {[mysql-pypyodbc-w32]commands}
[psycopg-w32]
platform = win32
+commands =
+ {[testenv]commands}
+ -dropdb --username=runner --no-password sqlobject_test
+ createdb --username=runner --no-password sqlobject_test
+ pytest -D "postgres://runner:test@localhost/sqlobject_test?driver=psycopg&charset=utf-8&debug=1"
+ dropdb --username=runner --no-password sqlobject_test
+
+[testenv:py3{6,7,8,9,10,11,12}-postgres-psycopg-noauto-w32]
+platform = win32
+commands = {[psycopg-w32]commands}
+
+[psycopg2-w32]
+platform = win32
commands =
{[testenv]commands}
-dropdb --username=runner --no-password sqlobject_test
@@ -492,15 +517,15 @@ commands =
pytest -D "postgres://runner:test@localhost/sqlobject_test?driver=psycopg2&charset=utf-8&debug=1"
dropdb --username=runner --no-password sqlobject_test
-[testenv:py27-postgres-psycopg-w32]
+[testenv:py27-postgres-psycopg2-w32]
platform = win32
commands =
easy_install -i https://downloads.egenix.com/python/index/ucs2/ egenix-mx-base
- {[psycopg-w32]commands}
+ {[psycopg2-w32]commands}
-[testenv:py3{4,5,6,7,8,9,10,11,12}-postgres-psycopg-w32]
+[testenv:py3{4,5,6,7,8,9,10,11,12}-postgres-psycopg2-w32]
platform = win32
-commands = {[psycopg-w32]commands}
+commands = {[psycopg2-w32]commands}
[pygresql-w32]
platform = win32
http://sourceforge.net/p/sqlobject/sqlobject/ci/cf96c5e4974cd2241f182e61abd955bdc189fa8c
commit cf96c5e4974cd2241f182e61abd955bdc189fa8c
Author: Oleg Broytman <ph...@ph...>
Date: Tue Sep 24 22:53:22 2024 +0300
Tests, CI(GHActions): Run tests with Python 3.13
Excluding psycopg2 -- it's not yet compatible.
Excluding PyMySQL under w32 -- it's also not yet compatible.
diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml
index 4439ef2..e61a0c4 100644
--- a/.github/workflows/run-tests.yaml
+++ b/.github/workflows/run-tests.yaml
@@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
- python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
+ python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- os: windows-latest
python-version: "2.7"
@@ -45,6 +45,7 @@ jobs:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
+ channels: conda-forge, conda-forge/label/python_rc
miniforge-version: latest
python-version: ${{ matrix.python-version }}
if: ${{ !contains(fromJSON(env.not_in_conda), matrix.python-version) }}
diff --git a/devscripts/requirements/requirements.txt b/devscripts/requirements/requirements.txt
index a419296..befc10e 100644
--- a/devscripts/requirements/requirements.txt
+++ b/devscripts/requirements/requirements.txt
@@ -2,5 +2,7 @@
DateTime
FormEncode >= 1.1.1, != 1.3.0; python_version >= '2.7' and python_version < '3.0'
-FormEncode >= 1.3.1; python_version >= '3.4'
+FormEncode >= 1.3.1; python_version >= '3.4' and python_version < '3.13'
+git+https://github.com/formencode/formencode.git; python_version >= '3.13'
+
PyDispatcher >= 2.0.4
diff --git a/docs/News.rst b/docs/News.rst
index 6d75172..631d418 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -8,6 +8,11 @@ News
SQLObject (master)
==================
+Tests
+-----
+
+* Run tests with Python 3.13.
+
CI
--
@@ -17,6 +22,8 @@ CI
* GHActions: Switch to ``setup-miniconda``.
+* GHActions: Python 3.13.
+
SQLObject 3.11.0
================
diff --git a/setup.py b/setup.py
index 28a634b..356331c 100755
--- a/setup.py
+++ b/setup.py
@@ -64,6 +64,7 @@ and `GitHub <https://github.com/sqlobject>`_.
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
+ "Programming Language :: Python :: 3.13",
"Topic :: Database",
"Topic :: Database :: Front-Ends",
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -103,9 +104,12 @@ and `GitHub <https://github.com/sqlobject>`_.
requires=['FormEncode', 'PyDispatcher'],
install_requires=[
"FormEncode>=1.1.1,!=1.3.0; python_version=='2.7'",
- "FormEncode>=1.3.1; python_version>='3.4'",
+ "FormEncode>=1.3.1; python_version>='3.4' and python_version < '3.13'",
"PyDispatcher>=2.0.4",
- ],
+ ] + [
+ "formencode @ "
+ "git+https://github.com/formencode/formencode.git#egg=formencode"
+ ] if sys.version_info >= (3, 13) else [],
extras_require={
# Firebird/Interbase
'fdb': ['fdb'],
diff --git a/tox.ini b/tox.ini
index 4d1b619..91dce16 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 3.15
-envlist = py27,py3{4,5,6,7,8,9,10,11,12}-sqlite{,-memory},py{27,37,312}-flake8
+envlist = py27,py3{4,5,6,7,8,9,10,11,12,13}-sqlite{,-memory},py{27,37,312}-flake8
# Base test environment settings
[testenv]
@@ -60,7 +60,7 @@ commands =
easy_install -i https://downloads.egenix.com/python/index/ucs2/ egenix-mx-base
{[mysqldb]commands}
-[testenv:py3{4,5,6,7,8,9,10,11,12}-mysqldb]
+[testenv:py3{4,5,6,7,8,9,10,11,12,13}-mysqldb]
... 370 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|