2782817b765235605201a32a6bf1e13fa91768f1
[packages/python3-ipykernel.git] / python-ipykernel.spec
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
8 Summary:        IPython kernel for Jupyter
9 Summary(pl.UTF-8):      Jądro IPythona dla Jupytera
10 Name:           python-ipykernel
11 Version:        4.10.1
12 Release:        1
13 License:        BSD
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/ipykernel/
16 Source0:        https://files.pythonhosted.org/packages/source/i/ipykernel/ipykernel-%{version}.tar.gz
17 # Source0-md5:  23871bb7da2907749cb65a9446c9e637
18 URL:            https://pypi.org/project/ipykernel/
19 %if %{with python2}
20 BuildRequires:  python-modules >= 1:2.7
21 BuildRequires:  python-setuptools
22 %if %{with tests}
23 BuildRequires:  python-ipython >= 4.0.0
24 BuildRequires:  python-jupyter_client
25 BuildRequires:  python-mock
26 BuildRequires:  python-nose
27 BuildRequires:  python-pytest
28 BuildRequires:  python-pytest-cov
29 BuildRequires:  python-traitlets >= 4.1.0
30 BuildRequires:  python-tornado >= 4.0
31 %endif
32 %endif
33 %if %{with python3}
34 BuildRequires:  python3-modules >= 1:3.4
35 BuildRequires:  python3-setuptools
36 %if %{with tests}
37 BuildRequires:  python3-ipython >= 4.0.0
38 BuildRequires:  python3-jupyter_client
39 BuildRequires:  python3-nose
40 BuildRequires:  python3-pytest
41 BuildRequires:  python3-pytest-cov
42 BuildRequires:  python3-traitlets >= 4.1.0
43 BuildRequires:  python3-tornado >= 4.0
44 %endif
45 %endif
46 BuildRequires:  rpm-pythonprov
47 BuildRequires:  rpmbuild(macros) >= 1.714
48 BuildRequires:  sed >= 4.0
49 %if %{with doc}
50 BuildRequires:  python3-sphinxcontrib_github_alt
51 BuildRequires:  sphinx-pdg-3
52 %endif
53 Requires:       python-modules >= 1:3.4
54 BuildArch:      noarch
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %description
58 This package provides the IPython kernel for Jupyter.
59
60 %description -l pl.UTF-8
61 Ten pakiet dostarcza jądro IPythona dla Jupytera.
62
63 %package -n python3-ipykernel
64 Summary:        IPython kernel for Jupyter
65 Summary(pl.UTF-8):      Jądro IPythona dla Jupytera
66 Group:          Libraries/Python
67 Requires:       python3-modules >= 1:3.4
68
69 %description -n python3-ipykernel
70 This package provides the IPython kernel for Jupyter.
71
72 %description -n python3-ipykernel -l pl.UTF-8
73 Ten pakiet dostarcza jądro IPythona dla Jupytera.
74
75 %package apidocs
76 Summary:        API documentation for Python ipykernel module
77 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona ipykernel
78 Group:          Documentation
79
80 %description apidocs
81 API documentation for Python ipykernel module.
82
83 %description apidocs -l pl.UTF-8
84 Dokumentacja 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
95 PYTHONPATH=$(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}
104 PYTHONPATH=$(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
115 rm -rf $RPM_BUILD_ROOT
116
117 %if %{with python2}
118 %py_install
119
120 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-ipykernel-%{version}
121 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-ipykernel-%{version}
122 find $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
133 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-ipykernel-%{version}
134 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-ipykernel-%{version}
135 find $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
143 rm -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.061881 seconds and 2 git commands to generate.