e19505e
%if 0%{?fedora} || 0%{?rhel} > 7
4c4d6ea
%global with_python3 1
4c4d6ea
%endif
4c4d6ea
e4eb1d2
%if 0%{?fedora} && 0%{?fedora} < 31
e4eb1d2
%global with_python2 1
e4eb1d2
%endif
e4eb1d2
e19505e
%if 0%{?rhel} && 0%{?rhel} == 7
c6bd85c
%global with_python3 1
ddff526
%global with_python2 1
4c4d6ea
%endif
4c4d6ea
cf52b8b
%global _description \
cf52b8b
future is the missing compatibility layer between Python 2 and \
cf52b8b
Python 3. It allows you to use a single, clean Python 3.x-compatible \
cf52b8b
codebase to support both Python 2 and Python 3 with minimal overhead. \
cf52b8b
\
cf52b8b
It provides ``future`` and ``past`` packages with backports and forward \
cf52b8b
ports of features from Python 3 and 2. It also comes with ``futurize`` and \
cf52b8b
``pasteurize``, customized 2to3-based scripts that helps you to convert \
cf52b8b
either Py2 or Py3 code easily to support both Python 2 and 3 in a single \
cf52b8b
clean Py3-style codebase, module by module.
cf52b8b
4c4d6ea
Name: future
4c4d6ea
Summary: Easy, clean, reliable Python 2/3 compatibility
a5ca80a
Version: 0.18.2
da66205
Release: 3%{?dist}
4c4d6ea
License: MIT
4c4d6ea
URL: http://python-future.org/
a5ca80a
Source0: https://files.pythonhosted.org/packages/source/f/%{name}/%{name}-%{version}.tar.gz
4c4d6ea
BuildArch: noarch
4c4d6ea
cf52b8b
# https://github.com/PythonCharmers/python-future/issues/165
4c4d6ea
Patch0: %{name}-skip_tests_with_connection_errors.patch
4c4d6ea
ddff526
%if 0%{?with_python3_other}
ddff526
BuildRequires:  python%{python3_other_pkgversion}-devel
ddff526
%endif
ddff526
4c4d6ea
%description
cf52b8b
%{_description}
4c4d6ea
ddff526
%if 0%{?with_python2}
5865eee
%package -n python2-%{name}
5865eee
Summary: Easy, clean, reliable Python 2/3 compatibility
5865eee
%{?python_provide:%python_provide python2-%{name}}
e19505e
%if 0%{?el6}
f759a1c
BuildRequires: python-argparse, python-unittest2, python-importlib 
f759a1c
Requires:      python-importlib
f759a1c
Requires:      python-argparse
f759a1c
%endif
9fb6344
%if 0%{?el7} || 0%{?fedora}
f759a1c
BuildRequires: python2-devel
f759a1c
BuildRequires: python2-setuptools
f759a1c
BuildRequires: python2-numpy
f759a1c
BuildRequires: python2-requests
f759a1c
BuildRequires: python2-pytest
5865eee
Provides:      future = 0:%{version}-%{release}
d21a4b3
%endif
5865eee
%description -n python2-%{name}
cf52b8b
%{_description}
ddff526
%endif
5865eee
4c4d6ea
%if 0%{?with_python3}
c6bd85c
%package -n python%{python3_pkgversion}-%{name}
4c4d6ea
Summary: Easy, clean, reliable Python 2/3 compatibility
c6bd85c
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
c6bd85c
BuildRequires: python%{python3_pkgversion}-devel
c6bd85c
BuildRequires: python%{python3_pkgversion}-setuptools
c6bd85c
BuildRequires: python%{python3_pkgversion}-numpy
c6bd85c
BuildRequires: python%{python3_pkgversion}-requests
c6bd85c
BuildRequires: python%{python3_pkgversion}-pytest
ddff526
Provides:      future-python3 = 0:%{version}-%{release}
a5ca80a
%if 0%{?fedora} && 0%{?fedora} > 30
a5ca80a
Obsoletes: python2-%{name} < 0:%{version}-%{release}
a5ca80a
Obsoletes: %{name}-python2 < 0:%{version}-%{release}
a5ca80a
Provides:  future = 0:%{version}-%{release}
e19505e
%endif
e4eb1d2
%if 0%{?rhel} && 0%{?rhel} < 8
e4eb1d2
Obsoletes: python34-%{name} < 0:%{version}-%{release}
e4eb1d2
%endif
c6bd85c
c6bd85c
%description -n python%{python3_pkgversion}-%{name}
cf52b8b
%{_description}
e19505e
%endif
e19505e
# with_python3
4c4d6ea
ddff526
%if 0%{?with_python3_other}
ddff526
%package -n python%{python3_other_pkgversion}-%{name}
ddff526
Summary:        Easy, clean, reliable Python 2/3 compatibility
ddff526
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{name}}
ddff526
BuildRequires: python%{python3_other_pkgversion}-devel
ddff526
BuildRequires: python%{python3_other_pkgversion}-setuptools
ddff526
BuildRequires: python%{python3_other_pkgversion}-numpy
ddff526
BuildRequires: python%{python3_other_pkgversion}-requests
ddff526
BuildRequires: python%{python3_other_pkgversion}-pytest
ddff526
Provides:      future-python%{python3_other_pkgversion} = 0:%{version}-%{release}
ddff526
ddff526
%description -n python%{python3_other_pkgversion}-%{name}
cf52b8b
%{_description}
ddff526
%endif
ddff526
4c4d6ea
%prep
2377942
%setup -qc -n future-%{version}
4c4d6ea
2377942
pushd future-%{version}
ddff526
%patch0 -p0
ddff526
popd
ddff526
ddff526
%if 0%{?with_python2}
2377942
cp -a future-%{version} python2
a5ca80a
find python2 -name '*.py' | xargs pathfix.py -pn -i "%{__python2}"
ddff526
%endif
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
2377942
cp -a future-%{version} python3
a5ca80a
find python3 -name '*.py' | xargs pathfix.py -pn -i "%{__python3}"
2377942
%endif
2377942
# with_python3
4c4d6ea
ddff526
%if 0%{?with_python3_other}
2377942
cp -a future-%{version} python%{python3_other_pkgversion}
a5ca80a
find python%{python3_other_pkgversion} -name '*.py' | xargs pathfix.py -pn -i "%{__python3}"
ddff526
%endif
ddff526
4c4d6ea
%build
ddff526
%if 0%{?with_python2}
90bc4f1
pushd python2
ddff526
%py2_build
90bc4f1
popd
ddff526
%endif
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
90bc4f1
pushd python3
ddff526
%py3_build
4c4d6ea
popd
2377942
%endif
2377942
# with_python3
4c4d6ea
ddff526
%if 0%{?with_python3_other}
ddff526
pushd python%{python3_other_pkgversion}
ddff526
%py3_other_build
ddff526
popd
ddff526
%endif
ddff526
4c4d6ea
%install
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
90bc4f1
pushd python3
ddff526
%py3_install
7c25f05
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/futurize-%{python3_version}
7c25f05
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-%{python3_version}
7c25f05
ln -sf ./futurize-%{python3_version} $RPM_BUILD_ROOT%{_bindir}/futurize-3
7c25f05
ln -sf ./pasteurize-%{python3_version} $RPM_BUILD_ROOT%{_bindir}/pasteurize-3
da66205
%if 0%{?fedora} && 0%{?fedora} > 30
7c25f05
ln -sf ./futurize-%{python3_version} $RPM_BUILD_ROOT%{_bindir}/futurize
7c25f05
ln -sf ./pasteurize-%{python3_version} $RPM_BUILD_ROOT%{_bindir}/pasteurize
7c25f05
%endif
e19505e
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py
e19505e
popd
9fb6344
9fb6344
chmod a+x $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py
e19505e
%endif
ddff526
ddff526
%if 0%{?with_python3_other}
ddff526
pushd python%{python3_other_pkgversion}
ddff526
%py3_other_install
7c25f05
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/futurize-%{python3_other_version}
7c25f05
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-%{python3_other_version}
ddff526
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_other_sitelib}/future/backports/test/pystone.py
4c4d6ea
popd
9fb6344
9fb6344
chmod a+x $RPM_BUILD_ROOT%{python3_other_sitelib}/future/backports/test/pystone.py
4c4d6ea
%endif
4c4d6ea
ddff526
%if 0%{?with_python2}
90bc4f1
pushd python2
ddff526
%py2_install
7c25f05
cp -pr $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/futurize-%{python2_version}
7c25f05
cp -pr $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-%{python2_version}
7c25f05
ln -sf ./futurize-%{python2_version} $RPM_BUILD_ROOT%{_bindir}/futurize-2
7c25f05
ln -sf ./pasteurize-%{python2_version} $RPM_BUILD_ROOT%{_bindir}/pasteurize-2
4c4d6ea
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python2_sitelib}/future/backports/test/pystone.py
90bc4f1
popd
9fb6344
9fb6344
chmod a+x $RPM_BUILD_ROOT%{python2_sitelib}/future/backports/test/pystone.py
ddff526
%endif
4c4d6ea
e19505e
## This packages ships PEM certificates in future/backports/test directory.
e19505e
## It's for testing purpose, i guess. Ignore them.
4c4d6ea
%check
ddff526
%if 0%{?with_python2}
90bc4f1
pushd python2
e19505e
PYTHONPATH=$PWD/build/lib py.test-%{python2_version}
90bc4f1
popd
ddff526
%endif
4c4d6ea
2377942
# Bugs
2377942
# https://github.com/PythonCharmers/python-future/issues/474
2377942
# https://github.com/PythonCharmers/python-future/issues/508
ddff526
%if 0%{?with_python3}
90bc4f1
pushd python3
7fc2d92
%if 0%{?python3_version_nodots} > 37
a5ca80a
PYTHONPATH=$PWD/build/lib py.test-%{python3_version} -k "not test_pow and not test_urllib2"
a5ca80a
%endif
a5ca80a
%if 0%{?python3_version_nodots} <= 37
a5ca80a
PYTHONPATH=$PWD/build/lib py.test-%{python3_version}
784552e
%endif
4c4d6ea
popd
e19505e
%endif
e19505e
# with_python3
ddff526
ddff526
%if 0%{?with_python3_other}
ddff526
pushd python%{python3_other_pkgversion}
e19505e
PYTHONPATH=$PWD/build/lib py.test-%{python3_other_version}
ddff526
popd
e19505e
%endif
e19505e
# with_python3
4c4d6ea
ddff526
%if 0%{?with_python2}
5865eee
%files -n python2-%{name}
90bc4f1
%doc python2/README.rst
90bc4f1
%license python2/LICENSE.txt
4c4d6ea
%{_bindir}/futurize
4c4d6ea
%{_bindir}/futurize-2*
4c4d6ea
%{_bindir}/pasteurize
4c4d6ea
%{_bindir}/pasteurize-2*
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
ddff526
%endif
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
c6bd85c
%files -n python%{python3_pkgversion}-%{name}
90bc4f1
%license python3/LICENSE.txt
90bc4f1
%doc python3/README.rst
c6bd85c
%{_bindir}/futurize-3
c6bd85c
%{_bindir}/pasteurize-3
da66205
%if 0%{?fedora} && 0%{?fedora} > 30
e19505e
%{_bindir}/futurize
e19505e
%{_bindir}/pasteurize
e19505e
%endif
e19505e
%{_bindir}/futurize-%{python3_version}
ddff526
%{_bindir}/pasteurize-%{python3_version}
4c4d6ea
%{python3_sitelib}/future/
4c4d6ea
%{python3_sitelib}/past/
4c4d6ea
%{python3_sitelib}/libfuturize/
4c4d6ea
%{python3_sitelib}/libpasteurize/
4c4d6ea
%{python3_sitelib}/*.egg-info
4c4d6ea
%endif
4c4d6ea
ddff526
%if 0%{?with_python3_other}
ddff526
%files -n python%{python3_other_pkgversion}-%{name}
ddff526
%license python3/LICENSE.txt
ddff526
%doc python3/README.rst
ddff526
%{_bindir}/futurize-%{python3_other_version}
ddff526
%{_bindir}/pasteurize-%{python3_other_version}
ddff526
%{python3_other_sitelib}/future/
ddff526
%{python3_other_sitelib}/past/
ddff526
%{python3_other_sitelib}/libfuturize/
ddff526
%{python3_other_sitelib}/libpasteurize/
ddff526
%{python3_other_sitelib}/*.egg-info
ddff526
%endif
ddff526
ddff526
4c4d6ea
%changelog
da66205
* Fri Jan 24 2020 Antonio Trande <sagitterATfedoraproject.org> - 0.18.2-3
da66205
- Fix Python2 executable on Fedora 30
da66205
e4eb1d2
* Fri Jan 24 2020 Antonio Trande <sagitterATfedoraproject.org> - 0.18.2-2
e4eb1d2
- Build Python2 version on Fedora 30
e4eb1d2
a5ca80a
* Fri Jan 24 2020 Antonio Trande <sagitterATfedoraproject.org> - 0.18.2-1
a5ca80a
- Release 0.18.2
a5ca80a
7fc2d92
* Sat Oct 12 2019 Antonio Trande <sagitterATfedoraproject.org> - 0.18.0-2
7fc2d92
- Use python3_version_nodots macro
7fc2d92
2377942
* Sat Oct 12 2019 Antonio Trande <sagitterATfedoraproject.org> - 0.18.0-1
2377942
- Release 0.18.0
2377942
efcb73a
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.17.1-0.5.20190506git23989c4
efcb73a
- Rebuilt for Python 3.8.0rc1 (#1748018)
efcb73a
2fcee8b
* Sun Aug 18 2019 Miro Hrončok <mhroncok@redhat.com> - 0.17.1-0.4.20190506git23989c4
2fcee8b
- Rebuilt for Python 3.8
2fcee8b
009f2c6
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.1-0.3.20190506git23989c4
009f2c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
009f2c6
e19505e
* Tue Jul 23 2019 Antonio Trande <sagitterATfedoraproject.org> - 0.17.1-0.2.20190506git23989c4
e19505e
- Bump to a pre-release 0.17.1, commit #23989c4
e19505e
- Unversioned commands point to Python3 on Fedora
e19505e
- Obsolete Python2 version on Fedora
e19505e
cf52b8b
* Tue Apr 09 2019 Antonio Trande <sagitterATfedoraproject.org> - 0.17.1-0.1.20190313gitc423752
cf52b8b
- Bump to a pre-release 0.17.1 (fix rhbz#1698160, upstream bug #488)
cf52b8b
d1a0c50
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.0-2
d1a0c50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d1a0c50
03d3372
* Fri Oct 26 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.17.0-1
03d3372
- Release 0.17.0
03d3372
d436bdf
* Wed Oct 24 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.17.0-0.1.20181019gitbee0f3b
d436bdf
- Bump to a pre-release 0.17.0
d436bdf
d053487
* Wed Oct 24 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-13.20181019gitbee0f3b
d053487
- Update to the commit #bee0f3b
d053487
- Perform all Python3 tests
d053487
cb0276c
* Fri Sep 21 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-12.20180917gitaf02ef6
cb0276c
- Update to the commit #af02ef6
cb0276c
ddff526
* Sun Aug 26 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-11
ddff526
- Prepare SPEC file for deprecation of Python2 on fedora 30+
ddff526
- Prepare SPEC file for Python3-modules packaging on epel7
ddff526
16b4fb1
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-10
16b4fb1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
16b4fb1
0351165
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.16.0-9
0351165
- Rebuilt for Python 3.7
0351165
184ccdd
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-8
184ccdd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
184ccdd
f759a1c
* Sun Jan 14 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-7
f759a1c
- Use versioned Python2 packages
f759a1c
c6bd85c
* Fri Dec 15 2017 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-6
c6bd85c
- Python3 built on epel7
c6bd85c
2199817
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-5
2199817
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2199817
54aefc0
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-4
54aefc0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
54aefc0
6c30623
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.16.0-3
6c30623
- Rebuild for Python 3.6
6c30623
ea07c13
* Tue Dec 13 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-2
ea07c13
- BR Python2 dependencies unversioned on epel6
ea07c13
b1f0ce8
* Tue Dec 13 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-1
b1f0ce8
- Update to 0.16.0
b1f0ce8
b1f0ce8
* Wed Aug 17 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.15.2-10
f9c6bf6
- Rebuild for Python 3.5.2
f9c6bf6
189f864
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15.2-9
189f864
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
189f864
96ecdf0
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.2-8
96ecdf0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
96ecdf0
5865eee
* Fri Jan 29 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.15.2-7
5865eee
- Renamed Python2 package
5865eee
90bc4f1
* Thu Dec 10 2015 Antonio Trande <sagitterATfedoraproject.org> - 0.15.2-6
90bc4f1
- SPEC file adapted to recent guidelines for Python
90bc4f1
c71511f
* Fri Nov 13 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-5
c71511f
- Rebuild
c71511f
87d21bd
* Fri Nov 13 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-4
87d21bd
- Python3 tests temporarily disabled with Python35
87d21bd
87d21bd
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
87d21bd
- 0.15.2-3 - 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