]>
Commit | Line | Data |
---|---|---|
3f50ff1d | 1 | # |
3f50ff1d | 2 | # Conditional build: |
7a08de33 | 3 | %bcond_without python2 # CPython 2.x module |
3f50ff1d | 4 | %bcond_without python3 # CPython 3.x module |
7a08de33 JB |
5 | %bcond_without doc # Sphinx documentation |
6 | %bcond_without tests # unit tests | |
3f50ff1d ER |
7 | |
8 | %define module webtest | |
9 | Summary: Helper to test WSGI applications | |
7a08de33 | 10 | Summary(pl.UTF-8): Moduł pomocniczy do testowania aplikacji WSGI |
3f50ff1d | 11 | Name: python-%{module} |
7a08de33 | 12 | Version: 2.0.30 |
229ff859 | 13 | Release: 5 |
3f50ff1d ER |
14 | License: MIT |
15 | Group: Libraries/Python | |
7a08de33 JB |
16 | #Source0Download: https://pypi.org/simple/webtest/ |
17 | Source0: https://files.pythonhosted.org/packages/source/W/WebTest/WebTest-%{version}.tar.gz | |
18 | # Source0-md5: 0dd5a9093922e08e452f60d7d2eae99a | |
19 | Patch0: %{name}-deps.patch | |
20 | URL: http://webtest.pythonpaste.org/ | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.7 | |
23 | BuildRequires: python-setuptools | |
24 | %if %{with tests} | |
25 | BuildRequires: python-PasteDeploy | |
26 | BuildRequires: python-WSGIProxy2 | |
27 | BuildRequires: python-WebOb >= 1.2 | |
28 | BuildRequires: python-bs4 | |
3f50ff1d | 29 | BuildRequires: python-dtopt |
7a08de33 JB |
30 | BuildRequires: python-lxml |
31 | BuildRequires: python-mock | |
3f50ff1d | 32 | BuildRequires: python-nose |
7a08de33 JB |
33 | BuildRequires: python-pyquery |
34 | BuildRequires: python-six | |
35 | BuildRequires: python-waitress >= 0.8.5 | |
36 | %endif | |
37 | %endif | |
3f50ff1d | 38 | %if %{with python3} |
7a08de33 | 39 | BuildRequires: python3-modules >= 1:3.3 |
3f50ff1d | 40 | BuildRequires: python3-setuptools |
7a08de33 JB |
41 | %if %{with tests} |
42 | BuildRequires: python3-PasteDeploy | |
43 | BuildRequires: python3-WSGIProxy2 | |
44 | BuildRequires: python3-WebOb >= 1.2 | |
45 | BuildRequires: python3-bs4 | |
46 | BuildRequires: python3-dtopt | |
47 | BuildRequires: python3-nose >= 1.3.1 | |
48 | BuildRequires: python3-pyquery | |
49 | BuildRequires: python3-six | |
50 | BuildRequires: python3-waitress >= 0.8.5 | |
51 | %endif | |
3f50ff1d | 52 | %endif |
7a08de33 JB |
53 | BuildRequires: rpm-pythonprov |
54 | BuildRequires: rpmbuild(macros) >= 1.714 | |
55 | %if %{with doc} | |
56 | BuildRequires: sphinx-pdg | |
57 | %endif | |
58 | Requires: python-modules >= 1:2.7 | |
dae60d97 | 59 | Obsoletes: python-WebTest |
3f50ff1d ER |
60 | BuildArch: noarch |
61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
62 | ||
63 | %description | |
64 | WebTest wraps any WSGI application and makes it easy to send test | |
65 | requests to that application, without starting up an HTTP server. | |
66 | ||
67 | This provides convenient full-stack testing of applications written | |
68 | with any WSGI-compatible framework. | |
69 | ||
7a08de33 JB |
70 | %description -l pl.UTF-8 |
71 | WebTest obudowuje dowolną aplikację WSGI i ułatwia wysyłanie do niej | |
72 | testowych żądań bez uruchamiania serwera HTTP. | |
73 | ||
74 | Daje to wygodne, oparte o pełny stos testowanie aplikacji napisanych | |
75 | przy użyciu dowolnego szkieletu zgodnego z WSGI. | |
76 | ||
3f50ff1d ER |
77 | %package -n python3-webtest |
78 | Summary: Helper to test WSGI applications | |
7a08de33 | 79 | Summary(pl.UTF-8): Moduł pomocniczy do testowania aplikacji WSGI |
3f50ff1d | 80 | Group: Libraries/Python |
7a08de33 | 81 | Requires: python3-modules >= 1:3.3 |
3f50ff1d ER |
82 | |
83 | %description -n python3-webtest | |
84 | WebTest wraps any WSGI application and makes it easy to send test | |
85 | requests to that application, without starting up an HTTP server. | |
86 | ||
87 | This provides convenient full-stack testing of applications written | |
88 | with any WSGI-compatible framework. | |
89 | ||
7a08de33 JB |
90 | %description -n python3-webtest -l pl.UTF-8 |
91 | WebTest obudowuje dowolną aplikację WSGI i ułatwia wysyłanie do niej | |
92 | testowych żądań bez uruchamiania serwera HTTP. | |
93 | ||
94 | Daje to wygodne, oparte o pełny stos testowanie aplikacji napisanych | |
95 | przy użyciu dowolnego szkieletu zgodnego z WSGI. | |
96 | ||
97 | %package apidocs | |
98 | Summary: API documentation for Python WebTest module | |
99 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona WebTest | |
100 | Group: Documentation | |
101 | ||
102 | %description apidocs | |
103 | API documentation for Python WebTest module. | |
104 | ||
105 | %description apidocs -l pl.UTF-8 | |
106 | Dokumentacja API modułu Pythona WebTest. | |
107 | ||
3f50ff1d ER |
108 | %prep |
109 | %setup -q -n WebTest-%{version} | |
7a08de33 | 110 | %patch0 -p1 |
3f50ff1d | 111 | |
7a08de33 JB |
112 | # Remove bundled egg info |
113 | %{__rm} -r *.egg-info | |
3f50ff1d | 114 | |
3f50ff1d | 115 | %build |
7a08de33 JB |
116 | %if %{with python2} |
117 | %py_build %{?with_tests:test} | |
3f50ff1d ER |
118 | %endif |
119 | ||
3f50ff1d | 120 | %if %{with python3} |
7a08de33 | 121 | %py3_build %{?with_tests:test} |
3f50ff1d | 122 | %endif |
7a08de33 JB |
123 | |
124 | %if %{with doc} | |
125 | PYTHONPATH=$(pwd) \ | |
126 | %{__make} -C docs html | |
3f50ff1d ER |
127 | %endif |
128 | ||
129 | %install | |
130 | rm -rf $RPM_BUILD_ROOT | |
7a08de33 JB |
131 | |
132 | %if %{with python2} | |
133 | %py_install | |
134 | ||
135 | %py_postclean | |
136 | %endif | |
137 | ||
3f50ff1d | 138 | %if %{with python3} |
abb094e4 | 139 | %py3_install |
3f50ff1d ER |
140 | %endif |
141 | ||
3f50ff1d ER |
142 | %clean |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | ||
7a08de33 | 145 | %if %{with python2} |
3f50ff1d ER |
146 | %files |
147 | %defattr(644,root,root,755) | |
7a08de33 JB |
148 | %doc CHANGELOG.rst README.rst docs/license.rst |
149 | %{py_sitescriptdir}/webtest | |
3f50ff1d | 150 | %{py_sitescriptdir}/WebTest-%{version}-py*.egg-info |
7a08de33 | 151 | %endif |
3f50ff1d ER |
152 | |
153 | %if %{with python3} | |
154 | %files -n python3-webtest | |
155 | %defattr(644,root,root,755) | |
7a08de33 JB |
156 | %doc CHANGELOG.rst README.rst docs/license.rst |
157 | %{py3_sitescriptdir}/webtest | |
3f50ff1d | 158 | %{py3_sitescriptdir}/WebTest-%{version}-py*.egg-info |
7a08de33 JB |
159 | %endif |
160 | ||
161 | %if %{with doc} | |
162 | %files apidocs | |
163 | %defattr(644,root,root,755) | |
164 | %doc docs/_build/html/{_static,*.html,*.js} | |
3f50ff1d | 165 | %endif |