File python-pyserial-asyncio.spec of Package python-pyserial-asyncio
#
# spec file for package python-pyserial-asyncio
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python3-%{**}}
%bcond_without test
%define skip_python2 1
%define pyname pyserial-asyncio
Name: python-pyserial-asyncio
Version: 0
Release: 0
Summary: asyncio extension package for pyserial
License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/pyserial/pyserial-asyncio
Source0: %{pyname}-%{version}.tar.xz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel >= 3.4}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module packaging}
BuildRequires: %{python_module pyserial}
BuildRequires: fdupes
#tests
%if %{with test}
BuildRequires: %{python_module virtualenv >= 14.0.0}
BuildRequires: %{python_module pytest}
%endif
BuildArch: noarch
Requires: python-pyserial
%python_subpackages
%description
Async I/O extension package for the Python Serial Port Extension for OSX, Linux, BSD
It depends on pySerial and is compatible with Python 3.4 and later.
%prep
%setup -q -n %{pyname}-%{version}
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with test}
%check
exit 0
%{python_expand virtualenv-%$python_bin_suffix --system-site-packages --no-download testvenv-%$python_bin_suffix
testvenv-%$python_bin_suffix/bin/pip install -e .[test,build]
export PYTHONPATH=$PWD/testvenv-%$python_bin_suffix/lib/python%$python_bin_suffix/site-packages/:$PWD
testvenv-%$python_bin_suffix/bin/python -m pytest && rm -Rf testvenv-%$python_bin_suffix
}
%endif
%files %{python_files}
%defattr(-,root,root,-)
%license LICENSE.txt
%doc README.rst
%{python_sitelib}/*
%changelog