Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-psycopg2cffi for openSUSE:Factory checked in at 2021-10-12 21:51:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-psycopg2cffi (Old) and /work/SRC/openSUSE:Factory/.python-psycopg2cffi.new.2443 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-psycopg2cffi" Tue Oct 12 21:51:42 2021 rev:2 rq:924941 version:2.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-psycopg2cffi/python-psycopg2cffi.changes 2020-06-10 00:47:32.254807075 +0200 +++ /work/SRC/openSUSE:Factory/.python-psycopg2cffi.new.2443/python-psycopg2cffi.changes 2021-10-12 21:51:42.664074235 +0200 @@ -1,0 +2,15 @@ +Tue Oct 12 10:18:07 UTC 2021 - ecsos <ec...@opensuse.org> + +- Update to 2.9.0 + * New features: + - Add execute_batch and execute_values to psycopg2cffi.extras in #98 + - psycopg2cffi.extras: add fetch argument to execute_values() in #119 + * Bug fixes: + - Fix for async keyword argument when creating a connection in #104 + - Allow adapters to be passed as arguments of cursor's execute() in #107 + - Fix installation with old cffi by dand-oss in #116 + * Test changes: + - Dropped support for python 2.6, 3.3, 3.4 in #109 + - Added support for python 3.8 in #108 + +------------------------------------------------------------------- Old: ---- psycopg2cffi-2.8.1.tar.gz New: ---- psycopg2cffi-2.9.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-psycopg2cffi.spec ++++++ --- /var/tmp/diff_new_pack.nbrNTO/_old 2021-10-12 21:51:43.208075014 +0200 +++ /var/tmp/diff_new_pack.nbrNTO/_new 2021-10-12 21:51:43.212075019 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-psycopg2cffi # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 Name: python-psycopg2cffi -Version: 2.8.1 +Version: 2.9.0 Release: 0 Summary: Implementation of the psycopg2 module using cffi License: LGPL-3.0-or-later URL: https://github.com/chtd/psycopg2cffi Source: https://files.pythonhosted.org/packages/source/p/psycopg2cffi/psycopg2cffi-%{version}.tar.gz -BuildRequires: %{python_module devel} +BuildRequires: %{python_module devel >= 3.5} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: postgresql-server-devel @@ -39,7 +40,7 @@ %python_subpackages %description -Implementation of the psycopg2 module using cffi. +This is a implementation of the psycopg2 module using cffi. %prep %setup -q -n psycopg2cffi-%{version} ++++++ psycopg2cffi-2.8.1.tar.gz -> psycopg2cffi-2.9.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg2cffi-2.8.1/PKG-INFO new/psycopg2cffi-2.9.0/PKG-INFO --- old/psycopg2cffi-2.8.1/PKG-INFO 2018-07-31 19:34:01.000000000 +0200 +++ new/psycopg2cffi-2.9.0/PKG-INFO 2021-01-27 14:00:54.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: psycopg2cffi -Version: 2.8.1 +Version: 2.9.0 Summary: .. image:: https://travis-ci.org/chtd/psycopg2cffi.svg?branch=master Home-page: http://github.com/chtd/psycopg2cffi Author: Konstantin Lopuhin @@ -33,7 +33,7 @@ OS X 10.8 - 10.10. It should be possible to make it work on Windows, but I did not test it. - This module works under CPython 2.6+, CPython 3.2+, PyPy 2 and PyPy 3 + This module works under CPython 2.7+, CPython 3.5+, PyPy 2 and PyPy 3 (PyPy version should be at least 2.0, which is ancient history now). To use this package with Django or SQLAlchemy invoke a compatibility @@ -86,6 +86,25 @@ Release notes ------------- + 2.9.0 (27 Jan 2021) + +++++++++++++++++++ + + New features: + + - Add execute_batch and execute_values to psycopg2cffi.extras by @fake-name in #98 + - psycopg2cffi.extras: add fetch argument to execute_values() by @intelfx in #119 + + Bug fixes: + + - Fix for async keyword argument when creating a connection by @donalm in #104 + - Allow adapters to be passed as arguments of cursor's execute() by @amigrave in #107 + - Fix installation with old cffi by dand-oss in #116 + + Test changes: + + - Dropped support for python 2.6, 3.3, 3.4 by @thedrow in #109 + - Added support for python 3.8 by @thedrow in #108 + 2.8.1 (31 July 2018) ++++++++++++++++++++ @@ -195,14 +214,11 @@ Classifier: Development Status :: 3 - Alpha Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) Classifier: Intended Audience :: Developers -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.2 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Programming Language :: SQL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg2cffi-2.8.1/README.rst new/psycopg2cffi-2.9.0/README.rst --- old/psycopg2cffi-2.8.1/README.rst 2018-07-31 19:33:15.000000000 +0200 +++ new/psycopg2cffi-2.9.0/README.rst 2021-01-27 13:57:03.000000000 +0100 @@ -25,7 +25,7 @@ OS X 10.8 - 10.10. It should be possible to make it work on Windows, but I did not test it. -This module works under CPython 2.6+, CPython 3.2+, PyPy 2 and PyPy 3 +This module works under CPython 2.7+, CPython 3.5+, PyPy 2 and PyPy 3 (PyPy version should be at least 2.0, which is ancient history now). To use this package with Django or SQLAlchemy invoke a compatibility @@ -78,6 +78,25 @@ Release notes ------------- +2.9.0 (27 Jan 2021) ++++++++++++++++++++ + +New features: + +- Add execute_batch and execute_values to psycopg2cffi.extras by @fake-name in #98 +- psycopg2cffi.extras: add fetch argument to execute_values() by @intelfx in #119 + +Bug fixes: + +- Fix for async keyword argument when creating a connection by @donalm in #104 +- Allow adapters to be passed as arguments of cursor's execute() by @amigrave in #107 +- Fix installation with old cffi by dand-oss in #116 + +Test changes: + +- Dropped support for python 2.6, 3.3, 3.4 by @thedrow in #109 +- Added support for python 3.8 by @thedrow in #108 + 2.8.1 (31 July 2018) ++++++++++++++++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg2cffi-2.8.1/psycopg2cffi/__init__.py new/psycopg2cffi-2.9.0/psycopg2cffi/__init__.py --- old/psycopg2cffi-2.8.1/psycopg2cffi/__init__.py 2018-07-31 19:33:22.000000000 +0200 +++ new/psycopg2cffi-2.9.0/psycopg2cffi/__init__.py 2021-01-27 13:57:03.000000000 +0100 @@ -10,7 +10,7 @@ from psycopg2cffi._impl.exceptions import * from psycopg2cffi._impl.typecasts import BINARY, DATETIME, NUMBER, ROWID, STRING -__version__ = '2.8.1' +__version__ = '2.9.0' apilevel = '2.0' paramstyle = 'pyformat' threadsafety = 2 @@ -88,11 +88,11 @@ if port is not None: items.append(('port', port)) - kwasync = {} + async_ = False if 'async' in kwargs: - kwasync['async'] = kwargs.pop('async') + async_ = kwargs.pop('async') if 'async_' in kwargs: - kwasync['async_'] = kwargs.pop('async_') + async_ = kwargs.pop('async_') items.extend([(k, v) for (k, v) in kwargs.items() if v is not None]) @@ -108,7 +108,7 @@ dsn = " ".join(["%s=%s" % (k, _param_escape(str(v))) for (k, v) in items]) - conn = _connect(dsn, connection_factory=connection_factory, **kwasync) + conn = _connect(dsn, connection_factory=connection_factory, async_=async_) if cursor_factory is not None: conn.cursor_factory = cursor_factory diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg2cffi-2.8.1/psycopg2cffi/_impl/adapters.py new/psycopg2cffi-2.9.0/psycopg2cffi/_impl/adapters.py --- old/psycopg2cffi-2.8.1/psycopg2cffi/_impl/adapters.py 2017-08-11 13:15:20.000000000 +0200 +++ new/psycopg2cffi-2.9.0/psycopg2cffi/_impl/adapters.py 2019-10-23 19:52:36.000000000 +0200 @@ -289,7 +289,10 @@ """Helper method""" if param is None: return b'NULL' - adapter = adapt(param) + if isinstance(param, _BaseAdapter): + adapter = param + else: + adapter = adapt(param) try: adapter.prepare(conn) except AttributeError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg2cffi-2.8.1/psycopg2cffi/extras.py new/psycopg2cffi-2.9.0/psycopg2cffi/extras.py --- old/psycopg2cffi-2.8.1/psycopg2cffi/extras.py 2018-07-31 19:19:12.000000000 +0200 +++ new/psycopg2cffi-2.9.0/psycopg2cffi/extras.py 2021-01-27 13:57:03.000000000 +0100 @@ -999,6 +999,166 @@ return caster + +def _paginate(seq, page_size): + """Consume an iterable and return it in chunks. + + Every chunk is at most `page_size`. Never return an empty chunk. + """ + page = [] + it = iter(seq) + while 1: + try: + for i in range(page_size): + page.append(next(it)) + yield page + page = [] + except StopIteration: + if page: + yield page + return + + +def execute_batch(cur, sql, argslist, page_size=100): + r"""Execute groups of statements in fewer server roundtrips. + + Execute *sql* several times, against all parameters set (sequences or + mappings) found in *argslist*. + + The function is semantically similar to + + .. parsed-literal:: + + *cur*\.\ `~cursor.executemany`\ (\ *sql*\ , *argslist*\ ) + + but has a different implementation: Psycopg will join the statements into + fewer multi-statement commands, each one containing at most *page_size* + statements, resulting in a reduced number of server roundtrips. + + After the execution of the function the `cursor.rowcount` property will + **not** contain a total result. + + """ + for page in _paginate(argslist, page_size=page_size): + sqls = [cur.mogrify(sql, args) for args in page] + cur.execute(b";".join(sqls)) + + +def execute_values(cur, sql, argslist, template=None, page_size=100, fetch=False): + '''Execute a statement using :sql:`VALUES` with a sequence of parameters. + + :param cur: the cursor to use to execute the query. + + :param sql: the query to execute. It must contain a single ``%s`` + placeholder, which will be replaced by a `VALUES list`__. + Example: ``"INSERT INTO mytable (id, f1, f2) VALUES %s"``. + + :param argslist: sequence of sequences or dictionaries with the arguments + to send to the query. The type and content must be consistent with + *template*. + + :param template: the snippet to merge to every item in *argslist* to + compose the query. + + - If the *argslist* items are sequences it should contain positional + placeholders (e.g. ``"(%s, %s, %s)"``, or ``"(%s, %s, 42)``" if there + are constants value...). + + - If the *argslist* items are mappings it should contain named + placeholders (e.g. ``"(%(id)s, %(f1)s, 42)"``). + + If not specified, assume the arguments are sequence and use a simple + positional template (i.e. ``(%s, %s, ...)``), with the number of + placeholders sniffed by the first element in *argslist*. + + :param page_size: maximum number of *argslist* items to include in every + statement. If there are more items the function will execute more than + one statement. + + :param fetch: if `!True` return the query results into a list (like in a + `~cursor.fetchall()`). Useful for queries with :sql:`RETURNING` + clause. + + .. __: https://www.postgresql.org/docs/current/static/queries-values.html + + After the execution of the function the `cursor.rowcount` property will + **not** contain a total result. + + While :sql:`INSERT` is an obvious candidate for this function it is + possible to use it with other statements, for example:: + + >>> cur.execute( + ... "create table test (id int primary key, v1 int, v2 int)") + + >>> execute_values(cur, + ... "INSERT INTO test (id, v1, v2) VALUES %s", + ... [(1, 2, 3), (4, 5, 6), (7, 8, 9)]) + + >>> execute_values(cur, + ... """UPDATE test SET v1 = data.v1 FROM (VALUES %s) AS data (id, v1) + ... WHERE test.id = data.id""", + ... [(1, 20), (4, 50)]) + + >>> cur.execute("select * from test order by id") + >>> cur.fetchall() + [(1, 20, 3), (4, 50, 6), (7, 8, 9)]) + + ''' + # we can't just use sql % vals because vals is bytes: if sql is bytes + # there will be some decoding error because of stupid codec used, and Py3 + # doesn't implement % on bytes. + if not isinstance(sql, bytes): + sql = sql.encode(_ext.encodings[cur.connection.encoding]) + pre, post = _split_sql(sql) + + result = [] if fetch else None + for page in _paginate(argslist, page_size=page_size): + if template is None: + template = b'(' + b','.join([b'%s'] * len(page[0])) + b')' + parts = pre[:] + for args in page: + parts.append(cur.mogrify(template, args)) + parts.append(b',') + parts[-1:] = post + cur.execute(b''.join(parts)) + if fetch: + result.extend(cur.fetchall()) + + return result + + +def _split_sql(sql): + """Split *sql* on a single ``%s`` placeholder. + + Split on the %s, perform %% replacement and return pre, post lists of + snippets. + """ + curr = pre = [] + post = [] + tokens = _re.split(br'(%.)', sql) + for token in tokens: + if len(token) != 2 or token[:1] != b'%': + curr.append(token) + continue + + if token[1:] == b's': + if curr is pre: + curr = post + else: + raise ValueError( + "the query contains more than one '%s' placeholder") + elif token[1:] == b'%': + curr.append(b'%') + else: + raise ValueError("unsupported format character: '%s'" + % token[1:].decode('ascii', 'replace')) + + if curr is pre: + raise ValueError("the query doesn't contain any '%s' placeholder") + + return pre, post + + # expose the json adaptation stuff into the module from psycopg2cffi._json import json, Json, register_json, register_default_json from psycopg2cffi._json import register_default_json, register_default_jsonb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg2cffi-2.8.1/psycopg2cffi.egg-info/PKG-INFO new/psycopg2cffi-2.9.0/psycopg2cffi.egg-info/PKG-INFO --- old/psycopg2cffi-2.8.1/psycopg2cffi.egg-info/PKG-INFO 2018-07-31 19:34:01.000000000 +0200 +++ new/psycopg2cffi-2.9.0/psycopg2cffi.egg-info/PKG-INFO 2021-01-27 14:00:54.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: psycopg2cffi -Version: 2.8.1 +Version: 2.9.0 Summary: .. image:: https://travis-ci.org/chtd/psycopg2cffi.svg?branch=master Home-page: http://github.com/chtd/psycopg2cffi Author: Konstantin Lopuhin @@ -33,7 +33,7 @@ OS X 10.8 - 10.10. It should be possible to make it work on Windows, but I did not test it. - This module works under CPython 2.6+, CPython 3.2+, PyPy 2 and PyPy 3 + This module works under CPython 2.7+, CPython 3.5+, PyPy 2 and PyPy 3 (PyPy version should be at least 2.0, which is ancient history now). To use this package with Django or SQLAlchemy invoke a compatibility @@ -86,6 +86,25 @@ Release notes ------------- + 2.9.0 (27 Jan 2021) + +++++++++++++++++++ + + New features: + + - Add execute_batch and execute_values to psycopg2cffi.extras by @fake-name in #98 + - psycopg2cffi.extras: add fetch argument to execute_values() by @intelfx in #119 + + Bug fixes: + + - Fix for async keyword argument when creating a connection by @donalm in #104 + - Allow adapters to be passed as arguments of cursor's execute() by @amigrave in #107 + - Fix installation with old cffi by dand-oss in #116 + + Test changes: + + - Dropped support for python 2.6, 3.3, 3.4 by @thedrow in #109 + - Added support for python 3.8 by @thedrow in #108 + 2.8.1 (31 July 2018) ++++++++++++++++++++ @@ -195,14 +214,11 @@ Classifier: Development Status :: 3 - Alpha Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) Classifier: Intended Audience :: Developers -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.2 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Programming Language :: SQL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg2cffi-2.8.1/setup.py new/psycopg2cffi-2.9.0/setup.py --- old/psycopg2cffi-2.8.1/setup.py 2018-07-31 18:16:45.000000000 +0200 +++ new/psycopg2cffi-2.9.0/setup.py 2021-01-27 13:58:55.000000000 +0100 @@ -42,14 +42,11 @@ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', 'Intended Audience :: Developers', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Programming Language :: SQL', @@ -75,7 +72,7 @@ ], )) else: - from distutils.command.build_py import build_py as _build_py + from setuptools.command.build_py import build_py as _build_py class build_py(_build_py): has_been_run = False