%if 0%{?epel} # disable build of docs and tests for epel because of missing dependencies: # - python3-ipykernel # - python3-jupyter-client # - python3-nbformat # - python3-testpath # tests and docs subpackages are also disabled %bcond_with check %bcond_with doc %else %bcond_without check %bcond_without doc %endif Name: ipython Version: 8.21.0 Release: %autorelease Summary: An enhanced interactive Python shell # See bug #603178 for a quick overview for the choice of licenses # most files are under BSD and just a few under Python or MIT # There are some extensions released under GPLv2+ License: (BSD and MIT and Python) and GPLv2+ URL: http://ipython.org/ Source0: %pypi_source BuildArch: noarch BuildRequires: make BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-stack-data %if %{with doc} BuildRequires: python%{python3_pkgversion}-sphinx BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme BuildRequires: python%{python3_pkgversion}-ipykernel BuildRequires: python%{python3_pkgversion}-matplotlib BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-typing-extensions %endif %if %{with check} BuildRequires: python%{python3_pkgversion}-Cython BuildRequires: python%{python3_pkgversion}-matplotlib BuildRequires: python%{python3_pkgversion}-matplotlib-inline BuildRequires: python%{python3_pkgversion}-pymongo BuildRequires: python%{python3_pkgversion}-tornado >= 4.0 BuildRequires: python%{python3_pkgversion}-zmq BuildRequires: python%{python3_pkgversion}-zmq-tests BuildRequires: python%{python3_pkgversion}-nbformat BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pytest-asyncio BuildRequires: python%{python3_pkgversion}-ipykernel BuildRequires: python%{python3_pkgversion}-jupyter-client BuildRequires: python%{python3_pkgversion}-testpath # for frontend BuildRequires: python%{python3_pkgversion}-pygments # for latex BuildRequires: /usr/bin/dvipng BuildRequires: tex(amsmath.sty) BuildRequires: tex(amssymb.sty) BuildRequires: tex(amsthm.sty) BuildRequires: tex(bm.sty) %endif %global ipython_desc_base \ IPython provides a replacement for the interactive Python interpreter with\ extra functionality.\ \ Main features:\ * Comprehensive object introspection.\ * Input history, persistent across sessions.\ * Caching of output results during a session with automatically generated\ references.\ * Readline based name completion.\ * Extensible system of 'magic' commands for controlling the environment and\ performing many tasks related either to IPython or the operating system.\ * Configuration system with easy switching between different setups (simpler\ than changing $PYTHONSTARTUP environment variables every time).\ * Session logging and reloading.\ * Extensible syntax processing for special purpose situations.\ * Access to the system shell with user-extensible alias system.\ * Easily embeddable in other Python programs.\ * Integrated access to the pdb debugger and the Python profiler. %description %{ipython_desc_base} %package -n python%{python3_pkgversion}-ipython Summary: An enhanced interactive Python shell Provides: ipython3 = %{version}-%{release} Provides: ipython = %{version}-%{release} Provides: python3-ipython-console = %{version}-%{release} Obsoletes: python3-ipython-console < 5.3.0-1 Conflicts: python2-ipython < 7 BuildRequires: python%{python3_pkgversion}-backcall BuildRequires: python%{python3_pkgversion}-decorator BuildRequires: python%{python3_pkgversion}-jedi >= 0.10 BuildRequires: python%{python3_pkgversion}-pexpect BuildRequires: python%{python3_pkgversion}-pickleshare BuildRequires: python%{python3_pkgversion}-prompt-toolkit >= 2 BuildRequires: python%{python3_pkgversion}-traitlets >= 4.2 Requires: (tex(amsmath.sty) if /usr/bin/dvipng) Requires: (tex(amssymb.sty) if /usr/bin/dvipng) Requires: (tex(amsthm.sty) if /usr/bin/dvipng) Requires: (tex(bm.sty) if /usr/bin/dvipng) %description -n python%{python3_pkgversion}-ipython %{ipython_desc_base} This package provides IPython for in a terminal. %{?python_extras_subpkg:%python_extras_subpkg -n python%{python3_pkgversion}-ipython -i %{python3_sitelib}/*.egg-info notebook} %package -n python%{python3_pkgversion}-ipython-sphinx Summary: Sphinx directive to support embedded IPython code Requires: python%{python3_pkgversion}-ipython = %{version}-%{release} BuildRequires: python%{python3_pkgversion}-sphinx Requires: python%{python3_pkgversion}-sphinx %description -n python%{python3_pkgversion}-ipython-sphinx %{ipython_desc_base} This package contains the ipython sphinx extension. %if %{with check} %package -n python%{python3_pkgversion}-ipython+test Summary: Tests for %{name} Provides: python3-ipython-tests = %{version}-%{release} Obsoletes: python3-ipython-tests < 8.7.0-2 Requires: python%{python3_pkgversion}-ipykernel Requires: python%{python3_pkgversion}-ipython = %{version}-%{release} Requires: python%{python3_pkgversion}-jupyter-client Requires: python%{python3_pkgversion}-nbformat Requires: python%{python3_pkgversion}-zmq-tests # For latex Requires: /usr/bin/dvipng Requires: tex(amsmath.sty) Requires: tex(amssymb.sty) Requires: tex(amsthm.sty) Requires: tex(bm.sty) %description -n python%{python3_pkgversion}-ipython+test This package contains the tests of %{name}. You can check this way, if ipython works on your platform. %endif %if %{with doc} %package -n python%{python3_pkgversion}-ipython-doc Summary: Documentation for %{name} %description -n python%{python3_pkgversion}-ipython-doc This package contains the documentation of %{name}. %endif %prep %autosetup -p1 # delete bundling libs pushd IPython/external ls -l ls -l * popd # Remove shebangs sed -i '1d' $(grep -lr '^#!/usr/' IPython) find . -name '*.py' -print0 | xargs -0 sed -i '1s|^#!python|#!%{__python3}|' sed /black$/d -i setup.cfg %build %py3_build %if %{with doc} pushd docs PYTHONPATH=.. make html SPHINXBUILD='sphinx-build-3 -D intersphinx_timeout=1' mkdir -p build/html/ rm -rf build/html/.buildinfo popd %endif %install %py3_install mv %{buildroot}%{_bindir}/ipython{3,%{python3_version}} touch %{buildroot}%{_bindir}/ipython3 ln -sf ipython3 %{buildroot}%{_bindir}/ipython # link the manpage to ipython3 mv %{buildroot}%{_mandir}/man1/ipython{,%{python3_version}}.1 touch %{buildroot}%{_mandir}/man1/ipython3.1.gz ln -s ipython3.1 %{buildroot}%{_mandir}/man1/ipython.1 %if %{with check} %check # Ensure that the user's .pythonrc.py is not invoked during any tests. export PYTHONSTARTUP="" # Koji builders can be slow, especially on arms, we scale timeouts 4 times export IPYTHON_TESTING_TIMEOUT_SCALE=4 # To prevent _pytest.pathlib.ImportPathMismatchError, we are # testing directly in buildroot pushd %{buildroot}%{python3_sitelib}/IPython %pytest rm -rf .pytest_cache popd %else rm -r %{buildroot}%{python3_sitelib}/IPython/*/tests %endif %post -n python%{python3_pkgversion}-ipython if [ -f %{_bindir}/ipython3 -a ! -h %{_bindir}/ipython3 ]; then sed -i 's/python3$/python3.9/' %{_bindir}/ipython3 || : mv -f %{_bindir}/ipython{3,3.9} fi if [ -f %{_mandir}/man1/ipython3.1.gz -a ! -h %{_mandir}/man1/ipython3.1.gz ]; then mv -f %{_mandir}/man1/ipython{3,3.9}.1.gz fi for ver in 3.9 %{python3_version}; do alternatives --add-slave python3 %{_bindir}/python$ver \ %{_bindir}/ipython3 \ ipython3 \ %{_bindir}/ipython$ver alternatives --add-slave python3 %{_bindir}/python$ver \ %{_mandir}/man1/ipython3.1.gz \ ipython3-man \ %{_mandir}/man1/ipython$ver.1.gz done %postun -n python%{python3_pkgversion}-ipython # Do this only during uninstall process (not during update) if [ $1 -eq 0 ]; then for f in ipython3{,-man}; do alternatives --keep-foreign --remove-slave \ python3 %{_bindir}/python%{python3_version} $f done fi %files -n python%{python3_pkgversion}-ipython %ghost %{_bindir}/ipython %{_bindir}/ipython%{python3_version} %ghost %{_bindir}/ipython3 %ghost %{_mandir}/man1/ipython.* %{_mandir}/man1/ipython%{python3_version}.1.gz %ghost %{_mandir}/man1/ipython3.1.gz %dir %{python3_sitelib}/IPython %{python3_sitelib}/IPython/external %{python3_sitelib}/IPython/__pycache__/ %{python3_sitelib}/IPython/*.py* %{python3_sitelib}/IPython/py.typed %dir %{python3_sitelib}/IPython/testing %{python3_sitelib}/IPython/testing/__pycache__/ %{python3_sitelib}/IPython/testing/*.py* %{python3_sitelib}/IPython/testing/plugin %{python3_sitelib}/ipython-%{version}-py%{python3_version}.egg-info/ %{python3_sitelib}/IPython/core/ %{python3_sitelib}/IPython/extensions/ %{python3_sitelib}/IPython/lib/ %{python3_sitelib}/IPython/terminal/ %{python3_sitelib}/IPython/utils/ # tests go into subpackage %exclude %{python3_sitelib}/IPython/*/tests/ %files -n python%{python3_pkgversion}-ipython-sphinx %{python3_sitelib}/IPython/sphinxext/ %if %{with check} %files -n python%{python3_pkgversion}-ipython+test %ghost %{python3_sitelib}/ipython-%{version}-py%{python3_version}.egg-info/ %{python3_sitelib}/IPython/*/tests %endif %if %{with doc} %files -n python%{python3_pkgversion}-ipython-doc %doc docs/build/html %endif %changelog %autochangelog