]> git.pld-linux.org Git - packages/python-behave.git/blob - python-behave.spec
6c6fa8d5abedd11b6c0da45733cd07505231f991
[packages/python-behave.git] / python-behave.spec
1 #
2 # Conditional build:
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
7
8 Summary:        Behaviour-driven development, Python style
9 Summary(pl.UTF-8):      Programowanie sterowane zachowaniem - w stylu Pythona
10 Name:           python-behave
11 Version:        1.2.6
12 Release:        3
13 License:        BSD
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/
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.6
22 BuildRequires:  python-setuptools
23 %if %{with tests}
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
38 %endif
39 %endif
40 %endif
41 %if %{with python3}
42 BuildRequires:  python3-2to3 >= 1:3.3
43 BuildRequires:  python3-modules >= 1:3.3
44 BuildRequires:  python3-setuptools
45 %if %{with tests}
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
55 %endif
56 %endif
57 %endif
58 BuildRequires:  rpm-pythonprov
59 BuildRequires:  rpmbuild(macros) >= 1.714
60 %if %{with doc}
61 BuildRequires:  python3-sphinx_bootstrap_theme >= 0.6.0
62 BuildRequires:  sphinx-pdg-3 >= 1.6
63 %endif
64 Requires:       python-modules >= 1:2.6
65 BuildArch:      noarch
66 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
68 %description
69 behave is behavior-driven development, Python style.
70
71 %description -l pl.UTF-8
72 behave to programowanie sterowane zachowaniem, w stylu Pythona.
73
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
79
80 %description -n python3-behave
81 behave is behavior-driven development, Python style.
82
83 %description -n python3-behave -l pl.UTF-8
84 behave to programowanie sterowane zachowaniem, w stylu Pythona.
85
86 %package apidocs
87 Summary:        API documentation for Python behave module
88 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona behave
89 Group:          Documentation
90
91 %description apidocs
92 API documentation for Python behave module.
93
94 %description apidocs -l pl.UTF-8
95 Dokumentacja API modułu Pythona behave.
96
97 %prep
98 %setup -q -n behave-%{version}
99 %patch0 -p1
100
101 %build
102 %if %{with python2}
103 %py_build
104
105 %if %{with tests}
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'
110 %endif
111 %endif
112
113 %if %{with python3}
114 %py3_build
115
116 %if %{with tests}
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)'
122 %endif
123 %endif
124
125 %if %{with doc}
126 %{__make} -C docs html \
127         SPHINXBUILD=sphinx-build-3
128 %endif
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132
133 %if %{with python2}
134 %py_install
135
136 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-2}
137
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}
141
142 %py_postclean
143 %endif
144
145 %if %{with python3}
146 %py3_install
147
148 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-3}
149
150 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
151 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
152 %endif
153
154 %clean
155 rm -rf $RPM_BUILD_ROOT
156
157 %if %{with python2}
158 %files
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}
166 %endif
167
168 %if %{with python3}
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}
178 %endif
179
180 %if %{with doc}
181 %files apidocs
182 %defattr(644,root,root,755)
183 %doc build/docs/html/{_images,_static,*.html,*.js}
184 %endif
This page took 0.048371 seconds and 2 git commands to generate.