Bug 2233084 - Review Request: python-click-option-group - Option groups missing in Click
Summary: Review Request: python-click-option-group - Option groups missing in Click
Keywords:
Status: CLOSED ERRATA
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: https://github.com/click-contrib/clic...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-21 11:23 UTC by Cristian Le
Modified: 2023-09-15 18:50 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-15 01:35:03 UTC
Type: ---
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 6325405 to 6325687 (999 bytes, patch)
2023-08-21 12:52 UTC, Fedora Review Service
no flags Details | Diff

Description Cristian Le 2023-08-21 11:23:55 UTC
Spec URL: https://github.com/LecrisUT/python-click-option-group/blob/copr/python-click-option-group.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/lecris/python-click-option-group/fedora-rawhide-x86_64/06325161-python-click-option-group/python-click-option-group-0.5.6-4.fc40.src.rpm
Description: click-option-group is a Click-extension package that adds option groups missing in Click.
Fedora Account System Username:lecris

Comment 1 Fedora Review Service 2023-08-21 11:38:48 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6324606
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2233084-python-click-option-group/fedora-rawhide-x86_64/06324606-python-click-option-group/fedora-review/review.txt

Please take a look if any issues were found.

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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 4 Fedora Review Service 2023-08-21 12:48:24 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6325405
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2233084-python-click-option-group/fedora-rawhide-x86_64/06325405-python-click-option-group/fedora-review/review.txt

Please take a look if any issues were found.

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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 5 Fedora Review Service 2023-08-21 12:52:59 UTC
Created attachment 1984330 [details]
The .spec file difference from Copr build 6325405 to 6325687

Comment 6 Fedora Review Service 2023-08-21 12:53:01 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6325687
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2233084-python-click-option-group/fedora-rawhide-x86_64/06325687-python-click-option-group/fedora-review/review.txt

Please take a look if any issues were found.

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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 7 Robert-André Mauchin 🐧 2023-08-26 15:59:06 UTC
 - Ok, it would be nice to build the docs. For that you need the Github archive. 


For that you need build python-m2r2 :


%global pypi_name m2r2

Name:           python-%{pypi_name}
Version:        0.3.3.post2
Release:        %autorelease
Summary:         Markdown to reStructuredText converter

License:        MIT
URL:            https://github.com/crossnox/m2r2
Source:         %URL/archive/v%{version}/%{pypi_name}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(sphinx)

%global _description %{expand:
M2R2 converts a markdown file including reStructuredText (rst) markups to a
valid rst format.}

%description %_description

%package -n python3-%{pypi_name}
Summary:        %{summary}

%description -n python3-%{pypi_name} %_description


%package -n python-%{pypi_name}-doc
Summary:        Documentation for python-%{pypi_name}
BuildArch:      noarch

%description -n python-%{pypi_name}-doc
%{common_description}

This package is providing the documentation for %{pypi_name}.


%prep
%autosetup -n %{pypi_name}-%{version}
sed -i 's|__version__ = get_distribution("m2r2").version|__version__ = "%{version}"|' m2r2.py


%generate_buildrequires
%pyproject_buildrequires -t


%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files m2r2


# generate html docs
export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitelib}/
sphinx-build-3 -b html docs/ html
# remove the sphinx-build-3 leftovers
rm -rf html/.{doctrees,buildinfo}

%check
%pytest


%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE
%doc CHANGES.md  README.md
%{_bindir}/m2r2

%files -n python-%{pypi_name}-doc
%doc html
%license LICENSE


%changelog
%autochangelog
========================================================

%global pypi_name click-option-group
%global pypi_name_with_underscore %(echo "%{pypi_name}" | sed "s/-/_/g")

Name:           python-%{pypi_name}
Version:        0.5.6
Release:        %autorelease
Summary:        Option groups missing in Click

License:        BSD-3-Clause
URL:            https://github.com/click-contrib/click-option-group
Source:         %URL/archive/v%{version}/%{pypi_name}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  python3dist(m2r2)
BuildRequires:  python3dist(sphinx)
BuildRequires:  python3dist(pallets-sphinx-themes)

%global _description %{expand:
click-option-group is a Click-extension package that adds option groups missing
in Click.}

%description %_description


%package -n python3-click-option-group
Summary:        %{summary}

%description -n python3-click-option-group %_description


%package -n python-%{pypi_name}-doc
Summary:        Documentation for python-%{pypi_name}
BuildArch:      noarch

%description -n python-%{pypi_name}-doc
%_description

This package is providing the documentation for %{pypi_name}.


%prep
%autosetup -n click-option-group-%{version}


%generate_buildrequires
%pyproject_buildrequires -x tests


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files click_option_group


# generate html docs
export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitelib}/
sphinx-build-3 -b html docs/ html
# remove the sphinx-build-3 leftovers
rm -rf html/.{doctrees,buildinfo}


%check
%pytest


%files -n python3-click-option-group -f %{pyproject_files}
%license LICENSE
%doc README.md


%files -n python-%{pypi_name}-doc
%doc html
%license LICENSE


%changelog
%autochangelog


========================================================

-  description must be split after 80 column:

%global _description %{expand:
click-option-group is a Click-extension package that adds option groups missing in Click.
}

->

%global _description %{expand:
click-option-group is a Click-extension package that adds option groups missing
in Click.}

Comment 8 Cristian Le 2023-08-29 15:24:23 UTC
Thanks for the review. There are a few conflicting opinions I got from previous reviews.

(In reply to Robert-André Mauchin 🐧 from comment #7)
>  - Ok, it would be nice to build the docs. For that you need the Github
> archive. 

Could that be postponed to a later release? I have just switched it to `hatchling` [1] which should include the docs in the sdist, and if `m2r2` is just used to convert markdown to `rst`, I think it would be better to modernize it to use myst instead.

> %global pypi_name click-option-group
> %global pypi_name_with_underscore %(echo "%{pypi_name}" | sed "s/-/_/g")

In a previous review on `scikit-build(-core)`, I was recommended to move away from macros like `%ppi_name` in order to make the spec file more readable.

> %global _description %{expand:
> click-option-group is a Click-extension package that adds option groups
> missing
> in Click.}

I guess I line-breaked too late on this one? I did try to keep it within 80 characters and I thought the rpminspect is checking for that in the review.

> # generate html docs
> export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitelib}/
> sphinx-build-3 -b html docs/ html
> # remove the sphinx-build-3 leftovers
> rm -rf html/.{doctrees,buildinfo}

Only generate and package html docs right? Btw, what about if the documentation has `inter-sphinx`, will it be able to link to the local documentation of the other documentation package?

> %files -n python3-click-option-group -f %{pyproject_files}
> %license LICENSE

Not relevant yet, but the `%license` will be automatically constructed from the metadata provided by hatchling [2]. So in the case of:

> %files -n python-%{pypi_name}-doc
> %license LICENSE

That would then have to be provided manually for this sub-package. Could the license be centralized in the main package instead? 


[1] https://github.com/click-contrib/click-option-group/blob/8118a76fd0321ac32a23684c586d6c3ce873f3c3/pyproject.toml#L1-L3
[2] https://github.com/packit/packit/pull/1913#discussion_r1163956946

Comment 9 Jerry James 2023-08-30 16:08:16 UTC
(In reply to Cristian Le from comment #8)
> Only generate and package html docs right? Btw, what about if the
> documentation has `inter-sphinx`, will it be able to link to the local
> documentation of the other documentation package?

It isn't automatic.  Several python packages I maintain have something like this in %prep:

# Use local objects.inv for intersphinx
sed -e "s|\('https://docs\.python\.org/3/': \)None|\1'%{_docdir}/python3-docs/html/objects.inv'|" \
    -e "s|\('https://persistent\.readthedocs\.io/en/latest/': \)None|\1'%{_docdir}/python3-persistent-doc/objects.inv'|" \
    -e 's|\("https://zopeinterface\.readthedocs\.io/en/latest/": \)None|\1"%{_docdir}/python-zope-interface/html/objects.inv"|' \
    -i docs/conf.py

You have to add the relevant documentation packages to BuildRequires, of course.

Comment 10 Cristian Le 2023-08-30 16:37:49 UTC
@loganjerry Thanks for the tip. I would probably add a patch and use `%pyproject_buildrequires -x` to simplify things

Comment 11 Robert-André Mauchin 🐧 2023-09-06 06:09:18 UTC
> Could that be postponed to a later release? I have just switched it to `hatchling` [1] which should include the docs in the sdist, and if `m2r2` is just used to convert markdown to `rst`, I think it would be better to modernize it to use myst instead.

OK

> In a previous review on `scikit-build(-core)`, I was recommended to move away from macros like `%ppi_name` in order to make the spec file more readable.

I have a different view on that, but you do as you wish. I use the SPEC like a template where I can replace the variable by another for a new package.

> I guess I line-breaked too late on this one? I did try to keep it within 80 characters and I thought the rpminspect is checking for that in the review.

Yeah but don't put a newline before the closing }

> Only generate and package html docs right? Btw, what about if the documentation has `inter-sphinx`, will it be able to link to the local documentation of the other documentation package?

Not automatically. Never seen it done though.

> Could the license be centralized in the main package instead? 

If you put a Require on the main package yes.


Package approved.

Please:
 - add commit rights to python-packagers-sig after requesting the repo
 - add the package to Koschei in the python-packagers-sig group on all branches you are building
 - add the package to release-monitoring.org even if it does not release version



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: "Unknown or generated", "BSD 3-Clause License". 23 files have
     unknown license. Detailed output of licensecheck in
     /home/bob/packaging/review/python-click-option-group/review-python-
     click-option-group/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.
[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]: The License field must be a valid SPDX expression.
[x]: Package requires other packages for directories it uses.
[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]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 4065 bytes in 1 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

Python:
[x]: Binary eggs must be removed in %prep
     Note: Cannot find any build in BUILD directory (--prebuilt option?)
[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

===== 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-click-option-group
[?]: 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.
[x]: %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: No rpmlint messages.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: python3-click-option-group-0.5.6-1.fc40.noarch.rpm
          python-click-option-group-doc-0.5.6-1.fc40.noarch.rpm
          python-click-option-group-0.5.6-1.fc40.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/tmpz2mqhokm')]
checks: 31, packages: 3

=============================================================================================================== 3 packages and 0 specfiles checked; 0 errors, 0 warnings, 0 badness; has taken 0.5 s ===============================================================================================================

Comment 12 Fedora Admin user for bugzilla script actions 2023-09-06 09:03:44 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/python-click-option-group

Comment 13 Fedora Update System 2023-09-06 11:11:38 UTC
FEDORA-EPEL-2023-9d44eee6fb has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-9d44eee6fb

Comment 14 Fedora Update System 2023-09-06 11:11:39 UTC
FEDORA-2023-1a7f8b5e64 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-1a7f8b5e64

Comment 15 Fedora Update System 2023-09-07 02:23:59 UTC
FEDORA-2023-bdcebdb39a has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-bdcebdb39a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-bdcebdb39a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2023-09-07 02:31:17 UTC
FEDORA-2023-1a7f8b5e64 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-1a7f8b5e64`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-1a7f8b5e64

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2023-09-07 02:32:20 UTC
FEDORA-EPEL-2023-9d44eee6fb has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-9d44eee6fb

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2023-09-07 02:40:07 UTC
FEDORA-2023-72e30570cd has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-72e30570cd`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-72e30570cd

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2023-09-15 01:35:03 UTC
FEDORA-2023-1a7f8b5e64 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2023-09-15 01:41:57 UTC
FEDORA-2023-72e30570cd has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2023-09-15 02:00:40 UTC
FEDORA-EPEL-2023-9d44eee6fb has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 22 Fedora Update System 2023-09-15 18:50:01 UTC
FEDORA-2023-bdcebdb39a has been pushed to the Fedora 39 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.