%bcond_without check %bcond_without doc %global pypi_name ipython Name: python2-ipython Version: 5.3.0 Release: 5%{?dist} Summary: An enhanced interactive Python shell License: BSD URL: http://ipython.org/ Source0: https://files.pythonhosted.org/packages/source/i/ipython/ipython-%{version}.tar.gz # Already fixed bug, will be removed during next update # https://github.com/ipython/ipython/pull/10476 Patch0: 0001-Fix-bug-in-generating-shortcuts.patch BuildArch: noarch %{?python_provide:%python_provide %{name}} Provides: ipython2 = %{version}-%{release} Provides: %{name}-console = %{version}-%{release} Provides: %{pypi_name} = %{version}-%{release} Obsoletes: %{name}-console < 5.3.0-1 Obsoletes: %{pypi_name} < 5.3.0-4 BuildRequires: python2-devel BuildRequires: python2-decorator BuildRequires: python2-jsonschema BuildRequires: python2-path BuildRequires: python2-pexpect BuildRequires: python2-simplegeneric BuildRequires: python2-pickleshare BuildRequires: python-mistune >= 0.3.1 BuildRequires: python2-traitlets >= 4.2 BuildRequires: python2-prompt_toolkit Requires: python2-zmq Requires: python2-backports-shutil_get_terminal_size Requires: python2-zmq Requires: python-pathlib Requires: python2-decorator Requires: python-mistune >= 0.3.1 Requires: python2-jsonschema Requires: python2-path Requires: python2-simplegeneric Requires: python2-traitlets >= 4.2 Requires: python2-prompt_toolkit Requires: python2-pickleshare Requires: python2-setuptools # Require $current_python_interpreter-ipython Requires: python-ipython %if %{with doc} BuildRequires: python2-sphinx %endif %if %{with check} # for checking/testing BuildRequires: python2-Cython BuildRequires: python2-nose BuildRequires: python2-matplotlib BuildRequires: python2-mock BuildRequires: python2-pymongo BuildRequires: python2-requests BuildRequires: python2-zmq BuildRequires: python2-zmq-tests BuildRequires: python-pathlib BuildRequires: python2-backports-shutil_get_terminal_size BuildRequires: python2-nbformat BuildRequires: python2-pytest BuildRequires: python2-ipykernel BuildRequires: python2-jupyter-client BuildRequires: python2-testpath # for frontend BuildRequires: python-pygments # for running qt/matplotlib tests BuildRequires: xorg-x11-server-Xvfb %endif # with check %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} This package provides IPython for a terminal. %package sphinx Summary: Sphinx directive to support embedded IPython code %{?python_provide:%python_provide %{name}-sphinx} Requires: %{name} = %{version}-%{release} BuildRequires: python2-sphinx Requires: python2-sphinx %description sphinx %{ipython_desc_base} This package contains the ipython sphinx extension. %package tests Summary: Tests for %{name} %{?python_provide:%python_provide %{name}-tests} Requires: python2-nose Requires: python2-zmq-tests Requires: %{name} = %{version}-%{release} Requires: python2-nbformat Requires: python2-pytest Requires: python2-ipykernel Requires: python2-jupyter-client Requires: python2-testpath %description tests This package contains the tests of %{name}. You can check this way, if ipython works on your platform. %if %{with doc} %package doc Summary: Documentation for %{name} License: CC-BY %{?python_provide:%python_provide %{name}-doc} %description doc This package contains the documentation of %{name}. %endif %prep %autosetup -p1 -n %{pypi_name}-%{version} # delete bundling libs pushd IPython/external ls -l ls -l * # use decorators of numpy rm decorators/_decorators.py popd # Remove shebangs sed -i '1d' $(grep -lr '^#!/usr/' IPython) %build %py2_build %if %{with doc} pushd docs PYTHONPATH=.. make html PYTHON=%{__python2} SPHINXBUILD=sphinx-build-2 mkdir -p build/html/ rm -rf build/html/.buildinfo # Do not bundle fonts rm -rf build/html/_static/fonts/ popd %endif %install %py2_install # Do we need to replace python3 with python2? Only seems to occur on rawhide, see #1123618 echo %{buildroot}%{_bindir}/{iptest,ipython} | xargs head -n 2 echo %{buildroot}%{_bindir}/{iptest,ipython} | xargs sed -i '1s|^#!%{__python3}|#!%{__python2}|' %if %{with check} %check %global test_groups extensions lib testing terminal utils nbformat core autoreload # Ensure that the user's .pythonrc.py is not invoked during any tests. export PYTHONSTARTUP="" mkdir -p run_tests pushd run_tests PYTHONPATH=%{buildroot}%{python2_sitelib} \ PATH="%{buildroot}%{_bindir}:$PATH" \ LC_ALL=en_US.UTF-8 \ xvfb-run \ %{buildroot}%{_bindir}/iptest2 %{test_groups} popd %endif %files %license COPYING.rst %{_bindir}/ipython %{_bindir}/ipython2 %{_mandir}/man*/ipython.* %dir %{python2_sitelib}/IPython %{python2_sitelib}/IPython/external %{python2_sitelib}/IPython/*.py* %dir %{python2_sitelib}/IPython/kernel %{python2_sitelib}/IPython/kernel/*.py* %dir %{python2_sitelib}/IPython/testing %{python2_sitelib}/IPython/testing/*.py* %{python2_sitelib}/IPython/testing/plugin %{python2_sitelib}/ipython-%{version}-py?.?.egg-info %{python2_sitelib}/IPython/core/ %{python2_sitelib}/IPython/extensions/ %{python2_sitelib}/IPython/lib/ %{python2_sitelib}/IPython/terminal/ %{python2_sitelib}/IPython/utils/ # tests go into subpackage %exclude %{python2_sitelib}/IPython/*/tests/ %files sphinx %license COPYING.rst %{python2_sitelib}/IPython/sphinxext/ %files tests %license COPYING.rst %{_bindir}/iptest %{_bindir}/iptest2 %{python2_sitelib}/IPython/*/tests %if %{with doc} %files doc %license COPYING.rst %doc docs/build/html %endif %changelog * Fri Apr 21 2017 Lumír Balhar - 5.3.0-5 - Initial package split from original ipython package