File python-apsw.spec of Package python-apsw

# spec file for package python-apsw
# Copyright (c) 2024 SUSE LLC
# 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

Name:           python-apsw
Release:        0
Summary:        Another Python SQLite Wrapper
License:        Zlib
Group:          Development/Libraries/Python
BuildRequires:  %{python_module devel >= 3.8}
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

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.

%autosetup -p1 -n apsw-%{version}

# See the discussion on gh#rogerbinns/apsw#462
cat << EOF >setup.apsw
use_system_sqlite_config = true

export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_exec build_test_extension

%python_expand %fdupes %{buildroot}%{$python_sitearch}

# 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

%files %{python_files}
%license LICENSE
%doc README.rst

openSUSE Build Service is sponsored by