3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 Summary: Behaviour-driven development, Python style
9 Summary(pl.UTF-8): Programowanie sterowane zachowaniem - w stylu Pythona
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/behave/
16 Source0: https://files.pythonhosted.org/packages/source/b/behave/behave-%{version}.tar.gz
17 # Source0-md5: 3f05c859a1c45f5ed33e925817ad887d
18 Patch0: %{name}-mock.patch
19 URL: https://pypi.org/project/behave/
21 BuildRequires: python-modules >= 1:2.6
22 BuildRequires: python-setuptools
24 BuildRequires: python-enum34
25 BuildRequires: python-mock >= 2.0
26 BuildRequires: python-nose >= 1.3
27 BuildRequires: python-parse >= 1.8.2
28 BuildRequires: python-parse_type >= 0.4.2
29 BuildRequires: python-path >= 10.1
30 BuildRequires: python-pyhamcrest >= 1.9
31 BuildRequires: python-pytest >= 3.0
32 BuildRequires: python-six >= 1.11
33 BuildRequires: python-traceback2
34 %if "%{py_ver}" < "2.7"
35 BuildRequires: python-argparse
36 BuildRequires: python-importlib
37 BuildRequires: python-ordereddict
42 BuildRequires: python3-2to3 >= 1:3.3
43 BuildRequires: python3-modules >= 1:3.3
44 BuildRequires: python3-setuptools
46 BuildRequires: python3-nose >= 1.3
47 BuildRequires: python3-parse >= 1.8.2
48 BuildRequires: python3-parse_type >= 0.4.2
49 BuildRequires: python3-path >= 10.1
50 BuildRequires: python3-pyhamcrest >= 1.9
51 BuildRequires: python3-pytest >= 3.0
52 BuildRequires: python3-six >= 1.11
55 BuildRequires: rpm-pythonprov
56 BuildRequires: rpmbuild(macros) >= 1.714
58 BuildRequires: python3-sphinx_bootstrap_theme >= 0.6.0
59 BuildRequires: sphinx-pdg-3 >= 1.6
61 Requires: python-modules >= 1:2.6
63 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 behave is behavior-driven development, Python style.
68 %description -l pl.UTF-8
69 behave to programowanie sterowane zachowaniem, w stylu Pythona.
71 %package -n python3-behave
72 Summary: Behaviour-driven development, Python style
73 Summary(pl.UTF-8): Programowanie sterowane zachowaniem - w stylu Pythona
74 Group: Libraries/Python
75 Requires: python3-modules >= 1:3.3
77 %description -n python3-behave
78 behave is behavior-driven development, Python style.
80 %description -n python3-behave -l pl.UTF-8
81 behave to programowanie sterowane zachowaniem, w stylu Pythona.
84 Summary: API documentation for Python behave module
85 Summary(pl.UTF-8): Dokumentacja API modułu Pythona behave
89 API documentation for Python behave module.
91 %description apidocs -l pl.UTF-8
92 Dokumentacja API modułu Pythona behave.
95 %setup -q -n behave-%{version}
103 # can't get test_text__with_assert_failed_and_bytes_message test to work
104 # (LC_ALL=C.UTF-8 and PYTHONIOENCODING=utf-8 don't help)
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 %{__python} -m pytest tests -k 'not test_text__with_assert_failed_and_bytes_message'
114 # test_text__with_... fail with some repr differences
115 # some TestCaptureController tests die with "expected string or bytes-like object" TypeError
116 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
117 PYTHONPATH=$(pwd)/lib \
118 %{__python3} -m pytest tests -k 'not (test_text__with_assert_failed_and_unicode_message or test_text__with_raised_exception_and_unicode_message or test_capturing__retrieve_captured_several_times or test_capturing__with_several_start_stop_cycles or test_make_capture_report or test_basics)'
123 %{__make} -C docs html \
124 SPHINXBUILD=sphinx-build-3
128 rm -rf $RPM_BUILD_ROOT
133 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-2}
135 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-behave-%{version}
136 # async_step requires python3.5+, don't install in python2 package
137 cp -pr examples/env_vars $RPM_BUILD_ROOT%{_examplesdir}/python-behave-%{version}
145 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-3}
147 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
148 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
152 rm -rf $RPM_BUILD_ROOT
156 %defattr(644,root,root,755)
157 %doc CHANGES.rst LICENSE README.rst
158 %attr(755,root,root) %{_bindir}/behave-2
159 %{py_sitescriptdir}/behave
160 %{py_sitescriptdir}/behave-%{version}-py*.egg-info
161 %{py_sitescriptdir}/setuptools_behave.py[co]
162 %{_examplesdir}/python-behave-%{version}
166 %files -n python3-behave
167 %defattr(644,root,root,755)
168 %doc CHANGES.rst LICENSE README.rst
169 %attr(755,root,root) %{_bindir}/behave-3
170 %{py3_sitescriptdir}/behave
171 %{py3_sitescriptdir}/behave-%{version}-py*.egg-info
172 %{py3_sitescriptdir}/setuptools_behave.py
173 %{py3_sitescriptdir}/__pycache__/setuptools_behave.cpython-*.py[co]
174 %{_examplesdir}/python3-behave-%{version}
179 %defattr(644,root,root,755)
180 %doc build/docs/html/{_images,_static,*.html,*.js}