From 15c9035ec8139b3ef104fa09c369ed0ed33a8971 Mon Sep 17 00:00:00 2001 From: sagitter Date: May 03 2019 12:51:29 +0000 Subject: Merge changes from master to epel7 branch at this point of the history|Obsolete python34 build on epel7 (rhbz #1705983) --- diff --git a/.gitignore b/.gitignore index fb03091..04c5b28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /python-future-0.15.2.tar.gz /python-future-0.16.0.tar.gz +/python-future-bee0f3bcb8ba9e7bd131d64e3bf631f5bd06c5b4.tar.gz diff --git a/future-skip_tests_with_connection_errors.patch b/future-skip_tests_with_connection_errors.patch index 8005d93..3c1450f 100644 --- a/future-skip_tests_with_connection_errors.patch +++ b/future-skip_tests_with_connection_errors.patch @@ -3,16 +3,7 @@ --- tests/test_future/test_standard_library.orig.py 2014-11-21 12:52:03.000000000 +0100 +++ tests/test_future/test_standard_library.py 2015-09-02 11:37:36.808826777 +0200 -@@ -318,7 +318,7 @@ - import builtins - self.assertTrue(hasattr(builtins, 'tuple')) - -- # @unittest.skip("ssl support has been stripped out for now ...") -+ @unittest.skip("ConnectionError: ('Connection aborted.', gaierror(-3, 'Temporary failure in name resolution'))...") - def test_urllib_request_ssl_redirect(self): - """ - This site redirects to https://... -@@ -332,6 +332,7 @@ +@@ -333,6 +333,7 @@ # pprint(r.read().decode('utf-8')) self.assertTrue(True) @@ -20,7 +11,7 @@ def test_moves_urllib_request_http(self): """ This site (python-future.org) uses plain http (as of 2014-09-23). -@@ -343,6 +343,7 @@ +@@ -345,6 +345,7 @@ data = r.read() self.assertTrue(b'' in data) diff --git a/future.spec b/future.spec index b9ed5c0..9bec4a5 100644 --- a/future.spec +++ b/future.spec @@ -1,49 +1,46 @@ -%if 0%{?fedora} +%if 0%{?fedora} && 0%{?fedora} < 30 %global with_python3 1 +%global with_python2 1 +%endif -## Make python?_shortver macros -%{!?python2_shortver: %global python2_shortver %(%{__python2} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')} -%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')} +%if 0%{?fedora} && 0%{?fedora} >= 30 +%global with_python3 1 +%global with_python2 1 %endif -%if 0%{?rhel} && 0%{?rhel} <= 6 +%if 0%{?rhel} && 0%{?rhel} < 7 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %global python2_version 2.6 %global with_python3 0 +%global with_python2 1 %endif -%if 0%{?rhel} && 0%{?rhel} > 6 +%if 0%{?rhel} && 0%{?rhel} >= 7 %global with_python3 1 -%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')} +%global with_python2 1 %endif -%global with_python35 1 +%global commit bee0f3bcb8ba9e7bd131d64e3bf631f5bd06c5b4 +%global date 20181019 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: future Summary: Easy, clean, reliable Python 2/3 compatibility Version: 0.16.0 -Release: 7%{?dist} +Release: 14.%{date}git%{shortcommit}%{?dist} License: MIT -Group: Applications/Engineering URL: http://python-future.org/ -Source0: https://github.com/PythonCharmers/python-future/archive/v%{version}.tar.gz#/python-future-%{version}.tar.gz +Source0: https://github.com/PythonCharmers/python-future/archive/%{commit}/python-%{name}-%{commit}.tar.gz BuildArch: noarch ##https://github.com/PythonCharmers/python-future/issues/165 Patch0: %{name}-skip_tests_with_connection_errors.patch -%if 0%{?rhel} && 0%{?rhel} <= 6 -BuildRequires: python-argparse, python-unittest2, python-importlib -Requires: python-importlib -Requires: python-argparse +%if 0%{?with_python3_other} +BuildRequires: python%{python3_other_pkgversion}-devel %endif -BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: numpy -BuildRequires: python-requests -BuildRequires: pytest %description %{name} is the missing compatibility layer between Python 2 and @@ -56,9 +53,20 @@ ports of features from Python 3 and 2. It also comes with ``futurize`` and either Py2 or Py3 code easily to support both Python 2 and 3 in a single clean Py3-style codebase, module by module. +%if 0%{?with_python2} %package -n python2-%{name} Summary: Easy, clean, reliable Python 2/3 compatibility %{?python_provide:%python_provide python2-%{name}} +%if 0%{?rhel} && 0%{?rhel} <= 6 +BuildRequires: python-argparse, python-unittest2, python-importlib +Requires: python-importlib +Requires: python-argparse +%endif +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python2-numpy +BuildRequires: python2-requests +BuildRequires: python2-pytest Provides: future = 0:%{version}-%{release} %description -n python2-%{name} Python2 %{name} is the missing compatibility layer between Python 2 and @@ -70,6 +78,7 @@ ports of features from Python 3 and 2. It also comes with ``futurize`` and ``pasteurize``, customized 2to3-based scripts that helps you to convert either Py2 or Py3 code easily to support both Python 2 and 3 in a single clean Py3-style codebase, module by module. +%endif %if 0%{?with_python3} %package -n python%{python3_pkgversion}-%{name} @@ -80,6 +89,7 @@ BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-requests BuildRequires: python%{python3_pkgversion}-pytest +Provides: future-python3 = 0:%{version}-%{release} %description -n python%{python3_pkgversion}-%{name} Python3-%{name} is the missing compatibility layer between Python 2 and @@ -93,55 +103,116 @@ either Py2 or Py3 code easily to support both Python 2 and 3 in a single clean Py3-style codebase, module by module. %endif # with_python3 +%if 0%{?with_python3_other} +%package -n python%{python3_other_pkgversion}-%{name} +Summary: Easy, clean, reliable Python 2/3 compatibility +%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{name}} +BuildRequires: python%{python3_other_pkgversion}-devel +BuildRequires: python%{python3_other_pkgversion}-setuptools +BuildRequires: python%{python3_other_pkgversion}-numpy +BuildRequires: python%{python3_other_pkgversion}-requests +BuildRequires: python%{python3_other_pkgversion}-pytest +Provides: future-python%{python3_other_pkgversion} = 0:%{version}-%{release} +Obsoletes: python34-future < 0.16.0-7 + +%description -n python%{python3_other_pkgversion}-%{name} +Python3-%{name} is the missing compatibility layer between Python 2 and +Python 3. It allows you to use a single, clean Python 3.x-compatible +codebase to support both Python 2 and Python 3 with minimal overhead. + +It provides ``future`` and ``past`` packages with backports and forward +ports of features from Python 3 and 2. It also comes with ``futurize`` and +``pasteurize``, customized 2to3-based scripts that helps you to convert +either Py2 or Py3 code easily to support both Python 2 and 3 in a single +clean Py3-style codebase, module by module. +%endif + %prep %setup -qc -mv python-future-%{version} python2 -pushd python2 -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' +pushd python-future-%{commit} %patch0 -p0 popd +%if 0%{?with_python2} +cp -a python-future-%{commit} python2 +find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' +%endif + %if 0%{?with_python3} -cp -a python2 python3 +cp -a python-future-%{commit} python3 find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif # with_python3 +%if 0%{?with_python3_other} +cp -a python-future-%{commit} python%{python3_other_pkgversion} +find python%{python3_other_pkgversion} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif + %build +%if 0%{?with_python2} pushd python2 -CFLAGS="%{optflags}" %{__python2} setup.py build --executable="%{__python2} -s" +%py2_build popd +%endif %if 0%{?with_python3} pushd python3 -CFLAGS="%{optflags}" %{__python3} setup.py build --executable="%{__python3} -s" +%py3_build popd %endif # with_python3 +%if 0%{?with_python3_other} +pushd python%{python3_other_pkgversion} +%py3_other_build +popd +%endif + %install %if 0%{?with_python3} pushd python3 -CFLAGS="%{optflags}" %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_pkgversion}-futurize -mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_pkgversion}-pasteurize +%py3_install +mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-futurize +mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-pasteurize sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py -for i in futurize-3 futurize-%{?python3_shortver}; do +for i in futurize-3 futurize-%{python3_version}; do touch $i install -p $i $RPM_BUILD_ROOT%{_bindir} - ln -sf %{_bindir}/python%{python3_pkgversion}-futurize $RPM_BUILD_ROOT%{_bindir}/$i + ln -sf %{_bindir}/python%{python3_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i done -for i in pasteurize-3 pasteurize-%{?python3_shortver}; do +for i in pasteurize-3 pasteurize-%{python3_version}; do touch $i install -p $i $RPM_BUILD_ROOT%{_bindir} - ln -sf %{_bindir}/python%{python3_pkgversion}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i + ln -sf %{_bindir}/python%{python3_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i done popd %endif +%if 0%{?with_python3_other} +pushd python%{python3_other_pkgversion} +%py3_other_install +mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-futurize +mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-pasteurize +sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_other_sitelib}/future/backports/test/pystone.py + +for i in futurize-3 futurize-%{python3_other_version}; do + touch $i + install -p $i $RPM_BUILD_ROOT%{_bindir} + ln -sf %{_bindir}/python%{python3_other_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i +done +for i in pasteurize-3 pasteurize-%{python3_other_version}; do + touch $i + install -p $i $RPM_BUILD_ROOT%{_bindir} + ln -sf %{_bindir}/python%{python3_other_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i +done +popd +%endif + +%if 0%{?with_python2} pushd python2 -CFLAGS="%{optflags}" %{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%py2_install cp -p $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-futurize cp -p $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-pasteurize @@ -157,22 +228,31 @@ for i in pasteurize pasteurize-2 pasteurize-%{python2_version}; do done sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python2_sitelib}/future/backports/test/pystone.py popd +%endif ##This packages ships PEM certificates in future/backports/test directory ##It's for testing purpose, i guess. Ignore them. %check +%if 0%{?with_python2} pushd python2 PYTHONPATH=$PWD/build/lib py.test -v popd +%endif -%if 0%{?with_python3} && !%{?with_python35} +%if 0%{?with_python3} pushd python3 -PYTHONPATH=$PWD/build/lib py.test-%{python3_pkgversion} -v +PYTHONPATH=$PWD/build/lib py.test-%{python3_version} -v popd -%endif # with_python3 # with_python35 +%endif # with_python3 +%if 0%{?with_python3_other} +pushd python%{python3_other_pkgversion} +PYTHONPATH=$PWD/build/lib py.test-%{python3_other_version} -v +popd +%endif # with_python3 + +%if 0%{?with_python2} %files -n python2-%{name} -%{!?_licensedir:%global license %doc} %doc python2/README.rst %license python2/LICENSE.txt %{_bindir}/futurize @@ -199,18 +279,18 @@ popd %{python2_sitelib}/winreg/ %{python2_sitelib}/xmlrpc/ %{python2_sitelib}/*.egg-info +%endif %if 0%{?with_python3} %files -n python%{python3_pkgversion}-%{name} -%{!?_licensedir:%global license %doc} %license python3/LICENSE.txt %doc python3/README.rst %{_bindir}/futurize-3 -%{_bindir}/futurize-%{?python3_shortver} +%{_bindir}/futurize-%{python3_version} %{_bindir}/pasteurize-3 -%{_bindir}/pasteurize-%{?python3_shortver} -%{_bindir}/python%{python3_pkgversion}-futurize -%{_bindir}/python%{python3_pkgversion}-pasteurize +%{_bindir}/pasteurize-%{python3_version} +%{_bindir}/python%{python3_version}-futurize +%{_bindir}/python%{python3_version}-pasteurize %{python3_sitelib}/future/ %{python3_sitelib}/past/ %{python3_sitelib}/libfuturize/ @@ -218,9 +298,52 @@ popd %{python3_sitelib}/*.egg-info %endif +%if 0%{?with_python3_other} +%files -n python%{python3_other_pkgversion}-%{name} +%license python3/LICENSE.txt +%doc python3/README.rst +%{_bindir}/futurize-3 +%{_bindir}/futurize-%{python3_other_version} +%{_bindir}/pasteurize-3 +%{_bindir}/pasteurize-%{python3_other_version} +%{_bindir}/python%{python3_other_version}-futurize +%{_bindir}/python%{python3_other_version}-pasteurize +%{python3_other_sitelib}/future/ +%{python3_other_sitelib}/past/ +%{python3_other_sitelib}/libfuturize/ +%{python3_other_sitelib}/libpasteurize/ +%{python3_other_sitelib}/*.egg-info +%endif + + %changelog -* Thu Mar 07 2019 Troy Dawson - 0.16.0-7 +* Wed Oct 24 2018 Antonio Trande - 0.16.0-14.20181019gitbee0f3b +- Merge changes from master to epel7 branch at this point of the history - Rebuilt to change main python from 3.4 to 3.6 +- Obsolete python34 build on epel7 (rhbz #1705983) + +* Wed Oct 24 2018 Antonio Trande - 0.16.0-13.20181019gitbee0f3b +- Update to the commit #bee0f3b +- Perform all Python3 tests + +* Fri Sep 21 2018 Antonio Trande - 0.16.0-12.20180917gitaf02ef6 +- Update to the commit #af02ef6 + +* Sun Aug 26 2018 Antonio Trande - 0.16.0-11 +- Prepare SPEC file for deprecation of Python2 on fedora 30+ +- Prepare SPEC file for Python3-modules packaging on epel7 + +* Fri Jul 13 2018 Fedora Release Engineering - 0.16.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro HronĨok - 0.16.0-9 +- Rebuilt for Python 3.7 + +* Wed Feb 07 2018 Fedora Release Engineering - 0.16.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sun Jan 14 2018 Antonio Trande - 0.16.0-7 +- Use versioned Python2 packages * Fri Dec 15 2017 Antonio Trande - 0.16.0-6 - Python3 built on epel7 diff --git a/sources b/sources index 45b721f..74f44d4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-future-0.16.0.tar.gz) = 8422e132921d7c0da1f1025ce672ddb301d604bf4629c73634b709a12d77465e941f7365f9e85e870d98718a37988bd928cda7325eb0cc27b1351d23d31a365e +SHA512 (python-future-bee0f3bcb8ba9e7bd131d64e3bf631f5bd06c5b4.tar.gz) = 28b521b5a11a913089592f865216eae7819f2f6a9df50cdfb9e459ab11efa14552edf9dc3c4bf0c71409bc8f736ffda88cfd787a3bc1798f4a65c0da3f6f9057