#5 Fix for Python 3.6 in EPEL
Merged 4 years ago by swt2c. Opened 4 years ago by swt2c.
rpms/ swt2c/python-pexpect fix_py36_epel  into  epel7

file modified
+24 -81
@@ -5,7 +5,7 @@ 

  Name:           python-%{modname}

  Summary:        Unicode-aware Pure Python Expect-like module

  Version:        4.6

- Release:        1%{?dist}

+ Release:        2%{?dist}

  

  License:        MIT

  URL:            https://github.com/pexpect/pexpect
@@ -30,40 +30,14 @@ 

  compiled.  It should work on any platform that supports the standard Python

  pty module.

  

- %package -n python2-%{modname}

+ %package -n python%{python3_pkgversion}-%{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.

+ BuildRequires:  python%{python3_pkgversion}-devel

+ BuildRequires:  python%{python3_pkgversion}-pytest

+ BuildRequires:  python%{python3_pkgversion}-ptyprocess

+ Requires:       python%{python3_pkgversion}-ptyprocess

  

- 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}

- Summary:        %{summary}

- BuildRequires:  python34-devel

- BuildRequires:  python34-pytest

- BuildRequires:  python34-ptyprocess

- Requires:       python34-ptyprocess

- 

- %description -n python3-%{modname}

+ %description -n python%{python3_pkgversion}-%{modname}

  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
@@ -80,70 +54,39 @@ 

  pty module.

  

  %prep

- %autosetup -c

- mv %{modname}-%{version} python2

- chmod +x python2/tools/*

- find python2/examples -type f | xargs chmod a-x

- cp -pr python2 python3

- 

- find python2 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python2}|'

- find python3 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'

+ %autosetup -n %{modname}-%{version}

+ chmod +x tools/*

+ find examples -type f | xargs chmod a-x

+ find . -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'

  

  %build

- pushd python2

-   %py2_build

- popd

- 

- pushd python3

-   %py3_build

- popd

+ %py3_build

  

  %install

- pushd python2

-   %py2_install

-   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

+ %py3_install

+ rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests

  

  %if %{with check}

  %check

  export PYTHONIOENCODING=UTF-8

  export LC_ALL="en_US.UTF-8"

  

- pushd python2

-   %{__python2} ./tools/display-sighandlers.py

-   %{__python2} ./tools/display-terminalinfo.py

-   PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} ./tools/display-maxcanon.py

-   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

+ %{__python3} ./tools/display-sighandlers.py

+ %{__python3} ./tools/display-terminalinfo.py

+ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} ./tools/display-maxcanon.py

+ py.test-3 --verbose

  %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}

- %license python3/LICENSE

- %doc python3/doc python3/examples

+ %files -n python%{python3_pkgversion}-%{modname}

+ %license LICENSE

+ %doc doc examples

  %{python3_sitelib}/%{modname}/

  %{python3_sitelib}/%{modname}-*.egg-info

  

  %changelog

+ * Tue Oct 29 2019 Scott Talbert <swt@techie.net> - 4.6-2

+ - Fix for Python 3.6 in EPEL; remove Python 2 module as it exists in RHEL

+ 

  * Wed Jul 25 2018 Dan Radez <dradez@redhat.com> - 4.6-1

  - update to 4.6

  

no initial comment

Looks good to me and it's installable and importable.

Thanks. Can someone merge + build + update please?

This removes the 3.4 package, does anything require it?

Ah, this was never built, correct?

Nope looks like it was never built.

However, I just noticed that there appears to be a Python 2 version of pexpect in RHEL, so I guess I'll need to remove Py2 from this.

rebased onto d93f2db

4 years ago

Removed Python 2 module.

looks sane. if it builds, let's ship it?

It does build of course. I would never submit something that doesn't build. :) It doesn't look like the simple-koji-ci build re-fired after I force pushed, though.

It does build of course. I would never submit something that doesn't build. :)

:100:

It doesn't look like the simple-koji-ci build re-fired after I force pushed, though.

It is very simple indeed.

Python SIG admins this package, hence as a member of that SIG I've made a decision to add @swt2c as an admin as well for them to maintain the EPEL branch, as offered in Bugzilla.

Pull-Request has been merged by swt2c

4 years ago