]>
Commit | Line | Data |
---|---|---|
f3bc1ac7 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_with tests # unit tests (one failing on py3) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
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 | Version: 0.1.1.post0 | |
1c59d218 | 12 | Release: 2 |
f3bc1ac7 JB |
13 | License: MIT |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/pytest-cython/ | |
16 | #Source0: https://files.pythonhosted.org/packages/source/p/pytest-cython/pytest-cython-%{version}.tar.gz | |
17 | Source0: https://files.pythonhosted.org/packages/45/12/39dba6aae3257d762ef56b0667971e71544ab1932825839666152c744c1e/pytest-cython-%{version}.tar.gz | |
18 | # Source0-md5: f24330785e961eed5f9a40716a977bae | |
19 | URL: https://pypi.org/project/pytest-cython/ | |
20 | %{?with_tests:BuildRequires: libstdc++-devel} | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.6 | |
23 | BuildRequires: python-setuptools | |
24 | %if %{with tests} | |
25 | BuildRequires: python-Cython >= 0.20.2 | |
26 | BuildRequires: python-pytest >= 2.7.3 | |
27 | %endif | |
28 | %endif | |
29 | %if %{with python3} | |
30 | BuildRequires: python3-modules >= 1:3.3 | |
31 | BuildRequires: python3-setuptools | |
32 | %if %{with tests} | |
33 | BuildRequires: python3-Cython >= 0.20.2 | |
34 | BuildRequires: python3-pytest >= 2.7.3 | |
35 | %endif | |
36 | %endif | |
37 | BuildRequires: rpm-pythonprov | |
38 | BuildRequires: rpmbuild(macros) >= 1.714 | |
39 | %if %{with doc} | |
40 | BuildRequires: python3-Sphinx >= 1.3 | |
41 | BuildRequires: python3-sphinx_py3doc_enhanced_theme | |
42 | %endif | |
43 | Requires: python-modules >= 1:2.6 | |
44 | BuildArch: noarch | |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | This Pytest plugin allows for the doctesting of C extension modules | |
49 | for Python, specifically created through Cython. | |
50 | ||
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. | |
54 | ||
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 | |
60 | ||
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. | |
64 | ||
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. | |
68 | ||
69 | %package apidocs | |
70 | Summary: API documentation for Python pytest-cython module | |
71 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona pytest-cython | |
72 | Group: Documentation | |
73 | ||
74 | %description apidocs | |
75 | API documentation for Python pytest-cython module. | |
76 | ||
77 | %description apidocs -l pl.UTF-8 | |
78 | Dokumentacja API modułu Pythona pytest-cython. | |
79 | ||
80 | %prep | |
81 | %setup -q -n pytest-cython-%{version} | |
82 | ||
83 | %build | |
84 | %if %{with python2} | |
85 | %py_build | |
86 | ||
87 | %if %{with tests} | |
88 | cd tests/example-project | |
89 | %{__python} setup.py clean build_ext --inplace --use-cython | |
90 | cd ../.. | |
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 | |
95 | %endif | |
96 | %endif | |
97 | ||
98 | %if %{with python3} | |
99 | %py3_build | |
100 | ||
101 | %if %{with tests} | |
102 | cd tests/example-project | |
103 | %{__python3} setup.py clean build_ext --inplace --use-cython | |
104 | cd ../.. | |
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 | |
109 | %endif | |
110 | %endif | |
111 | ||
112 | %if %{with doc} | |
113 | cd docs | |
114 | PYTHONPATH=$(pwd)/../src \ | |
115 | %{__python3} -m sphinx -W . build/html | |
116 | %endif | |
117 | ||
118 | %install | |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
121 | %if %{with python2} | |
122 | %py_install | |
123 | ||
124 | %py_postclean | |
125 | %endif | |
126 | ||
127 | %if %{with python3} | |
128 | %py3_install | |
129 | %endif | |
130 | ||
131 | %clean | |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
134 | %if %{with python2} | |
135 | %files | |
136 | %defattr(644,root,root,755) | |
137 | %doc CHANGELOG.rst LICENSE README.rst | |
138 | %{py_sitescriptdir}/pytest_cython | |
139 | %{py_sitescriptdir}/pytest_cython-%{version}-py*.egg-info | |
140 | %endif | |
141 | ||
142 | %if %{with python3} | |
143 | %files -n python3-pytest-cython | |
144 | %defattr(644,root,root,755) | |
145 | %doc CHANGELOG.rst LICENSE README.rst | |
146 | %{py3_sitescriptdir}/pytest_cython | |
147 | %{py3_sitescriptdir}/pytest_cython-%{version}-py*.egg-info | |
148 | %endif | |
149 | ||
150 | %if %{with doc} | |
151 | %files apidocs | |
152 | %defattr(644,root,root,755) | |
153 | %doc docs/build/html/{_static,reference,*.html,*.js} | |
154 | %endif |