Bug 2255786 - Review Request: python-argparse-dataclass - Declarative CLIs with argparse and dataclasses
Summary: Review Request: python-argparse-dataclass - Declarative CLIs with argparse an...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Sandro
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: Trivial
Depends On: 2255788
Blocks: fedora-neuro, NeuroFedora 2255578
TreeView+ depends on / blocked
 
Reported: 2023-12-25 03:06 UTC by Ben Beasley
Modified: 2024-01-04 02:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-12-26 13:36:10 UTC
Type: ---
Embargoed:
gui1ty: fedora-review+


Attachments (Terms of Use)

Description Ben Beasley 2023-12-25 03:06:28 UTC
Spec URL: https://music.fedorapeople.org/python-argparse-dataclass.spec
SRPM URL: https://music.fedorapeople.org/python-argparse-dataclass-2.0.0-1.fc39.src.rpm

Description:

Declarative CLIs with argparse and dataclasses.

Fedora Account System Username: music

Koji scratch builds:

F40: https://koji.fedoraproject.org/koji/taskinfo?taskID=110809443
F39: https://koji.fedoraproject.org/koji/taskinfo?taskID=110809449
F38: https://koji.fedoraproject.org/koji/taskinfo?taskID=110809451

This is a dependency for python-snakemake-interface-common (https://pypi.org/project/snakemake-interface-common/), which in turn is a new dependency for snakemake 8.0. It will be a neuro-sig package.

Comment 1 Fedora Review Service 2023-12-25 08:17:31 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6813958
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2255786-python-argparse-dataclass/fedora-rawhide-x86_64/06813958-python-argparse-dataclass/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 2 Sandro 2023-12-25 08:52:56 UTC
My first thought glancing over the spec file:

> # We use the GitHub archive instead of the PyPI sdist to get CHANGELOG.md and
> # the tests.
> Source:         %{url}/archive/%{version}/argparse_dataclass-%{version}.tar.gz

Doesn't that scream `%forgesource`, pretty please with sugar on top?

It would also let you do away with `%autosetup -n argparse_dataclass-%{version}` in favor of `%forgeautosetup`.

Comment 3 Ben Beasley 2023-12-25 20:17:24 UTC
(In reply to Sandro from comment #2)
> My first thought glancing over the spec file:
> 
> > # We use the GitHub archive instead of the PyPI sdist to get CHANGELOG.md and
> > # the tests.
> > Source:         %{url}/archive/%{version}/argparse_dataclass-%{version}.tar.gz
> 
> Doesn't that scream `%forgesource`, pretty please with sugar on top?

You know, I personally find that it’s not worth defining %forgeurl and adding %forgemeta just to simplify the source URL and avoid writing out the extraction directory name for %autosetup. There is just as much noise added to the spec file as is removed, and at the cost of an extra layer of indirection. I do find the forge macros can be worth it for forges with much less straightforward URL schemes (GitLab), and perhaps when frequently alternating between snapshots and proper releases.

I’m not opposed to the general NeuroFedora habit of adding forge macros or to working on packages that use them. I just don’t *personally* find that they add much in straightforward cases like this.

> It would also let you do away with `%autosetup -n
> argparse_dataclass-%{version}` in favor of `%forgeautosetup`.

On the other hand, considering the comments in

  https://git.sr.ht/~gotmax23/forge-srpm-macros/tree/354ce4a51e80f6d524084d49612d77e69336cb71/item/rpm/macros.d/macros.forge#L65

about possibly removing %forgeautosetup in the future, this is probably better written as

  %autosetup %{forgesetupargs}

Comment 4 Sandro 2023-12-25 21:55:46 UTC
(In reply to Ben Beasley from comment #3)
> (In reply to Sandro from comment #2)
> > My first thought glancing over the spec file:
> > 
> > > # We use the GitHub archive instead of the PyPI sdist to get CHANGELOG.md and
> > > # the tests.
> > > Source:         %{url}/archive/%{version}/argparse_dataclass-%{version}.tar.gz
> > 
> > Doesn't that scream `%forgesource`, pretty please with sugar on top?
> 
> You know, I personally find that it’s not worth defining %forgeurl and
> adding %forgemeta just to simplify the source URL and avoid writing out the
> extraction directory name for %autosetup. There is just as much noise added
> to the spec file as is removed, and at the cost of an extra layer of
> indirection. I do find the forge macros can be worth it for forges with much
> less straightforward URL schemes (GitLab), and perhaps when frequently
> alternating between snapshots and proper releases.
> 
> I’m not opposed to the general NeuroFedora habit of adding forge macros or
> to working on packages that use them. I just don’t *personally* find that
> they add much in straightforward cases like this.

I guess this boils down to a matter of personal preferences. I quite like just throwing the URL in the spec and maybe a tag and let the forge macros do their magic. If needed, a `-v` or `rpmspec --parse` will let me peek under the hood.

I promise I'll try being a bit less noisy when it comes to forge macros next year. ;)


> > It would also let you do away with `%autosetup -n
> > argparse_dataclass-%{version}` in favor of `%forgeautosetup`.
> 
> On the other hand, considering the comments in
> 
>  
> https://git.sr.ht/~gotmax23/forge-srpm-macros/tree/
> 354ce4a51e80f6d524084d49612d77e69336cb71/item/rpm/macros.d/macros.forge#L65
> 
> about possibly removing %forgeautosetup in the future, this is probably
> better written as
> 
>   %autosetup %{forgesetupargs}

Ouch! I don't like the look of that. The comment reads "this will probably be removed since it is unsafe in presence of multiple sources". Assuming `%autosetup` is safe in presence of multiple sources. How can `%forgeautosetup` be unsafe in the same situation? It already calls `%autosetup %{forgesetupargs}` under the hood.

On a different note, I find it amusing that people actually scroll through the code for information / documentation. I had a PR on one of my packages a couple of days ago, fixing an issue with `%forgesource` being wrong for a GitHub project that did not have it's version munged (tag == version). I was pointed to a comment in the source code, explaining the issue.

Comment 5 Sandro 2023-12-26 11:51:03 UTC
Notes
=====

[x]: Package is named according to the Package Naming Guidelines.

=> While the package name is correct, it is unfortunate that it clashes with `python-argparse`, making this package look like a sub package of the former.

[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.

=> This could be your first package using the `-l` flag for `%pyproject_save_files`. I know the f38 update is still pending. But it should get there before the package is pushed to f38.

Package is APPROVED.

Package Review
==============

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



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

Generic:
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[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]: 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 15416 bytes in 2 files.
[x]: Package complies to the Packaging Guidelines
[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 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:
[-]: Binary eggs must be removed in %prep
[-]: 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.
[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:
[x]: Reviewer should test that the package builds in mock.
[-]: 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).
[?]: 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.
[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]: Spec use %global instead of %define unless justified.
[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.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: No rpmlint messages.


Rpmlint
-------
Checking: python3-argparse-dataclass-2.0.0-1.fc40.noarch.rpm
          python-argparse-dataclass-2.0.0-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/tmp9bxbpl7j')]
checks: 31, packages: 2

 2 packages and 0 specfiles checked; 0 errors, 0 warnings, 0 badness; has taken 0.1 s 




Rpmlint (installed packages)
----------------------------
(none): E: there is no installed rpm "python3-argparse-dataclass".
There are no files to process nor additional arguments.
Nothing to do, aborting.
============================ rpmlint session starts ============================
rpmlint: 2.5.0
configuration:
    /usr/lib/python3.12/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
checks: 32, packages: 1

 0 packages and 0 specfiles checked; 0 errors, 0 warnings, 0 filtered, 0 badness; has taken 0.0 s 



Source checksums
----------------
https://github.com/mivade/argparse_dataclass/archive/2.0.0/argparse_dataclass-2.0.0.tar.gz :
  CHECKSUM(SHA256) this package     : 4840dc5c793bfeea4864371f21a341dcf6592047755f558c1c2814c0724b4119
  CHECKSUM(SHA256) upstream package : 4840dc5c793bfeea4864371f21a341dcf6592047755f558c1c2814c0724b4119


Requires
--------
python3-argparse-dataclass (rpmlib, GLIBC filtered):
    python(abi)



Provides
--------
python3-argparse-dataclass:
    python-argparse-dataclass
    python3-argparse-dataclass
    python3.12-argparse-dataclass
    python3.12dist(argparse-dataclass)
    python3dist(argparse-dataclass)



Generated by fedora-review 0.10.0 (e79b66b) last change: 2023-07-24
Command line :/bin/fedora-review --no-colors --prebuilt --rpm-spec --name python-argparse-dataclass --mock-config /var/lib/copr-rpmbuild/results/configs/child.cfg
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Python, Shell-api
Disabled plugins: Perl, PHP, Ocaml, SugarActivity, fonts, Haskell, R, C/C++, Java
Disabled flags: EXARCH, EPEL6, EPEL7, DISTTAG, BATCH

Comment 6 Ben Beasley 2023-12-26 13:22:24 UTC
> I guess this boils down to a matter of personal preferences. I quite like just throwing the URL in the spec and maybe a tag and let the forge macros do their magic. If needed, a `-v` or `rpmspec --parse` will let me peek under the hood.

Yes, I agree this is a matter of personal preference. I don’t think there’s an overwhelming technical argument either for or against the use of the forge macros in trivial cases like this.

(In reply to Sandro from comment #5)
> Notes
> =====
> 
> [x]: Package is named according to the Package Naming Guidelines.
> 
> => While the package name is correct, it is unfortunate that it clashes with
> `python-argparse`, making this package look like a sub package of the former.

I agree it could be a bit confusing. At least it is in fact an *extension* of argparse. There’s also no python-argparse in Fedora because argparse is in the standard library now.

> => This could be your first package using the `-l` flag for
> `%pyproject_save_files`. I know the f38 update is still pending. But it
> should get there before the package is pushed to f38.

I am *very* excited about %pyproject_save_files. I’ve already added it to a bunch of “my” packages in Rawhide even though it’s not in F38/F39 yet and it still breaks Zuul.

I’ve been trying to avoid inflicting it on reviewers just yet, but I’ll add it after import in the rawhide branch.

> Package is APPROVED.

Thank you for the review!

Comment 7 Fedora Admin user for bugzilla script actions 2023-12-26 13:23:10 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/python-argparse-dataclass

Comment 8 Sandro 2023-12-26 13:28:13 UTC
(In reply to Ben Beasley from comment #6)
> (In reply to Sandro from comment #5)
> > Notes
> > =====
> > 
> > [x]: Package is named according to the Package Naming Guidelines.
> > 
> > => While the package name is correct, it is unfortunate that it clashes with
> > `python-argparse`, making this package look like a sub package of the former.
> 
> I agree it could be a bit confusing. At least it is in fact an *extension*
> of argparse. There’s also no python-argparse in Fedora because argparse is
> in the standard library now.

Yeah, I just realized I was confusing `python-argparse` with `python-argcomplete`. No name clash there. Although, my brains beg to disagree.

Note to self: Don't pay to much attention to that grey mass.

Comment 9 Fedora Update System 2023-12-26 13:33:56 UTC
FEDORA-2023-14239a051f has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-14239a051f

Comment 10 Fedora Update System 2023-12-26 13:36:10 UTC
FEDORA-2023-14239a051f has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Ben Beasley 2023-12-26 13:52:10 UTC
https://release-monitoring.org/project/78366/

Comment 12 Fedora Update System 2023-12-26 13:54:01 UTC
FEDORA-EPEL-2023-e1b4aa4a21 has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-e1b4aa4a21

Comment 13 Fedora Update System 2023-12-26 14:28:53 UTC
FEDORA-2023-524422d73f has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-524422d73f

Comment 14 Fedora Update System 2023-12-26 14:29:02 UTC
FEDORA-2023-336a69b3a6 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-336a69b3a6

Comment 15 Fedora Update System 2023-12-27 02:10:29 UTC
FEDORA-2023-336a69b3a6 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-336a69b3a6 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-336a69b3a6

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

Comment 16 Fedora Update System 2023-12-27 02:17:10 UTC
FEDORA-EPEL-2023-e1b4aa4a21 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-e1b4aa4a21

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

Comment 17 Fedora Update System 2023-12-27 02:20:23 UTC
FEDORA-2023-524422d73f has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-524422d73f \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-524422d73f

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

Comment 18 Fedora Update System 2024-01-04 01:38:10 UTC
FEDORA-2023-336a69b3a6 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2024-01-04 01:48:23 UTC
FEDORA-EPEL-2023-e1b4aa4a21 has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2024-01-04 02:06:10 UTC
FEDORA-2023-524422d73f 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.