Bug 1425934

Summary: Review Request: python-mtg - Console-based access to the Gatherer Magic Card Database
Product: [Fedora] Fedora Reporter: Ben Rosser <rosser.bjr>
Component: Package ReviewAssignee: Athos Ribeiro <athoscribeiro>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: athoscribeiro, package-review
Target Milestone: ---Flags: athoscribeiro: 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: 2017-03-15 17:51:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Rosser 2017-02-22 19:40:16 UTC
Spec URL: https://tc01.fedorapeople.org/python/mtg/python-mtg.spec
SRPM URL: https://tc01.fedorapeople.org/python/mtg/python-mtg-1.6.1-1.fc25.src.rpm

Description:
Search for Magic cards from the command line. Limit your results by card name,
color, type, rules text, converted mana cost, power, toughness, or expansion
set. Rulings and flavor text also available. Clean interface and output.

Fedora Account System Username: tc01

This is (primarily) a CLI application, so I've made the python3 subpackage provide "mtg". (the upstream name). If this is not the right thing to do, I can remove the provide.

rpmlint is mostly clean:

python-mtg.src: W: spelling-error %description -l en_US mana -> mama, mans, man
python-mtg.src:50: W: unversioned-explicit-provides mtg
python2-mtg.noarch: W: spelling-error %description -l en_US mana -> mama, mans, man
python2-mtg.noarch: W: no-manual-page-for-binary mtg-2
python2-mtg.noarch: W: no-manual-page-for-binary mtg-2.7
python3-mtg.noarch: W: spelling-error %description -l en_US mana -> mama, mans, man
python3-mtg.noarch: W: no-manual-page-for-binary mtg
python3-mtg.noarch: W: no-manual-page-for-binary mtg-3
python3-mtg.noarch: W: no-manual-page-for-binary mtg-3.5

I've pulled the source from github rather than PyPI, as the github tarball includes the unit tests, README and LICENSE files, which are all absent from the PyPI tarball.

Comment 1 Athos Ribeiro 2017-02-23 19:34:29 UTC
Hi Ben, I am taking this review!

I don't think we need a python 2 binary nor have them versioned as mtg-X-Y. See [1] for reference.

There are no egg.info directories in the package, so there's no need to remove one in %prep

About adding the Provides: mtg, we can see in [2] that this is up to you :)

Finally, do you have any comments on the content in 'tests/_data'?
It seems that upstream copied some pages from Wizards of the Coast with some real Magic: The Gathering card descriptions. I am not sure if we can ship that, even if it is in a source package.

I would be comfortable with either
 - raising FE-LEGAL flag to make sure this content is allowed
 - removing the tests from the tarball :(
 - removing the _data subdir from the tests and skipping the tests that need it

[1] https://fedoraproject.org/wiki/Packaging:Python#Avoiding_collisions_between_the_python_2_and_python_3_stacks
[2] https://fedoraproject.org/wiki/User:Tibbs/AppVsLib

Comment 2 Ben Rosser 2017-02-26 20:01:54 UTC
Thanks for taking the review!

My bad; it did not even occur to me that we couldn't ship tests/_data. It seems that 43 of the 142 tests need that content [1] in order to run. All the failing tests are in card_extractor_test.py, but there are also some tests in there that succeed. 

As a short term solution, I could simply get rid of card_extractor_test.py; as a long term solution I could try to get upstream to split card_extractor_test into tests that do require data_ and tests that don't.

If that seems like a reasonable course of action, I'll remove data_ from the tarball, rebuild the SRPM, and get rid of card_extractor_test.py in %prep.

[1] https://paste.fedoraproject.org/paste/nvzygVUtxGq4p-MgEYqelF5M1UNdIGYhyRLivL9gydE=/

Comment 3 Athos Ribeiro 2017-02-26 20:05:30 UTC
> My bad; it did not even occur to me that we couldn't ship tests/_data.

As I said, I am not sure if we can or if we can not ship those.

> 
> As a short term solution, I could simply get rid of card_extractor_test.py;
> as a long term solution I could try to get upstream to split
> card_extractor_test into tests that do require data_ and tests that don't.
> 
> If that seems like a reasonable course of action, I'll remove data_ from the
> tarball, rebuild the SRPM, and get rid of card_extractor_test.py in %prep.

I would be ok with that! :)

Comment 4 Ben Rosser 2017-02-26 20:29:47 UTC
Okay; I've updated the spec and SRPM with those changes then. :)

Spec URL: https://tc01.fedorapeople.org/python/mtg/python-mtg.spec
SRPM URL: https://tc01.fedorapeople.org/python/mtg/python-mtg-1.6.2-1.fc25.src.rpm

- Remove mtg-2* binaries, as they should behave the same as the python3 versions.
- Get rid of the versioned mtg-3 binaries, as there's no potential collision with python2 binaries.
- Remove card_extractor_test.py, as those tests require tests/_data directory.
- Remove tests/_data directory from tarball, as Fedora probably can't ship it in a source package.

Comment 5 Athos Ribeiro 2017-02-26 23:38:56 UTC
Hello Ben,

Your last changelog entry has the wrong release version. Also, note that rpmlint complains about some macros in comments.

Package looks good. Approved!

Remember to fix the changelog before uploading this.

P.S.: the link for the second SRPM was broken :)

Package Review
==============

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

===== 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.
[x]: License file installed when any subpackage combination is installed.
[x]: Package must own all directories that it creates.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: 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.
[-]: 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.
[x]: 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 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.
[x]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[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).
[x]: Fully versioned dependency in subpackages if applicable.
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: SourceX tarball generation or download is documented.
     Note: Package contains tarball without URL, check comments
[x]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[?]: Package should compile and build into binary rpms on all supported
     architectures.
[!]: %check is present and all tests pass.
      NOTE: see bug comments for context
[x]: 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]: 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).


Rpmlint
-------
Checking: python2-mtg-1.6.1-2.fc26.noarch.rpm
          python3-mtg-1.6.1-2.fc26.noarch.rpm
          python-mtg-1.6.1-2.fc26.src.rpm
python2-mtg.noarch: W: spelling-error %description -l en_US mana -> mama, mans, man
python3-mtg.noarch: W: spelling-error %description -l en_US mana -> mama, mans, man
python3-mtg.noarch: W: no-manual-page-for-binary mtg
python-mtg.src: W: spelling-error %description -l en_US mana -> mama, mans, man
python-mtg.src:14: W: macro-in-comment %{pypi_name}
python-mtg.src:14: W: macro-in-comment %{version}
python-mtg.src:14: W: macro-in-comment %{pypi_name}
python-mtg.src:14: W: macro-in-comment %{version}
python-mtg.src:52: W: unversioned-explicit-provides mtg
python-mtg.src:80: W: macro-in-comment %{buildroot}
python-mtg.src:80: W: macro-in-comment %{_bindir}
python-mtg.src:80: W: macro-in-comment %{buildroot}
python-mtg.src:80: W: macro-in-comment %{_bindir}
python-mtg.src:81: W: macro-in-comment %{_bindir}
python-mtg.src:81: W: macro-in-comment %{buildroot}
python-mtg.src:81: W: macro-in-comment %{_bindir}
python-mtg.src:81: W: macro-in-comment %{python3_version}
python-mtg.src: W: invalid-url Source0: mtg-1.6.1.tar.gz
3 packages and 0 specfiles checked; 0 errors, 18 warnings.




Rpmlint (installed packages)
----------------------------
sh: /usr/bin/python: No such file or directory
python2-mtg.noarch: W: spelling-error %description -l en_US mana -> mama, mans, man
python3-mtg.noarch: W: spelling-error %description -l en_US mana -> mama, mans, man
python3-mtg.noarch: W: no-manual-page-for-binary mtg
2 packages and 0 specfiles checked; 0 errors, 3 warnings.



Requires
--------
python2-mtg (rpmlib, GLIBC filtered):
    python(abi)
    python-cssselect
    python-lxml

python3-mtg (rpmlib, GLIBC filtered):
    /usr/bin/python3
    python(abi)
    python3-cssselect
    python3-lxml



Provides
--------
python2-mtg:
    python-mtg
    python2-mtg
    python2.7dist(mtg)
    python2dist(mtg)

python3-mtg:
    mtg
    python3-mtg
    python3.6dist(mtg)
    python3dist(mtg)

Comment 6 Ben Rosser 2017-02-26 23:54:52 UTC
Thanks again for the review! I'll fix the changelog before importing.

Comment 7 Gwyn Ciesla 2017-02-27 13:54:42 UTC
Package request has been approved: https://admin.fedoraproject.org/pkgdb/package/rpms/python-mtg

Comment 8 Fedora Update System 2017-02-28 03:44:57 UTC
python-mtg-1.6.1-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6ed5dc7e2f

Comment 9 Fedora Update System 2017-02-28 03:48:25 UTC
python-mtg-1.6.1-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-63ef48add3

Comment 10 Fedora Update System 2017-03-01 02:51:34 UTC
python-mtg-1.6.1-2.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-2017-63ef48add3

Comment 11 Fedora Update System 2017-03-01 02:53:54 UTC
python-mtg-1.6.1-2.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-2017-6ed5dc7e2f

Comment 12 Fedora Update System 2017-03-15 17:51:57 UTC
python-mtg-1.6.1-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2017-03-23 18:21:07 UTC
python-mtg-1.6.1-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.