]>
Commit | Line | Data |
---|---|---|
5b6b56be JB |
1 | # |
2 | # Conditional build: | |
7349462c JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_with tests # unit tests | |
5b6b56be JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
5b6b56be JB |
8 | Summary: Invoke py.test as distutils command with dependency resolution |
9 | Summary(pl.UTF-8): Wywoływanie py.test jako polecenia distutils z rozwiązywaniem zależności | |
10 | Name: python-pytest-runner | |
7349462c JB |
11 | # keep 5.2.x here for python2 support |
12 | Version: 5.2 | |
923a39af | 13 | Release: 3 |
5b6b56be JB |
14 | License: MIT |
15 | Group: Libraries/Python | |
72ca6d02 | 16 | #Source0Download: https://pypi.org/simple/pytest-runner/ |
80cc05d2 | 17 | Source0: https://files.pythonhosted.org/packages/source/p/pytest-runner/pytest-runner-%{version}.tar.gz |
7349462c | 18 | # Source0-md5: e5f66b8e8e87f62c59631c35c919d321 |
80cc05d2 | 19 | URL: https://github.com/pytest-dev/pytest-runner |
5b6b56be | 20 | %if %{with python2} |
72ca6d02 | 21 | BuildRequires: python-modules >= 1:2.7 |
7349462c | 22 | BuildRequires: python-setuptools >= 1:31.0.1 |
80cc05d2 | 23 | BuildRequires: python-setuptools_scm >= 1.15.0 |
72ca6d02 | 24 | %if %{with tests} |
7349462c JB |
25 | BuildRequires: python-pytest >= 3.5 |
26 | BuildRequires: python-pytest-black-multipy | |
27 | BuildRequires: python-pytest-cov | |
72ca6d02 | 28 | BuildRequires: python-pytest-flake8 |
7349462c | 29 | BuildRequires: python-pytest-virtualenv |
72ca6d02 | 30 | %endif |
5b6b56be JB |
31 | %endif |
32 | %if %{with python3} | |
33 | BuildRequires: python3-modules >= 1:3.2 | |
7349462c | 34 | BuildRequires: python3-setuptools >= 1:31.0.1 |
80cc05d2 | 35 | BuildRequires: python3-setuptools_scm >= 1.15.0 |
72ca6d02 | 36 | %if %{with tests} |
7349462c JB |
37 | BuildRequires: python3-pytest >= 3.5 |
38 | BuildRequires: python3-pytest-black-multipy | |
39 | BuildRequires: python3-pytest-cov | |
72ca6d02 | 40 | BuildRequires: python3-pytest-flake8 |
7349462c | 41 | BuildRequires: python3-pytest-virtualenv |
72ca6d02 | 42 | %endif |
5b6b56be | 43 | %endif |
7349462c JB |
44 | %if %{with doc} |
45 | BuildRequires: python-jaraco.packaging >= 3.2 | |
46 | BuildRequires: python-rst.linker >= 1.9 | |
47 | BuildRequires: sphinx-pdg-2 | |
48 | %endif | |
80cc05d2 JB |
49 | BuildRequires: rpm-pythonprov |
50 | BuildRequires: rpmbuild(macros) >= 1.714 | |
72ca6d02 | 51 | Requires: python-modules >= 1:2.7 |
5b6b56be JB |
52 | BuildArch: noarch |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %description | |
56 | Setup scripts can use pytest-runner to add setup.py test support for | |
57 | pytest runner. | |
58 | ||
59 | %description -l pl.UTF-8 | |
60 | Skrypty setup mogą wykorzystywać moduł pytest-runner do dodawania | |
61 | obsługi testów pytest runnera w setup.py. | |
62 | ||
63 | %package -n python3-pytest-runner | |
64 | Summary: Invoke py.test as distutils command with dependency resolution | |
65 | Summary(pl.UTF-8): Wywoływanie py.test jako polecenia distutils z rozwiązywaniem zależności | |
66 | Group: Libraries/Python | |
80cc05d2 | 67 | Requires: python3-modules >= 1:3.2 |
5b6b56be JB |
68 | |
69 | %description -n python3-pytest-runner | |
70 | Setup scripts can use pytest-runner to add setup.py test support for | |
71 | pytest runner. | |
72 | ||
73 | %description -n python3-pytest-runner -l pl.UTF-8 | |
74 | Skrypty setup mogą wykorzystywać moduł pytest-runner do dodawania | |
75 | obsługi testów pytest runnera w setup.py. | |
76 | ||
77 | %package apidocs | |
78 | Summary: pytest-runner module documentation | |
79 | Summary(pl.UTF-8): Dokumentacja modułu pytest-runner | |
80 | Group: Documentation | |
81 | ||
82 | %description apidocs | |
83 | Documentation for pytest-runner module. | |
84 | ||
85 | %description apidocs -l pl.UTF-8 | |
86 | Dokumentacja modułu pytest-runner. | |
87 | ||
88 | %prep | |
89 | %setup -q -n pytest-runner-%{version} | |
90 | ||
91 | %build | |
92 | %if %{with python2} | |
80cc05d2 JB |
93 | %py_build |
94 | ||
7349462c JB |
95 | %if %{with tests} |
96 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
97 | PYTEST_PLUGINS=pytest_black_multipy,pytest_cov.plugin,pytest_flake8,pytest_virtualenv \ | |
98 | %{__python} -m pytest ptr.py tests | |
5b6b56be JB |
99 | %endif |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
80cc05d2 JB |
103 | %py3_build |
104 | ||
7349462c JB |
105 | %if %{with tests} |
106 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
107 | PYTEST_PLUGINS=pytest_black_multipy,pytest_cov.plugin,pytest_flake8,pytest_virtualenv \ | |
108 | %{__python3} -m pytest ptr.py tests | |
109 | %endif | |
110 | %endif | |
111 | ||
112 | %if %{with doc} | |
113 | sphinx-build-2 -b html docs docs/build/html | |
5b6b56be JB |
114 | %endif |
115 | ||
116 | %install | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
119 | %if %{with python2} | |
1ab68473 | 120 | %py_install |
5b6b56be JB |
121 | |
122 | %py_postclean | |
123 | %endif | |
124 | ||
125 | %if %{with python3} | |
1ab68473 | 126 | %py3_install |
5b6b56be JB |
127 | %endif |
128 | ||
129 | %clean | |
130 | rm -rf $RPM_BUILD_ROOT | |
131 | ||
132 | %if %{with python2} | |
133 | %files | |
134 | %defattr(644,root,root,755) | |
72ca6d02 | 135 | %doc CHANGES.rst LICENSE README.rst |
5b6b56be JB |
136 | %{py_sitescriptdir}/ptr.py[co] |
137 | %{py_sitescriptdir}/pytest_runner-%{version}-py*.egg-info | |
138 | %endif | |
139 | ||
140 | %if %{with python3} | |
141 | %files -n python3-pytest-runner | |
142 | %defattr(644,root,root,755) | |
72ca6d02 | 143 | %doc CHANGES.rst LICENSE README.rst |
5b6b56be JB |
144 | %{py3_sitescriptdir}/ptr.py |
145 | %{py3_sitescriptdir}/__pycache__/ptr.cpython-*.py[co] | |
146 | %{py3_sitescriptdir}/pytest_runner-%{version}-py*.egg-info | |
147 | %endif | |
148 | ||
149 | %if %{with doc} | |
150 | %files apidocs | |
151 | %defattr(644,root,root,755) | |
7349462c | 152 | %doc docs/build/html/{_static,*.html,*.js} |
5b6b56be | 153 | %endif |