1 # NOTE: for versions >= 0.5 (for Python 3.5+) see python3-sphinx_gallery.spec
4 %bcond_with tests # unit tests [testconfs dir is missing in dist tarball]
5 %bcond_without python2 # CPython 2.x module
6 %bcond_with python3 # CPython 3.x module (built from python3-sphinx_gallery.spec)
8 Summary: Sphinx extension to automatically generate an examples gallery
9 Summary(pl.UTF-8): Rozszerzenie Sphinksa do automatycznego generowania galerii przykładów
10 Name: python-sphinx_gallery
11 # NOTE: keep 0.4.x here; 0.5+ don't support python 2
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/sphinx-gallery/
17 Source0: https://files.pythonhosted.org/packages/source/s/sphinx-gallery/sphinx-gallery-%{version}.tar.gz
18 # Source0-md5: 1f3e578107ca253a184889733a4fbcea
19 URL: https://github.com/sphinx-gallery/sphinx-gallery
21 BuildRequires: python-modules >= 1:2.5
22 %{?with_tests:BuildRequires: python-pytest}
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules >= 1:3.2
27 %{?with_tests:BuildRequires: python3-pytest}
28 BuildRequires: python3-setuptools
30 BuildRequires: rpm-pythonprov
31 BuildRequires: rpmbuild(macros) >= 1.714
32 Requires: python-modules >= 1:2.5
33 Provides: python-sphinx-gallery = %{version}-%{release}
34 Obsoletes: python-sphinx-gallery < 0.4.0-5
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 A Sphinx extension that builds an HTML version of any Python script
40 and puts it into an examples gallery.
42 It is extracted from the scikit-learn project and aims to be an
43 independent general purpose extension.
45 %description -l pl.UTF-8
46 Rozszerzenie Sphinksa tworzące wersję HTML dowolnego skryptu Pythona i
47 umieszczające go w galerii przykładów.
49 Zostało wyciągnięte z projektu scikit-learn z myślą o używaniu jako
50 niezależne rozszerzenie ogólnego przeznaczenia.
52 %package -n python3-sphinx_gallery
53 Summary: Sphinx extension to automatically generate an examples gallery
54 Summary(pl.UTF-8): Rozszerzenie Sphinksa do automatycznego generowania galerii przykładów
55 Group: Libraries/Python
56 Requires: python3-modules >= 1:3.2
57 Provides: python3-sphinx-gallery = %{version}-%{release}
58 Obsoletes: python3-sphinx-gallery < 0.4.0-5
60 %description -n python3-sphinx_gallery
61 A Sphinx extension that builds an HTML version of any Python script
62 and puts it into an examples gallery.
64 It is extracted from the scikit-learn project and aims to be an
65 independent general purpose extension.
67 %description -n python3-sphinx_gallery -l pl.UTF-8
68 Rozszerzenie Sphinksa tworzące wersję HTML dowolnego skryptu Pythona i
69 umieszczające go w galerii przykładów.
71 Zostało wyciągnięte z projektu scikit-learn z myślą o używaniu jako
72 niezależne rozszerzenie ogólnego przeznaczenia.
75 %setup -q -n sphinx-gallery-%{version}
82 PYTHONPATH=$(pwd)/build-2/lib \
83 pytest-2 sphinx_gallery/tests
91 PYTHONPATH=$(pwd)/build-3/lib \
92 pytest-3 sphinx_gallery/tests
97 rm -rf $RPM_BUILD_ROOT
103 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/sphinx_gallery/tests
107 # ensure tools come from python3 package
108 %{__rm} -r $RPM_BUILD_ROOT%{_bindir}
111 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/sphinx_gallery/tests
115 rm -rf $RPM_BUILD_ROOT
119 %defattr(644,root,root,755)
120 %doc CHANGES.rst LICENSE README.rst
121 %if %{without python3}
122 %attr(755,root,root) %{_bindir}/copy_sphinxgallery.sh
123 %attr(755,root,root) %{_bindir}/sphx_glr_python_to_jupyter.py
125 %{py_sitescriptdir}/sphinx_gallery
126 %{py_sitescriptdir}/sphinx_gallery-%{version}-py*.egg-info
130 %files -n python3-sphinx_gallery
131 %defattr(644,root,root,755)
132 %doc CHANGES.rst LICENSE README.rst
133 %attr(755,root,root) %{_bindir}/copy_sphinxgallery.sh
134 %attr(755,root,root) %{_bindir}/sphx_glr_python_to_jupyter.py
135 %{py3_sitescriptdir}/sphinx_gallery
136 %{py3_sitescriptdir}/sphinx_gallery-%{version}-py*.egg-info