Bug 1335965 - Review Request: py3c - Guide and compatibility macros for porting extensions to Python 3
Summary: Review Request: py3c - Guide and compatibility macros for porting extensions ...
Keywords:
Status: CLOSED ERRATA
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:
TreeView+ depends on / blocked
 
Reported: 2016-05-13 16:22 UTC by Petr Viktorin (pviktori)
Modified: 2016-06-24 01:56 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-06-23 17:54:17 UTC
Type: ---
Embargoed:
mhroncok: fedora-review+


Attachments (Terms of Use)

Description Petr Viktorin (pviktori) 2016-05-13 16:22:43 UTC
Spec URL: https://gist.githubusercontent.com/encukou/c42efc9ec2acabe113fd55d8eba8fbe7/raw/936101f2c1806422e5b066857e056c5be88103b0/py3c.spec
SRPM URL: https://copr-be.cloud.fedoraproject.org/results/pviktori/py3c/fedora-rawhide-x86_64/00227932-py3c/py3c-0.5-1.fc25.src.rpm
Scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=14046160

Description:

py3c helps you port C extensions to Python 3.

It provides a detailed guide, and a set of macros to make porting easy
and reduce boilerplate.

This is a header-only library (-devel), plus extensive documentation (-doc)

Fedora Account System Username: pviktori

Comment 1 Miro Hrončok 2016-05-18 12:47:15 UTC
First eyes only review of the spec:


> # A header-only library has no debuginfo
> %global debug_package %{nil}
Isn't header ony library noarch? That would also mean debuginfo will not be generated.

> License:        MIT and CC-BY-SA

Please describe in comment what parts have what specific license. I assume CC-BY-SA is documentation, but it should be written in comment anyway.

Oh, it's subpackages level split, so maybe just say something like:

    # licenses differ for subpackages

> URL:            http://py3c.readthedocs.io/en/latest/guide.html

I'd suggest to use plain simple http://py3c.readthedocs.io/

> Source0:        https://github.com/encukou/py3c/archive/v0.5.tar.gz#/py3c-0.5.tar.gz

Don't hardcode the version number here, but use %{version} instead.

> BuildRequires:  python-devel

Should be python2-devel

> # Do not require python2-devel, because some projects can drop Python 2 support
> # but still use the compat macros.

Maybe use Suggests here.

> Provides:       %{name}-static = %{version}-%{release}

This might need some arch specific tweaks, but if you do it noarch, you'll avoid that.

> make ...

You should uses parallel make %{?_smp_mflags} macro, but in case you know there is nothing to be parallel, I guess you can omit that.
I guess that in %check it can run in parallel, but maybe the readability of the output would be bad, give it a try.

> %{_includedir}/py3c/*.h

You should own the directory, easiest way is to do this instead:

    %{_includedir}/py3c

But if you want to doublecheck that only .h files are in there, you can do:

    %dir %{_includedir}/py3c
    %{_includedir}/py3c/*.h

Also:

The docs files -- might be easier not to copy them around, but add them directly in %doc instead.

Comment 2 Miro Hrončok 2016-05-18 12:55:29 UTC
(In reply to Miro Hrončok from comment #1)
> First eyes only review of the spec:
> 
> 
> > # A header-only library has no debuginfo
> > %global debug_package %{nil}
> Isn't header ony library noarch? That would also mean debuginfo will not be
> generated.

So after personal conversation I now know that header only libs should not be noarch due to tests, so I suggest to make just the supackages noarch.

Comment 3 Petr Viktorin (pviktori) 2016-05-19 13:33:40 UTC
I turned on the parallel make. It doesn't make a difference, since there's nothing for Make to parallelize (either in build or tests).

The Provides: line was taken directly from the guidelines for header-only libraries [0]. These guidelines also explicitly say that header-only packages must not be marked noarch. (The tests run in buildArch in Koji.)

As for the docs, I want them in %{_pkgdocdir} (/usr/share/doc/py3c) rather than %{_docdir} (/usr/share/doc/py3c-doc). So I'll keep copying htem to %_pkgdocdir. I do own the directory now, though.

The other issues should be fixed now, thanks for being thorough!
I've also updated to version 0.6, which fixes an issue with permissions on the installed headers.

[0] https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries


Updated package:

Spec: https://gist.githubusercontent.com/encukou/c42efc9ec2acabe113fd55d8eba8fbe7/raw/9eb90f3d90bee409218685281500c29b00e0b1ed/py3c.spec
SRPM: https://copr-be.cloud.fedoraproject.org/results/pviktori/py3c/fedora-rawhide-x86_64/00287694-py3c/py3c-0.6-1.fc25.src.rpm
Scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=14169646

Comment 4 Miro Hrončok 2016-05-19 16:08:56 UTC
Package Review
==============

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

Issues
======

Package contains fonts in /usr/share/doc/py3c/_static/fonts/
You have multiple options:
  * rm them and let the docs look a bit different
  * ln -s them from python3-sphinx_rtd_theme and require that package
    * downside is that doc would than bring along python3
  * require font(fontawesome) and font(lato), ln -s the fonts if needed

I still think that the static virtual provide shown on wiki in guidelines is just an example, because this is what is provided now on 64bit:

py3c-devel:
    py3c-devel
    py3c-devel(x86-64)
    py3c-static

And I think py3c-static(x86-64) should be there as well.

Provides:       %{name}-static = %{version}-%{release}
Provides:       %{name}-static%{?_isa} = %{version}-%{release}


I'm not sure if this would not generate two identical provides on 32bit, so maybe do:

Provides:         %{name}-static = %{version}-%{release}
%{?_isa:Provides: %{name}-static%{?_isa} = %{version}-%{release}}

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

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

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.
[x]: License file installed when any subpackage combination is installed.
[x]: If the package is under multiple licenses, the licensing breakdown
     must be documented in the spec.
[x]: %build honors applicable compiler flags or justifies otherwise.
[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.
[x]: 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.
[-]: Useful -debuginfo package or justification otherwise.
[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.
[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: No rpmlint messages.
[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]: All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
[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

===== SHOULD items =====

Generic:
[!]: Avoid bundling fonts in non-fonts packages.
     Note: Package contains font files
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[!]: Final provides and requires are sane (see attachments).
[-]: Fully versioned dependency in subpackages if applicable.
[?]: 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.
[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]: Uses parallel make %{?_smp_mflags} macro.
[x]: The placement of pkgconfig(.pc) files are correct.
[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: No rpmlint messages.
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: py3c-devel-0.6-1.fc23.x86_64.rpm
          py3c-doc-0.6-1.fc23.noarch.rpm
          py3c-0.6-1.fc23.src.rpm
3 packages and 0 specfiles checked; 0 errors, 0 warnings.




Rpmlint (installed packages)
----------------------------
2 packages and 0 specfiles checked; 0 errors, 0 warnings.



Requires
--------
py3c-devel (rpmlib, GLIBC filtered):
    /usr/bin/pkg-config

py3c-doc (rpmlib, GLIBC filtered):



Provides
--------
py3c-devel:
    pkgconfig(py3c)
    py3c-devel
    py3c-devel(x86-64)
    py3c-static

py3c-doc:
    py3c-doc



Source checksums
----------------
https://github.com/encukou/py3c/archive/v0.6.tar.gz#/py3c-0.6.tar.gz :
  CHECKSUM(SHA256) this package     : 31ff3ef6f9a6272d373a04426c5dde18fd5c51c17167870cfc1827935541bc01
  CHECKSUM(SHA256) upstream package : 31ff3ef6f9a6272d373a04426c5dde18fd5c51c17167870cfc1827935541bc01

Comment 5 Petr Viktorin (pviktori) 2016-05-19 17:13:02 UTC
I've linked fonts from the docs to the theme. Thanks for catching that!
Whoever has disk space to read HTML docs isn't likely to complain about python3 being dragged in.

I disagree with the %{name}-static%{_isa} Provides. The package doesn't install anything architecture-specific. I see is nothing in the Packaging Guidelines (Packaging Static Libraries section) that suggests the arch tag is useful here and nothing that hints it should be added. I don't see a different reason to add the tag.
If the arch tag would be useful, I think you should open a FPC ticket – this would affect all header-only packages and so it really should be clarified.



Spec: https://gist.githubusercontent.com/encukou/c42efc9ec2acabe113fd55d8eba8fbe7/raw/70958e74d3b714c71681f104f8d2a596629dafd2/py3c.spec
SRPM: https://copr-be.cloud.fedoraproject.org/results/pviktori/py3c/fedora-rawhide-x86_64/00288596-py3c/py3c-0.6-2.fc25.src.rpm
Koji scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=14173086

Comment 6 Miro Hrončok 2016-05-19 20:39:50 UTC
Package APPROVED

Comment 7 Gwyn Ciesla 2016-05-20 15:16:54 UTC
Package request has been approved: https://admin.fedoraproject.org/pkgdb/package/rpms/py3c

Comment 8 Fedora Update System 2016-06-15 14:07:53 UTC
py3c-0.6-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-1cafda4a24

Comment 9 Fedora Update System 2016-06-15 14:08:32 UTC
py3c-0.6-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-dd5abd8f14

Comment 10 Fedora Update System 2016-06-15 16:55:44 UTC
py3c-0.6-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-1cafda4a24

Comment 11 Fedora Update System 2016-06-15 17:27:01 UTC
py3c-0.6-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-dd5abd8f14

Comment 12 Fedora Update System 2016-06-23 17:54:15 UTC
py3c-0.6-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-06-24 01:56:20 UTC
py3c-0.6-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, 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.