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