Bug 1685922 - Review Request: packit - A set of tools to integrate upstream open source projects into Fedora operating system
Summary: Review Request: packit - A set of tools to integrate upstream open source pro...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-06 10:15 UTC by Frantisek Lachman
Modified: 2020-06-03 07:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-03 07:04:56 UTC
Type: Bug
msuchy: fedora-review+


Attachments (Terms of Use)

Description Frantisek Lachman 2019-03-06 10:15:38 UTC
Spec URL: https://copr-be.cloud.fedoraproject.org/results/lachmanfrantisek/packit/fedora-rawhide-x86_64/00865041-packit/packit.spec
SRPM URL: https://copr-be.cloud.fedoraproject.org/results/lachmanfrantisek/packit/fedora-rawhide-x86_64/00865041-packit/packit-0.0.1-1.fc30.src.rpm

This project provides tooling and automation to integrate upstream open source
projects into Fedora operating system.

This package contains the python code,
check out packit package for the executable.


Fedora Account System Username: lachmanfrantisek

===========

The [builds in copr](https://copr.fedorainfracloud.org/coprs/lachmanfrantisek/packit/build/864898/) are failing, but with local mock, everything went well.

===========

I am part of the upstream. Here is the pull-request, that is adding the specfile :
https://github.com/packit-service/packit/pull/98

===========

This is my first package. Any advice would be appreciated.
Thank you!

Comment 1 Miroslav Suchý 2019-03-06 11:03:46 UTC
I will do the review.

Comment 2 Miroslav Suchý 2019-03-06 11:07:07 UTC
The Copr build is failing because of:

+ /usr/bin/gzip -dc /builddir/build/SOURCES/packitos-0.0.1.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd packitos-0.0.1
/var/tmp/rpm-tmp.f06WvJ: line 38: cd: packitos-0.0.1: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.f06WvJ (%prep)

That is because you have chosen in Copr to build SRPM for you from SCM. I guess that it will easy for you to start with uploading src.rpm to Copr.

Comment 3 Miroslav Suchý 2019-03-06 11:14:28 UTC
> %files -n %{real_name}

This should be simplified to 
  %files


> %license LICENSE

This should be in the main package too. See

https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/#subpackage-licensing

> Requires:       python3-%{real_name}

This is usually in the form of
  Requires:       python3-%{real_name} = %{version}-%{release}

But in case you are fine having a different version of the main package and different version of the library you do not need to put it there.

Comment 4 Miroslav Suchý 2019-03-06 11:18:04 UTC
You are missing a man page, but I see
  https://github.com/packit-service/packit/issues/85
so if you fix this in near future I am not going to block review on this.

Comment 6 Frantisek Lachman 2019-03-06 12:04:00 UTC
> > %files -n %{real_name}
> > %license LICENSE

I forgot to commit those changes. I'll upload the new files.

> python3-%{real_name} = %{version}-%{release}

This is definitely what we want. Thanks for the tip.

> You are missing a man page, but I see
>   https://github.com/packit-service/packit/issues/85
> so if you fix this in near future I am not going to block review on this.

Yes, we are going to fix that soon.

Comment 8 Miroslav Suchý 2019-03-08 12:44:52 UTC
echo A set of tools to integrate upstream open source projects into Fedora operating system |wc -c
87
The summary should be less than 80 characters: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_summary_and_description

Summary:        %{summary}
This is ... ehm lazy? :)
I guess something like:
  Python libraries for Packit
will work

packit.noarch: W: incoherent-version-in-changelog 0.1.0-1 ['0.0.1-1.fc29', '0.0.1-1']
The Y and Z from X.Y.Z-R does not match.

python3-packit.noarch: E: non-executable-script /usr/lib/python3.7/site-packages/packit/cli/watch_sg_pr.py 644 /usr/bin/python3 
python3-packit.noarch: E: non-executable-script /usr/lib/python3.7/site-packages/packit/cli/watch_upstream_release.py 644 /usr/bin/python3 
If the script has shebang, then it should be executable script by setting executable bit (and either be in /usr/bin/ or /usr/libexec) or when it does not have executable bit then it should not have shebang.

Comment 9 Frantisek Lachman 2019-03-08 13:10:02 UTC
Thank you for the feedback.

> python3-packit.noarch: E: non-executable-script /usr/lib/python3.7/site-packages/packit/cli/watch_sg_pr.py 644 /usr/bin/python3 
> python3-packit.noarch: E: non-executable-script /usr/lib/python3.7/site-packages/packit/cli/watch_upstream_release.py 644 /usr/bin/python3 
> If the script has shebang, then it should be executable script by setting executable bit (and either be in /usr/bin/ or /usr/libexec) or when it does not have executable bit then > it should not have shebang.

Upstream issue created: https://github.com/packit-service/packit/issues/132

I've resolved other issues about summary/description and will send new links soon.

Comment 11 Frantisek Lachman 2019-03-08 13:50:24 UTC
> Upstream issue created: https://github.com/packit-service/packit/issues/132

Fixed on master: https://github.com/packit-service/packit/pull/134

Comment 12 Miroslav Suchý 2019-03-12 16:12:53 UTC
Package Review
==============

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



===== 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.
[x]: License file installed when any subpackage combination is installed.
[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.
[-]: 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.
[-]: A package which is used by another package via an egg interface should
     provide egg info.
[!]: 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).
[-]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     python3-packit
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[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.
[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:
[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.


So only remaining issue is that /usr/lib/python3.7/site-packages/__pycache__/* is missing in %files section.

Comment 13 Frantisek Lachman 2019-03-13 09:20:02 UTC
Thank you for the review.


> So only remaining issue is that /usr/lib/python3.7/site-packages/__pycache__/* is missing in %files section.

OK, I've probably misunderstood the following part of the [Python Packaging Guideline](https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_byte_compiling):

> You MUST NOT include the directories %{python3_sitearch}/__pycache__ or %{python3_sitelib}/__pycache__ because they are already owned by the python3-libs package.

So, the directory itself must not be in %files section, but the %{python3_sitelib}/__pycache__/* has to be there. I'll send new files soon.

Comment 14 Frantisek Lachman 2019-03-13 09:42:02 UTC
> So, the directory itself must not be in %files section, but the %{python3_sitelib}/__pycache__/* has to be there. I'll send new files soon.

It gives me an error:
File not found: /builddir/build/BUILDROOT/packit-0.0.1-1.fc31.x86_64/usr/lib/python3.7/site-packages/__pycache__/*

> Python Packaging Guideline:
>
> All that you need to do is include the files in the %files section (replacing %{python3_sitelib} with the appropriate macro for your package):
> 
> %files
> %{python3_sitelib}/foo/
>
> or, if the python code installs directly into %{python3_sitelib}:
> 
> %files
> %{python3_sitelib}/foo.py
> %{python3_sitelib}/__pycache__/*

We have the first case, so this should be ok:

> 53 %{python3_sitelib}/%{real_name}

Am I right?

Comment 15 Miroslav Suchý 2019-03-13 10:17:27 UTC
> So, the directory itself must not be in %files section, but the %{python3_sitelib}/__pycache__/* has to be there.

Right. The directory itself should not be there, but the content of the directory must be there.

The easiest way is to have
%files
%{python3_sitelib}/*

which include both *py and pycache.

Comment 17 Miroslav Suchý 2019-03-13 13:25:09 UTC
APPROVED

Comment 18 Gwyn Ciesla 2019-03-13 14:04:20 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/packit

Comment 19 Miroslav Suchý 2020-06-02 21:08:48 UTC
Ping, any progress on this?

I see the bodhi-update filed. You can close this BZ then.

Comment 20 Frantisek Lachman 2020-06-03 07:04:56 UTC
(In reply to Miroslav Suchý from comment #19)
> Ping, any progress on this?
> 
> I see the bodhi-update filed. You can close this BZ then.

Sorry. Closing.


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