- typo
[packages/python3-ipykernel.git] / python-ipykernel.spec
CommitLineData
0eac7f55
JB
1#
2# Conditional build:
3%bcond_without doc # Sphinx documentation
4%bcond_without tests # unit tests
5%bcond_without python2 # CPython 2.x module
6%bcond_without python3 # CPython 3.x module
7
8Summary: IPython kernel for Jupyter
9Summary(pl.UTF-8): Jądro IPythona dla Jupytera
10Name: python-ipykernel
11Version: 4.10.1
12Release: 1
13License: BSD
14Group: Libraries/Python
15#Source0Download: https://pypi.org/simple/ipykernel/
16Source0: https://files.pythonhosted.org/packages/source/i/ipykernel/ipykernel-%{version}.tar.gz
17# Source0-md5: 23871bb7da2907749cb65a9446c9e637
18URL: https://pypi.org/project/ipykernel/
19%if %{with python2}
20BuildRequires: python-modules >= 1:2.7
21BuildRequires: python-setuptools
22%if %{with tests}
23BuildRequires: python-ipython >= 4.0.0
24BuildRequires: python-jupyter_client
25BuildRequires: python-mock
26BuildRequires: python-nose
27BuildRequires: python-pytest
28BuildRequires: python-pytest-cov
29BuildRequires: python-traitlets >= 4.1.0
30BuildRequires: python-tornado >= 4.0
31%endif
32%endif
33%if %{with python3}
34BuildRequires: python3-modules >= 1:3.4
35BuildRequires: python3-setuptools
36%if %{with tests}
37BuildRequires: python3-ipython >= 4.0.0
38BuildRequires: python3-jupyter_client
39BuildRequires: python3-nose
40BuildRequires: python3-pytest
41BuildRequires: python3-pytest-cov
42BuildRequires: python3-traitlets >= 4.1.0
43BuildRequires: python3-tornado >= 4.0
44%endif
45%endif
46BuildRequires: rpm-pythonprov
47BuildRequires: rpmbuild(macros) >= 1.714
48BuildRequires: sed >= 4.0
49%if %{with doc}
50BuildRequires: python3-sphinxcontrib_github_alt
51BuildRequires: sphinx-pdg-3
52%endif
84f5d5ff 53Requires: python-modules >= 1:2.7
0eac7f55
JB
54BuildArch: noarch
55BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57%description
58This package provides the IPython kernel for Jupyter.
59
60%description -l pl.UTF-8
61Ten pakiet dostarcza jądro IPythona dla Jupytera.
62
63%package -n python3-ipykernel
64Summary: IPython kernel for Jupyter
65Summary(pl.UTF-8): Jądro IPythona dla Jupytera
66Group: Libraries/Python
67Requires: python3-modules >= 1:3.4
68
69%description -n python3-ipykernel
70This package provides the IPython kernel for Jupyter.
71
72%description -n python3-ipykernel -l pl.UTF-8
73Ten pakiet dostarcza jądro IPythona dla Jupytera.
74
75%package apidocs
76Summary: API documentation for Python ipykernel module
77Summary(pl.UTF-8): Dokumentacja API modułu Pythona ipykernel
78Group: Documentation
79
80%description apidocs
81API documentation for Python ipykernel module.
82
83%description apidocs -l pl.UTF-8
84Dokumentacja API modułu Pythona ipykernel.
85
86%prep
87%setup -q -n ipykernel-%{version}
88
89%build
90%if %{with python2}
91%py_build
92
93%if %{with tests}
94# test_oinfo_detail test requires ipython source code
95PYTHONPATH=$(pwd) \
96%{__python} -m pytest -k 'not test_oinfo_detail' ipykernel
97%endif
98%endif
99
100%if %{with python3}
101%py3_build
102
103%if %{with tests}
104PYTHONPATH=$(pwd) \
105%{__python3} -m pytest ipykernel
106%endif
107%endif
108
109%if %{with doc}
110%{__make} -C docs html \
111 SPHINXBUILD=sphinx-build-3
112%endif
113
114%install
115rm -rf $RPM_BUILD_ROOT
116
117%if %{with python2}
118%py_install
119
120install -d $RPM_BUILD_ROOT%{_examplesdir}/python-ipykernel-%{version}
121cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-ipykernel-%{version}
122find $RPM_BUILD_ROOT%{_examplesdir}/python-ipykernel-%{version} -name '*.py' \
123 | xargs sed -i '1s|/usr/bin/env python|%{__python}|'
124
125%py_postclean
126%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/ipykernel/tests \
127 $RPM_BUILD_ROOT%{py_sitescriptdir}/ipykernel/inprocess/tests
128%endif
129
130%if %{with python3}
131%py3_install
132
133install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-ipykernel-%{version}
134cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-ipykernel-%{version}
135find $RPM_BUILD_ROOT%{_examplesdir}/python3-ipykernel-%{version} -name '*.py' \
136 | xargs sed -i '1s|/usr/bin/env python|%{__python3}|'
137
138%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/ipykernel/tests \
139 $RPM_BUILD_ROOT%{py3_sitescriptdir}/ipykernel/inprocess/tests
140%endif
141
142%clean
143rm -rf $RPM_BUILD_ROOT
144
145%if %{with python2}
146%files
147%defattr(644,root,root,755)
148%doc COPYING.md README.md
149%{py_sitescriptdir}/ipykernel
150%{py_sitescriptdir}/ipykernel_launcher.py[co]
151%{py_sitescriptdir}/ipykernel-%{version}-py*.egg-info
152%dir %{_datadir}/jupyter
153%dir %{_datadir}/jupyter/kernels
154%{_datadir}/jupyter/kernels/python2
155%{_examplesdir}/python-ipykernel-%{version}
156%endif
157
158%if %{with python3}
159%files -n python3-ipykernel
160%defattr(644,root,root,755)
161%doc COPYING.md README.md
162%{py3_sitescriptdir}/ipykernel
163%{py3_sitescriptdir}/ipykernel_launcher.py
164%{py3_sitescriptdir}/__pycache__/ipykernel_launcher.cpython-*.py[co]
165%{py3_sitescriptdir}/ipykernel-%{version}-py*.egg-info
166%dir %{_datadir}/jupyter
167%dir %{_datadir}/jupyter/kernels
168%{_datadir}/jupyter/kernels/python3
169%{_examplesdir}/python3-ipykernel-%{version}
170%endif
171
172%if %{with doc}
173%files apidocs
174%defattr(644,root,root,755)
175%doc docs/_build/html/{_static,*.html,*.js}
176%endif
This page took 0.143663 seconds and 4 git commands to generate.