Bug 2009450 - Review Request: python-kanboard - Python API Client for Kanboard
Summary: Review Request: python-kanboard - Python API Client for Kanboard
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Hunor Csomortáni
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-30 16:53 UTC by netvor
Modified: 2022-01-18 18:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-01-18 18:04:26 UTC
Type: ---
Embargoed:
hcsomort: fedora-review+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Pagure releng/fedora-scm-requests issue 41082 0 None None None 2022-01-18 14:19:07 UTC

Description netvor 2021-09-30 16:53:20 UTC
Spec URL: https://netvor.info/projects/python-kanboard-in-fedora/python-kanboard.spec
SRPM URL: https://netvor.info/projects/python-kanboard-in-fedora/python-kanboard-1.1.2-0.fc34.src.rpm
Description: Client library for Kanboard API.  Builds also available in my COPR: https://copr.fedorainfracloud.org/coprs/netvor/kbrd/builds/
Fedora Account System Username: netvor

Comment 1 Alois Mahdal 2021-10-06 15:34:33 UTC
(In reply to netvor from comment #0)
> Spec URL:
> https://netvor.info/projects/python-kanboard-in-fedora/python-kanboard-1.1.2-

The 1.1.2 didn't ship %license due to upstream error which is now fixed.

Spec URL: https://netvor.info/projects/python-kanboard-in-fedora/python-kanboard.spec
SRPM URL: https://netvor.info/projects/python-kanboard-in-fedora/python-kanboard-1.1.3-0.fc34.src.rpm
Description: Client library for Kanboard API.  Builds also available in my COPR: https://copr.fedorainfracloud.org/coprs/netvor/kbrd/builds/
Fedora Account System Username: netvor

Comment 2 Alois Mahdal 2022-01-13 11:34:24 UTC
I asked on fedora-devel, and it's been suggested for me to have a look at BuildRequires: pyproject-rpm-macros

>     │12:18:48  +csomh[m] | I can look at it tomorrow netvor, if that's okay for you.
>     │12:19:12  +csomh[m] | As a first note: the specfile might be missing a `BuildRequires: pyproject-rpm-macros` line.
>     │12:19:15     netvor | that would be more than okay, csomh[m], thanks :)
>     │12:19:34     netvor | nice, i will check it out and try to fix it before tomorrow

However, I think it might be outdated; this macro is not mentioned in the Fedora Python Packaging Guide.

There's already `BuildRequires: python3-devel`, and that seems to already imply this package:

    $ grep CPE /etc/os-release 
    CPE_NAME="cpe:/o:fedoraproject:fedora:35"
    $ rpm -qR python3-devel
    (pyproject-rpm-macros if rpm-build)
    (python-rpm-macros if rpm-build)
    (python3-rpm-generators if rpm-build)
    (python3-rpm-macros if rpm-build)
    /usr/bin/pkg-config
    /usr/bin/sh
    libpython3.10.so.1.0()(64bit)
    python3 = 3.10.1-2.fc35
    python3-libs(x86-64) = 3.10.1-2.fc35
    rpmlib(CompressedFileNames) <= 3.0.4-1
    rpmlib(FileDigests) <= 4.6.0-1
    rpmlib(PartialHardlinkSets) <= 4.0.4-1
    rpmlib(PayloadFilesHavePrefix) <= 4.0-1
    rpmlib(PayloadIsZstd) <= 5.4.18-1
    rpmlib(RichDependencies) <= 4.12.0-1
    $

Comment 3 Miro Hrončok 2022-01-13 12:01:16 UTC
(In reply to Alois Mahdal from comment #2)
> I asked on fedora-devel, and it's been suggested for me to have a look at
> BuildRequires: pyproject-rpm-macros
> 
> >     │12:18:48  +csomh[m] | I can look at it tomorrow netvor, if that's okay for you.
> >     │12:19:12  +csomh[m] | As a first note: the specfile might be missing a `BuildRequires: pyproject-rpm-macros` line.
> >     │12:19:15     netvor | that would be more than okay, csomh[m], thanks :)
> >     │12:19:34     netvor | nice, i will check it out and try to fix it before tomorrow
> 
> However, I think it might be outdated; this macro is not mentioned in the
> Fedora Python Packaging Guide.

That is correct. Consider the package to be an implementation detail (unless you build for plain RHEL 9 without EPEL). Just BR pytohn3-devel, as documented in the guidelines.

(It used to be needed to BR the macros package when the macros were unstable and not in the guidelines yet.)

Comment 4 Miro Hrončok 2022-01-13 12:03:57 UTC
Let me point out a more serious problem with the package:


https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_running_tests

"""If a test suite exists upstream, it SHOULD be run in the %check section. If that is not possible with reasonable effort, at least a basic smoke test (such as importing the packaged module) MUST be run in %check."""


The test suite is https://github.com/kanboard/python-api-client/blob/master/test_kanboard.py and if that is not possible to run with reasonable effort, at least add %pyproject_check_import to %check.

Comment 5 Hunor Csomortáni 2022-01-14 11:47:32 UTC
Package Review
==============

=== Summary ===

- Start with release 1.
- Add initial %changelog entry.
- Add %check section and run the tests.

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


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

Generic:
[!]: Release should be '1%{dist}', as a release number less than 1 means a
     pre-release version, but that is not the case.
     See: https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_prerelease_versions
[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: "MIT License", "Unknown or generated". 5 files have unknown
     license. Detailed output of licensecheck in
     /home/hcsomort/reviews/2009450-python-kanboard/licensecheck.txt
[x]: Package contains no bundled libraries without FPC exception.
[!]: Changelog in prescribed format.
     - Initial changelog entry is missing.
[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.
[x]: Package does not generate any conflict.
[-]: 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 2 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 runpon 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]: 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 must not depend on deprecated() packages.
[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.
[-]: 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]: Packages MUST NOT have dependencies (either build-time or runtime) on
     packages named with the unversioned python- prefix unless no properly
     versioned package exists. Dependencies on Python packages instead MUST
     use names beginning with python2- or python3- as appropriate.
[x]: Python packages must not contain %{pythonX_site(lib|arch)}/* in %files
[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]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[-]: 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.
     As Miro pointed out already, please run the tests in %check. There is no
     dependency fo running them, so it should be trivial.
[-]: 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
-------
Cannot parse rpmlint output:


Rpmlint (installed packages)
----------------------------
Cannot parse rpmlint output:

Comment 6 netvor 2022-01-14 18:52:42 UTC
Thanks for the review, Hunor & Miro.

(In reply to Hunor Csomortáni from comment #5)
> Package Review
> ==============
> 
> === Summary ===
> 
> - Start with release 1.
> - Add initial %changelog entry.
> - Add %check section and run the tests.
> 

All three issues are fixed now.

Comment 7 Hunor Csomortáni 2022-01-17 10:58:17 UTC
(In reply to netvor from comment #6)
> 
> All three issues are fixed now.

Please provide to new spec and SRPM urls :)

Comment 8 Miro Hrončok 2022-01-17 11:22:44 UTC
The original links seem to have updated content.

Comment 9 Hunor Csomortáni 2022-01-17 11:41:58 UTC
I've tried running another review with 'fedora-review', but failed getting the srpm:

    ERROR: 'Error HTTP Error 404: Not Found downloading https://netvor.info/projects/python-kanboard-in-fedora/python-kanboard-1.1.3-0.fc34.src.rpm' (logs in /home/hcsomort/.cache/fedora-review.log)

The spec-file was indeed updated.

Alois, would you mind removing the the 'pwd' and 'ls -al' lines from '%check' and use the '%{python3}' macro for the python executable?

Comment 10 Miro Hrončok 2022-01-17 12:19:09 UTC
Warning:

python3 setup.py test

This is deprecated. The entire spec file machinery with %pyproject RPM macros is abstracted away from the "setup.py" file. I am not entirely sure it even runs any tests, would need to check the build logs (but the linked copr is no more).

Comment 11 Miro Hrončok 2022-01-17 12:24:28 UTC
This warks:

%check
%{python3} -m unittest



I also strongly suggest using `%pyproject_buildrequires -r` (include runtime dependencies) -- when running tests in %check, you need all the runtime dependencies installed during the build -- that fact that it does not seem required is confusing, but consider it a lucky coincidence -- any future version of this package might add runtime dependencies that will be missed during %check.

Comment 12 Miro Hrončok 2022-01-17 12:24:54 UTC
s/warks/works/

Comment 13 Alois Mahdal 2022-01-17 20:27:34 UTC
Ahh, sorry about the mess...

New set of links is (fixed SRPM link and COPR link):

    Spec URL: https://netvor.info/projects/python-kanboard-in-fedora/python-kanboard.spec
    SRPM URL: https://netvor.info/projects/python-kanboard-in-fedora/python-kanboard-1.1.3-1.fc35.src.rpm
    Description: Client library for Kanboard API.  Builds also available in my COPR: https://copr.fedorainfracloud.org/coprs/netvor/scratch/builds/
    Fedora Account System Username: netvor

I've also fixed the SRPM:

 *  added -r to %pyproject_buildrequires
 *  used %{python3} -m unittest to implement `%check`
 *  removed the `pwd` and `ls` junk.

The latest build is: https://copr.fedorainfracloud.org/coprs/netvor/scratch/build/3192179/


BTW the reason i originally used `setup.py test` because that's exactly what upstream is using (in .github/workflows/ci.yml).  I understand that it's kinda "dirty" (rpmbuild log warned) but other options in the guide imply tox or pytest, which seems as overkill.

-m unittest does indeed work:

      [..]
      [..]
    + /usr/lib/rpm/brp-python-hardlink
    + /usr/lib/rpm/redhat/brp-mangle-shebangs
    Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.niDO5y
    + umask 022
    + cd /builddir/build/BUILD
    + cd python-api-client-1.1.3
    + /usr/bin/python3 -m unittest
    ........
    ----------------------------------------------------------------------
    Ran 8 tests in 0.007s

    OK
    + RPM_EC=0
    ++ jobs -p
      [..]
      [..]

Comment 14 netvor 2022-01-17 20:31:22 UTC
(...and I accidentally used my Red Hat account:  FTR: yes, "netvor" <n9042e84> ~= "Alois Mahdal" <amahdal>)

Comment 15 Hunor Csomortáni 2022-01-18 09:19:59 UTC
Thank you for all the improvements!

lgtm :)

Comment 16 Gwyn Ciesla 2022-01-18 15:55:02 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-kanboard

Comment 17 netvor 2022-01-18 18:04:26 UTC
Submitted to Rawhide (no plans for earlier);  first Koji build is successful:  https://koji.fedoraproject.org/koji/taskinfo?taskID=81415929

Also enabled anitya: https://release-monitoring.org/project/242073/

I will notify upstream once I see the package arrive in Rawhide.


---> CLOSED/RAWHIDE 🎉

Thanks again Miro & Hunor for help!

Comment 18 Miro Hrončok 2022-01-18 18:22:08 UTC
Consider also https://koschei.fedoraproject.org/package/python-kanboard


Note You need to log in before you can comment on or make changes to this bug.