]> git.pld-linux.org Git - packages/python-behave.git/blob - python-behave.spec
Release 6 (by relup.sh)
[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:        6
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 %endif
54 %endif
55 BuildRequires:  rpm-pythonprov
56 BuildRequires:  rpmbuild(macros) >= 1.714
57 %if %{with doc}
58 BuildRequires:  python3-sphinx_bootstrap_theme >= 0.6.0
59 BuildRequires:  sphinx-pdg-3 >= 1.6
60 %endif
61 Requires:       python-modules >= 1:2.6
62 BuildArch:      noarch
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 %description
66 behave is behavior-driven development, Python style.
67
68 %description -l pl.UTF-8
69 behave to programowanie sterowane zachowaniem, w stylu Pythona.
70
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
76
77 %description -n python3-behave
78 behave is behavior-driven development, Python style.
79
80 %description -n python3-behave -l pl.UTF-8
81 behave to programowanie sterowane zachowaniem, w stylu Pythona.
82
83 %package apidocs
84 Summary:        API documentation for Python behave module
85 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona behave
86 Group:          Documentation
87
88 %description apidocs
89 API documentation for Python behave module.
90
91 %description apidocs -l pl.UTF-8
92 Dokumentacja API modułu Pythona behave.
93
94 %prep
95 %setup -q -n behave-%{version}
96 %patch0 -p1
97
98 %build
99 %if %{with python2}
100 %py_build
101
102 %if %{with tests}
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'
107 %endif
108 %endif
109
110 %if %{with python3}
111 %py3_build
112
113 %if %{with tests}
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)'
119 %endif
120 %endif
121
122 %if %{with doc}
123 %{__make} -C docs html \
124         SPHINXBUILD=sphinx-build-3
125 %endif
126
127 %install
128 rm -rf $RPM_BUILD_ROOT
129
130 %if %{with python2}
131 %py_install
132
133 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-2}
134
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}
138
139 %py_postclean
140 %endif
141
142 %if %{with python3}
143 %py3_install
144
145 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-3}
146
147 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
148 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
149 %endif
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %if %{with python2}
155 %files
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}
163 %endif
164
165 %if %{with python3}
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}
175 %endif
176
177 %if %{with doc}
178 %files apidocs
179 %defattr(644,root,root,755)
180 %doc build/docs/html/{_images,_static,*.html,*.js}
181 %endif
This page took 0.086454 seconds and 3 git commands to generate.