| |
@@ -1,10 +1,16 @@
|
| |
- %if 0%{?fedora}
|
| |
- %global with_python3 1
|
| |
+ %if 0%{?fedora} || 0%{?rhel} > 7
|
| |
+ # Enable python3 build by default
|
| |
+ %bcond_without python3
|
| |
+ # Disable python2 build by default
|
| |
+ %bcond_with python2
|
| |
+ %else
|
| |
+ %bcond_with python3
|
| |
+ %bcond_without python2
|
| |
%endif
|
| |
|
| |
Name: python-requests-mock
|
| |
Version: 1.5.2
|
| |
- Release: 2%{?dist}
|
| |
+ Release: 3%{?dist}
|
| |
Summary: A requests mocking tool for python
|
| |
|
| |
License: ASL 2.0
|
| |
@@ -19,6 +25,7 @@
|
| |
requests-mock provides a simple way to do HTTP mocking at the
|
| |
python-requests layer.
|
| |
|
| |
+ %if %{with python2}
|
| |
%package -n python2-requests-mock
|
| |
Summary: A requests mocking tool for python
|
| |
|
| |
@@ -54,9 +61,10 @@
|
| |
%description -n python2-requests-mock
|
| |
requests-mock provides a simple way to do HTTP mocking at the
|
| |
python-requests layer.
|
| |
+ %endif
|
| |
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
+ %if %{with python3}
|
| |
%package -n python3-requests-mock
|
| |
Summary: A requests mocking tool for python
|
| |
|
| |
@@ -97,39 +105,47 @@
|
| |
|
| |
|
| |
%build
|
| |
+ %if %{with python2}
|
| |
%py2_build
|
| |
+ %endif
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
+ %if %{with python3}
|
| |
%py3_build
|
| |
%endif
|
| |
|
| |
|
| |
%install
|
| |
+ %if %{with python2}
|
| |
%py2_install
|
| |
+ %endif
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
+ %if %{with python3}
|
| |
%py3_install
|
| |
%endif
|
| |
|
| |
|
| |
%check
|
| |
+ %if %{with python2}
|
| |
%{__python2} -m testtools.run discover
|
| |
%{__python2} -m pytest tests/pytest
|
| |
+ %endif
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
+ %if %{with python3}
|
| |
%{__python3} -m testtools.run discover
|
| |
%{__python3} -m pytest tests/pytest
|
| |
%endif
|
| |
|
| |
|
| |
+ %if %{with python2}
|
| |
%files -n python2-requests-mock
|
| |
%license LICENSE
|
| |
%doc README.rst ChangeLog
|
| |
%{python2_sitelib}/requests_mock
|
| |
%{python2_sitelib}/requests_mock-%{version}-py%{python2_version}.egg-info
|
| |
+ %endif
|
| |
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
+ %if %{with python3}
|
| |
%files -n python3-requests-mock
|
| |
%license LICENSE
|
| |
%doc README.rst ChangeLog
|
| |
@@ -139,6 +155,9 @@
|
| |
|
| |
|
| |
%changelog
|
| |
+ * Wed Feb 27 2019 Yatin Karel <ykarel@redhat.com> - 1.5.2-3
|
| |
+ - Disable python2 build in Fedora and EL > 7
|
| |
+
|
| |
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-2
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
| |
|
| |