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 2024-04-21 20:27:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-aiosqlite (Old)
and /work/SRC/openSUSE:Factory/.python-aiosqlite.new.26366 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-aiosqlite"
Sun Apr 21 20:27:13 2024 rev:4 rq:1169366 version:0.20.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-aiosqlite/python-aiosqlite.changes
2023-06-12 15:28:08.151649917 +0200
+++
/work/SRC/openSUSE:Factory/.python-aiosqlite.new.26366/python-aiosqlite.changes
2024-04-21 20:28:44.373132469 +0200
@@ -1,0 +2,10 @@
+Sat Apr 20 13:51:11 UTC 2024 - Dirk Müller <[email protected]>
+
+- update to 0.20.0:
+ * Connection `.close()` method is now idempotent
+ * Performance improvements in connection thread and event loop
+ * Updated contributor guide
+ * Tested on Python 3.12
+ * Dropped support for Python 3.7
+
+-------------------------------------------------------------------
Old:
----
aiosqlite-0.19.0.tar.gz
New:
----
aiosqlite-0.20.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-aiosqlite.spec ++++++
--- /var/tmp/diff_new_pack.OxZeDa/_old 2024-04-21 20:28:44.913152293 +0200
+++ /var/tmp/diff_new_pack.OxZeDa/_new 2024-04-21 20:28:44.913152293 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-aiosqlite
#
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2019 Matthias Fehring <[email protected]>
#
# All modifications and additions to the file contributed by third parties
@@ -19,27 +19,21 @@
%{?sle15_python_module_pythons}
Name: python-aiosqlite
-Version: 0.19.0
+Version: 0.20.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
-BuildRequires: %{python_module base >= 3.7}
+BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module flit-core}
BuildRequires: %{python_module pip}
+BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python
-%if 0%{?python_version_nodots} < 38
-Requires: python-typing-extensions >= 4
-%endif
BuildArch: noarch
-# SECTION test requirements
-BuildRequires: %{python_module typing-extensions >= 4 if %python-base < 3.8}
-BuildRequires: %{pythons}
-# /SECTION
%python_subpackages
%description
++++++ aiosqlite-0.19.0.tar.gz -> aiosqlite-0.20.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/CHANGELOG.md
new/aiosqlite-0.20.0/CHANGELOG.md
--- old/aiosqlite-0.19.0/CHANGELOG.md 2023-04-17 08:20:20.312727500 +0200
+++ new/aiosqlite-0.20.0/CHANGELOG.md 2024-02-20 07:07:01.681851900 +0100
@@ -4,6 +4,28 @@
[![Generated by attribution][attribution-badge]][attribution-url]
+v0.20.0
+-------
+
+Feature release
+
+- Connection `.close()` method is now idempotent (#238)
+- Performance improvements in connection thread and event loop (#213, #271)
+- Updated contributor guide (#255)
+- Tested on Python 3.12
+- Dropped support for Python 3.7 (#230)
+
+```text
+$ git shortlog -s v0.19.0...v0.20.0
+ 6 Amethyst Reese
+ 4 J. Nick Koston
+ 1 Waket Zheng
+ 18 dependabot[bot]
+ 1 mike bayer
+ 1 vdergachyov
+```
+
+
v0.19.0
-------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/CONTRIBUTING.md
new/aiosqlite-0.20.0/CONTRIBUTING.md
--- old/aiosqlite-0.19.0/CONTRIBUTING.md 2023-04-17 06:54:04.378911000
+0200
+++ new/aiosqlite-0.20.0/CONTRIBUTING.md 2024-02-20 06:00:09.330281300
+0100
@@ -2,13 +2,12 @@
## Preparation
-You'll need to have at least Python 3.5 available for testing.
-Python 3.6 or newer is recommended in order to validate formatting.
+You'll need to have at least Python 3.8 available for testing.
You can do this with [pyenv][]:
- $ pyenv install 3.6.10
- $ pyenv local 3.6.10
+ $ pyenv install <version>
+ $ pyenv local <version>
## Setup
@@ -23,9 +22,9 @@
## Formatting
-aiosqlite uses *[black][]* and [isort][] for formatting code
-and imports, respectively. If your editor does not already
-support this workflow, you can manually format files:
+aiosqlite uses *[ufmt][]* for formatting code and imports.
+If your editor does not already support this workflow,
+you can manually format files:
$ make format
@@ -50,6 +49,5 @@
* Formatted code following project standards
* Validated code and formatting with `make test lint`
-[black]: https://github.com/psf/black
-[isort]: https://timothycrosley.github.io/isort/
[pyenv]: https://github.com/pyenv/pyenv
+[µfmt]: https://ufmt.omnilib.dev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/PKG-INFO
new/aiosqlite-0.20.0/PKG-INFO
--- old/aiosqlite-0.19.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/aiosqlite-0.20.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,27 +1,26 @@
Metadata-Version: 2.1
Name: aiosqlite
-Version: 0.19.0
+Version: 0.20.0
Summary: asyncio bridge to the standard sqlite3 module
Author-email: Amethyst Reese <[email protected]>
-Requires-Python: >=3.7
+Requires-Python: >=3.8
Description-Content-Type: text/x-rst
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries
-Requires-Dist: typing_extensions >= 4.0; python_version < '3.8'
-Requires-Dist: aiounittest==1.4.1 ; extra == "dev" and ( python_version <
'3.8')
-Requires-Dist: attribution==1.6.2 ; extra == "dev"
-Requires-Dist: black==23.3.0 ; extra == "dev"
-Requires-Dist: coverage[toml]==7.2.3 ; extra == "dev"
-Requires-Dist: flake8==5.0.4 ; extra == "dev"
-Requires-Dist: flake8-bugbear==23.3.12 ; extra == "dev"
-Requires-Dist: flit==3.7.1 ; extra == "dev"
-Requires-Dist: mypy==1.2.0 ; extra == "dev"
-Requires-Dist: ufmt==2.1.0 ; extra == "dev"
-Requires-Dist: usort==1.0.6 ; extra == "dev"
-Requires-Dist: sphinx==6.1.3 ; extra == "docs" and ( python_version >= '3.8')
+Requires-Dist: typing_extensions >= 4.0
+Requires-Dist: attribution==1.7.0 ; extra == "dev"
+Requires-Dist: black==24.2.0 ; extra == "dev"
+Requires-Dist: coverage[toml]==7.4.1 ; extra == "dev"
+Requires-Dist: flake8==7.0.0 ; extra == "dev"
+Requires-Dist: flake8-bugbear==24.2.6 ; extra == "dev"
+Requires-Dist: flit==3.9.0 ; extra == "dev"
+Requires-Dist: mypy==1.8.0 ; extra == "dev"
+Requires-Dist: ufmt==2.3.0 ; extra == "dev"
+Requires-Dist: usort==1.0.8.post1 ; extra == "dev"
+Requires-Dist: sphinx==7.2.6 ; extra == "docs"
Requires-Dist: sphinx-mdinclude==0.5.3 ; extra == "docs"
Project-URL: Documentation, https://aiosqlite.omnilib.dev
Project-URL: Github, https://github.com/omnilib/aiosqlite
@@ -48,7 +47,9 @@
It replicates the standard ``sqlite3`` module, but with async versions
of all the standard connection and cursor methods, plus context managers for
-automatically closing connections and cursors::
+automatically closing connections and cursors:
+
+.. code-block:: python
async with aiosqlite.connect(...) as db:
await db.execute("INSERT INTO some_table ...")
@@ -58,7 +59,9 @@
async for row in cursor:
...
-It can also be used in the traditional, procedural manner::
+It can also be used in the traditional, procedural manner:
+
+.. code-block:: python
db = await aiosqlite.connect(...)
cursor = await db.execute('SELECT * FROM some_table')
@@ -67,7 +70,9 @@
await cursor.close()
await db.close()
-aiosqlite also replicates most of the advanced features of ``sqlite3``::
+aiosqlite also replicates most of the advanced features of ``sqlite3``:
+
+.. code-block:: python
async with aiosqlite.connect(...) as db:
db.row_factory = aiosqlite.Row
@@ -82,10 +87,10 @@
Install
-------
-aiosqlite is compatible with Python 3.7 and newer.
+aiosqlite is compatible with Python 3.8 and newer.
You can install it from PyPI:
-.. code-block:: bash
+.. code-block:: console
$ pip install aiosqlite
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/README.rst
new/aiosqlite-0.20.0/README.rst
--- old/aiosqlite-0.19.0/README.rst 2023-04-17 06:54:04.379176400 +0200
+++ new/aiosqlite-0.20.0/README.rst 2023-04-17 09:19:41.139964600 +0200
@@ -18,7 +18,9 @@
It replicates the standard ``sqlite3`` module, but with async versions
of all the standard connection and cursor methods, plus context managers for
-automatically closing connections and cursors::
+automatically closing connections and cursors:
+
+.. code-block:: python
async with aiosqlite.connect(...) as db:
await db.execute("INSERT INTO some_table ...")
@@ -28,7 +30,9 @@
async for row in cursor:
...
-It can also be used in the traditional, procedural manner::
+It can also be used in the traditional, procedural manner:
+
+.. code-block:: python
db = await aiosqlite.connect(...)
cursor = await db.execute('SELECT * FROM some_table')
@@ -37,7 +41,9 @@
await cursor.close()
await db.close()
-aiosqlite also replicates most of the advanced features of ``sqlite3``::
+aiosqlite also replicates most of the advanced features of ``sqlite3``:
+
+.. code-block:: python
async with aiosqlite.connect(...) as db:
db.row_factory = aiosqlite.Row
@@ -52,10 +58,10 @@
Install
-------
-aiosqlite is compatible with Python 3.7 and newer.
+aiosqlite is compatible with Python 3.8 and newer.
You can install it from PyPI:
-.. code-block:: bash
+.. code-block:: console
$ pip install aiosqlite
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/aiosqlite/__version__.py
new/aiosqlite-0.20.0/aiosqlite/__version__.py
--- old/aiosqlite-0.19.0/aiosqlite/__version__.py 2023-04-17
08:20:20.317927400 +0200
+++ new/aiosqlite-0.20.0/aiosqlite/__version__.py 2024-02-20
07:07:01.688394800 +0100
@@ -4,4 +4,4 @@
Do not edit manually. Get more info at https://attribution.omnilib.dev
"""
-__version__ = "0.19.0"
+__version__ = "0.20.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/aiosqlite/core.py
new/aiosqlite-0.20.0/aiosqlite/core.py
--- old/aiosqlite-0.19.0/aiosqlite/core.py 2023-04-17 08:13:41.283589100
+0200
+++ new/aiosqlite-0.20.0/aiosqlite/core.py 2024-02-20 06:32:51.713042700
+0100
@@ -8,11 +8,9 @@
import asyncio
import logging
import sqlite3
-import sys
-import warnings
from functools import partial
from pathlib import Path
-from queue import Empty, Queue
+from queue import Empty, Queue, SimpleQueue
from threading import Thread
from typing import (
Any,
@@ -20,17 +18,14 @@
Callable,
Generator,
Iterable,
+ Literal,
Optional,
+ Tuple,
Type,
Union,
)
from warnings import warn
-if sys.version_info >= (3, 8):
- from typing import Literal
-else:
- from typing_extensions import Literal
-
from .context import contextmanager
from .cursor import Cursor
@@ -42,11 +37,19 @@
IsolationLevel = Optional[Literal["DEFERRED", "IMMEDIATE", "EXCLUSIVE"]]
-def get_loop(future: asyncio.Future) -> asyncio.AbstractEventLoop:
- if sys.version_info >= (3, 7):
- return future.get_loop()
- else:
- return future._loop
+def set_result(fut: asyncio.Future, result: Any) -> None:
+ """Set the result of a future if it hasn't been set already."""
+ if not fut.done():
+ fut.set_result(result)
+
+
+def set_exception(fut: asyncio.Future, e: BaseException) -> None:
+ """Set the exception of a future if it hasn't been set already."""
+ if not fut.done():
+ fut.set_exception(e)
+
+
+_STOP_RUNNING_SENTINEL = object()
class Connection(Thread):
@@ -60,7 +63,7 @@
self._running = True
self._connection: Optional[sqlite3.Connection] = None
self._connector = connector
- self._tx: Queue = Queue()
+ self._tx: SimpleQueue[Tuple[asyncio.Future, Callable[[], Any]]] =
SimpleQueue()
self._iter_chunk_size = iter_chunk_size
if loop is not None:
@@ -69,6 +72,11 @@
DeprecationWarning,
)
+ def _stop_running(self):
+ self._running = False
+ # PEP 661 is not accepted yet, so we cannot type a sentinel
+ self._tx.put_nowait(_STOP_RUNNING_SENTINEL) # type: ignore[arg-type]
+
@property
def _conn(self) -> sqlite3.Connection:
if self._connection is None:
@@ -95,30 +103,21 @@
# 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:
- if self._running:
- continue
+
+ tx_item = self._tx.get()
+ if tx_item is _STOP_RUNNING_SENTINEL:
break
+
+ future, function = tx_item
+
try:
LOG.debug("executing %s", function)
result = function()
LOG.debug("operation %s completed", function)
-
- def set_result(fut, result):
- if not fut.done():
- fut.set_result(result)
-
- get_loop(future).call_soon_threadsafe(set_result, future,
result)
- except BaseException as e:
+ future.get_loop().call_soon_threadsafe(set_result, future,
result)
+ except BaseException as e: # noqa B036
LOG.debug("returning exception %s", e)
-
- def set_exception(fut, e):
- if not fut.done():
- fut.set_exception(e)
-
- get_loop(future).call_soon_threadsafe(set_exception, future, e)
+ future.get_loop().call_soon_threadsafe(set_exception, future,
e)
async def _execute(self, fn, *args, **kwargs):
"""Queue a function with the given arguments for execution."""
@@ -140,7 +139,7 @@
self._tx.put_nowait((future, self._connector))
self._connection = await future
except Exception:
- self._running = False
+ self._stop_running()
self._connection = None
raise
@@ -171,13 +170,17 @@
async def close(self) -> None:
"""Complete queued queries/cursors and close the connection."""
+
+ if self._connection is None:
+ return
+
try:
await self._execute(self._conn.close)
except Exception:
LOG.info("exception occurred while closing connection")
raise
finally:
- self._running = False
+ self._stop_running()
self._connection = None
@contextmanager
@@ -235,30 +238,18 @@
that query executions take place so instead of executing directly
against the connection, we defer this to `run` function.
- In Python 3.8 and above, if *deterministic* is true, the created
- function is marked as deterministic, which allows SQLite to perform
- additional optimizations. This flag is supported by SQLite 3.8.3 or
- higher, ``NotSupportedError`` will be raised if used with older
- versions.
+ If ``deterministic`` is true, the created function is marked as
deterministic,
+ which allows SQLite to perform additional optimizations. This flag is
supported
+ by SQLite 3.8.3 or higher, ``NotSupportedError`` will be raised if
used with
+ older versions.
"""
- if sys.version_info >= (3, 8):
- await self._execute(
- self._conn.create_function,
- name,
- num_params,
- func,
- deterministic=deterministic,
- )
- else:
- if deterministic:
- warnings.warn(
- "Deterministic function support is only available on "
- 'Python 3.8+. Function "{}" will be registered as '
- "non-deterministic as per SQLite defaults.".format(name),
- stacklevel=2,
- )
-
- await self._execute(self._conn.create_function, name, num_params,
func)
+ await self._execute(
+ self._conn.create_function,
+ name,
+ num_params,
+ func,
+ deterministic=deterministic,
+ )
@property
def in_transaction(self) -> bool:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/aiosqlite/tests/perf.py
new/aiosqlite-0.20.0/aiosqlite/tests/perf.py
--- old/aiosqlite-0.19.0/aiosqlite/tests/perf.py 2023-04-17
06:54:04.380278600 +0200
+++ new/aiosqlite-0.20.0/aiosqlite/tests/perf.py 2023-04-17
09:19:41.140246600 +0200
@@ -5,14 +5,10 @@
Simple perf tests for aiosqlite and the asyncio run loop.
"""
import string
-import sys
import tempfile
import time
-if sys.version_info < (3, 8):
- from aiounittest import AsyncTestCase as TestCase
-else:
- from unittest import IsolatedAsyncioTestCase as TestCase
+from unittest import IsolatedAsyncioTestCase as TestCase
import aiosqlite
from .smoke import setup_logger
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/aiosqlite/tests/smoke.py
new/aiosqlite-0.20.0/aiosqlite/tests/smoke.py
--- old/aiosqlite-0.19.0/aiosqlite/tests/smoke.py 2023-04-17
08:13:53.953288800 +0200
+++ new/aiosqlite-0.20.0/aiosqlite/tests/smoke.py 2024-02-20
06:00:09.330886000 +0100
@@ -2,16 +2,10 @@
# Licensed under the MIT license
import asyncio
import sqlite3
-import sys
from pathlib import Path
from sqlite3 import OperationalError
from threading import Thread
-from unittest import skipIf, SkipTest, skipUnless
-
-if sys.version_info < (3, 8):
- from aiounittest import AsyncTestCase as TestCase
-else:
- from unittest import IsolatedAsyncioTestCase as TestCase
+from unittest import IsolatedAsyncioTestCase as TestCase, SkipTest
import aiosqlite
from .helpers import setup_logger
@@ -328,29 +322,7 @@
row = await res.fetchone()
self.assertEqual(row[0], 20)
- @skipUnless(sys.version_info < (3, 8), "Python < 3.8 specific behaviour")
- async def test_create_function_deterministic_pre38(self):
- """Make sure the deterministic parameter cannot be used in old Python
versions"""
-
- def one_arg(num):
- return num * 2
-
- async with aiosqlite.connect(TEST_DB) as db:
- with self.assertWarnsRegex(UserWarning, "registered as
non-deterministic"):
- await db.create_function("one_arg", 1, one_arg,
deterministic=True)
-
- await db.execute("create table foo (id int, bar int)")
-
- # Deterministic parameter is only available in Python 3.8+ so this
- # won't be deterministic
- with self.assertRaisesRegex(
- OperationalError,
- "non-deterministic functions prohibited in index expressions",
- ):
- await db.execute("create index t on foo(one_arg(bar))")
-
- @skipIf(sys.version_info < (3, 8), "Python 3.8+ specific behaviour")
- async def test_create_function_deterministic_post38(self):
+ async def test_create_function_deterministic(self):
"""Assert that after creating a deterministic custom function, it can
be used.
https://sqlite.org/deterministic.html
@@ -385,8 +357,7 @@
self.assertIsNone(db) # should never be reached
with self.assertRaisesRegex(OperationalError, "unable to open
database"):
- db = await aiosqlite.connect(bad_db)
- self.assertIsNone(db) # should never be reached
+ await aiosqlite.connect(bad_db)
async def test_iterdump(self):
async with aiosqlite.connect(":memory:") as db:
@@ -432,7 +403,14 @@
except sqlite3.ProgrammingError:
pass
- @skipIf(sys.version_info < (3, 7), "Test backup() on 3.7+")
+ async def test_close_twice(self):
+ db = await aiosqlite.connect(TEST_DB)
+
+ await db.close()
+
+ # no error
+ await db.close()
+
async def test_backup_aiosqlite(self):
def progress(a, b, c):
print(a, b, c)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/docs/conf.py
new/aiosqlite-0.20.0/docs/conf.py
--- old/aiosqlite-0.19.0/docs/conf.py 2023-04-17 06:54:04.381419700 +0200
+++ new/aiosqlite-0.20.0/docs/conf.py 2023-04-17 09:19:41.140550000 +0200
@@ -51,7 +51,7 @@
autodoc_member_order = "groupwise"
autodoc_typehints = "description"
-highlight_language = "python3"
+highlight_language = "text"
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
master_doc = "index"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiosqlite-0.19.0/pyproject.toml
new/aiosqlite-0.20.0/pyproject.toml
--- old/aiosqlite-0.19.0/pyproject.toml 2023-04-17 08:03:56.242899200 +0200
+++ new/aiosqlite-0.20.0/pyproject.toml 2024-02-20 07:03:15.441501100 +0100
@@ -17,26 +17,25 @@
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries",
]
-requires-python = ">=3.7"
+requires-python = ">=3.8"
dependencies = [
- "typing_extensions >= 4.0; python_version < '3.8'",
+ "typing_extensions >= 4.0",
]
[project.optional-dependencies]
dev = [
- "aiounittest==1.4.1; python_version < '3.8'",
- "attribution==1.6.2",
- "black==23.3.0",
- "coverage[toml]==7.2.3",
- "flake8==5.0.4",
- "flake8-bugbear==23.3.12",
- "flit==3.7.1",
- "mypy==1.2.0",
- "ufmt==2.1.0",
- "usort==1.0.6",
+ "attribution==1.7.0",
+ "black==24.2.0",
+ "coverage[toml]==7.4.1",
+ "flake8==7.0.0",
+ "flake8-bugbear==24.2.6",
+ "flit==3.9.0",
+ "mypy==1.8.0",
+ "ufmt==2.3.0",
+ "usort==1.0.8.post1",
]
docs = [
- "sphinx==6.1.3; python_version >= '3.8'",
+ "sphinx==7.2.6",
"sphinx-mdinclude==0.5.3",
]