]> git.pld-linux.org Git - packages/python-responses.git/blob - python-responses.spec
- test BRs fixed
[packages/python-responses.git] / python-responses.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module          responses
8 Summary:        A utility for mocking out the Python Requests library
9 Summary(pl.UTF-8):      Narzędzie do podstawiania atrap biblioteki Python Requests
10 Name:           python-%{module}
11 # keep 0.17.x here for python2 support
12 Version:        0.17.0
13 Release:        1
14 License:        Apache v2.0
15 Group:          Libraries/Python
16 #Source0Download: https://github.com/getsentry/responses/releases
17 Source0:        https://github.com/getsentry/responses/archive/%{version}/%{module}-%{version}.tar.gz
18 # Source0-md5:  7b94ef2851112c11c3bf75455e4ebeff
19 Patch0:         %{name}-py2.patch
20 URL:            https://github.com/getsentry/responses
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-cookies
28 BuildRequires:  python-coverage >= 3.7.1
29 BuildRequires:  python-flake8
30 BuildRequires:  python-mock
31 BuildRequires:  python-pytest >= 4.6
32 BuildRequires:  python-pytest-cov
33 BuildRequires:  python-pytest-localserver
34 BuildRequires:  python-requests >= 2.0
35 BuildRequires:  python-urllib3 >= 1.25.10
36 BuildRequires:  python-six
37 %endif
38 %endif
39 %if %{with python3}
40 BuildRequires:  python3-modules >= 1:3.5
41 BuildRequires:  python3-setuptools
42 %if %{with tests}
43 BuildRequires:  python3-coverage >= 3.7.1
44 BuildRequires:  python3-flake8
45 BuildRequires:  python3-pytest >= 4.6
46 BuildRequires:  python3-pytest-cov
47 BuildRequires:  python3-pytest-localserver
48 BuildRequires:  python3-requests >= 2.0
49 BuildRequires:  python3-urllib3 >= 1.25.10
50 BuildRequires:  python3-six
51 %endif
52 %endif
53 BuildArch:      noarch
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %description
57 A utility library for mocking out the requests Python library.
58
59 %description -l pl.UTF-8
60 Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
61 requests.
62
63 %package -n python3-%{module}
64 Summary:        A utility for mocking out the Python Requests library
65 Summary(pl.UTF-8):      Narzędzie do podstawiania atrap biblioteki Python Requests
66 Group:          Libraries/Python
67
68 %description -n python3-%{module}
69 A utility library for mocking out the requests Python library.
70
71 %description -n python3-%{module} -l pl.UTF-8
72 Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
73 requests.
74
75 %prep
76 %setup -q -n %{module}-%{version}
77 %patch0 -p1
78
79 %build
80 %if %{with python2}
81 %py_build
82
83 %if %{with tests}
84 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
85 PYTEST_PLUGINS="pytest_localserver.plugin" \
86 %{__python} -m pytest responses
87 %endif
88 %endif
89
90 %if %{with python3}
91 %py3_build
92
93 %if %{with tests}
94 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
95 PYTEST_PLUGINS="pytest_localserver.plugin" \
96 %{__python3} -m pytest responses
97 %endif
98 %endif
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102
103 %if %{with python2}
104 %py_install
105
106 %py_postclean
107 %endif
108
109 %if %{with python3}
110 %py3_install
111 %endif
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116 %if %{with python2}
117 %files
118 %defattr(644,root,root,755)
119 %doc CHANGES README.rst
120 %{py_sitescriptdir}/responses
121 %{py_sitescriptdir}/responses-%{version}-py*.egg-info
122 %endif
123
124 %if %{with python3}
125 %files -n python3-%{module}
126 %defattr(644,root,root,755)
127 %doc CHANGES README.rst
128 %{py3_sitescriptdir}/responses
129 %{py3_sitescriptdir}/responses-%{version}-py*.egg-info
130 %endif
This page took 0.069991 seconds and 3 git commands to generate.