Bug 2235080 (python-pymaven-patch) - Review Request: python-pymaven-patch - Library for working with Maven repositories via Python
Summary: Review Request: python-pymaven-patch - Library for working with Maven reposit...
Keywords:
Status: CLOSED ERRATA
Alias: python-pymaven-patch
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sandro
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: scancode-toolkit
TreeView+ depends on / blocked
 
Reported: 2023-08-26 11:25 UTC by Robert-André Mauchin 🐧
Modified: 2023-11-04 03:45 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-03 18:47:25 UTC
Type: ---
Embargoed:
gui1ty: fedora-review+


Attachments (Terms of Use)
Example showing simplification using forge macros (1.02 KB, patch)
2023-09-29 14:07 UTC, Sandro
no flags Details | Diff

Description Robert-André Mauchin 🐧 2023-08-26 11:25:26 UTC
Spec URL: https://eclipseo.fedorapeople.org/for-review/python-pymaven-patch.spec
SRPM URL: https://eclipseo.fedorapeople.org/for-review/python-pymaven-patch-0.3.0-1.fc38.src.rpm

Description:
Pymaven is a Python library for interfacing with the Maven build system. There are two major interfaces:   - pymaven.client provides a basic Maven repository client  - pymaven.pom provides a Pom object that can provide progromatic access to a  maven pom file

Fedora Account System Username: eclipseo

To build it against the dependencies, use the following COPR in your rawhide mock.cfg:

[copr:copr.fedorainfracloud.org:eclipseo:scancode-toolkit]
name=Copr repo for scancode-toolkit owned by eclipseo
baseurl=https://download.copr.fedorainfracloud.org/results/eclipseo/scancode-toolkit/fedora-rawhide-/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://download.copr.fedorainfracloud.org/results/eclipseo/scancode-toolkit/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1

Comment 1 Sandro 2023-09-29 13:44:33 UTC
Looking at the spec file:

%global pypi_name pymaven-patch
%global pypi_name_with_underscore %(echo "%{pypi_name}" | sed "s/-/_/g")
%global github_name pymaven

This seems over engineered. Here you could really benefit from the forge macros. I'll supply a patch for inspiration.

You are not using all the macros consistently (e.g.: `%pyproject_save_files pymaven`). Personally, I'd do away with the macros and just spell it out. Makes the spec file easier to read.

A comment on why `export PBR_VERSION=%{version}` is needed would be appreciated. It helps others understanding the spec file.

Comment 2 Sandro 2023-09-29 13:52:31 UTC
Package Review
==============

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


Issues
======

=> The license file is already included and marked as such by `%pyproject_save_files`. Using `%license` in addition duplicates the file, see `rpm -q --licensefiles -p $RPM`.

===== 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.
[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 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]: 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:
[-]: 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
[x]: Binary eggs must be removed in %prep

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

Generic:
[x]: Reviewer should test that the package builds in mock.
[x]: 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.
[?]: 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]: 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.


Rpmlint
-------
Checking: python3-pymaven-patch-0.3.0-1.fc38.noarch.rpm
          python-pymaven-patch-0.3.0-1.fc38.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/tmppc268ftg')]
checks: 31, packages: 2

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




Rpmlint (installed packages)
----------------------------
============================ 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
checks: 31, packages: 1

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



Source checksums
----------------
https://github.com/nexB/pymaven/archive/0.3.0/pymaven-0.3.0.tar.gz :
  CHECKSUM(SHA256) this package     : 7afff3f42b01531df546cdf06cd87aba3c93c34524a5f23e4686413fd6fae017
  CHECKSUM(SHA256) upstream package : 7afff3f42b01531df546cdf06cd87aba3c93c34524a5f23e4686413fd6fae017


Requires
--------
python3-pymaven-patch (rpmlib, GLIBC filtered):
    (python3.11dist(lxml) < 5~~ with python3.11dist(lxml) >= 4)
    (python3.11dist(requests) < 3~~ with python3.11dist(requests) >= 2.7)
    (python3.11dist(six) < 2~~ with python3.11dist(six) >= 1.10)
    python(abi)



Provides
--------
python3-pymaven-patch:
    python-pymaven-patch
    python3-pymaven-patch
    python3.11-pymaven-patch
    python3.11dist(pymaven-patch)
    python3dist(pymaven-patch)



Generated by fedora-review 0.9.0 (6761b6c) last change: 2022-08-23
Command line :/usr/bin/fedora-review --no-colors --prebuilt --rpm-spec --name python-pymaven-patch --mock-config /var/lib/copr-rpmbuild/results/configs/child.cfg
Buildroot used: fedora-38-x86_64
Active plugins: Shell-api, Generic, Python
Disabled plugins: SugarActivity, Perl, Java, Haskell, PHP, C/C++, R, Ocaml, fonts
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 3 Sandro 2023-09-29 14:07:45 UTC
Created attachment 1991094 [details]
Example showing simplification using forge macros

As mentioned, this is how the spec file could be simplified using forge macros.

Comment 4 Sandro 2023-10-08 19:53:21 UTC
Ping?

Comment 5 Robert-André Mauchin 🐧 2023-10-17 17:11:14 UTC
Spec URL: https://eclipseo.fedorapeople.org/for-review/python-pymaven-patch.spec
SRPM URL: https://eclipseo.fedorapeople.org/for-review/python-pymaven-patch-0.3.0-1.fc39.src.rpm

I just got back to this yesterday night but fell asleep.

Thanks you for the review!

Comment 6 Fedora Review Service 2023-10-17 17:16:18 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6540095
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2235080-python-pymaven-patch/fedora-rawhide-x86_64/06540095-python-pymaven-patch/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 Sandro 2023-10-17 22:05:19 UTC
> => The license file is already included and marked as such by `%pyproject_save_files`. Using `%license` in addition duplicates the file, see `rpm -q --licensefiles -p $RPM`.

That has not been fixed. The license file is still duplicated. You can drop %license from the %files section (not a blocker, though).

Other than that this looks good now. Thanks for adding the comment. Regarding the version, you are most likely encountering the use of dynamic version detection by looking at tags.

Instead of:

%generate_buildrequires
# Fix issue about "versioning for this project requires either an sdist tarball,
# or access to an upstream git repository. It's also possible that there is a
# mismatch between the package name in setup.cfg and the argument given 
# to pbr.version.VersionInfo."
export PBR_VERSION=%{version}
%pyproject_buildrequires

you could try:

BuildRequires: git-core

...

%prep
%forgeautosetup -p1 -S git
git tag %{version} # if upstream uses vX.Y.Z make it v%{version}

%generate_buildrequires
%pyproject_buildrequires

But that's just a general idea from experience. I haven't looked at upstreams code nor have I tried it myself.

APPROVED! (bonus points for using forge macros!) ;)

Comment 8 Robert-André Mauchin 🐧 2023-10-24 18:03:37 UTC
Fixed! Thank you for the review, Sandro!

Comment 9 Fedora Admin user for bugzilla script actions 2023-10-24 18:03:43 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/python-pymaven-patch

Comment 10 Fedora Update System 2023-10-26 18:28:47 UTC
FEDORA-2023-9623ea0072 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-9623ea0072

Comment 11 Fedora Update System 2023-10-26 18:46:54 UTC
FEDORA-2023-327859703a has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-327859703a

Comment 12 Fedora Update System 2023-10-26 18:47:27 UTC
FEDORA-2023-132a8a2477 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-132a8a2477

Comment 13 Fedora Update System 2023-10-27 01:20:20 UTC
FEDORA-2023-327859703a 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-327859703a \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-327859703a

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

Comment 14 Fedora Update System 2023-10-27 02:15:16 UTC
FEDORA-2023-9623ea0072 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-9623ea0072 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-9623ea0072

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

Comment 15 Fedora Update System 2023-10-27 02:18:03 UTC
FEDORA-2023-132a8a2477 has been pushed to the Fedora 37 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-132a8a2477 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-132a8a2477

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

Comment 16 Fedora Update System 2023-11-03 18:47:25 UTC
FEDORA-2023-9623ea0072 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2023-11-04 03:42:26 UTC
FEDORA-2023-327859703a has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2023-11-04 03:45:48 UTC
FEDORA-2023-132a8a2477 has been pushed to the Fedora 37 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.