503b2cd
%if %{defined fedora}
503b2cd
%bcond_without ptipython
503b2cd
%endif
Carl George a8dae08
adbe8ef
Name:           ptpython
af85f5b
Version:        3.0.23
2a27f0a
Release:        %autorelease
adbe8ef
Summary:        Python REPL build on top of prompt_toolkit
af85f5b
License:        BSD-3-Clause
3c110be
URL:            https://github.com/prompt-toolkit/ptpython
af85f5b
Source:         %{pypi_source ptpython}
adbe8ef
BuildArch:      noarch
Carl George a8dae08
af85f5b
%global common_description %{expand:
af85f5b
Ptpython is an advanced Python REPL built on top of the prompt_toolkit library.
af85f5b
It features syntax highlighting, multiline editing (the up arrow works),
af85f5b
autocompletion, mouse support, support for color schemes, support for bracketed
af85f5b
paste, both Vi and Emacs key bindings, support for double width (Chinese)
af85f5b
characters, and many other things.}
af85f5b
Carl George a8dae08
adbe8ef
%description %{common_description}
8be029e
8be029e
Carl George a8dae08
%package -n ptpython3
adbe8ef
Summary:        %{summary}
adbe8ef
BuildRequires:  python3-devel
c5ffc43
Provides:       ptpython = %{version}-%{release}
af85f5b
%py_provides    python3-ptpython
Carl George a8dae08
Carl George a8dae08
adbe8ef
%description -n ptpython3 %{common_description}
Carl George a8dae08
Carl George a8dae08
Carl George a8dae08
%prep
5fe2e30
%autosetup
Carl George a8dae08
find -name \*.py | xargs sed -i -e '1 {/^#!\//d}'
Carl George a8dae08
Carl George a8dae08
0527674
%generate_buildrequires
503b2cd
%pyproject_buildrequires %{?with_ptipython:-x ptipython}
0527674
0527674
Carl George a8dae08
%build
0527674
%pyproject_wheel
Carl George a8dae08
Carl George a8dae08
Carl George a8dae08
%install
0527674
%pyproject_install
af85f5b
%pyproject_save_files ptpython
ff66cb6
%if %{without ptipython}
ff66cb6
rm %{buildroot}%{_bindir}/ptipython*
ff66cb6
%endif
0527674
0527674
0527674
%check
ff66cb6
%pyproject_check_import -e ptpython.contrib.asyncssh_repl %{!?with_ptipython:-e ptpython.ipython}
Carl George a8dae08
Carl George a8dae08
0527674
%files -n ptpython3 -f %{pyproject_files}
Carl George a8dae08
%doc CHANGELOG README.rst
75c11bd
%{_bindir}/ptpython
Carl George a8dae08
%{_bindir}/ptpython3
Carl George a8dae08
%{_bindir}/ptpython%{python3_version}
503b2cd
503b2cd
503b2cd
%if %{with ptipython}
503b2cd
%pyproject_extras_subpkg -n ptpython3 ptipython
75c11bd
%{_bindir}/ptipython
Carl George a8dae08
%{_bindir}/ptipython3
Carl George a8dae08
%{_bindir}/ptipython%{python3_version}
503b2cd
%endif
Carl George a8dae08
Carl George a8dae08
Carl George a8dae08
%changelog
2a27f0a
%autochangelog