%global srcname matrix-nio
Name: python-%{srcname}
Version: 0.15.2
Release: 1%{?dist}
Summary: A Matrix client library
License: ISC and ASL 2.0
URL: https://pypi.python.org/pypi/%{srcname}
Source0: %{pypi_source}
BuildArch: noarch
%global _description %{expand:
nio is a multilayered Matrix client library. The underlying base layer doesn't
do any network IO on its own, but on top of that is a full fledged
batteries-included asyncio layer using aiohttp. File IO is only done if you
enable end-to-end encryption (E2EE).}
%description %_description
%package -n python3-%{srcname}
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: pyproject-rpm-macros
%description -n python3-%{srcname} %_description
%generate_buildrequires
%pyproject_buildrequires -x e2e
%prep
%autosetup -n %{srcname}-%{version}
# Update BRs
sed \
-e 's/aiofiles.*/aiofiles = "*"/' \
-e 's/h11.*/h11 = "*"/' \
-e 's/h2.*/h2 = "*"/' \
-e 's/pycryptodome.*/pycryptodomex = "*"/' \
-i pyproject.toml
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files '*' +auto
# Remove backup file
rm -f %{buildroot}/%{python3_sitelib}/nio/events/room_events.py.orig
%check
# Note that there is no %%files section for the unversioned python module
%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE.md
%doc README.md
%changelog
* Fri Nov 20 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.15.2-1
- Initial rpm