Compare commits

..

No commits in common. "8e6397508faa3ee55ea0c78c2495560b6eb4e572" and "abe1df67f08d3e73d98bfe4cface520d73a3bc42" have entirely different histories.

4 changed files with 72 additions and 25 deletions

Binary file not shown.

View File

@ -3,25 +3,35 @@
This package intends to provides a compatibility layer for Python between its \
two version release. The future and past packages are both provides for backports \
and forwards, in which you are able to use a single, clean codebase to run under \
Python3 environmets easily. With also providing futurize and pasteurize scripts, \
Python2/3 environmets easily. With also providing futurize and pasteurize scripts, \
you can convert you Python code to support both version.
%{!?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))')}
Name: future
Version: 0.18.3
Release: 1
Summary: Missing compatibility layer on Python 3
Version: 0.16.0
Release: 11
Summary: Missing compatibility layer between Python 2 and Python 3
License: MIT
URL: http://python-future.org/
Source0: %{pypi_source future}
Source0: https://github.com/PythonCharmers/python-future/archive/v%{version}.tar.gz#/python-future-%{version}.tar.gz
BuildArch: noarch
%description
%{desc}
%package -n python2-future
Summary: Missing compatibility layer between Python 2 and Python 3
%{?python_provide:%python_provide python2-future}
BuildRequires: python2-devel python2-setuptools python2-numpy python2-requests python2-pytest
Provides: future = 0:%{version}-%{release}
%description -n python2-future
%{desc}
%package -n python3-future
Summary: Missing compatibility layer on Python 3
Summary: Missing compatibility layer between Python 2 and Python 3
%{?python_provide:%python_provide python3-future}
BuildRequires: python3-devel python3-setuptools python3-numpy python3-requests python3-pytest
@ -29,12 +39,28 @@ BuildRequires: python3-devel python3-setuptools python3-numpy python3-requests
%{desc}
%prep
%autosetup -p1
%autosetup -c -p1
mv python-future-%{version} python2
cd python2
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
cd ..
cp -a python2 python3
find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%build
cd python2
CFLAGS="%{optflags}" %{__python2} setup.py build --executable="%{__python2} -s"
cd ..
cd python3
CFLAGS="%{optflags}" %{__python3} setup.py build --executable="%{__python3} -s"
cd ..
%install
cd python3
CFLAGS="%{optflags}" %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python3-futurize
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python3-pasteurize
@ -49,16 +75,53 @@ touch pasteurize-3 pasteurize-%{?python3_shortver}
install -p pasteurize-3 pasteurize-%{?python3_shortver} $RPM_BUILD_ROOT%{_bindir}
ln -sf %{_bindir}/python3-pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-3
ln -sf %{_bindir}/python3-pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-%{?python3_shortver}
cd ..
cd python2
CFLAGS="%{optflags}" %{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
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
touch futurize futurize-2 futurize-%{python2_version}
install -p futurize futurize-2 futurize-%{python2_version} $RPM_BUILD_ROOT%{_bindir}
ln -sf %{_bindir}/python%{python2_version}-futurize $RPM_BUILD_ROOT%{_bindir}/futurize
ln -sf %{_bindir}/python%{python2_version}-futurize $RPM_BUILD_ROOT%{_bindir}/futurize-2
ln -sf %{_bindir}/python%{python2_version}-futurize $RPM_BUILD_ROOT%{_bindir}/futurize-%{python2_version}
touch pasteurize pasteurize-2 pasteurize-%{python2_version}
install -p pasteurize pasteurize-2 pasteurize-%{python2_version} $RPM_BUILD_ROOT%{_bindir}
ln -sf %{_bindir}/python%{python2_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize
ln -sf %{_bindir}/python%{python2_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-2
ln -sf %{_bindir}/python%{python2_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-%{python2_version}
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python2_sitelib}/future/backports/test/pystone.py
cd ..
%check
%if %{with_tests}
cd python2
PYTHONPATH=$PWD/build/lib py.test -v
cd ..
cd python3
PYTHONPATH=$PWD/build/lib py.test-3 -v
cd ..
%endif
%files -n python2-future
%{!?_licensedir:%global license %doc}
%doc python2/README.rst
%license python2/LICENSE.txt
%{_bindir}/futurize
%{_bindir}/futurize-2*
%{_bindir}/pasteurize
%{_bindir}/pasteurize-2*
%{_bindir}/python%{python2_version}-futurize
%{_bindir}/python%{python2_version}-pasteurize
%{python2_sitelib}/*
%files -n python3-future
%{!?_licensedir:%global license %doc}
%license LICENSE.txt
%doc README.rst
%license python3/LICENSE.txt
%doc python3/README.rst
%{_bindir}/futurize-3
%{_bindir}/futurize-%{?python3_shortver}
%{_bindir}/pasteurize-3
@ -68,18 +131,6 @@ PYTHONPATH=$PWD/build/lib py.test-3 -v
%{python3_sitelib}/*
%changelog
* Fri Jul 07 2023 Ge Wang <wang__ge@126.com> - 0.18.3-1
- Update to version 0.18.3
* Fri Mar 10 2023 yaoxin <yaoxin30@h-partners.com> - 0.18.2-2
- Fix CVE-2022-40899
* Wed Jul 14 2021 liksh <liks11@chinaunicom.cn> - 0.18.2-1
- update package from 0.16.0 to 0.18.2
* Wed Oct 21 2020 leiju <leiju4@huawei.com> - 0.16.0-12
- remove python2 subpackage
* Thu Jan 09 2020 lihao <lihao129@huawei.com> - 0.16.0-11
- Package Init

View File

@ -1,4 +0,0 @@
version_control: github
src_repo: PythonCharmers/python-future
tag_prefix: ^v
seperator: .

BIN
python-future-0.16.0.tar.gz Normal file

Binary file not shown.