]>
Commit | Line | Data |
---|---|---|
99e5f7af JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
5 | ||
6 | Summary: The Jupyter Notebook Format | |
7 | Summary(pl.UTF-8): Format Jupyter Notebook | |
8 | Name: python3-nbformat | |
9 | Version: 5.0.5 | |
eb062f6c | 10 | Release: 2 |
99e5f7af JB |
11 | License: BSD |
12 | Group: Libraries/Python | |
13 | #Source0Download: https://pypi.org/simple/nbformat/ | |
14 | Source0: https://files.pythonhosted.org/packages/source/n/nbformat/nbformat-%{version}.tar.gz | |
15 | # Source0-md5: b519838bfe4765cda1885936db4a2bea | |
16 | Patch0: %{name}-use_setuptools.patch | |
17 | URL: https://pypi.org/project/nbformat/ | |
18 | BuildRequires: python3-modules >= 1:3.5 | |
19 | BuildRequires: python3-setuptools | |
20 | %if %{with tests} | |
21 | BuildRequires: python3-ipython_genutils | |
22 | BuildRequires: python3-jsonschema >= 2.5.1 | |
23 | BuildRequires: python3-jupyter_core | |
24 | BuildRequires: python3-pytest | |
25 | BuildRequires: python3-pytest-cov | |
26 | BuildRequires: python3-testpath | |
27 | BuildRequires: python3-traitlets >= 4.1 | |
28 | %endif | |
29 | BuildRequires: rpm-pythonprov | |
30 | BuildRequires: rpmbuild(macros) >= 1.714 | |
31 | %if %{with doc} | |
32 | BuildRequires: sphinx-pdg-3 | |
33 | BuildRequires: python3-ipython_genutils | |
34 | BuildRequires: python3-jsonschema >= 2.5.1 | |
35 | BuildRequires: python3-jupyter_core | |
36 | BuildRequires: python3-traitlets | |
37 | %endif | |
38 | Requires: python3-modules >= 1:3.5 | |
39 | BuildArch: noarch | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | nbformat contains the reference implementation of the Jupyter Notebook | |
44 | format and Python APIs for working with notebooks. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | nbformat zawiera wzorcową implementację formatu Jupyter Notebook oraz | |
48 | API Pythona do pracy z takimi notatnikami. | |
49 | ||
50 | %package apidocs | |
51 | Summary: API documentation for Python nbformat module | |
52 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona nbformat | |
53 | Group: Documentation | |
54 | ||
55 | %description apidocs | |
56 | API documentation for Python nbformat module. | |
57 | ||
58 | %description apidocs -l pl.UTF-8 | |
59 | Dokumentacja API modułu Pythona nbformat. | |
60 | ||
61 | %prep | |
62 | %setup -q -n nbformat-%{version} | |
63 | %patch0 -p1 | |
64 | ||
65 | %build | |
66 | %py3_build | |
67 | ||
68 | %if %{with tests} | |
69 | %{__python3} -m pytest nbformat/tests | |
70 | %endif | |
71 | ||
72 | %if %{with doc} | |
73 | PYTHONPATH=$(pwd) \ | |
74 | %{__make} -C docs html \ | |
75 | SPHINXBUILD=sphinx-build-3 | |
76 | %endif | |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %py3_install | |
82 | ||
83 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/jupyter-trust{,-3} | |
84 | ln -s jupyter-trust-3 $RPM_BUILD_ROOT%{_bindir}/jupyter-trust | |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc COPYING.md README.md | |
92 | %attr(755,root,root) %{_bindir}/jupyter-trust | |
93 | %attr(755,root,root) %{_bindir}/jupyter-trust-3 | |
94 | %{py3_sitescriptdir}/nbformat | |
95 | %{py3_sitescriptdir}/nbformat-%{version}-py*.egg-info | |
96 | ||
97 | %if %{with doc} | |
98 | %files apidocs | |
99 | %defattr(644,root,root,755) | |
100 | %doc docs/_build/html/{_static,*.html,*.js} | |
101 | %endif |