Removing python2 support

This commit is contained in:
Dan Radez 2019-09-24 15:15:12 -04:00
parent a8f793bbf3
commit e121357364

View File

@ -5,7 +5,7 @@
Name: python-%{modname} Name: python-%{modname}
Summary: Unicode-aware Pure Python Expect-like module Summary: Unicode-aware Pure Python Expect-like module
Version: 4.7.0 Version: 4.7.0
Release: 3%{?dist} Release: 4%{?dist}
License: ISC License: ISC
URL: https://github.com/pexpect/pexpect URL: https://github.com/pexpect/pexpect
@ -30,32 +30,6 @@ does not require TCL or Expect nor does it require C extensions to be
compiled. It should work on any platform that supports the standard Python compiled. It should work on any platform that supports the standard Python
pty module. pty module.
%package -n python2-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires: python2-devel
BuildRequires: python2-pytest
BuildRequires: python2-ptyprocess
Requires: python2-ptyprocess
Provides: pexpect = %{version}-%{release}
Obsoletes: pexpect <= 2.3-20
%description -n python2-pexpect
Pexpect is a pure Python module for spawning child applications; controlling
them; and responding to expected patterns in their output. Pexpect works like
Don Libes' Expect. Pexpect allows your script to spawn a child application and
control it as if a human were typing commands. This package contains the
python2 version of this module.
Pexpect can be used for automating interactive applications such as ssh, ftp,
passwd, telnet, etc. It can be used to automate setup scripts for duplicating
software package installations on different servers. And it can be used for
automated software testing. Pexpect is in the spirit of Don Libes' Expect, but
Pexpect is pure Python. Unlike other Expect-like modules for Python, Pexpect
does not require TCL or Expect nor does it require C extensions to be
compiled. It should work on any platform that supports the standard Python
pty module.
%package -n python3-%{modname} %package -n python3-%{modname}
Summary: %{summary} Summary: %{summary}
%{?python_provide:%python_provide python3-%{modname}} %{?python_provide:%python_provide python3-%{modname}}
@ -81,69 +55,42 @@ compiled. It should work on any platform that supports the standard Python
pty module. pty module.
%prep %prep
%autosetup -c %autosetup -n %{modname}-%{version}
mv %{modname}-%{version} python2 #mv %{modname}-%{version} python2
chmod +x python2/tools/* #chmod +x python2/tools/*
find python2/examples -type f | xargs chmod a-x #find python2/examples -type f | xargs chmod a-x
cp -pr python2 python3 #cp -pr python2 python3
find python2 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python2}|' #find python2 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python2}|'
find python3 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|' #find python3 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'
%build %build
pushd python2 %py3_build
%py2_build
popd
pushd python3
%py3_build
popd
%install %install
pushd python2 %py3_install
%py2_install rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests
rm -rf ${buildroot}%{python2_sitelib}/setuptools/tests
# Drop asyncio stuff from py2
rm -f %{buildroot}%{python2_sitelib}/%{modname}/_async.py
popd
pushd python3
%py3_install
rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests
popd
%if %{with check} %if %{with check}
%check %check
export PYTHONIOENCODING=UTF-8 export PYTHONIOENCODING=UTF-8
pushd python2 %{__python3} ./tools/display-sighandlers.py
%{__python2} ./tools/display-sighandlers.py %{__python3} ./tools/display-terminalinfo.py
%{__python2} ./tools/display-terminalinfo.py PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} ./tools/display-maxcanon.py
PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} ./tools/display-maxcanon.py py.test-3 --verbose
py.test-2 --verbose
popd
pushd python3
%{__python3} ./tools/display-sighandlers.py
%{__python3} ./tools/display-terminalinfo.py
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} ./tools/display-maxcanon.py
py.test-3 --verbose
popd
%endif %endif
%files -n python2-%{modname}
%license python2/LICENSE
%doc python2/doc python2/examples
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-*.egg-info
%files -n python3-%{modname} %files -n python3-%{modname}
%license python3/LICENSE %license LICENSE
%doc python3/doc python3/examples %doc doc examples
%{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-*.egg-info %{python3_sitelib}/%{modname}-*.egg-info
%changelog %changelog
* Tue Sep 24 2019 Dan Radez <dradez@redhat.com> - 4.7.0-4
- Remove Python2 packaging
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 4.7.0-3 * Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 4.7.0-3
- Rebuilt for Python 3.8 - Rebuilt for Python 3.8