From 6edb3d3a3df544d8b0614ac883f29e4b536ab1d5 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Feb 11 2017 02:26:46 +0000 Subject: Enable Python 3 build on EPEL 7, drop old EL 6 workarounds --- diff --git a/python-cached_property.spec b/python-cached_property.spec index d7951ba..a10009a 100644 --- a/python-cached_property.spec +++ b/python-cached_property.spec @@ -1,19 +1,10 @@ -# RHEL 6 compatibility. -%if 0%{?fedora} > 12 -%global with_python3 1 +# Enable Python 3 builds for Fedora + EPEL >6 +%if 0%{?fedora} || 0%{?rhel} > 6 +# If the definition isn't available for python3_pkgversion, define it +%{?!python3_pkgversion:%global python3_pkgversion 3} +%bcond_without python3 %else -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif - -# --skip-missing-interpreters only exists in tox >= 1.7.2. -# --sitepackages only exists in tox >= 1.7.0. -# Fedora 20 and 21 have 1.7.1, RHEL 6 and 7 have 1.4.2. -# I'm gonna go ahead and guess RHEL 8 will have something new enough... -# As of 1.3.0, tox config expects py3.5 interpreter, f22 doesn't know -# about it. -%if 0%{?fedora} > 22 || 0%{?rhel} > 7 -%global with_tests 1 +%bcond_with python3 %endif %global projectname cached-property @@ -23,7 +14,7 @@ Name: python-%{modulename} Version: 1.3.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A cached-property for decorating methods in Python classes License: BSD URL: https://github.com/pydanny/%{projectname} @@ -32,19 +23,15 @@ Source0: https://github.com/pydanny/%{projectname}/archive/%{commit}/%{pr BuildArch: noarch BuildRequires: python2-devel -%if 0%{?with_tests} BuildRequires: python-dateutil BuildRequires: python-freezegun BuildRequires: pytest -%endif # with_tests %if 0%{?with_python3} -BuildRequires: python3-devel -%if 0%{?with_tests} -BuildRequires: python3-dateutil -BuildRequires: python3-freezegun -BuildRequires: python3-pytest -%endif # with_tests +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-dateutil +BuildRequires: python%{python3_pkgversion}-freezegun +BuildRequires: python%{python3_pkgversion}-pytest %endif # with_python3 %description @@ -57,24 +44,21 @@ Summary: A cached-property for decorating methods in Python classes. # I messed up at 1.3.0-1 and called this package python2-%{projectname} Provides: python2-%{projectname} = %{version}-%{release} Obsoletes: python2-%{projectname} < 1.3.0-2 -# python_provide isn't available on EL 6 -%{!?python_provide:Provides: python-%{modulename} = %{version}-%{release}} -%{!?python_provide:Obsoletes: python-%{modulename} < 1.3.0-1} %description -n python2-%{modulename} cached_property allows properties in Python classes to be cached until the cache is invalidated or expired. %if 0%{?with_python3} -%package -n python3-%{modulename} +%package -n python%{python3_pkgversion}-%{modulename} Summary: A cached-property for decorating methods in Python classes. -%{?python_provide:%python_provide python3-%{modulename}} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{modulename}} # This package was python3-%{projectname} for a long time, but never should've # been -Provides: python3-%{projectname} = %{version}-%{release} -Obsoletes: python3-%{projectname} < 1.3.0-2 +Provides: python%{python3_pkgversion}-%{projectname} = %{version}-%{release} +Obsoletes: python%{python3_pkgversion}-%{projectname} < 1.3.0-2 -%description -n python3-%{modulename} +%description -n python%{python3_pkgversion}-%{modulename} cached_property allows properties in Python classes to be cached until the cache is invalidated or expired. %endif # with_python3 @@ -106,12 +90,10 @@ popd %endif # with_python3 %check -%if 0%{?with_tests} -PYTHONPATH=./ py.test-2 +PYTHONPATH=./ py.test %if 0%{?with_python3} PYTHONPATH=./ py.test-3 %endif # with_python3 -%endif # with_tests %files -n python2-%{modulename} %{!?_licensedir:%global license %%doc} @@ -120,7 +102,7 @@ PYTHONPATH=./ py.test-3 %{python2_sitelib}/%{modulename}* %if 0%{?with_python3} -%files -n python3-%{modulename} +%files -n python%{python3_pkgversion}-%{modulename} %doc AUTHORS.rst HISTORY.rst CONTRIBUTING.rst README.rst %license LICENSE %{python3_sitelib}/%{modulename}* @@ -128,6 +110,9 @@ PYTHONPATH=./ py.test-3 %endif # with_python3 %changelog +* Fri Feb 10 2017 Adam Williamson - 1.3.0-7 +- Enable Python 3 build on EPEL 7 + * Mon Dec 19 2016 Miro HronĨok - 1.3.0-6 - Rebuild for Python 3.6