]> git.pld-linux.org Git - packages/python-requests-mock.git/blob - python-requests-mock.spec
rebuild with python 3.10
[packages/python-requests-mock.git] / python-requests-mock.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # API 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 %define         module          requests_mock
9 %define         egg_name        %{module}
10 %define         pypi_name       requests-mock
11 Summary:        Mock out responses from the requests package
12 Summary(pl.UTF-8):      Podstawianie atrap odpowiedzi z pakietu requests
13 Name:           python-%{pypi_name}
14 Version:        1.8.0
15 Release:        3
16 License:        Apache v2.0
17 Group:          Libraries/Python
18 #Source0Download: https://pypi.org/simple/requests-mock/
19 Source0:        https://files.pythonhosted.org/packages/source/r/requests-mock/%{pypi_name}-%{version}.tar.gz
20 # Source0-md5:  f09403c1d05ae2d3a72cac6aeb74c40d
21 Patch0:         %{name}-mock.patch
22 Patch1:         %{name}-no-git.patch
23 URL:            https://requests-mock.readthedocs.io/
24 BuildRequires:  rpm-pythonprov
25 BuildRequires:  rpmbuild(macros) >= 1.714
26 %if %{with python2}
27 BuildRequires:  python-modules
28 BuildRequires:  python-pbr
29 BuildRequires:  python-setuptools
30 %if %{with tests}
31 BuildRequires:  python-fixtures
32 BuildRequires:  python-mock
33 BuildRequires:  python-purl
34 BuildRequires:  python-pytest
35 BuildRequires:  python-requests >= 2.3
36 BuildRequires:  python-six
37 BuildRequires:  python-subunit
38 BuildRequires:  python-testrepository >= 0.0.18
39 BuildRequires:  python-testtools
40 BuildRequires:  subunit-python2
41 %endif
42 %endif
43 %if %{with python3}
44 BuildRequires:  python3-modules
45 BuildRequires:  python3-pbr
46 BuildRequires:  python3-setuptools
47 %if %{with tests}
48 BuildRequires:  python3-fixtures
49 BuildRequires:  python3-purl
50 BuildRequires:  python3-pytest
51 BuildRequires:  python3-requests >= 2.3
52 BuildRequires:  python3-six
53 BuildRequires:  python3-subunit
54 BuildRequires:  python3-testrepository >= 0.0.18
55 BuildRequires:  python3-testtools
56 BuildRequires:  subunit-python3
57 %endif
58 %endif
59 %if %{with doc}
60 BuildRequires:  python3-reno
61 BuildRequires:  sphinx-pdg-3
62 %endif
63 BuildArch:      noarch
64 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65
66 %description
67 requests-mock provides a building block to stub out the HTTP requests
68 portions of your testing code.
69
70 %description -l pl.UTF-8
71 Pakiet requests-mock udostępnia blok do tworzenia zaślepek żądań HTTP
72 w kodzie testowym.
73
74 %package -n python3-%{pypi_name}
75 Summary:        Mock out responses from the requests package
76 Summary(pl.UTF-8):      Podstawianie atrap odpowiedzi z pakietu requests
77 Group:          Libraries/Python
78 Requires:       python3-modules
79
80 %description -n python3-%{pypi_name}
81 requests-mock provides a building block to stub out the HTTP requests
82 portions of your testing code.
83
84 %description -n python3-%{pypi_name} -l pl.UTF-8
85 Pakiet requests-mock udostępnia blok do tworzenia zaślepek żądań HTTP
86 w kodzie testowym.
87
88 %package apidocs
89 Summary:        API documentation for requests_mock module
90 Summary(pl.UTF-8):      Dokumentacja API modułu requests_mock
91 Group:          Documentation
92
93 %description apidocs
94 API documentation for requests_mock module.
95
96 %description apidocs -l pl.UTF-8
97 Dokumentacja API modułu requests_mock.
98
99 %prep
100 %setup -q -n %{pypi_name}-%{version}
101 %patch0 -p1
102 %patch1 -p1
103
104 %build
105 %if %{with python2}
106 %py_build
107
108 %if %{with tests}
109 PYTHONPATH=$(pwd) \
110 %{__python} -m pytest tests/pytest
111
112 %{__python} -m subunit.run discover | subunit2pyunit-2
113 %endif
114 %endif
115
116 %if %{with python3}
117 %py3_build
118
119 %if %{with tests}
120 PYTHONPATH=$(pwd) \
121 %{__python3} -m pytest tests/pytest
122
123 %{__python3} -m subunit.run discover | subunit2pyunit-3
124 %endif
125 %endif
126
127 %install
128 rm -rf $RPM_BUILD_ROOT
129
130 %if %{with python2}
131 %py_install
132
133 %py_postclean
134 %endif
135
136 %if %{with python3}
137 %py3_install
138 %endif
139
140 %if %{with doc}
141 #%{__make} -C doc html \
142 #       SPHINXBUILD=sphinx-build-3
143 # broken Makefile (specifies . instead of "source" as source dir), so invoke directly:
144 PYTHONPATH=$(pwd) \
145 sphinx-build-3 -b html doc/source doc/_build/html
146 %endif
147
148 %clean
149 rm -rf $RPM_BUILD_ROOT
150
151 %if %{with python2}
152 %files
153 %defattr(644,root,root,755)
154 %doc AUTHORS ChangeLog README.rst
155 %{py_sitescriptdir}/%{module}
156 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
157 %endif
158
159 %if %{with python3}
160 %files -n python3-%{pypi_name}
161 %defattr(644,root,root,755)
162 %doc AUTHORS ChangeLog README.rst
163 %{py3_sitescriptdir}/%{module}
164 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
165 %endif
166
167 %if %{with doc}
168 %files apidocs
169 %defattr(644,root,root,755)
170 %doc doc/_build/html/{_static,*.html,*.js}
171 %endif
This page took 0.057942 seconds and 3 git commands to generate.