File pyserial-asyncio.spec of Package pyserial-asyncio
%global pypi_name pyserial-asyncio
Name: %{pypi_name}
Version: 0.6
Release: 13%{?dist}
Summary: Asynchronous Python Serial Port Extension
# Automatically converted from old format: BSD - review is highly recommended.
License: LicenseRef-Callaway-BSD
URL: https://github.com/pyserial/pyserial-asyncio
Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
Async I/O extension package for the Python Serial Port Extension.
%package -n python3-%{pypi_name}
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3dist(pyserial)
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(pytest)
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
Async I/O extension package for the Python Serial Port Extension.
%package -n python-%{pypi_name}-doc
Summary: pyserial-asyncio documentation
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-rtd-theme)
%description -n python-%{pypi_name}-doc
Documentation for pyserial-asyncio.
%prep
%autosetup -n %{pypi_name}-%{version}
rm -rf %{pypi_name}.egg-info
sed -i -e '/^#!\//, 1d' serial_asyncio/__init__.py
%build
%py3_build
PYTHONPATH=${PWD} sphinx-build-3 documentation html
rm -rf html/.{doctrees,buildinfo}
%install
%py3_install
%check
%pytest -v test
%files -n python3-%{pypi_name}
%license LICENSE.txt
%doc README.rst
%{python3_sitelib}/serial_asyncio/
%{python3_sitelib}/pyserial_asyncio-%{version}-py%{python3_version}.egg-info/
%files -n python-%{pypi_name}-doc
%doc html
%license LICENSE.txt