Bug 1595420 - Review Request: ydiff - View colored, incremental diff
Summary: Review Request: ydiff - View colored, incremental diff
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: FE-NEEDSPONSOR
TreeView+ depends on / blocked
 
Reported: 2018-06-26 21:50 UTC by Alois Mahdal
Modified: 2018-09-08 09:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-08 09:47:08 UTC
Type: ---
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)

Description Alois Mahdal 2018-06-26 21:50:20 UTC
Spec URL: http://file.vornet.cz/tmp/fedora-submit-ydiff/s/ydiff.spec
SRPM URL: http://file.vornet.cz/tmp/fedora-submit-ydiff/s/ydiff-1.1-1.fc28.src.rpm
Description:
Term based tool to view colored, incremental diff in a Git/Mercurial/Svn
workspace or from stdin, with side by side (similar to diff -y) and auto
pager support.
Fedora Account System Username: netvor

Hi, this is my second package, first Python one, I'll appreciate your mentoring.

Here's Koji scratch build:
    https://koji.fedoraproject.org/koji/taskinfo?taskID=27887772

Comment 1 Robert-André Mauchin 🐧 2018-06-27 09:17:20 UTC
 - Should not be needed in %files

%{python2_sitelib}/%{name}.pyc
%{python2_sitelib}/%{name}.pyo

 - You should package it with Python 3 not Python 2. Python 2 will be phased out from Fedora near 2020:

 - You should include the Python provide macro:

BuildRequires: python3-devel

   And:

%package -n     python3-%{name}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{name}}

%description -n python3-%{name}
Python library that implements API used by ydiff tool.


    And:

%files -n python3-%{name}
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{name}.py
%{python3_sitelib}/%{name}-%{version}-py?.?.egg-info

Comment 2 Alois Mahdal 2018-06-27 15:39:54 UTC
(In reply to Robert-André Mauchin from comment #1)
>  - You should package it with Python 3 not Python 2. Python 2 will be phased
> out from Fedora near 2020:
> 
>  - You should include the Python provide macro:
> 
> BuildRequires: python3-devel
> 
>    And:
> 
> %package -n     python3-%{name}
> Summary:        %{summary}
> %{?python_provide:%python_provide python3-%{name}}
> 
> %description -n python3-%{name}
> Python library that implements API used by ydiff tool.
> 
> 
>     And:
> 
> %files -n python3-%{name}
> %{python3_sitelib}/__pycache__/*
> %{python3_sitelib}/%{name}.py
> %{python3_sitelib}/%{name}-%{version}-py?.?.egg-info

(I was under the impression that ydiff did not support Python3, looks
like I was wrong.)

I've added the py3 gear.  However, the guideline does not seem to match
perfectly on this layout where binary is packaged as own sub-package.
So I "stole" what was missing from fmf/fmf.spec (in particular, the
ydiff subpackage should require and use the python3-ydiff.


>  - Should not be needed in %files
> 
> %{python2_sitelib}/%{name}.pyc
> %{python2_sitelib}/%{name}.pyo

Anyway, I do get errors when I remove them.

    RPM build errors:
    error: Installed (but unpackaged) file(s) found:
       /usr/lib/python2.7/site-packages/ydiff.pyc
       /usr/lib/python2.7/site-packages/ydiff.pyo
        Installed (but unpackaged) file(s) found:
       /usr/lib/python2.7/site-packages/ydiff.pyc
       /usr/lib/python2.7/site-packages/ydiff.pyo

The guide actually says that the files should be included, although
it's not clear if that should be done explicity in %files or some RPM
automation does it.


I'll post new version in few minutes.

Comment 3 Alois Mahdal 2018-06-27 15:45:52 UTC
Spec URL: http://file.vornet.cz/tmp/fedora-submit-ydiff/r1/ydiff.spec
SRPM URL: http://file.vornet.cz/tmp/fedora-submit-ydiff/r1/ydiff-1.1-1.fc28.src.rpm
Description:
Term based tool to view colored, incremental diff in a Git/Mercurial/Svn
workspace or from stdin, with side by side (similar to diff -y) and auto
pager support.
Fedora Account System Username: netvor

Hi, this is my second package, first Python one, I'll appreciate your mentoring.

Here's Koji scratch build:
    https://koji.fedoraproject.org/koji/taskinfo?taskID=27898821

Comment 4 Robert-André Mauchin 🐧 2018-06-27 16:40:30 UTC
 - You misunderstand me: only package the Python 3 lib, Py2 is not needed. Or, in the case you want to support current EPEL, make a conditional with %bcond_without python3 to build Py3 for Fedora and Py2 for EPEL:

%if 0%{?rhel} >= 8 || 0%{?fedora} >= 19
%bcond_without python3
%else
%bcond_with python3
%endif

Name:       ydiff
Version:    1.1
Release:    1%{?dist}
Summary:    View colored, incremental diff
URL:        https://github.com/ymattw/ydiff
License:    BSD
Source0:    https://github.com/ymattw/ydiff/archive/%{version}/%{name}-%{version}.tar.gz

%if %{without python3}
BuildRequires: python2-devel
Requires: python%{python2_pkgversion}-%{name}
%else
BuildRequires: python3-devel
Requires: python%{python3_pkgversion}-%{name}
%endif
Requires: less
BuildArch: noarch

%description
Term based tool to view colored, incremental diff in a Git/Mercurial/Svn
workspace or from stdin, with side by side (similar to diff -y) and auto
pager support.

%if %{without python3}

%package -n python2-%{name}
%{?python_provide:%python_provide python2-%{name}}
Summary: %{summary}
%description -n python2-%{name}
Python library that implements API used by ydiff tool.

%else

%package -n     python3-%{name}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name}
Python library that implements API used by ydiff tool.

%endif

%prep
%autosetup -n %{name}-%{version}
/usr/bin/sed -i '/#!\/usr\/bin\/env python/d' ydiff.py

%build
%if %{without python3}
%py2_build
%else
%py3_build
%endif

%install
%if %{without python3}
%py2_install
%else
%py3_install
%endif

%files
%doc README.rst
%license LICENSE
%{_bindir}/ydiff

%if %{without python3}
%files -n python2-%{name}
%{python2_sitelib}/%{name}.py
%{python2_sitelib}/%{name}.pyc
%{python2_sitelib}/%{name}.pyo
%{python2_sitelib}/%{name}-*.egg-info
%else

%files -n python3-%{name}
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{name}.py
%{python3_sitelib}/%{name}-%{version}-py?.?.egg-info
%endif


If you don't need EPEL, just drop the Py 2 package.

Comment 5 Alois Mahdal 2018-06-27 17:43:47 UTC
You're right, I misunderstood.  I don't really need EPEL so I'll drop the py2 stuff.  Thanks!

Comment 6 Alois Mahdal 2018-06-27 17:44:33 UTC
Spec URL: http://file.vornet.cz/tmp/fedora-submit-ydiff/r4/ydiff.spec
SRPM URL: http://file.vornet.cz/tmp/fedora-submit-ydiff/r4/ydiff-1.1-1.fc28.src.rpm
Description:
Term based tool to view colored, incremental diff in a Git/Mercurial/Svn
workspace or from stdin, with side by side (similar to diff -y) and auto
pager support.
Fedora Account System Username: netvor

Hi, this is my second package, first Python one, I'll appreciate your mentoring.

Here's Koji scratch build:
    https://koji.fedoraproject.org/koji/taskinfo?taskID=27899890

Comment 7 Robert-André Mauchin 🐧 2018-06-27 18:14:42 UTC
Package approved.



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. Licenses
     found: "BSD (3 clause)", "Unknown or generated", "*No copyright* BSD
     (unspecified)". 97 files have unknown license. Detailed output of
     licensecheck in /home/bob/packaging/review/ydiff/review-
     ydiff/licensecheck.txt
[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.
[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]: 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 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.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     python3-ydiff
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: 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.
[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.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: ydiff-1.1-1.fc29.noarch.rpm
          python3-ydiff-1.1-1.fc29.noarch.rpm
          ydiff-1.1-1.fc29.src.rpm
ydiff.noarch: W: spelling-error %description -l en_US workspace -> work space, work-space, works pace
ydiff.noarch: W: spelling-error %description -l en_US stdin -> stein, stain, stdio
ydiff.noarch: W: no-manual-page-for-binary ydiff
python3-ydiff.noarch: W: no-documentation
ydiff.src: W: spelling-error %description -l en_US workspace -> work space, work-space, works pace
ydiff.src: W: spelling-error %description -l en_US stdin -> stein, stain, stdio
3 packages and 0 specfiles checked; 0 errors, 6 warnings.

Comment 8 Alois Mahdal 2018-06-28 18:23:54 UTC
> 20:20 <+mboddu> netvor: Okay, here's what we can do, can you comment on both of the tickets that with you RH account saying that you want to give them to "netvor", that way we can verify/confirm it is you

Hi, I'd like to transfer this to my other identity, ie. @netvor under FAS.

Comment 9 Mohan Boddu 2018-06-28 19:41:16 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/ydiff


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