Bug 2161095 - Review Request: python-ffmpeg-python - Python bindings for FFmpeg
Summary: Review Request: python-ffmpeg-python - Python bindings for FFmpeg
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Neal Gompa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2163518
TreeView+ depends on / blocked
 
Reported: 2023-01-15 19:24 UTC by Ondrej Mosnáček
Modified: 2023-01-28 13:55 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-01-28 13:55:47 UTC
Type: ---
Embargoed:
ngompa13: fedora-review+


Attachments (Terms of Use)

Description Ondrej Mosnáček 2023-01-15 19:24:12 UTC
Spec URL: https://omos.fedorapeople.org/shared_files/python-ffmpeg/python-ffmpeg.spec
SRPM URL: https://omos.fedorapeople.org/shared_files/python-ffmpeg/python-ffmpeg-0.2.0-1.fc38.src.rpm
Description: See https://github.com/kkroening/ffmpeg-python#readme
Fedora Account System Username: omos

I intend to package r128gain [1] in Fedora and this is the only missing dependency. The package just wraps the ffmpeg binary, so it can be used transparently with both ffmpeg-free and the RPMFusion's full ffmpeg.

NOTE: The project is actually named "ffmpeg-python" upstream and in PyPI, but I choose "python-ffmpeg" as the Fedora package name to align it with the Packaging Guidelines. There is another package called "python-ffmpeg" in PyPI, so this may create confusion, but I don't know how to better name the package.

[1] https://pypi.org/project/r128gain/

Comment 1 Neal Gompa 2023-01-15 21:32:54 UTC
Taking this review.

Comment 2 Neal Gompa 2023-01-15 21:37:28 UTC
Spec review notes:

> Source0:        %{url}/archive/refs/tags/%{version}.tar.gz

This should be "Source0: %{url}/archive/%{version}/%{projname}-%{version}.tar.gz"

Comment 3 Neal Gompa 2023-01-15 21:39:00 UTC
> NOTE: The project is actually named "ffmpeg-python" upstream and in PyPI, but I choose "python-ffmpeg" as the Fedora package name to align it with the Packaging Guidelines. There is another package called "python-ffmpeg" in PyPI, so this may create confusion, but I don't know how to better name the package.

I'd probably suggest just going with python-ffmpeg-python as the source package name, and use python3-ffmpeg-python as the binary package name. Yes, it's redundant, but it avoids the *known* conflict situation. We've had to do it before with other Python libraries, so it's not out of the question.

Comment 4 Ondrej Mosnáček 2023-01-16 07:58:35 UTC
(In reply to Neal Gompa from comment #2)
> > Source0:        %{url}/archive/refs/tags/%{version}.tar.gz
> 
> This should be "Source0:
> %{url}/archive/%{version}/%{projname}-%{version}.tar.gz"

Oh, somehow I thought this form wouldn't work when the project has just tags and no releases, but apparently it does :) Will use that URL, thanks.

(In reply to Neal Gompa from comment #3)
> I'd probably suggest just going with python-ffmpeg-python as the source
> package name, and use python3-ffmpeg-python as the binary package name. Yes,
> it's redundant, but it avoids the *known* conflict situation. We've had to
> do it before with other Python libraries, so it's not out of the question.

Ok, if there's already a precedence then it makes sense to go with python-ffmpeg-python. Will apply that suggestion, too.

Comment 6 Neal Gompa 2023-01-16 09:50:07 UTC
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.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "*No copyright* Apache License 2.0",
     "*No copyright* Apache License", "MIT License". 72 files have unknown
     license. Detailed output of licensecheck in
     /home/ngompa/2161095-python-ffmpeg-python/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.
[x]: 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.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 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).
[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.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[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]: 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:
[!]: Spec file according to URL is the same as in SRPM.
     Note: Spec file as given by url is not the same as in SRPM (see
     attached diff).
     See: (this test has no URL)
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).


Rpmlint
-------
Checking: python3-ffmpeg-python-0.2.0-1.fc38.noarch.rpm
          python-ffmpeg-python-0.2.0-1.fc38.src.rpm
========================================================================================== 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
rpmlintrc: [PosixPath('/tmp/tmpc0i1gu_r')]
checks: 31, packages: 2

python-ffmpeg-python.src: W: strange-permission python-ffmpeg-python.spec 600
python-ffmpeg-python.src: E: description-line-too-long There are tons of Python FFmpeg wrappers out there but they seem to lack complex filter support. ffmpeg-python works well for simple as well as complex signal graphs.
python3-ffmpeg-python.noarch: E: description-line-too-long There are tons of Python FFmpeg wrappers out there but they seem to lack complex filter support. ffmpeg-python works well for simple as well as complex signal graphs.
=========================================================== 2 packages and 0 specfiles checked; 2 errors, 1 warnings, 2 badness; has taken 1.1 s ===========================================================




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-ffmpeg-python.noarch: E: description-line-too-long There are tons of Python FFmpeg wrappers out there but they seem to lack complex filter support. ffmpeg-python works well for simple as well as complex signal graphs.
 1 packages and 0 specfiles checked; 1 errors, 0 warnings, 1 badness; has taken 0.0 s 



Source checksums
----------------
https://github.com/kkroening/ffmpeg-python/archive/0.2.0/ffmpeg-python-0.2.0.tar.gz :
  CHECKSUM(SHA256) this package     : 01b6b7640f00585a404194a358358bdf7f4050cedcd99f41416ac8b27222c9f1
  CHECKSUM(SHA256) upstream package : 01b6b7640f00585a404194a358358bdf7f4050cedcd99f41416ac8b27222c9f1


Requires
--------
python3-ffmpeg-python (rpmlib, GLIBC filtered):
    /usr/bin/ffmpeg
    python(abi)
    python3.11dist(future)



Provides
--------
python3-ffmpeg-python:
    python-ffmpeg-python
    python3-ffmpeg-python
    python3.11-ffmpeg-python
    python3.11dist(ffmpeg-python)
    python3dist(ffmpeg-python)



Diff spec file in url and in SRPM
---------------------------------
--- /home/ngompa/2161095-python-ffmpeg-python/srpm/python-ffmpeg-python.spec	2023-01-16 04:30:04.511595590 -0500
+++ /home/ngompa/2161095-python-ffmpeg-python/srpm-unpacked/python-ffmpeg-python.spec	2023-01-16 03:09:54.000000000 -0500
@@ -1,2 +1,12 @@
+## START: Set by rpmautospec
+## (rpmautospec version 0.3.1)
+## RPMAUTOSPEC: autorelease, autochangelog
+%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
+    release_number = 1;
+    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
+    print(release_number + base_release_number - 1);
+}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
+## END: Set by rpmautospec
+
 %global modname ffmpeg
 %global projname %{modname}-python
@@ -62,3 +72,4 @@
 
 %changelog
-%autochangelog
+* Sun Jan 15 2023 Ondrej Mosnáček <omosnacek> - 0.2.0-1
+- Initial version


Generated by fedora-review 0.9.0 (6761b6c) last change: 2022-08-23
Command line :/usr/bin/fedora-review -b 2161095 -m fedora-rawhide-x86_64
Buildroot used: fedora-rawhide-x86_64
Active plugins: Python, Generic, Shell-api
Disabled plugins: R, PHP, fonts, C/C++, SugarActivity, Java, Ocaml, Haskell, Perl
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 7 Jakub Kadlčík 2023-01-16 15:26:52 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5238027
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2161095-python-ffmpeg/srpm-builds/05238027/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

Comment 8 Jakub Kadlčík 2023-01-16 15:30:28 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5238041
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2161095-python-ffmpeg-python/srpm-builds/05238041/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

Comment 9 Ondrej Mosnáček 2023-01-21 09:17:35 UTC
(In reply to Neal Gompa from comment #6)
> Generic:
> [!]: Spec file according to URL is the same as in SRPM.
>      Note: Spec file as given by url is not the same as in SRPM (see
>      attached diff).
>      See: (this test has no URL)

This is just due to rpmautospec being used.

> python-ffmpeg-python.src: E: description-line-too-long There are tons of
> Python FFmpeg wrappers out there but they seem to lack complex filter
> support. ffmpeg-python works well for simple as well as complex signal
> graphs.
> python3-ffmpeg-python.noarch: E: description-line-too-long There are tons of
> Python FFmpeg wrappers out there but they seem to lack complex filter
> support. ffmpeg-python works well for simple as well as complex signal
> graphs.

Not sure what to do about this... [1] recommends to use a macro to avoid duplicating the description, but it seems that discards the newlines from it [2]. Should I just duplicate the description? Use %include? Ignore the error?

[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_example_spec_file
[2] https://stackoverflow.com/questions/4339417/is-there-any-syntax-or-trick-to-be-able-to-create-a-multiline-rpm-spec-file-macr

Comment 10 Neal Gompa 2023-01-21 12:38:32 UTC
(In reply to Ondrej Mosnáček from comment #9)
> (In reply to Neal Gompa from comment #6)
> > Generic:
> > [!]: Spec file according to URL is the same as in SRPM.
> >      Note: Spec file as given by url is not the same as in SRPM (see
> >      attached diff).
> >      See: (this test has no URL)
> 
> This is just due to rpmautospec being used.
> 
> > python-ffmpeg-python.src: E: description-line-too-long There are tons of
> > Python FFmpeg wrappers out there but they seem to lack complex filter
> > support. ffmpeg-python works well for simple as well as complex signal
> > graphs.
> > python3-ffmpeg-python.noarch: E: description-line-too-long There are tons of
> > Python FFmpeg wrappers out there but they seem to lack complex filter
> > support. ffmpeg-python works well for simple as well as complex signal
> > graphs.
> 
> Not sure what to do about this... [1] recommends to use a macro to avoid
> duplicating the description, but it seems that discards the newlines from it
> [2]. Should I just duplicate the description? Use %include? Ignore the error?
> 
> [1]
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/
> #_example_spec_file
> [2]
> https://stackoverflow.com/questions/4339417/is-there-any-syntax-or-trick-to-
> be-able-to-create-a-multiline-rpm-spec-file-macr

You need to do your own word wrapping. You didn't wrap the description text. The Python example does this.

Comment 11 Ondrej Mosnáček 2023-01-21 13:12:05 UTC
(In reply to Neal Gompa from comment #10)
> You need to do your own word wrapping. You didn't wrap the description text.
> The Python example does this.

*facepalm* You're right. My editor displays the lines wrapped by default and doesn't make it obvious what is actually the same line... So I believed the description was wrapped when it really wasn't. Sorry about that.

v3:
Spec URL: https://gitlab.com/omos/fedora-package-review/-/raw/a75224eb6b3a3f97dc80a797cb1ff184f1d29e72/python-ffmpeg-python/python-ffmpeg-python.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/omos/r128gain/srpm-builds/05281098/python-ffmpeg-python-0.2.0-1.fc38.src.rpm

Copr build: https://copr.fedorainfracloud.org/coprs/omos/r128gain/build/5281098/

Comment 13 Ondrej Mosnáček 2023-01-28 11:26:51 UTC
@ngompa13 Gentle ping?

Comment 14 Neal Gompa 2023-01-28 11:48:40 UTC
Review notes:

* Package follows general packaging guidelines
* Package follows Python packaging guidelines
* Package builds and installs
* No serious issues from rpmlint

Something to consider: maybe rework the upstream tests to use Free codecs like VP9 and Opus on WebM rather than H264 and AAC on MP4. That way you can turn them on later. :)

Comment 15 Fedora Admin user for bugzilla script actions 2023-01-28 12:38:27 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/python-ffmpeg-python

Comment 16 Ondrej Mosnáček 2023-01-28 13:27:34 UTC
(In reply to Neal Gompa from comment #14)
> Review notes:
> 
> * Package follows general packaging guidelines
> * Package follows Python packaging guidelines
> * Package builds and installs
> * No serious issues from rpmlint

Thanks for the review!

> Something to consider: maybe rework the upstream tests to use Free codecs
> like VP9 and Opus on WebM rather than H264 and AAC on MP4. That way you can
> turn them on later. :)

Yeah, I do tend to tinker with tests, so it's likely I will get to that eventually :)

Comment 17 Fedora Update System 2023-01-28 13:53:48 UTC
FEDORA-2023-771e7b785d has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-771e7b785d

Comment 18 Fedora Update System 2023-01-28 13:55:47 UTC
FEDORA-2023-771e7b785d has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


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