17
0

Compare commits

4 Commits

2 changed files with 24 additions and 18 deletions

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Jun 4 15:18:22 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
- Migrate to libalternatives
-------------------------------------------------------------------
Tue May 13 13:05:55 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Wed Jan 25 09:40:02 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-ajsonrpc
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,7 @@
#
%define skip_python2 1
%bcond_without libalternatives
Name: python-ajsonrpc
Version: 1.2.0
Release: 0
@@ -24,10 +24,14 @@ Summary: Async JSON-RPC 20 protocol + server powered by asyncio
License: MIT
URL: https://github.com/pavlov99/ajsonrpc
Source: https://files.pythonhosted.org/packages/source/a/ajsonrpc/ajsonrpc-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: alts
BuildArch: noarch
%python_subpackages
@@ -35,32 +39,24 @@ BuildArch: noarch
Async JSON-RPC 2.0 protocol + server powered by asyncio.
%prep
%setup -q -n ajsonrpc-%{version}
%autosetup -p1 -n ajsonrpc-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/async-json-rpc-server
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# 1 test fails on python 3.6
# See https://github.com/pavlov99/ajsonrpc/issues/19
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
if [ %{$python_version} != "3.6" ]
then
rm -rf _build*
$python -m pytest -v
fi
}
%pytest
%post
%python_install_alternative async-json-rpc-server
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative async-json-rpc-server
%postun
%python_uninstall_alternative async-json-rpc-server
# post and postun macro call is not needed with only libalternatives
%files %{python_files}
%doc README.md