Drop python2 for Fedora 32+/EPEL8+

This commit is contained in:
Orion Poplawski 2019-11-16 15:37:35 -07:00
parent 9beda593f2
commit c0055e37bf

View File

@ -2,6 +2,12 @@
%global srcname setuptools_scm %global srcname setuptools_scm
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8
%bcond_with python2
%else
%bcond_without python2
%endif
Name: python-%{srcname} Name: python-%{srcname}
Version: 3.3.3 Version: 3.3.3
Release: 5%{?dist} Release: 5%{?dist}
@ -22,6 +28,7 @@ BuildRequires: mercurial
Setuptools_scm handles managing your python package versions in SCM metadata. Setuptools_scm handles managing your python package versions in SCM metadata.
It also handles file finders for the supported SCMs. It also handles file finders for the supported SCMs.
%if %{with python2}
%package -n python2-%{srcname} %package -n python2-%{srcname}
Summary: %{summary} Summary: %{summary}
BuildRequires: python2-devel BuildRequires: python2-devel
@ -34,6 +41,7 @@ BuildRequires: python2-pytest
%description -n python2-%{srcname} %description -n python2-%{srcname}
Setuptools_scm handles managing your python package versions in SCM metadata. Setuptools_scm handles managing your python package versions in SCM metadata.
It also handles file finders for the supported SCMs. It also handles file finders for the supported SCMs.
%endif
%package -n python%{python3_pkgversion}-%{srcname} %package -n python%{python3_pkgversion}-%{srcname}
Summary: %{summary} Summary: %{summary}
@ -53,24 +61,32 @@ It also handles file finders for the supported SCMs.
%autosetup -n %{srcname}-%{version} %autosetup -n %{srcname}-%{version}
%build %build
%if %{with python2}
%py2_build %py2_build
%endif
%py3_build %py3_build
%install %install
%if %{with python2}
%py2_install %py2_install
%endif
%py3_install %py3_install
%if %{with tests} %if %{with tests}
%check %check
%if %{with python2}
PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python2_version} -v -k 'not (test_pip_download or test_old_setuptools_fails or test_old_setuptools_allows_with_warnings or test_distlib_setuptools_works)' PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python2_version} -v -k 'not (test_pip_download or test_old_setuptools_fails or test_old_setuptools_allows_with_warnings or test_distlib_setuptools_works)'
%endif
PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v -k 'not (test_pip_download or test_old_setuptools_fails or test_old_setuptools_allows_with_warnings or test_distlib_setuptools_works)' PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v -k 'not (test_pip_download or test_old_setuptools_fails or test_old_setuptools_allows_with_warnings or test_distlib_setuptools_works)'
%endif %endif
%if %{with python2}
%files -n python2-%{srcname} %files -n python2-%{srcname}
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
%{python2_sitelib}/%{srcname}/ %{python2_sitelib}/%{srcname}/
%{python2_sitelib}/%{srcname}-*.egg-info/ %{python2_sitelib}/%{srcname}-*.egg-info/
%endif
%files -n python%{python3_pkgversion}-%{srcname} %files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE %license LICENSE
@ -79,6 +95,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v -k 'not
%{python3_sitelib}/%{srcname}-*.egg-info %{python3_sitelib}/%{srcname}-*.egg-info
%changelog %changelog
* Sat Nov 16 2019 Orion Poplawski <orion@nwra.com> - 3.3.3-6
- Drop python2 for Fedora 32+/EPEL8+
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.3.3-5 * Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.3.3-5
- Rebuilt for Python 3.8.0rc1 (#1748018) - Rebuilt for Python 3.8.0rc1 (#1748018)