3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests (failed for python3)
5 %bcond_without python2 # CPython 2.x module
6 %bcond_with python3 # CPython 3.x module (built from python3-pytest-cython.spec)
8 Summary: Plugin for testing Cython extension modules
9 Summary(pl.UTF-8): Wtyczka do testowania modułów rozszerzeń Cythona
10 Name: python-pytest-cython
11 # keep 0.1.x here for python2 support
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/pytest-cython/
17 Source0: https://files.pythonhosted.org/packages/source/p/pytest-cython/pytest-cython-%{version}.tar.gz
18 # Source0-md5: f24330785e961eed5f9a40716a977bae
19 URL: https://pypi.org/project/pytest-cython/
20 %{?with_tests:BuildRequires: libstdc++-devel}
22 BuildRequires: python-modules >= 1:2.6
23 BuildRequires: python-setuptools
25 BuildRequires: python-Cython >= 0.20.2
26 BuildRequires: python-pytest >= 2.7.3
30 BuildRequires: python3-modules >= 1:3.3
31 BuildRequires: python3-setuptools
33 BuildRequires: python3-Cython >= 0.20.2
34 BuildRequires: python3-pytest >= 2.7.3
37 BuildRequires: rpm-pythonprov
38 BuildRequires: rpmbuild(macros) >= 1.714
40 BuildRequires: python-sphinx_py3doc_enhanced_theme
41 BuildRequires: sphinx-pdg-2 >= 1.3
43 Requires: python-modules >= 1:2.6
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 This Pytest plugin allows for the doctesting of C extension modules
49 for Python, specifically created through Cython.
51 %description -l pl.UTF-8
52 Ta wtyczka Pytesta pozwala wykonywać doctesty modułów rozszerzeń w C
53 dla Pythona, w szczególności tych utworzonych przy pomocy Cythona.
55 %package -n python3-pytest-cython
56 Summary: Plugin for testing Cython extension modules
57 Summary(pl.UTF-8): Wtyczka do testowania modułów rozszerzeń Cythona
58 Group: Libraries/Python
59 Requires: python3-modules >= 1:3.3
61 %description -n python3-pytest-cython
62 This Pytest plugin allows for the doctesting of C extension modules
63 for Python, specifically created through Cython.
65 %description -n python3-pytest-cython -l pl.UTF-8
66 Ta wtyczka Pytesta pozwala wykonywać doctesty modułów rozszerzeń w C
67 dla Pythona, w szczególności tych utworzonych przy pomocy Cythona.
70 Summary: API documentation for Python pytest-cython module
71 Summary(pl.UTF-8): Dokumentacja API modułu Pythona pytest-cython
75 API documentation for Python pytest-cython module.
77 %description apidocs -l pl.UTF-8
78 Dokumentacja API modułu Pythona pytest-cython.
81 %setup -q -n pytest-cython-%{version}
88 cd tests/example-project
89 %{__python} setup.py clean build_ext --inplace --use-cython
91 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
92 PYTEST_PLUGINS="pytest_cython.plugin" \
93 PYTHONPATH=$(pwd)/src \
94 %{__python} -m pytest tests/test_pytest_cython.py
102 cd tests/example-project
103 %{__python3} setup.py clean build_ext --inplace --use-cython
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 PYTEST_PLUGINS="pytest_cython.plugin" \
107 PYTHONPATH=$(pwd)/src \
108 %{__python3} -m pytest tests/test_pytest_cython.py
114 PYTHONPATH=$(pwd)/src \
115 sphinx-build-2 docs docs/build/html
116 #%{__python3} -m sphinx . build/html
120 rm -rf $RPM_BUILD_ROOT
133 rm -rf $RPM_BUILD_ROOT
137 %defattr(644,root,root,755)
138 %doc CHANGELOG.rst LICENSE README.rst
139 %{py_sitescriptdir}/pytest_cython
140 %{py_sitescriptdir}/pytest_cython-%{version}-py*.egg-info
144 %files -n python3-pytest-cython
145 %defattr(644,root,root,755)
146 %doc CHANGELOG.rst LICENSE README.rst
147 %{py3_sitescriptdir}/pytest_cython
148 %{py3_sitescriptdir}/pytest_cython-%{version}-py*.egg-info
153 %defattr(644,root,root,755)
154 %doc docs/build/html/{_static,reference,*.html,*.js}