]> git.pld-linux.org Git - packages/python-sphinx-gallery.git/blob - python-sphinx-gallery.spec
- fix non-deterministic tools packaging; release 2
[packages/python-sphinx-gallery.git] / python-sphinx-gallery.spec
1 #
2 # Conditional build:
3 %bcond_with     tests   # unit tests [testconfs dir is missing in dist tarball]
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 Summary:        Sphinx extension to automatically generate an examples gallery
8 Summary(pl.UTF-8):      Rozszerzenie Sphinksa do automatycznego generowania galerii przykładów
9 Name:           python-sphinx-gallery
10 Version:        0.4.0
11 Release:        2
12 License:        BSD
13 Group:          Libraries/Python
14 #Source0Download: https://pypi.org/simple/sphinx-gallery/
15 Source0:        https://files.pythonhosted.org/packages/source/s/sphinx-gallery/sphinx-gallery-%{version}.tar.gz
16 # Source0-md5:  1f3e578107ca253a184889733a4fbcea
17 URL:            https://github.com/sphinx-gallery/sphinx-gallery
18 %if %{with python2}
19 BuildRequires:  python-modules >= 1:2.5
20 %{?with_tests:BuildRequires:    python-pytest}
21 BuildRequires:  python-setuptools
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-modules >= 1:3.2
25 %{?with_tests:BuildRequires:    python3-pytest}
26 BuildRequires:  python3-setuptools
27 %endif
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  rpmbuild(macros) >= 1.714
30 Requires:       python-modules >= 1:2.5
31 BuildArch:      noarch
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 A Sphinx extension that builds an HTML version of any Python script
36 and puts it into an examples gallery.
37   
38 It is extracted from the scikit-learn project and aims to be an
39 independent general purpose extension.
40
41 %description -l pl.UTF-8
42 Rozszerzenie Sphinksa tworzące wersję HTML dowolnego skryptu Pythona i
43 umieszczające go w galerii przykładów.
44
45 Zostało wyciągnięte z projektu scikit-learn z myślą o używaniu jako
46 niezależne rozszerzenie ogólnego przeznaczenia.
47
48 %package -n python3-sphinx-gallery
49 Summary:        Sphinx extension to automatically generate an examples gallery
50 Summary(pl.UTF-8):      Rozszerzenie Sphinksa do automatycznego generowania galerii przykładów
51 Group:          Libraries/Python
52 Requires:       python3-modules >= 1:3.2
53
54 %description -n python3-sphinx-gallery
55 A Sphinx extension that builds an HTML version of any Python script
56 and puts it into an examples gallery.
57   
58 It is extracted from the scikit-learn project and aims to be an
59 independent general purpose extension.
60
61 %description -n python3-sphinx-gallery -l pl.UTF-8
62 Rozszerzenie Sphinksa tworzące wersję HTML dowolnego skryptu Pythona i
63 umieszczające go w galerii przykładów.
64
65 Zostało wyciągnięte z projektu scikit-learn z myślą o używaniu jako
66 niezależne rozszerzenie ogólnego przeznaczenia.
67
68 %prep
69 %setup -q -n sphinx-gallery-%{version}
70
71 %build
72 %if %{with python2}
73 %py_build
74
75 %if %{with tests}
76 PYTHONPATH=$(pwd)/build-2/lib \
77 pytest-2 sphinx_gallery/tests
78 %endif
79 %endif
80
81 %if %{with python3}
82 %py3_build
83
84 %if %{with tests}
85 PYTHONPATH=$(pwd)/build-3/lib \
86 pytest-3 sphinx_gallery/tests
87 %endif
88 %endif
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92
93 %if %{with python2}
94 %py_install
95
96 %py_postclean
97 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/sphinx_gallery/tests
98
99 # ensure tools come from python3 package
100 %{__rm} $RPM_BUILD_ROOT%{_bindir}/*
101 %endif
102
103 %if %{with python3}
104 %py3_install
105
106 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/sphinx_gallery/tests
107 %endif
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %if %{with python2}
113 %files
114 %defattr(644,root,root,755)
115 %doc CHANGES.rst LICENSE README.rst
116 %{py_sitescriptdir}/sphinx_gallery
117 %{py_sitescriptdir}/sphinx_gallery-%{version}-py*.egg-info
118 %endif
119
120 %if %{with python3}
121 %files -n python3-sphinx-gallery
122 %defattr(644,root,root,755)
123 %doc CHANGES.rst LICENSE README.rst
124 %attr(755,root,root) %{_bindir}/copy_sphinxgallery.sh
125 %attr(755,root,root) %{_bindir}/sphx_glr_python_to_jupyter.py
126 %{py3_sitescriptdir}/sphinx_gallery
127 %{py3_sitescriptdir}/sphinx_gallery-%{version}-py*.egg-info
128 %endif
This page took 0.080504 seconds and 4 git commands to generate.