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
53 %if "%{py3_ver}" < "3.4"
54 BuildRequires: python3-enum34
58 BuildRequires: rpm-pythonprov
59 BuildRequires: rpmbuild(macros) >= 1.714
61 BuildRequires: python3-sphinx_bootstrap_theme >= 0.6.0
62 BuildRequires: sphinx-pdg-3 >= 1.6
64 Requires: python-modules >= 1:2.6
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69 behave is behavior-driven development, Python style.
71 %description -l pl.UTF-8
72 behave to programowanie sterowane zachowaniem, w stylu Pythona.
74 %package -n python3-behave
75 Summary: Behaviour-driven development, Python style
76 Summary(pl.UTF-8): Programowanie sterowane zachowaniem - w stylu Pythona
77 Group: Libraries/Python
78 Requires: python3-modules >= 1:3.3
80 %description -n python3-behave
81 behave is behavior-driven development, Python style.
83 %description -n python3-behave -l pl.UTF-8
84 behave to programowanie sterowane zachowaniem, w stylu Pythona.
87 Summary: API documentation for Python behave module
88 Summary(pl.UTF-8): Dokumentacja API modułu Pythona behave
92 API documentation for Python behave module.
94 %description apidocs -l pl.UTF-8
95 Dokumentacja API modułu Pythona behave.
98 %setup -q -n behave-%{version}
106 # can't get test_text__with_assert_failed_and_bytes_message test to work
107 # (LC_ALL=C.UTF-8 and PYTHONIOENCODING=utf-8 don't help)
108 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
109 %{__python} -m pytest tests -k 'not test_text__with_assert_failed_and_bytes_message'
117 # test_text__with_... fail with some repr differences
118 # some TestCaptureController tests die with "expected string or bytes-like object" TypeError
119 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
120 PYTHONPATH=$(pwd)/lib \
121 %{__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)'
126 %{__make} -C docs html \
127 SPHINXBUILD=sphinx-build-3
131 rm -rf $RPM_BUILD_ROOT
136 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-2}
138 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-behave-%{version}
139 # async_step requires python3.5+, don't install in python2 package
140 cp -pr examples/env_vars $RPM_BUILD_ROOT%{_examplesdir}/python-behave-%{version}
148 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-3}
150 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
151 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
155 rm -rf $RPM_BUILD_ROOT
159 %defattr(644,root,root,755)
160 %doc CHANGES.rst LICENSE README.rst
161 %attr(755,root,root) %{_bindir}/behave-2
162 %{py_sitescriptdir}/behave
163 %{py_sitescriptdir}/behave-%{version}-py*.egg-info
164 %{py_sitescriptdir}/setuptools_behave.py[co]
165 %{_examplesdir}/python-behave-%{version}
169 %files -n python3-behave
170 %defattr(644,root,root,755)
171 %doc CHANGES.rst LICENSE README.rst
172 %attr(755,root,root) %{_bindir}/behave-3
173 %{py3_sitescriptdir}/behave
174 %{py3_sitescriptdir}/behave-%{version}-py*.egg-info
175 %{py3_sitescriptdir}/setuptools_behave.py
176 %{py3_sitescriptdir}/__pycache__/setuptools_behave.cpython-*.py[co]
177 %{_examplesdir}/python3-behave-%{version}
182 %defattr(644,root,root,755)
183 %doc build/docs/html/{_images,_static,*.html,*.js}