Cleanse Python 2 bits of the spec file
This commit is contained in:
parent
811d0faeb8
commit
50985fef85
@ -14,29 +14,12 @@ Patch1: python-%{srcname}.certfile.patch
|
|||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
# Don't build for Python 2 on Fedora 34+ and RHEL
|
|
||||||
%if 0%{?fedora} > 33 || 0%{?rhel}
|
|
||||||
%bcond_with python2
|
|
||||||
%else
|
|
||||||
%bcond_without python2
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%global _description\
|
%global _description\
|
||||||
A comprehensive HTTP client library that supports many features left out of\
|
A comprehensive HTTP client library that supports many features left out of\
|
||||||
other HTTP libraries.
|
other HTTP libraries.
|
||||||
|
|
||||||
%description %{_description}
|
%description %{_description}
|
||||||
|
|
||||||
%if %{with python2}
|
|
||||||
%package -n python2-%{srcname}
|
|
||||||
Summary: %{summary}
|
|
||||||
%{?python_provide:%python_provide python2-%{srcname}}
|
|
||||||
BuildRequires: python2-setuptools
|
|
||||||
BuildRequires: python2-devel
|
|
||||||
|
|
||||||
%description -n python2-%{srcname} %{_description}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%package -n python3-%{srcname}
|
%package -n python3-%{srcname}
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
%{?python_provide:%python_provide python3-%{srcname}}
|
%{?python_provide:%python_provide python3-%{srcname}}
|
||||||
@ -54,48 +37,22 @@ BuildRequires: python3-mock
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
# The implementation is different for each major Python version
|
%autosetup -p1 -n %{srcname}-%{version}
|
||||||
# and we need to install from separate directories
|
rm -r python2
|
||||||
%setup -qc
|
|
||||||
pushd %{srcname}-%{version}
|
|
||||||
%autopatch -p1
|
|
||||||
|
|
||||||
# Drop coverage
|
# Drop coverage
|
||||||
sed -i '/--cov/d' setup.cfg
|
sed -i '/--cov/d' setup.cfg
|
||||||
popd
|
|
||||||
|
|
||||||
cp -a %{srcname}-%{version} python2
|
|
||||||
mv %{srcname}-%{version} python3
|
|
||||||
rm -r python2/python3
|
|
||||||
rm -r python3/python2
|
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if %{with python2}
|
|
||||||
pushd python2
|
|
||||||
%py2_build
|
|
||||||
popd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
pushd python3
|
|
||||||
%py3_build
|
%py3_build
|
||||||
popd
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if %{with python2}
|
|
||||||
pushd python2
|
|
||||||
%py2_install
|
|
||||||
popd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
pushd python3
|
|
||||||
%py3_install
|
%py3_install
|
||||||
popd
|
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
pushd python3
|
|
||||||
PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -k "not test_unknown_server \
|
PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -k "not test_unknown_server \
|
||||||
and not test_socks5_auth and not \
|
and not test_socks5_auth and not \
|
||||||
test_server_not_found_error_is_raised_for_invalid_hostname and not \
|
test_server_not_found_error_is_raised_for_invalid_hostname and not \
|
||||||
@ -105,24 +62,16 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -k "not test_unknown_server \
|
|||||||
test_get_301_via_https and not test_client_cert_password_verified and not\
|
test_get_301_via_https and not test_client_cert_password_verified and not\
|
||||||
test_get_via_https and not test_min_tls_version and not\
|
test_get_via_https and not test_min_tls_version and not\
|
||||||
test_client_cert_verified"
|
test_client_cert_verified"
|
||||||
popd
|
|
||||||
|
|
||||||
|
|
||||||
%if %{with python2}
|
|
||||||
%files -n python2-%{srcname}
|
|
||||||
%doc python2/README.md
|
|
||||||
%{python2_sitelib}/%{srcname}-*.egg-info/
|
|
||||||
%{python2_sitelib}/%{srcname}/
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files -n python3-%{srcname}
|
%files -n python3-%{srcname}
|
||||||
%doc python3/README.md
|
%doc README.md
|
||||||
%{python3_sitelib}/%{srcname}-*.egg-info/
|
%{python3_sitelib}/%{srcname}-*.egg-info/
|
||||||
%{python3_sitelib}/%{srcname}/
|
%{python3_sitelib}/%{srcname}/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Sat Jan 02 2021 Miro Hrončok <mhroncok@redhat.com> - 0.18.1-9
|
* Sat Jan 02 2021 Miro Hrončok <mhroncok@redhat.com> - 0.18.1-9
|
||||||
- Disable Python 2 build on Fedora 34+
|
- Disable Python 2 build entirely
|
||||||
|
|
||||||
* Tue Nov 24 2020 Miro Hrončok <mhroncok@redhat.com> - 0.18.1-8
|
* Tue Nov 24 2020 Miro Hrončok <mhroncok@redhat.com> - 0.18.1-8
|
||||||
- Disable Python 2 build on RHEL 9+
|
- Disable Python 2 build on RHEL 9+
|
||||||
|
Loading…
Reference in New Issue
Block a user