Bug 1393129

Summary: Review Request: python-aexpect - a python library to control interactive applications
Product: [Fedora] Fedora Reporter: Merlin Mathesius <mmathesi>
Component: Package ReviewAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mmathesi, package-review, sgallagh
Target Milestone: ---Flags: sgallagh: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-05 21:41:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Merlin Mathesius 2016-11-08 22:38:42 UTC
Spec URL: https://merlinm.fedorapeople.org/aexpect.spec
SRPM URL: https://merlinm.fedorapeople.org/aexpect-1.2.0-1.fc24.src.rpm
Koji scratch build URL: http://koji.fedoraproject.org/koji/taskinfo?taskID=16341439
Description:

Aexpect is a python library used to control interactive applications, very
similar to pexpect. You can use it to control applications such as ssh, scp
sftp, telnet, among others.

Fedora Account System Username: merlinm

Comment 1 Stephen Gallagher 2016-11-09 14:30:27 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- Package contains BR: python2-devel or python3-devel
  Currently, the package has `BuildRequires: python`, but it should be one or both of `BuildRequires: python2-devel` or `BuildRequires: python3-devel`

- If the package only supports Python 2, then it needs to indicate that in a comment in the spec file. If it supports Python 3, then it must build the Python 3 version as well and only the python3-aexpect package may ship aexpect-helper

- Non-blocking, but instead of `%{python_sitelib}/aexpect*`, use
%{python_sitelib}/aexpect/
%{python_sitelib}/aexpect-%{version}-py%{python2_version}-.egg-info

This has the benefit of intentionally failing a build if an unexpected file starting with "aexpect" turns up in that location. It's better to be explicit about what ends up in the RPMs.

- The URL is wrong: it points to the Avocado documentation. It should probably just be https://github.com/autotest/aexpect

- Drop the %defattr line from %files. It's not needed on Fedora or any currently supported version of RHEL.

- Where does the version 1.2.0 come from? I don't see that in the tarball or upstream anywhere.

- The commit doesn't match the latest HEAD or any tags. Why pick that one? It needs to be in a comment.

- Upstream includes a script called `selftests/checkall`. Why isn't this run in %check?. If it doesn't work or isn't meaningful, it should be added to the spec but commented out with a note about why for future packagers.

- in %description, drop the "Aexpect is" lead-in. It doesn't need to duplicate the name.

===== MUST items =====

Generic:
[X]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[X]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "GPL (v2)", "GPL (v2 or later)", "Unknown or generated". 26
     files have unknown license. Detailed output of licensecheck in
     /home/fedorareview/1393129-aexpect/licensecheck.txt
[X]: Package contains no bundled libraries without FPC exception.
[X]: Changelog in prescribed format.
[X]: Sources contain only permissible code or content.
[!]: Each %files section contains %defattr if rpm < 4.4
     Note: %defattr present but not needed
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[X]: Package uses nothing in %doc for runtime.
[X]: Package consistently uses macros (instead of hard-coded directory
     names).
[X]: Package is named according to the Package Naming Guidelines.
[X]: Package does not generate any conflict.
[X]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[X]: Requires correct, justified where necessary.
[X]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[X]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 1 files.
[!]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

Python:
[X]: Python eggs must not download any dependencies during the build
     process.
[X]: A package which is used by another package via an egg interface should
     provide egg info.
[!]: Package meets the Packaging Guidelines::Python
[x]: Binary eggs must be removed in %prep

===== SHOULD items =====

Generic:
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[X]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
[!]: Latest version is packaged.
[-]: Package does not include license text files separate from upstream.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[X]: Package should compile and build into binary rpms on all supported
     architectures.
[!]: %check is present and all tests pass.
[?]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: aexpect-1.2.0-1.fc26.noarch.rpm
          aexpect-1.2.0-1.fc26.src.rpm
aexpect.noarch: W: name-repeated-in-summary C Aexpect
aexpect.noarch: W: spelling-error %description -l en_US pexpect -> expect, p expect
aexpect.noarch: W: spelling-error %description -l en_US scp -> cps, sci, sip
aexpect.noarch: W: spelling-error %description -l en_US sftp -> ftp, ftps, s ftp
aexpect.noarch: W: no-manual-page-for-binary aexpect-helper
aexpect.src: W: name-repeated-in-summary C Aexpect
aexpect.src: W: spelling-error %description -l en_US pexpect -> expect, p expect
aexpect.src: W: spelling-error %description -l en_US scp -> cps, sci, sip
aexpect.src: W: spelling-error %description -l en_US sftp -> ftp, ftps, s ftp
2 packages and 0 specfiles checked; 0 errors, 9 warnings.




Rpmlint (installed packages)
----------------------------
aexpect.noarch: W: name-repeated-in-summary C Aexpect
aexpect.noarch: W: spelling-error %description -l en_US pexpect -> expect, p expect
aexpect.noarch: W: spelling-error %description -l en_US scp -> cps, sci, sip
aexpect.noarch: W: spelling-error %description -l en_US sftp -> ftp, ftps, s ftp
aexpect.noarch: W: no-manual-page-for-binary aexpect-helper
1 packages and 0 specfiles checked; 0 errors, 5 warnings.



Requires
--------
aexpect (rpmlib, GLIBC filtered):
    /usr/bin/python
    python
    python(abi)



Provides
--------
aexpect:
    aexpect
    python2.7dist(aexpect)
    python2dist(aexpect)



Source checksums
----------------
https://github.com/autotest/aexpect/archive/89b715b19918dba923e48d1c42b813c5f54d2c5a.tar.gz#/aexpect-89b715b.tar.gz :
  CHECKSUM(SHA256) this package     : 3d2e8da0496c7f130c6022ba70c12eaf0e0acedd4fd94b9ed6216cf6e59b4ab2
  CHECKSUM(SHA256) upstream package : 3d2e8da0496c7f130c6022ba70c12eaf0e0acedd4fd94b9ed6216cf6e59b4ab2


Generated by fedora-review 0.6.1 (f03e4e7) last change: 2016-05-02
Command line :/usr/bin/fedora-review -b 1393129 -m fedora-rawhide-x86_64
Buildroot used: fedora-rawhide-x86_64
Active plugins: Python, Generic, Shell-api
Disabled plugins: Java, C/C++, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP
Disabled flags: EXARCH, DISTTAG, EPEL5, BATCH, EPEL6

Comment 2 Merlin Mathesius 2016-11-09 23:17:10 UTC
Thank you for the detailed and helpful review comments.

The selected commit and version (1.2.0) were unofficial in upstream. However, an official tag for that commit was added just today (https://github.com/autotest/aexpect/issues/14).

I believe I addressed all of your other issues. I also attempted to include support for both Python 2 and Python 3. The tagged version 1.2.0 of aexpect does not support Python 3--although the current HEAD does. The upstream maintainers have suggested a version 1.3.0 will be coming soon. Thus, in the interim, I updated the package version to 1.2.1, set the source to use the current HEAD commit, and included a patch to update the version string embedded in setup.py.

New Spec URL: https://merlinm.fedorapeople.org/aexpect-1.2.1.spec
New SRPM URL: https://merlinm.fedorapeople.org/aexpect-1.2.1-1.fc24.src.rpm
New Koji scratch build URL: http://koji.fedoraproject.org/koji/taskinfo?taskID=16378886

Comment 3 Stephen Gallagher 2016-11-10 01:38:36 UTC
(In reply to Merlin Mathesius from comment #2)
> Thank you for the detailed and helpful review comments.
> 
> The selected commit and version (1.2.0) were unofficial in upstream.
> However, an official tag for that commit was added just today
> (https://github.com/autotest/aexpect/issues/14).
> 
> I believe I addressed all of your other issues. I also attempted to include
> support for both Python 2 and Python 3. The tagged version 1.2.0 of aexpect
> does not support Python 3--although the current HEAD does. The upstream
> maintainers have suggested a version 1.3.0 will be coming soon. Thus, in the
> interim, I updated the package version to 1.2.1, set the source to use the
> current HEAD commit, and included a patch to update the version string
> embedded in setup.py.

You can't do this. It's not safe to name something 1.2.1 because upstream could eventually opt to release a 1.2.1 that is entirely different from what you called 1.2.1. Then users of this package will be confused. Please drop the version hack.

If you want to release with the python 3 support, you need to follow the naming guidelines at https://fedoraproject.org/wiki/Packaging:Versioning#Snapshot_packages

The result will end up looking like:

aexpect-1.2.0-1.20161109git%{shortcommit0}.fc26


> 
> New Spec URL: https://merlinm.fedorapeople.org/aexpect-1.2.1.spec
> New SRPM URL: https://merlinm.fedorapeople.org/aexpect-1.2.1-1.fc24.src.rpm
> New Koji scratch build URL:
> http://koji.fedoraproject.org/koji/taskinfo?taskID=16378886


OK, a few more comments:
1) I should have thought of this earlier, but aexpect-helper is probably important to operation. So we should ship a version of it in the python3 subpackage, renamed to python3-aexpect-helper (at least until the support becomes stable). It probably wouldn't be a bad idea to rename the python2 version to python2-aexpect-helper and carry a symlink for the /usr/bin/aexpect-helper name. This would be future-compatible whenever we decided to swap over to python 3 as the preferred version.

If this is getting too complicated, feel free to skip Python 3 support entirely for the first pass here. It can be a quagmire.

2) The master name of the package should be python-aexpect, not just aexpect. The subpackages it produces are correct.

3) The order you run the %py2_install and %py3_install macros matters. Because both builds provide /usr/bin/aexpect-helper, whichever one builds second will overwrite the one that builds first. In this case, that means that you are actually installing the Python 3 version of the binary into the python2-aexpect subpackage. Oops! (If you follow my symlink suggestion in 1), you'll want to do the rename between the %py2_install and %py3_install calls and create the symlink last.)

Comment 4 Merlin Mathesius 2016-11-10 20:13:09 UTC
Thank you for the additional helpful review comments.

I missed the snapshot versioning guidelines. I have now corrected that, along with addressing all of your other comments. I have kept Python 3 support, but am only including the Python 2 version of /usr/bin/aexpect-helper with no renamed versions or symlinks to it--I'll address that when Python 3 support is no longer considered experimental.

Regarding the order of running the %py2_install and %py3_install macros, I found that the second one run does *not* overwrite the first /usr/bin/aexpect-helper. Just to avoid the unexpected, I changed the spec to run %py3_install first, remove aexpect-helper, then run  %py2_install so only the Python 2 version remains to be go into the python2-aexpect subpackage.

New Spec URL: https://merlinm.fedorapeople.org/python-aexpect.spec
New SRPM URL: https://merlinm.fedorapeople.org/python-aexpect-1.2.0-2.20161010gitaca459d.fc24.src.rpm
New Koji scratch build URL: http://koji.fedoraproject.org/koji/taskinfo?taskID=16388717

Comment 5 Stephen Gallagher 2016-11-10 20:39:04 UTC
Looks good to me now. Approved.

Comment 6 Stephen Gallagher 2016-11-10 20:39:05 UTC
Looks good to me now. Approved.

Comment 7 Jason Tibbitts 2016-11-10 21:45:01 UTC
Package request has been approved: https://admin.fedoraproject.org/pkgdb/package/rpms/python-aexpect

Comment 8 Fedora Update System 2016-11-23 13:44:02 UTC
python-aexpect-1.2.0-3.20161110gitaca459d.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c7b80aa595

Comment 9 Fedora Update System 2016-11-23 13:49:21 UTC
python-aexpect-1.2.0-3.20161110gitaca459d.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-2054c2c43c

Comment 10 Fedora Update System 2016-11-25 09:39:02 UTC
python-aexpect-1.2.0-3.20161110gitaca459d.fc24, python-avocado-43.0-6.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-2054c2c43c

Comment 11 Fedora Update System 2016-11-25 09:41:58 UTC
python-aexpect-1.2.0-3.20161110gitaca459d.fc25, python-avocado-43.0-6.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c7b80aa595

Comment 12 Fedora Update System 2016-12-05 21:41:15 UTC
python-aexpect-1.2.0-3.20161110gitaca459d.fc25, python-avocado-43.0-6.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-12-06 10:25:12 UTC
python-aexpect-1.2.0-3.20161110gitaca459d.fc24, python-avocado-43.0-6.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.