On Sun, Dec 19, 2021 at 12:14:29PM +0100, Miro Hrončok wrote:
> On 17. 12. 21 17:58, Matthew Miller wrote:
> >The modern Python macros are ... kind of a lot to pick up as a casual
> >packager
> If you could share a more constructive feedback, I'd gladly iterate
> on the documentation or the macros themselves.

I guess I mostly meant that literally: it's a lot! I started using pyp2rpm,
which says 

  Convert Python packages to RPM SPECFILES. The packages can be downloaded
  from PyPI and the produced SPEC is in line with Fedora Packaging
  Guidelines or Mageia Python Policy.

... which was probably my first mistake, because that uses a previous
generation, and I should know better than to trust that random package
descriptions are current. :)

I should have just thrown all of that out and gone with the template
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_empty_spec_file
.

On that template in specific:

1. It's not immediately clear that "..." means "put package name here".

2. You mentioned in the review request — and Zbyszek said something similar
   —  that it'd be better to repeat the package name throughout the spec
  file in the various place it's needed. That doesn't feel right to me.

  I know the macros replace a lot of boilerplate, which is a good direction,
  but having the name be different in every file _throughout_ the file makes
  it harder to pick up when something is different from standard. It seems
  that a lot of python packages could be identical _except_ for the header.
  (And maybe then all of that eventually hidden completely with just some
  thing near the top that indicates "standard python package".)

3. The machinery to make every package be python-... while generating an
   actual python3-... subpackage is awkward. Are we stuck with that forever?

Overall in the guideline doc, back to the "it's a lot!" feeling... 

What do you think about having a "Quick Version" at the top, which includes
the spec file template, followed by a line-by line commentary — or at least,
section by section. Like this:

        Name:           python-...
        Version:        ...
        Release:        0%{?dist}
        Summary:        ...

    Packages primarily providing a python library must have names starting
    with `python-` and that should be followed by the name of the main
    importable module. Applications which happen to be written in Python
    should follow the standard Fedora guidelines. See [Naming] for details
     
    Version, Release, and Summary are as standard for Fedora packages.


        License:        ...
        URL:            https://...
        Source0:        %{url}/archive/v%{version}/...-%{version}.tar.gz / 
%{pypi_source ...}

    These are also as normal, but also see [Source files from PyPI].

        BuildArch:      noarch
        BuildRequires:  gcc

    Pick **one** of the above, depending on the package. (Note on the
   generate-buildrequires macro here. Will that work for archful devel
   package requirements?)

        BuildRequires:  python3-devel
   
    This is mandatory for every package that uses Python at runtime.

   ... and so on.

-- 
Matthew Miller
<mat...@fedoraproject.org>
Fedora Project Leader
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to