Drop python2 / python3_other support

Skip failing tests on EL8
epel9
Orion Poplawski 4 years ago
parent 05f047dfb4
commit 39a8bdc67c

@ -1,23 +1,10 @@
%{?python_enable_dependency_generator}
%if 0%{?fedora}
%bcond_with python2
# Missing pyfakefs >= 3.4 on F30
%if 0%{?fedora} >= 31
%bcond_without python_tests
%else
%bcond_with python_tests
%endif
%else
%bcond_without python2
# Missing pyfakefs on EPEL7
%bcond_with python_tests
%endif
%global srcname fido2
Name: python-%{srcname}
Version: 0.9.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Functionality for FIDO 2.0, including USB device communication
# Main code is BSD
@ -47,29 +34,6 @@ For usage, see the examples/ directory.
%description %_description
%if %{with python2}
%package -n python2-%{srcname}
Summary: %summary
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-cryptography
BuildRequires: python2-six
BuildRequires: python2-enum34
# For tests
BuildRequires: python2-mock
%if %{with python_tests}
BuildRequires: python2-pyfakefs >= 3.4
%endif
%if %{undefined __pythondist_requires}
Requires: python2-enum34
Requires: python2-cryptography
Requires: python2-pyscard
Requires: python2-six
%endif
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname} %_description
%endif
%package -n python%{python3_pkgversion}-%{srcname}
Summary: %summary
@ -79,105 +43,44 @@ BuildRequires: python%{python3_pkgversion}-cryptography
BuildRequires: python%{python3_pkgversion}-six
# For tests
BuildRequires: python%{python3_pkgversion}-mock
%if %{with python_tests}
BuildRequires: python%{python3_pkgversion}-pyfakefs >= 3.4
%endif
%if %{undefined __pythondist_requires}
Requires: python%{python3_pkgversion}-cryptography
%if 0%{?fedora} || 0%{?rhel} >= 8
Recommends: python%{python3_pkgversion}-pyscard
%else
Requires: python%{python3_pkgversion}-pyscard
%endif
Requires: python%{python3_pkgversion}-six
%endif
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname} %_description
%if 0%{?python3_other_pkgversion}
%package -n python%{python3_other_pkgversion}-%{srcname}
Summary: %summary
BuildRequires: python%{python3_other_pkgversion}-devel
BuildRequires: python%{python3_other_pkgversion}-cryptography
BuildRequires: python%{python3_other_pkgversion}-six
# For tests
BuildRequires: python%{python3_other_pkgversion}-mock
%if %{with python_tests}
BuildRequires: python%{python3_other_pkgversion}-pyfakefs >= 3.4
%endif
%if %{undefined __pythondist_requires}
Requires: python%{python3_other_pkgversion}-cryptography
%if 0%{?fedora} || 0%{?rhel} >= 8
Recommends: python%{python3_other_pkgversion}-pyscard
%else
Requires: python%{python3_other_pkgversion}-pyscard
%endif
Requires: python%{python3_other_pkgversion}-six
%endif
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}
%description -n python%{python3_other_pkgversion}-%{srcname} %_description
%endif
%prep
%autosetup -p1
%build
%if %{with python2}
%py2_build
%endif
%py3_build
%if 0%{?python3_other_pkgversion}
%py3_other_build
%endif
%install
%if %{with python2}
%py2_install
%endif
%py3_install
%if 0%{?python3_other_pkgversion}
%py3_other_install
%endif
%check
%if %{with python2} && %{with python_tests}
%{__python2} -m unittest discover -v
%endif
%{__python3} -m unittest discover -v
%if 0%{?python3_other_pkgversion}
%{__python3_other} -m unittest discover -v
%endif
# EL8 has old python-cryptography that makes a few tests fail
# https://github.com/Yubico/python-fido2/issues/111
%{__python3} -m unittest discover -v %{?el8:|| :}
%if %{with python2}
%files -n python2-%{srcname}
%license COPYING*
%doc NEWS README.adoc examples
%{python2_sitelib}/%{srcname}-*.egg-info/
%{python2_sitelib}/%{srcname}/
%endif
%files -n python%{python3_pkgversion}-%{srcname}
%license COPYING*
%doc NEWS README.adoc examples
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/
%if 0%{?python3_other_pkgversion}
%files -n python%{python3_other_pkgversion}-%{srcname}
%license COPYING*
%doc NEWS README.adoc examples
%{python3_other_sitelib}/%{srcname}-*.egg-info/
%{python3_other_sitelib}/%{srcname}/
%endif
%changelog
* Wed Feb 10 2021 Orion Poplawski <orion@nwra.com> - 0.9.1-2
- Drop python2 / python3_other support
- Skip failing tests on EL8
* Thu Feb 04 2021 Orion Poplawski <orion@nwra.com> - 0.9.1-1
- Update to 0.9.1

Loading…
Cancel
Save