]>
Commit | Line | Data |
---|---|---|
b92641b1 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Run each test in a forked subprocess | |
8 | Summary(pl.UTF-8): Uruchamianie każdego testu w oddzielnym procesie | |
9 | Name: python-pytest-forked | |
9b6d17ac JB |
10 | # keep 1.3.x here for python2 support |
11 | Version: 1.3.0 | |
f85fb277 | 12 | Release: 2 |
b92641b1 JB |
13 | License: MIT |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/pytest-forked/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/p/pytest-forked/pytest-forked-%{version}.tar.gz | |
9b6d17ac | 17 | # Source0-md5: 7de04c46b48ca5c5a24e45bf1546355f |
b92641b1 JB |
18 | URL: https://github.com/pytest-dev/pytest-forked |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | BuildRequires: python-setuptools_scm | |
23 | %if %{with tests} | |
9b6d17ac JB |
24 | BuildRequires: python-py |
25 | BuildRequires: python-pytest >= 3.10 | |
b92641b1 JB |
26 | %endif |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.5 | |
30 | BuildRequires: python3-setuptools | |
31 | BuildRequires: python3-setuptools_scm | |
32 | %if %{with tests} | |
9b6d17ac JB |
33 | BuildRequires: python3-py |
34 | BuildRequires: python3-pytest >= 3.10 | |
b92641b1 JB |
35 | %endif |
36 | %endif | |
37 | BuildRequires: rpm-pythonprov | |
38 | BuildRequires: rpmbuild(macros) >= 1.714 | |
39 | Requires: python-modules >= 1:2.7 | |
40 | BuildArch: noarch | |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | Run each test in a forked subprocess. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Uruchamianie każdego testu w oddzielnym procesie. | |
48 | ||
49 | %package -n python3-pytest-forked | |
50 | Summary: Run each test in a forked subprocess | |
51 | Summary(pl.UTF-8): Uruchamianie każdego testu w oddzielnym procesie | |
52 | Group: Libraries/Python | |
53 | Requires: python3-modules >= 1:3.5 | |
54 | ||
55 | %description -n python3-pytest-forked | |
56 | Run each test in a forked subprocess. | |
57 | ||
58 | %description -n python3-pytest-forked -l pl.UTF-8 | |
59 | Uruchamianie każdego testu w oddzielnym procesie. | |
60 | ||
61 | %prep | |
62 | %setup -q -n pytest-forked-%{version} | |
63 | ||
b92641b1 JB |
64 | %build |
65 | %if %{with python2} | |
66 | %py_build | |
67 | ||
68 | %if %{with tests} | |
d679d493 | 69 | # pytest-flaky plugin breaks test_functional_boxed_capturing |
b92641b1 | 70 | PYTHONPATH=$(pwd)/src \ |
d679d493 | 71 | %{__python} -m pytest -p no:flaky testing |
b92641b1 JB |
72 | %endif |
73 | %endif | |
74 | ||
75 | %if %{with python3} | |
76 | %py3_build | |
77 | ||
78 | %if %{with tests} | |
79 | PYTHONPATH=$(pwd)/src \ | |
d679d493 | 80 | %{__python3} -m pytest -p no:flaky testing |
b92641b1 JB |
81 | %endif |
82 | %endif | |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %if %{with python2} | |
88 | %py_install | |
89 | ||
90 | %py_postclean | |
91 | %endif | |
92 | ||
93 | %if %{with python3} | |
94 | %py3_install | |
95 | %endif | |
96 | ||
97 | %clean | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
101 | %files | |
102 | %defattr(644,root,root,755) | |
103 | %doc CHANGELOG LICENSE README.rst example/boxed.txt | |
104 | %{py_sitescriptdir}/pytest_forked | |
105 | %{py_sitescriptdir}/pytest_forked-%{version}-py*.egg-info | |
106 | %endif | |
107 | ||
108 | %if %{with python3} | |
109 | %files -n python3-pytest-forked | |
110 | %defattr(644,root,root,755) | |
111 | %doc CHANGELOG LICENSE README.rst example/boxed.txt | |
112 | %{py3_sitescriptdir}/pytest_forked | |
113 | %{py3_sitescriptdir}/pytest_forked-%{version}-py*.egg-info | |
114 | %endif |