|
|
4c4d6ea |
%if 0%{?fedora} > 12
|
|
|
4c4d6ea |
%global with_python3 1
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
## Make python?_shortver macros
|
|
|
4c4d6ea |
%{!?python2_shortver: %global python2_shortver %(%{__python2} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
|
|
|
4c4d6ea |
%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
|
|
|
4c4d6ea |
%endif
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?rhel} && 0%{?rhel} <= 6
|
|
|
4c4d6ea |
%{!?__python2: %global __python2 /usr/bin/python2}
|
|
|
4c4d6ea |
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
|
|
4c4d6ea |
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
|
|
4c4d6ea |
%global python2_version 2.6
|
|
|
4c4d6ea |
%global with_python3 0
|
|
|
4c4d6ea |
%endif
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?rhel} && 0%{?rhel} > 6
|
|
|
4c4d6ea |
%global with_python3 0
|
|
|
4c4d6ea |
%endif
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
Name: future
|
|
|
4c4d6ea |
Summary: Easy, clean, reliable Python 2/3 compatibility
|
|
|
4c4d6ea |
Version: 0.15.2
|
|
|
f777061 |
Release: 3%{?dist}
|
|
|
4c4d6ea |
License: MIT
|
|
|
4c4d6ea |
Group: Applications/Engineering
|
|
|
4c4d6ea |
URL: http://python-future.org/
|
|
|
4c4d6ea |
Source0: https://github.com/PythonCharmers/python-future/archive/v%{version}.tar.gz#/python-future-%{version}.tar.gz
|
|
|
4c4d6ea |
BuildArch: noarch
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
##https://github.com/PythonCharmers/python-future/issues/165
|
|
|
4c4d6ea |
Patch0: %{name}-skip_tests_with_connection_errors.patch
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
##https://github.com/PythonCharmers/python-future/issues/118
|
|
|
4c4d6ea |
Patch01: %{name}-Remove-configparser-backport.patch
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?rhel} && 0%{?rhel} <= 6
|
|
|
4c4d6ea |
BuildRequires: python-argparse, python-unittest2, python-importlib
|
|
|
4c4d6ea |
Requires: python-importlib
|
|
|
4c4d6ea |
Requires: python-argparse
|
|
|
4c4d6ea |
%endif
|
|
|
4c4d6ea |
BuildRequires: python2-devel
|
|
|
4c4d6ea |
BuildRequires: python-setuptools
|
|
|
4c4d6ea |
BuildRequires: numpy
|
|
|
4c4d6ea |
BuildRequires: python-requests
|
|
|
4c4d6ea |
BuildRequires: pytest
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%{?python_provide:%python_provide python2-%{name}}
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%description
|
|
|
4c4d6ea |
%{name} is the missing compatibility layer between Python 2 and
|
|
|
4c4d6ea |
Python 3. It allows you to use a single, clean Python 3.x-compatible
|
|
|
4c4d6ea |
codebase to support both Python 2 and Python 3 with minimal overhead.
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
It provides ``future`` and ``past`` packages with backports and forward
|
|
|
4c4d6ea |
ports of features from Python 3 and 2. It also comes with ``futurize`` and
|
|
|
4c4d6ea |
``pasteurize``, customized 2to3-based scripts that helps you to convert
|
|
|
4c4d6ea |
either Py2 or Py3 code easily to support both Python 2 and 3 in a single
|
|
|
4c4d6ea |
clean Py3-style codebase, module by module.
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?with_python3}
|
|
|
4c4d6ea |
%package -n python3-%{name}
|
|
|
4c4d6ea |
Summary: Easy, clean, reliable Python 2/3 compatibility
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
BuildRequires: python3-devel
|
|
|
4c4d6ea |
BuildRequires: python3-setuptools
|
|
|
4c4d6ea |
BuildRequires: python3-numpy
|
|
|
4c4d6ea |
BuildRequires: python3-requests
|
|
|
4c4d6ea |
BuildRequires: python3-pytest
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%description -n python3-%{name}
|
|
|
4c4d6ea |
Python3-%{name} is the missing compatibility layer between Python 2 and
|
|
|
4c4d6ea |
Python 3. It allows you to use a single, clean Python 3.x-compatible
|
|
|
4c4d6ea |
codebase to support both Python 2 and Python 3 with minimal overhead.
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
It provides ``future`` and ``past`` packages with backports and forward
|
|
|
4c4d6ea |
ports of features from Python 3 and 2. It also comes with ``futurize`` and
|
|
|
4c4d6ea |
``pasteurize``, customized 2to3-based scripts that helps you to convert
|
|
|
4c4d6ea |
either Py2 or Py3 code easily to support both Python 2 and 3 in a single
|
|
|
4c4d6ea |
clean Py3-style codebase, module by module.
|
|
|
4c4d6ea |
%endif # with_python3
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%prep
|
|
|
4c4d6ea |
%setup -q -n python-future-%{version}
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%patch0 -p0
|
|
|
4c4d6ea |
%patch1 -p1
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?with_python3}
|
|
|
4c4d6ea |
rm -rf %{py3dir}
|
|
|
4c4d6ea |
cp -a . %{py3dir}
|
|
|
4c4d6ea |
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
|
|
4c4d6ea |
%endif # with_python3
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%build
|
|
|
4c4d6ea |
%{__python2} setup.py build
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?with_python3}
|
|
|
4c4d6ea |
pushd %{py3dir}
|
|
|
4c4d6ea |
%{__python3} setup.py build
|
|
|
4c4d6ea |
popd
|
|
|
4c4d6ea |
%endif # with_python3
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%install
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?with_python3}
|
|
|
4c4d6ea |
pushd %{py3dir}
|
|
|
4c4d6ea |
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
|
|
4c4d6ea |
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-futurize
|
|
|
4c4d6ea |
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-pasteurize
|
|
|
4c4d6ea |
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
for i in futurize-3 futurize-%{?python3_shortver}; do
|
|
|
4c4d6ea |
touch $i
|
|
|
4c4d6ea |
install -p $i $RPM_BUILD_ROOT%{_bindir}
|
|
|
4c4d6ea |
ln -sf %{_bindir}/python%{python3_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
|
|
|
4c4d6ea |
done
|
|
|
4c4d6ea |
for i in pasteurize-3 pasteurize-%{?python3_shortver}; do
|
|
|
4c4d6ea |
touch $i
|
|
|
4c4d6ea |
install -p $i $RPM_BUILD_ROOT%{_bindir}
|
|
|
4c4d6ea |
ln -sf %{_bindir}/python%{python3_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
|
|
|
4c4d6ea |
done
|
|
|
4c4d6ea |
popd
|
|
|
4c4d6ea |
%endif
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
|
|
4c4d6ea |
cp -p $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-futurize
|
|
|
4c4d6ea |
cp -p $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-pasteurize
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
for i in futurize futurize-2 futurize-%{python2_version}; do
|
|
|
4c4d6ea |
touch $i
|
|
|
4c4d6ea |
install -p $i $RPM_BUILD_ROOT%{_bindir}
|
|
|
4c4d6ea |
ln -sf %{_bindir}/python%{python2_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
|
|
|
4c4d6ea |
done
|
|
|
4c4d6ea |
for i in pasteurize pasteurize-2 pasteurize-%{python2_version}; do
|
|
|
4c4d6ea |
touch $i
|
|
|
4c4d6ea |
install -p $i $RPM_BUILD_ROOT%{_bindir}
|
|
|
4c4d6ea |
ln -sf %{_bindir}/python%{python2_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
|
|
|
4c4d6ea |
done
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python2_sitelib}/future/backports/test/pystone.py
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
##This packages ships PEM certificates in future/backports/test directory
|
|
|
4c4d6ea |
##It's for testing purpose, i guess. Ignore them.
|
|
|
4c4d6ea |
%check
|
|
|
4c4d6ea |
PYTHONPATH=$PWD/build/lib py.test -v
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?with_python3}
|
|
|
4c4d6ea |
pushd %{py3dir}
|
|
|
4c4d6ea |
PYTHONPATH=$PWD/build/lib py.test-%{python3_version} -v
|
|
|
4c4d6ea |
popd
|
|
|
4c4d6ea |
%endif # with_python3
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%files
|
|
|
4c4d6ea |
%{!?_licensedir:%global license %doc}
|
|
|
4c4d6ea |
%doc README.rst
|
|
|
4c4d6ea |
%license LICENSE.txt
|
|
|
4c4d6ea |
%{_bindir}/futurize
|
|
|
4c4d6ea |
%{_bindir}/futurize-2*
|
|
|
4c4d6ea |
%{_bindir}/pasteurize
|
|
|
4c4d6ea |
%{_bindir}/pasteurize-2*
|
|
|
4c4d6ea |
%{_bindir}/python%{python2_version}-futurize
|
|
|
4c4d6ea |
%{_bindir}/python%{python2_version}-pasteurize
|
|
|
4c4d6ea |
%{python2_sitelib}/future/
|
|
|
4c4d6ea |
%{python2_sitelib}/past/
|
|
|
4c4d6ea |
%{python2_sitelib}/libfuturize/
|
|
|
4c4d6ea |
%{python2_sitelib}/libpasteurize/
|
|
|
4c4d6ea |
%{python2_sitelib}/tkinter/
|
|
|
4c4d6ea |
%{python2_sitelib}/_dummy_thread/
|
|
|
4c4d6ea |
%{python2_sitelib}/_markupbase/
|
|
|
4c4d6ea |
%{python2_sitelib}/_thread/
|
|
|
4c4d6ea |
%{python2_sitelib}/builtins/
|
|
|
4c4d6ea |
%{python2_sitelib}/copyreg/
|
|
|
4c4d6ea |
%{python2_sitelib}/html/
|
|
|
4c4d6ea |
%{python2_sitelib}/http/
|
|
|
4c4d6ea |
%{python2_sitelib}/queue/
|
|
|
4c4d6ea |
%{python2_sitelib}/reprlib/
|
|
|
4c4d6ea |
%{python2_sitelib}/socketserver/
|
|
|
4c4d6ea |
%{python2_sitelib}/winreg/
|
|
|
4c4d6ea |
%{python2_sitelib}/xmlrpc/
|
|
|
4c4d6ea |
%{python2_sitelib}/*.egg-info
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%if 0%{?with_python3}
|
|
|
4c4d6ea |
%files -n python3-%{name}
|
|
|
4c4d6ea |
%{!?_licensedir:%global license %doc}
|
|
|
4c4d6ea |
%license LICENSE.txt
|
|
|
4c4d6ea |
%doc README.rst
|
|
|
4c4d6ea |
%{_bindir}/futurize-3*
|
|
|
4c4d6ea |
%{_bindir}/pasteurize-3*
|
|
|
4c4d6ea |
%{_bindir}/python%{python3_version}-futurize
|
|
|
4c4d6ea |
%{_bindir}/python%{python3_version}-pasteurize
|
|
|
4c4d6ea |
%{python3_sitelib}/future/
|
|
|
4c4d6ea |
%{python3_sitelib}/past/
|
|
|
4c4d6ea |
%{python3_sitelib}/libfuturize/
|
|
|
4c4d6ea |
%{python3_sitelib}/libpasteurize/
|
|
|
4c4d6ea |
%{python3_sitelib}/*.egg-info
|
|
|
4c4d6ea |
%endif
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
%changelog
|
|
|
f777061 |
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15.2-3
|
|
|
f777061 |
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
|
|
|
f777061 |
|
|
|
449a855 |
* Mon Sep 14 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-2
|
|
|
449a855 |
- Patch0 updated
|
|
|
449a855 |
|
|
|
4c4d6ea |
* Fri Sep 11 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-1
|
|
|
4c4d6ea |
- Update to 0.15.2
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
* Wed Sep 02 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-4
|
|
|
4c4d6ea |
- Added patch to exclude failed tests (patch0)
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
* Wed Aug 26 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-3
|
|
|
4c4d6ea |
- Added python-provides macro
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
* Thu Jul 30 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-2
|
|
|
4c4d6ea |
- Fixed Python3 packaging on Fedora
|
|
|
4c4d6ea |
- Removed configparser backport (patch1)
|
|
|
4c4d6ea |
|
|
|
4c4d6ea |
* Tue Jul 28 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-1
|
|
|
4c4d6ea |
- Initial build
|