Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-aiosqlite for openSUSE:Factory checked in at 2021-05-15 01:23:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-aiosqlite (Old) and /work/SRC/openSUSE:Factory/.python-aiosqlite.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-aiosqlite" Sat May 15 01:23:59 2021 rev:2 rq:893040 version:0.17.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-aiosqlite/python-aiosqlite.changes 2020-12-01 14:23:17.877626509 +0100 +++ /work/SRC/openSUSE:Factory/.python-aiosqlite.new.2988/python-aiosqlite.changes 2021-05-15 01:24:11.175025274 +0200 @@ -1,0 +2,12 @@ +Fri May 14 07:10:11 UTC 2021 - Matej Cepl <mc...@suse.com> + +- Update to 0.17.0: + - Connection objects now raise ValueError when closed and a + command is executed (#79) + - Fix documented examples in readme (#104) + - Reduce logging severity for exceptions (#93) + - Stop logging result objects; they can be big (#102) +- Add stdlib-typing_extensions.patch to avoid necessity for BR + python-typing_extensions (gh#omnilib/aiosqlite#114). + +------------------------------------------------------------------- Old: ---- aiosqlite-0.16.0.tar.gz New: ---- aiosqlite-0.17.0.tar.gz stdlib-typing_extensions.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-aiosqlite.spec ++++++ --- /var/tmp/diff_new_pack.paf1Eh/_old 2021-05-15 01:24:11.775023165 +0200 +++ /var/tmp/diff_new_pack.paf1Eh/_new 2021-05-15 01:24:11.775023165 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-aiosqlite # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # Copyright (c) 2019 Matthias Fehring <buschman...@opensuse.org> # # All modifications and additions to the file contributed by third parties @@ -20,22 +20,23 @@ %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-aiosqlite -Version: 0.16.0 +Version: 0.17.0 Release: 0 Summary: AsyncIO Bridge to the Standard Python sqlite3 Module License: MIT Group: Development/Languages/Python URL: https://github.com/jreese/aiosqlite Source: https://files.pythonhosted.org/packages/source/a/aiosqlite/aiosqlite-%{version}.tar.gz +# PATCH-FIX-UPSTREAM stdlib-typing_extensions.patch gh#omnilib/aiosqlite#114 mc...@suse.com +# Dependency on typing_extensions is unnecessary +Patch0: stdlib-typing_extensions.patch BuildRequires: %{python_module setuptools >= 38.6.0} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python -Requires: python-typing_extensions BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module aiounittest} -BuildRequires: %{python_module typing_extensions} BuildRequires: %{pythons} # /SECTION %python_subpackages @@ -46,7 +47,7 @@ automatically closing connections. %prep -%setup -q -n aiosqlite-%{version} +%autosetup -p1 -n aiosqlite-%{version} %build %python_build ++++++ aiosqlite-0.16.0.tar.gz -> aiosqlite-0.17.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiosqlite-0.16.0/CHANGELOG.md new/aiosqlite-0.17.0/CHANGELOG.md --- old/aiosqlite-0.16.0/CHANGELOG.md 2020-11-02 02:08:09.494588900 +0100 +++ new/aiosqlite-0.17.0/CHANGELOG.md 2021-02-22 01:53:48.009672400 +0100 @@ -1,6 +1,39 @@ aiosqlite ========= +v0.17.0 +------- + +Feature release + +* Connection objects now raise ValueError when closed and a command is executed (#79) +* Fix documented examples in readme (#104) + +``` +$ git shortlog -s v0.16.1...v0.17.0 + 3 John Reese + 5 Mariano Sorgente + 1 Nuno Andr?? + 1 pyup.io bot +``` + + +v0.16.1 +------- + +Bug fix release + +- Reduce logging severity for exceptions (#93) +- Stop logging result objects; they can be big (#102) + +``` +$ git shortlog -s v0.16.0...v0.16.1 + 1 Alexei Chetroi + 3 John Reese + 3 pyup.io bot +``` + + v0.16.0 ------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiosqlite-0.16.0/PKG-INFO new/aiosqlite-0.17.0/PKG-INFO --- old/aiosqlite-0.16.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/aiosqlite-0.17.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: aiosqlite -Version: 0.16.0 +Version: 0.17.0 Summary: asyncio bridge to the standard sqlite3 module Home-page: https://aiosqlite.omnilib.dev Author: John Reese diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiosqlite-0.16.0/README.rst new/aiosqlite-0.17.0/README.rst --- old/aiosqlite-0.16.0/README.rst 2020-05-06 08:53:47.193215400 +0200 +++ new/aiosqlite-0.17.0/README.rst 2021-02-22 01:23:09.006072500 +0100 @@ -51,7 +51,8 @@ async with aiosqlite.connect(...) as db: db.row_factory = aiosqlite.Row async with db.execute('SELECT * FROM some_table') as cursor: - value = row['column'] + async for row in cursor: + value = row['column'] await db.execute('INSERT INTO foo some_table') assert db.total_changes > 0 @@ -91,4 +92,4 @@ license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the `LICENSE`_ file for details. -.. _LICENSE: https://github.com/omnilib/aiosqlite/blob/master/LICENSE \ No newline at end of file +.. _LICENSE: https://github.com/omnilib/aiosqlite/blob/master/LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiosqlite-0.16.0/aiosqlite/__version__.py new/aiosqlite-0.17.0/aiosqlite/__version__.py --- old/aiosqlite-0.16.0/aiosqlite/__version__.py 2020-11-02 02:08:08.605816000 +0100 +++ new/aiosqlite-0.17.0/aiosqlite/__version__.py 2021-02-22 01:53:48.016908400 +0100 @@ -1 +1 @@ -__version__ = "0.16.0" +__version__ = "0.17.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiosqlite-0.16.0/aiosqlite/core.py new/aiosqlite-0.17.0/aiosqlite/core.py --- old/aiosqlite-0.16.0/aiosqlite/core.py 2020-11-01 23:41:22.427176000 +0100 +++ new/aiosqlite-0.17.0/aiosqlite/core.py 2021-02-22 01:48:46.597327000 +0100 @@ -87,16 +87,20 @@ :meta private: """ - while self._running: + while True: + # Continues running until all queue items are processed, + # even after connection is closed (so we can finalize all + # futures) try: future, function = self._tx.get(timeout=0.1) except Empty: - continue - + if self._running: + continue + break try: LOG.debug("executing %s", function) result = function() - LOG.debug("returning %s", result) + LOG.debug("operation %s completed", function) def set_result(fut, result): if not fut.done(): @@ -104,7 +108,7 @@ get_loop(future).call_soon_threadsafe(set_result, future, result) except BaseException as e: - LOG.info("returning exception %s", e) + LOG.debug("returning exception %s", e) def set_exception(fut, e): if not fut.done(): @@ -114,6 +118,9 @@ async def _execute(self, fn, *args, **kwargs): """Queue a function with the given arguments for execution.""" + if not self._running or not self._connection: + raise ValueError("Connection closed") + function = partial(fn, *args, **kwargs) future = asyncio.get_event_loop().create_future() @@ -125,7 +132,9 @@ """Connect to the actual sqlite database.""" if self._connection is None: try: - self._connection = await self._execute(self._connector) + future = asyncio.get_event_loop().create_future() + self._tx.put_nowait((future, self._connector)) + self._connection = await future except Exception: self._running = False self._connection = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiosqlite-0.16.0/aiosqlite/tests/smoke.py new/aiosqlite-0.17.0/aiosqlite/tests/smoke.py --- old/aiosqlite-0.16.0/aiosqlite/tests/smoke.py 2020-10-29 06:36:47.585738000 +0100 +++ new/aiosqlite-0.17.0/aiosqlite/tests/smoke.py 2021-02-22 01:48:46.757064000 +0100 @@ -391,6 +391,31 @@ ], ) + async def test_cursor_on_closed_connection(self): + db = await aiosqlite.connect(TEST_DB) + + cursor = await db.execute("select 1, 2") + await db.close() + with self.assertRaisesRegex(ValueError, "Connection closed"): + await cursor.fetchall() + with self.assertRaisesRegex(ValueError, "Connection closed"): + await cursor.fetchall() + + async def test_cursor_on_closed_connection_loop(self): + db = await aiosqlite.connect(TEST_DB) + + cursor = await db.execute("select 1, 2") + tasks = [] + for i in range(100): + if i == 50: + tasks.append(asyncio.ensure_future(db.close())) + tasks.append(asyncio.ensure_future(cursor.fetchall())) + for task in tasks: + try: + await task + except sqlite3.ProgrammingError: + pass + @skipIf(sys.version_info < (3, 7), "Test backup() on 3.7+") async def test_backup_aiosqlite(self): def progress(a, b, c): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiosqlite-0.16.0/requirements-dev.txt new/aiosqlite-0.17.0/requirements-dev.txt --- old/aiosqlite-0.16.0/requirements-dev.txt 2020-11-02 01:58:22.712895600 +0100 +++ new/aiosqlite-0.17.0/requirements-dev.txt 2021-02-22 01:23:09.007283700 +0100 @@ -1,11 +1,11 @@ aiounittest==1.4.0 -attribution==1.3.1 +attribution==1.4.0 black==20.8b1 -codecov==2.1.10 -coverage[toml]==5.3 +codecov==2.1.11 +coverage[toml]==5.4 flit==3.0.0 -mypy==0.790 -pylint==2.6.0 -sphinx==3.2.1 -usort==0.5.0 +mypy==0.812 +pylint==2.6.2 +sphinx==3.5.1 +usort==0.6.2 git+https://github.com/miyakogi/m2r diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiosqlite-0.16.0/setup.py new/aiosqlite-0.17.0/setup.py --- old/aiosqlite-0.16.0/setup.py 1970-01-01 01:00:00.000000000 +0100 +++ new/aiosqlite-0.17.0/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -13,7 +13,7 @@ ['typing_extensions>=3.7.2'] setup(name='aiosqlite', - version='0.16.0', + version='0.17.0', description='asyncio bridge to the standard sqlite3 module', author='John Reese', author_email='j...@noswap.com', ++++++ stdlib-typing_extensions.patch ++++++ --- aiosqlite/context.py | 5 ++--- pyproject.toml | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) --- a/aiosqlite/context.py +++ b/aiosqlite/context.py @@ -3,9 +3,8 @@ from functools import wraps -from typing import Any, Callable, Coroutine, Generator, TypeVar - -from typing_extensions import AsyncContextManager +from typing import (Any, Callable, Coroutine, Generator, TypeVar, + AsyncContextManager) from .cursor import Cursor --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ author = "John Reese" author-email = "j...@noswap.com" description-file = "README.rst" home-page = "https://aiosqlite.omnilib.dev" -requires = ["typing_extensions>=3.7.2"] +requires = [] requires-python = ">=3.6" classifiers = [ "Development Status :: 5 - Production/Stable", --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ package_data = \ {'': ['*']} install_requires = \ -['typing_extensions>=3.7.2'] +[] setup(name='aiosqlite', version='0.17.0',