* All objects that can be closed implement __bool__() which
returns True while open and False when closed - Connection,
Cursor, Backup, Blob, Session, ChangesetBuilder, Rebaser.
- update to 3.51.0.0:
* JSON can be used as though it is a native type of SQLite,
with automatic conversion of Python objects on writing and
reading. (example)
* Connection.convert_binding (and Cursor.convert_binding)
callback to allow conversion of bindings when executing SQL.
* Connection.convert_jsonb (and Cursor.convert_jsonb) callback
to allow conversion of JSONB when reading query results.
(JSONB is SQLite’s binary internal parsed format for quick
operations on JSON.)
* 3 functions for working directly with JSONB allowing direct
conversion between Python objects and JSONB, without having
to go through the intermediate JSON text format.
* Added apsw.ext.Function() for calling SQL functions directly
from Python.
* When using with (Connection context manager) you can set the
outer transaction mode to DEFERRED (default) / IMMEDIATE /
EXCLUSIVE. (APSW issue 578)
* Changeset.apply() now takes filter_change parameter for
allowing filtering on individual change level, taking
advantage of sqlite3changeset_apply_v3
* Updated Connection.status() to use 64 bit API, and
apsw.ext.ShowResourceUsage() to show TEMPBUF_SPILL. (pragma
cache_size controls the amount of temp/cache memory
available.)
* The percentile extension is enabled when enabling all
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-apsw?expand=0&rev=63
102 lines
2.9 KiB
RPMSpec
102 lines
2.9 KiB
RPMSpec
#
|
|
# spec file for package python-apsw
|
|
#
|
|
# Copyright (c) 2025 SUSE LLC and contributors
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
%bcond_without libalternatives
|
|
%else
|
|
%bcond_with libalternatives
|
|
%endif
|
|
|
|
%{?sle15_python_module_pythons}
|
|
Name: python-apsw
|
|
Version: 3.51.1.0
|
|
Release: 0
|
|
Summary: Another Python SQLite Wrapper
|
|
License: Zlib
|
|
Group: Development/Libraries/Python
|
|
URL: https://github.com/rogerbinns/apsw/
|
|
Source: https://files.pythonhosted.org/packages/source/a/apsw/apsw-%{version}.tar.gz
|
|
BuildRequires: %{python_module devel >= 3.9}
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: %{python_module wheel}
|
|
BuildRequires: fdupes
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: python-rpm-macros
|
|
BuildRequires: pkgconfig(sqlite3) >= 3.44
|
|
%if %{with libalternatives}
|
|
Requires: alts
|
|
BuildRequires: alts
|
|
%else
|
|
Requires(post): update-alternatives
|
|
Requires(postun): update-alternatives
|
|
%endif
|
|
%python_subpackages
|
|
|
|
%description
|
|
APSW is a Python wrapper for the SQLite embedded relational database
|
|
engine. In contrast to other wrappers such as pysqlite it focuses on
|
|
being a minimal layer over SQLite attempting just to translate the
|
|
complete SQLite API into Python.
|
|
|
|
%prep
|
|
%autosetup -p1 -n apsw-%{version}
|
|
# Remove shebang from all Python sources
|
|
find . -name "*.py" -exec sed -i "/#\!\/usr\/bin\/env python3/d" {} \;
|
|
|
|
# See the discussion on gh#rogerbinns/apsw#462
|
|
cat << EOF >setup.apsw
|
|
[build_ext]
|
|
use_system_sqlite_config = true
|
|
EOF
|
|
|
|
%build
|
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
|
%pyproject_wheel
|
|
%python_exec setup.py build_test_extension
|
|
|
|
%install
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
|
%python_clone -a %{buildroot}%{_bindir}/apsw
|
|
|
|
%check
|
|
# gh#rogerbinns/apsw#462
|
|
# We cannot use %%pyunittest_arch here, see the ticket for the discussion
|
|
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} PYTHONDONTWRITEBYTECODE=1
|
|
$python -m apsw.tests -v
|
|
}
|
|
|
|
%pre
|
|
%python_libalternatives_reset_alternative apsw
|
|
|
|
%post
|
|
%python_install_alternative apsw
|
|
|
|
%postun
|
|
%python_uninstall_alternative apsw
|
|
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%doc README.rst
|
|
%python_alternative %{_bindir}/apsw
|
|
%{python_sitearch}/apsw
|
|
%{python_sitearch}/apsw-%{version}*-info
|
|
|
|
%changelog
|