delete python2

This commit is contained in:
weiwei_150212 2020-08-08 16:27:57 +08:00
parent bdddeb3f28
commit 3aa3ef0bf2

View File

@ -1,26 +1,15 @@
%bcond_with python2
%bcond_without python3
%bcond_with python3.8
Name: python-cryptography
Version: 3.0
Release: 1
Release: 2
Summary: PyCA's cryptography library
License: ASL 2.0 or BSD
URL: https://cryptography.io/en/latest/
Source0: https://pypi.io/packages/source/c/cryptography/cryptography-%{version}.tar.gz
Source0: https://files.pythonhosted.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz
BuildRequires: openssl-devel
BuildRequires: gcc
%if %{with python2}
BuildRequires: python2-devel python2-pytest >= 3.2.1 python2-setuptools
BuildRequires: python2-pretend python2-iso8601 python2-cryptography-vectors = %{version}
BuildRequires: python2-asn1crypto >= 0.21 python2-hypothesis >= 1.11.4 python2-pytz
BuildRequires: python2-idna >= 2.1 python2-six >= 1.4.1 python2-cffi >= 1.7
BuildRequires: python2-enum34 python2-ipaddress
%endif
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-pytest >= 3.2.1
BuildRequires: python%{python3_pkgversion}-setuptools
@ -38,20 +27,6 @@ BuildRequires: python%{python3_pkgversion}-cffi >= 1.7
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
%if %{with python2}
%package -n python2-cryptography
Summary: PyCA's cryptography library
Requires: openssl-libs python2-idna >= 2.1 python2-asn1crypto >= 0.21
Requires: python2-six >= 1.4.1 python2-cffi >= 1.7 python2-enum34
Requires: python2-ipaddress
%{?python_provide:%python_provide python2-cryptography}
%description -n python2-cryptography
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
%endif
%package -n python%{python3_pkgversion}-cryptography
Summary: PyCA's cryptography library
@ -73,52 +48,14 @@ recipes to Python developers.
%prep
%autosetup -n cryptography-%{version} -p1
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
%build
%if %{with python2}
%py2_build
%endif
pushd %{py3dir}
%py3_build
popd
%install
# Actually other *.c and *.h are appropriate
# see https://github.com/pyca/cryptography/issues/1463
find . -name .keep -print -delete
%if %{with python2}
%py2_install
%endif
pushd %{py3dir}
%py3_install
popd
%check
# see https://github.com/pyca/cryptography/issues/4885 for the deselected test
%if %{with python2}
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)"
%endif
%if %{with python3.8}
pushd %{py3dir}
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)"
popd
%endif
%if %{with python2}
%files -n python2-cryptography
%defattr(-,root,root)
%doc AUTHORS.rst
%license LICENSE LICENSE.APACHE LICENSE.BSD
%{python2_sitearch}/cryptography
%{python2_sitearch}/cryptography-%{version}-py*.egg-info
%endif
%files -n python%{python3_pkgversion}-cryptography
%defattr(-,root,root)
@ -132,6 +69,12 @@ popd
%doc README.rst docs
%changelog
* Thu Aug 11 2020 tianwei<tianwei12@huawei.com> -3.0-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:delete python2
* Thu Jul 23 2020 dingyue<dingyue5@huawei.com> -3.0-1
- Type:enhancement
- ID:NA