File python-aiomcache.spec of Package python-aiomcache

#
# spec file for package python-aiomcache
#
# 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 https://bugs.opensuse.org/
#

%{?sle15_python_module_pythons}
Name:           python-aiomcache
Version:        0.8.2
Release:        0
Summary:        Minimal pure python memcached client
License:        BSD-2-Clause
URL:            https://github.com/aio-libs/aiomcache/
Source:         https://files.pythonhosted.org/packages/source/a/aiomcache/aiomcache-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module wheel}
# SECTION test requirements
BuildRequires:  %{python_module docker >= 1.10.6}
BuildRequires:  %{python_module pytest >= 8.2.0}
BuildRequires:  %{python_module pytest-asyncio >= 0.23.6}
BuildRequires:  %{python_module python-memcached >= 1.62}
BuildRequires:  %{python_module typing_extensions if %python-base < 3.11}
BuildRequires:  memcached
# /SECTION
BuildRequires:  fdupes
BuildArch:      noarch
Requires:       (python-typing_extensions if python-base < 3.11)
Suggests:       memcached
%python_subpackages

%description
Minimal pure python memcached client

%prep
%autosetup -p1 -n aiomcache-%{version}
sed -i -e 's/docker_mod\.Client/docker_mod.client/' tests/conftest.py

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
%if 0%{?sle_version} == 150600
%{_sbindir}/memcached -dv -P $PWD/memcached.pid
%else
%{_bindir}/memcached -dv -P $PWD/memcached.pid
%endif
%pytest
kill -9 $(cat $PWD/memcached.pid)

%files %{python_files}
%doc CHANGES.rst README.rst
%license LICENSE
%{python_sitelib}/aiomcache
%{python_sitelib}/aiomcache-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by