Blob Blame History Raw
%bcond_without check
%bcond_without doc
%global pypi_name ipython

Name:           python2-ipython
Version:        5.5.0
Release:        2%{?dist}
Summary:        An enhanced interactive Python shell

License:        BSD

BuildArch:      noarch

%{?python_provide:%python_provide %{name}}
Provides:       ipython2 = %{version}-%{release}
Provides:       %{name}-console = %{version}-%{release}
Provides:       python-ipython-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:  python2-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:       python2-pathlib
Requires:       python2-decorator
Requires:       python2-mistune >= 0.3.1
Requires:       python2-jsonschema
Requires:       python2-path
Requires:       python2-pexpect
Requires:       python2-simplegeneric
Requires:       python2-traitlets >= 4.2
Requires:       python2-prompt_toolkit
Requires:       python2-pickleshare
Requires:       python2-setuptools

%if %{with doc}
BuildRequires:  python2-sphinx

%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:  python2-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:  python2-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\
 * 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.


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

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}
Provides:       ipython-doc = %{version}-%{release}
%description doc
This package contains the documentation of %{name}.

%autosetup -p1 -n %{pypi_name}-%{version}

# delete bundling libs
pushd IPython/external
ls -l
ls -l *

# use decorators of numpy
rm decorators/


# Remove shebangs
sed -i '1d' $(grep -lr '^#!/usr/' IPython)


%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/


# 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}
%global test_groups extensions lib testing terminal utils nbformat core autoreload

# Ensure that the user's is not invoked during any tests.
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}

%license COPYING.rst

%dir %{python2_sitelib}/IPython
%dir %{python2_sitelib}/IPython/kernel
%dir %{python2_sitelib}/IPython/testing


# tests go into subpackage
%exclude %{python2_sitelib}/IPython/*/tests/

%files sphinx
%license COPYING.rst

%files tests
%license COPYING.rst

%if %{with doc}
%files doc
%license COPYING.rst
%doc docs/build/html

* Fri Dec 08 2017 Iryna Shcherbina <> - 5.5.0-2
- Fix ambiguous Python 2 dependency declarations

* Sat Sep 30 2017 Lumir Balhar <> - 5.5.0-1
- New upstream release

* Thu Jul 27 2017 Fedora Release Engineering <> - 5.4.0-2
- Rebuilt for

* Thu Jun 1 2017 Lumir Balhar <> - 5.4.0-1
- New upstream release
- Remove patch for already fixed bug

* Fri May 12 2017 Lumir Balhar <> - 5.3.0-7
- Fix missing requires bug (RHBZ#1450288)

* Fri May 12 2017 Lumir Balhar <> - 5.3.0-6
- Bootstraping done - enable tests and docs subpackage

* Fri Apr 21 2017 Lumír Balhar <> - 5.3.0-5
- Initial package split from original ipython package
- Bootstraping - step 1 - disable tests and docs subpackage