File python-pyrepl.spec of Package python-pyrepl
#
# spec file for package python-pyrepl
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pyrepl
# Waiting on new release
Version: 0.9.0
Release: 0
License: X11
Summary: A library for building flexible command line interfaces
Url: https://github.com/pypy/pyrepl/
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/p/pyrepl/pyrepl-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module six}
BuildRequires: %{python_module modernize}
BuildRequires: %{python_module pexpect}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setupmeta}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
Requires: python-six
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
A library for building flexible command line interfaces.
%prep
%setup -q -n pyrepl-%{version}
python-modernize -n -w --no-diffs pyrepl
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/pythoni
%python_clone -a %{buildroot}%{_bindir}/pythoni1
%check
export LANG=en_US.UTF-8
# -p no:unraisableexception ignores unclosed file resource warning
# test_raw_input fails due to test logic, not runtime logic
%pytest -p no:unraisableexception -k 'not (test_raw_input or test_read_history_file)'
%post
%{python_install_alternative pythoni pythoni1}
%postun
%{python_uninstall_alternative pythoni pythoni1}
%files %{python_files}
%doc CHANGES README
%license LICENSE
%python_alternative %{_bindir}/pythoni
%python_alternative %{_bindir}/pythoni1
%{python_sitelib}/*pyrepl*/
%changelog