f968e0d
%bcond_without tests
f968e0d
f968e0d
%global srcname urwid
f968e0d
f968e0d
Name:          python-%{srcname}
Packit 78543f4
Version:       2.6.10
434cbaa
Release:       %autorelease
26ea393
Summary:       Console user interface library
26ea393
5e4ed2f
# examples/twisted_serve_ssh.py is MIT
5e4ed2f
License:       LGPL-2.1-or-later AND MIT
26ea393
URL:           http://excess.org/urwid/
066b437
Source0:       %{pypi_source urwid}
26ea393
31b5f15
BuildArch:     noarch
31b5f15
26ea393
%global _description\
26ea393
Urwid is a Python library for making text console applications.  It has\
26ea393
many features including fluid interface resizing, support for UTF-8 and\
26ea393
CJK encodings, standard and custom text layout modes, simple markup for\
26ea393
setting text attributes, and a powerful, dynamic list box that handles a\
26ea393
mix of widget types.  It is flexible, modular, and leaves the developer in\
26ea393
control.
26ea393
26ea393
%description %_description
26ea393
f968e0d
%package -n python3-%{srcname}
26ea393
Summary: %summary
26ea393
%{?python_provide:%python_provide python3-urwid}
26ea393
BuildRequires: python3-devel
eedf09d
BuildRequires: python3-pytest
26ea393
f968e0d
%description -n python3-%{srcname} %_description
26ea393
4ee8c16
%generate_buildrequires
4ee8c16
%pyproject_buildrequires
4ee8c16
26ea393
%prep
682f486
%autosetup -n %{srcname}-%{version}
cd8d8a0
sed -i -e 's/--cov=urwid//' pyproject.toml
26ea393
find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \;
26ea393
find urwid -type f -name "*.py" -exec chmod 644 {} \;
26ea393
26ea393
%build
4ee8c16
%pyproject_wheel
26ea393
find examples -type f -exec chmod 0644 \{\} \;
26ea393
26ea393
%check
f968e0d
%if %{with tests}
7a93289
%pytest tests/
03236b0
%endif
26ea393
26ea393
%install
4ee8c16
%pyproject_install
4ee8c16
%pyproject_save_files %{srcname}
26ea393
4ee8c16
%files -n python3-%{srcname} -f %{pyproject_files}
26ea393
%license COPYING
26ea393
%doc README.rst examples docs
26ea393
26ea393
%changelog
434cbaa
%autochangelog