5ebbb44
# Unset -s on python shebang - ensure that extensions installed with pip
5ebbb44
# to user locations are seen and properly loaded
7e8de5c
%global py3_shebang_flags %(echo %py3_shebang_flags | sed s/s//)
5ebbb44
b9f2736
%global srcname jupyter-console
b9f2736
%global srcname_ jupyter_console
b9f2736
b9f2736
Name:           python-%{srcname}
5ba4ec0
Version:        6.6.3
f8e87a6
Release:        %autorelease
b9f2736
Summary:        Jupyter terminal console
b9f2736
2dc0885
License:        BSD-3-Clause
b9f2736
URL:            https://jupyter.org
b9f2736
Source0:        %pypi_source %{srcname_}
b9f2736
b9f2736
BuildArch:      noarch
b9f2736
b9f2736
BuildRequires:  python3-devel
b9f2736
b9f2736
%description
b9f2736
An IPython-like terminal frontend for Jupyter kernels in any language.
b9f2736
b9f2736
b9f2736
%package -n     python3-%{srcname}
b9f2736
Summary:        %{summary}
b9f2736
d4ddd64
BuildRequires:  python3dist(pillow)
b9f2736
b9f2736
%description -n python3-%{srcname}
b9f2736
An IPython-like terminal frontend for Jupyter kernels in any language.
b9f2736
b9f2736
b9f2736
%package -n python-%{srcname}-doc
b9f2736
Summary:        jupyter-console documentation
b9f2736
b9f2736
BuildArch: noarch
b9f2736
2c10eae
BuildRequires:  make
b9f2736
BuildRequires:  python3dist(sphinx)
b9f2736
BuildRequires:  python3dist(sphinx-rtd-theme)
b9f2736
BuildRequires:  python3dist(sphinxcontrib-github-alt)
b9f2736
b9f2736
%description -n python-%{srcname}-doc
b9f2736
Documentation for jupyter-console
b9f2736
b9f2736
b9f2736
%prep
390c3da
%autosetup -n %{srcname_}-%{version} -p1
b9f2736
b913a30
%generate_buildrequires
2dc0885
%pyproject_buildrequires -x test
b9f2736
b9f2736
%build
b913a30
%pyproject_wheel
b9f2736
b9f2736
# generate html docs
e936898
%make_build -C docs html PYTHONPATH=$PWD
2c10eae
mv docs/_build/html .
b9f2736
# remove the sphinx-build leftovers
b9f2736
rm -rf html/.{doctrees,buildinfo}
b9f2736
b9f2736
%install
b913a30
%pyproject_install
b913a30
%pyproject_save_files %{srcname_}
b9f2736
b9f2736
%check
d4ddd64
%{pytest} -ra
b9f2736
38cb80f
# assert we can start the console ad run a simple command
38cb80f
export PATH=%{buildroot}%{_bindir}:$PATH
38cb80f
export PYTHONPATH=%{buildroot}%{python3_sitelib}
38cb80f
echo 'exit()' | jupyter-console --simple-prompt
38cb80f
b913a30
%files -n python3-%{srcname} -f %{pyproject_files}
b9f2736
%doc README.md
b9f2736
%{_bindir}/%{srcname}
b9f2736
b9f2736
%files -n python-%{srcname}-doc
b9f2736
%doc html
e12cbb4
%license LICENSE
b9f2736
b9f2736
b9f2736
%changelog
f8e87a6
%autochangelog