Blob Blame History Raw
%global modname	ipykernel

Name:		python-%{modname}
Version:	4.8.2
Release:	1%{?dist}
Summary:	IPython Kernel for Jupyter
License:	BSD
URL:		https://github.com/ipython/%{modname}
Source0:	https://github.com/ipython/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz
BuildArch:	noarch

BuildRequires:  %{_bindir}/sphinx-build-3
BuildRequires:  python3-sphinxcontrib-github-alt

%global _description \
This package provides the IPython kernel for Jupyter.

%description	%{_description}

%package -n	python2-%{modname}
Summary:	%{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires:	python2-devel
BuildRequires:  python2-ipython >= 4
BuildRequires:  python2-jupyter-client
BuildRequires:  python2-traitlets >= 4.1.0
BuildRequires:  python2-tornado >= 4.0
BuildRequires:  python2-mock
BuildRequires:  python2-nose
BuildRequires:  python2-nose_warnings_filters
BuildRequires:  python2-numpy
Requires:       python2-ipython >= 4
Requires:       python2-jupyter-client
Requires:       python2-traitlets >= 4.1.0
Requires:       python2-tornado >= 4.0

Recommends:     python2-matplotlib
Recommends:     python2-numpy
Recommends:     python2-pandas
Recommends:     python2-scipy
Recommends:     python2-pillow

%description -n	python2-%{modname} %{_description}

Python 2 version.

%package -n	python%{python3_pkgversion}-%{modname}
Summary:	%{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}
BuildRequires:	python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-ipython >= 4
BuildRequires:  python%{python3_pkgversion}-jupyter-client
BuildRequires:  python%{python3_pkgversion}-traitlets >= 4.1.0
BuildRequires:  python%{python3_pkgversion}-tornado >= 4.0
BuildRequires:  python%{python3_pkgversion}-nose
BuildRequires:  python%{python3_pkgversion}-nose_warnings_filters
BuildRequires:  python%{python3_pkgversion}-numpy
Requires:       python%{python3_pkgversion}-ipython >= 4
Requires:       python%{python3_pkgversion}-jupyter-client
Requires:       python%{python3_pkgversion}-traitlets >= 4.1.0
Requires:       python%{python3_pkgversion}-tornado >= 4.0

Recommends:     python%{python3_pkgversion}-matplotlib
Recommends:     python%{python3_pkgversion}-numpy
Recommends:     python%{python3_pkgversion}-pandas
Recommends:     python%{python3_pkgversion}-scipy
Recommends:     python%{python3_pkgversion}-pillow

%description -n	python%{python3_pkgversion}-%{modname} %{_description}

Python 3 version.

%package	doc
Summary:	Documentation for %{name}

%description	doc
This package contains the documentation of %{name}.

%prep
%setup -q -n %{modname}-%{version}

%build
%py2_build
%py3_build

pushd docs
    make %{?_smp_mflags} html SPHINXBUILD=sphinx-build-3
popd

%install
%py2_install
%py3_install
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -fpavr docs/_build/html %{buildroot}%{_docdir}/%{name}
rm %{buildroot}%{_docdir}/%{name}/html/{.buildinfo,objects.inv}

# Install the kernels so they can be found
# See https://bugzilla.redhat.com/show_bug.cgi?id=1327979#c19
%{__python2} -m ipykernel install --prefix %{buildroot}%{_prefix}
ls %{buildroot}%{_datadir}/jupyter/kernels/python2/
cat %{buildroot}%{_datadir}/jupyter/kernels/python2/kernel.json

%{__python3} -m ipykernel install --prefix %{buildroot}%{_prefix}
ls %{buildroot}%{_datadir}/jupyter/kernels/python3/
cat %{buildroot}%{_datadir}/jupyter/kernels/python3/kernel.json

# Remove Python 2 syntactically invalid file to survive the bytecompilation
rm -f %{buildroot}%{python2_sitelib}/%{modname}/tests/_asyncio.py


%check
nosetests-2 ipykernel
nosetests-3 ipykernel


%files	-n python2-%{modname}
%license COPYING.md
%doc CONTRIBUTING.md MANIFEST.in README.md
%{python2_sitelib}/%{modname}*
%{python2_sitelib}/%{modname}*.egg-info
%dir %{_datadir}/jupyter
%dir %{_datadir}/jupyter/kernels
%{_datadir}/jupyter/kernels/python2


%files	-n python%{python3_pkgversion}-%{modname}
%license COPYING.md
%doc CONTRIBUTING.md MANIFEST.in README.md
%{python3_sitelib}/%{modname}*
%{python3_sitelib}/%{modname}*.egg-info
%{python3_sitelib}/__pycache__/%{modname}*
%dir %{_datadir}/jupyter
%dir %{_datadir}/jupyter/kernels
%{_datadir}/jupyter/kernels/python3


%files	doc
%doc %{_docdir}/%{name}/html

%changelog
* Wed May 23 2018 Miro Hrončok <mhroncok@redhat.com> - 4.8.2-1
- Update to 4.8.2 (#1438785)
- Use Python 3 Sphinx to build the docs

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Dec 08 2017 Iryna Shcherbina <ishcherb@redhat.com> - 4.6.0-3
- Fix ambiguous Python 2 dependency declarations
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sun Apr 09 2017 Miro Hrončok <mhroncok@redhat.com> - 4.6.0-1
- Update to 4.6.0
- Recommend some useful packages
- Run the testsuite

* Wed Mar 15 2017 Miro Hrončok <mhroncok@redhat.com> - 4.5.2-6
- Package the kernel json files

* Wed Mar 8 2017 Orion Poplawski <orion@cora.nwra.com> - 4.5.2-5
- Add missing requires (bug #1430480)

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Dec 27 2016 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 4.5.2-3
- Preseve timestamp of installed files (#1406958#c7)

* Mon Dec 26 2016 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 4.5.2-2
- Use proper Source0 format (#1406958#c4)
- Do parallel html make (#1406958#c4)

* Thu Dec 22 2016 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 4.5.2-1
- Update to latest upstream release.
- Correct removal of unnecessary doc files.

* Wed Nov 16 2016 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 4.5.1-1
- Initial package.