Bug 2150506 - Review Request: python-pypresence - Discord Rich Presence Client in Python
Summary: Review Request: python-pypresence - Discord Rich Presence Client in Python
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2116001
TreeView+ depends on / blocked
 
Reported: 2022-12-03 14:55 UTC by Steve Cossette
Modified: 2022-12-12 20:05 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-12 20:05:23 UTC
Type: ---
Embargoed:
mhroncok: fedora-review+


Attachments (Terms of Use)

Description Steve Cossette 2022-12-03 14:55:00 UTC
SPEC: https://api.nicehomeservices.com/images/temp/python-pypresence.spec
SRPM: https://api.nicehomeservices.com/images/temp/python-pypresence-4.2.1-1.fc37.src.rpm
Description: Pypresence is a Discord Rich Presence Client written in python. The package uses publically available Discord APIs to communicate changes to a user's "Rich presence" over the internet.
Fedora Account System Username: farchord

Comment 1 Steve Cossette 2022-12-03 15:21:59 UTC
If it matters, the reason for building this python library is from a need for it from a new version of lutris (0.5.12), link to the release bug: https://bugzilla.redhat.com/show_bug.cgi?id=2116001

Comment 2 Miro Hrončok 2022-12-05 18:17:30 UTC
Could you please use links for the spec and the SRPM that allow direct download by automation? Thanks.

Spec sanity:


> %global debug_package %{nil}

This usually indicates the package should be noarch (BuildArch: noarch) instead. Since this is a pure python package, this is also the case here.


> License:        BSD-3

This is not a valid SPDX license identifier. Did you mean BSD-3-Clause? https://docs.fedoraproject.org/en-US/legal/allowed-licenses/


> #%package -n python3-pypresence

This should remain here, the main package (SRPM) should be named python-pypresence and there should be a subpackage named python3-pypresence.


> %{?python_provide:%python_provide python3-pypresence}

This is deprecated and not needed. Please remove it.

Comment 3 Steve Cossette 2022-12-05 18:59:32 UTC
Thank you for your help!

(In reply to Miro Hrončok from comment #2)
> Could you please use links for the spec and the SRPM that allow direct
> download by automation? Thanks.

Done:
SPEC: https://api.nicehomeservices.com/images/temp/python-pypresence.spec
SRPM: https://api.nicehomeservices.com/images/temp/python-pypresence-4.2.1-1.fc37.src.rpm

> 
> Spec sanity:
> 
> 
> > %global debug_package %{nil}
> 
> This usually indicates the package should be noarch (BuildArch: noarch)
> instead. Since this is a pure python package, this is also the case here.

Done.

> 
> > License:        BSD-3
> 
> This is not a valid SPDX license identifier. Did you mean BSD-3-Clause?
> https://docs.fedoraproject.org/en-US/legal/allowed-licenses/

Done, I set it as BSD-3-Clause-LBNL as it matches with the license upstream: https://github.com/qwertyquerty/pypresence/blob/master/LICENSE
> 
> > #%package -n python3-pypresence
> 
> This should remain here, the main package (SRPM) should be named
> python-pypresence and there should be a subpackage named python3-pypresence.

Done, I uncommented it and fixed the spec to use it.

> 
> > %{?python_provide:%python_provide python3-pypresence}
> 
> This is deprecated and not needed. Please remove it.

Done.

Comment 4 Miro Hrončok 2022-12-05 19:44:05 UTC
The source URL returns 404:

$ spectool -g -R python-pypresence.spec 
Downloading: https://github.com/qwertyqwerty/pypresence/archive/refs/tags/4.2.1.tar.gz
Download failed:
404 Client Error: Not Found for url: https://github.com/qwertyqwerty/pypresence/archive/refs/tags/4.2.1.tar.gz
-   0.0 B Elapsed Time: 0:00:00  

Actually, the entire https://github.com/qwertyqwerty/pypresence returns 404. I belive it is supposed to be https://github.com/qwertyquerty/pypresence



BuildArch:	noarch

This mixes tabs and spaces in the spec file. Could you please stick to one?



There are no tests in %check. Could you please at least try to import the Python module to see if it is importable? https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#py3_check_import

Comment 5 Steve Cossette 2022-12-05 19:59:09 UTC
(In reply to Miro Hrončok from comment #4)
> The source URL returns 404:
> 
> $ spectool -g -R python-pypresence.spec 
> Downloading:
> https://github.com/qwertyqwerty/pypresence/archive/refs/tags/4.2.1.tar.gz
> Download failed:
> 404 Client Error: Not Found for url:
> https://github.com/qwertyqwerty/pypresence/archive/refs/tags/4.2.1.tar.gz
> -   0.0 B Elapsed Time: 0:00:00  
> 
> Actually, the entire https://github.com/qwertyqwerty/pypresence returns 404.
> I belive it is supposed to be https://github.com/qwertyquerty/pypresence

Right, that was a typo, which I fixed now:

❯ spectool -g -R python-pypresence.spec
Downloading: https://github.com/qwertyquerty/pypresence/archive/refs/tags/4.2.1.tar.gz
| 367.1 KiB Elapsed Time: 0:00:00                                                                                  
Downloaded: 4.2.1.tar.gz


> 
> 
> 
> BuildArch:	noarch
> 
> This mixes tabs and spaces in the spec file. Could you please stick to one?
Done. Replaced the tabs by spaces.
> 
> 
> There are no tests in %check. Could you please at least try to import the
> Python module to see if it is importable?
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/
> #py3_check_import

Done. mockbuild did the test and it worked.

Thanks again for your help!

Comment 6 Miro Hrončok 2022-12-05 20:23:12 UTC
It is customary to place %check between %insatll and %files. The usage of #------------------------------------------------------------------------------ is now also inconsistent (I suggest placing 2 empty lines between spec section instead of lines like this.)

I'll run automated Fedora-Review tool now.

Comment 7 Miro Hrončok 2022-12-05 20:35:00 UTC
There is some licensing mishmash here:

*No copyright* MIT License
--------------------------
pypresence-4.2.1/setup.py

BSD 3-Clause License
--------------------
pypresence-4.2.1/LICENSE

MIT License
-----------
pypresence-4.2.1/docs/html/_static/jquery-3.2.1.js
pypresence-4.2.1/docs/html/_static/jquery-3.5.1.js
pypresence-4.2.1/docs/html/_static/underscore-1.3.1.js
pypresence-4.2.1/docs/html/_static/underscore.js



I suggest deleting pypresence-4.2.1/docs in %prep not do deal with bundled jquery.

But setup.py clearly states this project is licensed under the MIT license, while LICENSE says BSD 3-Clause License.

There is this commit: https://github.com/qwertyquerty/pypresence/commit/decf5e88642661b2ae5c7f0cafa1b3393a7bc7de -- may you please ask upstream to also update the metadata in setup.py (license key and license classifier)? Otherwise, I am not sure we really know what the license is.

Comment 8 Steve Cossette 2022-12-05 21:07:01 UTC
I added the removal of the 'docs' folder in the spec file (Also added a comment just so I remember in the future to maybe check to see if this is fixed), hopefully that's okay.

I also posted upstream about the license issue, waiting to hear back, but someone already made a post about it: https://github.com/qwertyquerty/pypresence/issues/185

Will this issue hold the package from being brought live?

Comment 9 Steve Cossette 2022-12-05 22:18:11 UTC
Oh also just re-updated to change the order of %install, %check and %files. Sorry I didn't catch that comment of yours, and I changed the sections to be separated by 2 empty lines as suggested.

Comment 10 Miro Hrončok 2022-12-06 08:52:50 UTC
It seems that upstream considers this MIT. Let's give them a couple of days so they can revert the LICENSE change. Or is this review time sensitive?

----------

Tip:

Use this source:

Source:         https://github.com/qwertyquerty/pypresence/archive/%{version}/pypresence-%{version}.tar.gz

When downloaded, the filename is called pypresence-4.2.1.tar.gz which is consistent with what is in the tarball and easier to find when the sources directory is shared between multiple packages.

Also, the example removes a needless enumeration of the source.

------------


A partial output of Fedora-Review:



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

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



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

Generic:
[ ]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[ ]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "BSD 3-Clause License", "*No copyright*
     MIT License", "MIT License". 85 files have unknown license. Detailed
     output of licensecheck in
     /home/churchyard/rpmbuild/FedoraReview/2150506-python-
     pypresence/licensecheck.txt
[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.
[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.
[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 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.
[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]: 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).
[?]: Package functions as described.
[?]: 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.
[?]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %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
-------
============================ rpmlint session starts ============================
rpmlint: 2.2.0
configuration:
    /usr/lib/python3.10/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/licenses.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 32, packages: 3

python3-pypresence.noarch: W: files-duplicate /usr/lib/python3.11/site-packages/pypresence-4.2.1-py3.11.egg-info/zip-safe /usr/lib/python3.11/site-packages/pypresence-4.2.1-py3.11.egg-info/dependency_links.txt
 2 packages and 1 specfiles checked; 0 errors, 1 warnings, 0 badness; has taken 0.5 s 

That's alright.

Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.11/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 1

python3-pypresence.noarch: W: files-duplicate /usr/lib/python3.11/site-packages/pypresence-4.2.1-py3.11.egg-info/zip-safe /usr/lib/python3.11/site-packages/pypresence-4.2.1-py3.11.egg-info/dependency_links.txt
 1 packages and 0 specfiles checked; 0 errors, 1 warnings, 0 badness; has taken 0.0 s 

That's alright.


Source checksums
----------------
https://github.com/qwertyquerty/pypresence/archive/refs/tags/4.2.1.tar.gz :
  CHECKSUM(SHA256) this package     : c18fb3bbe945274ecea57da52e80ea6d3f0349596b18f0815d193b9b878d7dda
  CHECKSUM(SHA256) upstream package : c18fb3bbe945274ecea57da52e80ea6d3f0349596b18f0815d193b9b878d7dda


BuildRequires
-------------
rpmlib filtered:
    python3-devel
    python3-setuptools


Requires
--------
python3-pypresence (rpmlib, GLIBC filtered):
    python(abi) = 3.11


Provides
--------
python3-pypresence:
    python-pypresence = 4.2.1-1.fc38
    python3-pypresence = 4.2.1-1.fc38
    python3.11-pypresence = 4.2.1-1.fc38
    python3.11dist(pypresence) = 4.2.1
    python3dist(pypresence) = 4.2.1

Comment 11 Steve Cossette 2022-12-06 10:22:03 UTC
No this isnt time sensitive. I'm heading to vacation tomorrow but i will have my laptop with me so if this gets approved by then i can make this package from the hotel room. Thanks!

Comment 12 Steve Cossette 2022-12-06 10:58:13 UTC
I went ahead and updated the spec to use the MIT license scheme (Even though the LICENSE file doesn't reflect this yet) and changed the source url path to what you suggested. I appreciate your help on this, thank you!

Comment 13 Steve Cossette 2022-12-09 11:38:34 UTC
The license has been changed upstream, but hasnt made it into a release yet. 

Can we go as-is? Not sure what the procedure is in this case.

Thanks again!

Comment 14 Miro Hrončok 2022-12-09 13:05:54 UTC
I'd apply the fix as a patch.


# Fix licensing issues, merge upstream
Patch:          https://github.com/qwertyquerty/pypresence/commit/b5dc7308a0.patch

...

%prep
%autosetup -p1 -n pypresence-%{version}
...

Comment 15 Steve Cossette 2022-12-09 20:08:37 UTC
Thank you Miro. I went ahead and did just that, and the package has built properly. I updated the spec and source rpm, and you should be able to perform the review now.

And again, thank you very much!

Comment 16 Miro Hrončok 2022-12-10 08:19:38 UTC
I noticed my own typo:

 merge upstream -> merged upstream

Please fix that before importing the package to dist-git.



This package is APPROVED.

Comment 17 Gwyn Ciesla 2022-12-12 14:36:35 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-pypresence


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