Bug 2039649 - Review Request: python-charon - 3D printer related files lib for cura
Summary: Review Request: python-charon - 3D printer related files lib for cura
Keywords:
Status: CLOSED WONTFIX
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: 2039367
TreeView+ depends on / blocked
 
Reported: 2022-01-12 07:09 UTC by Gabriel Féron
Modified: 2022-09-23 08:38 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-09-23 08:38:49 UTC
Type: ---
Embargoed:
mhroncok: fedora-review+


Attachments (Terms of Use)

Description Gabriel Féron 2022-01-12 07:09:52 UTC
Spec URL: https://raw.githubusercontent.com/gferon/libcharon/master/python-charon.spec
SRPM URL: https://github.com/gferon/libcharon/raw/master/python-charon-4.10.2-1.fc35.src.rpm
Description: New dependency for cura 4.13
Fedora Account System Username: gferon

Comment 1 Miro Hrončok 2022-01-12 09:44:44 UTC
Couple of initial process comments:

- please use a raw spec for the Spec URL, so automation can download it
- please also link a SRPM, so automation can download it
- the source package name should be python-charon and hence the filename must be python-charon.spec
- the python3-charon thing needs to be a subpackage (see e.g. python-uranium vs python3-uranium): https://src.fedoraproject.org/rpms/python-uranium/blob/rawhide/f/python-uranium.spec#_39

Comment 2 Gabriel Féron 2022-01-12 14:51:43 UTC
Thanks, should be fine now.

Comment 3 Miro Hrončok 2022-01-12 15:01:08 UTC
Nit-picks and suggestions:

Summary:        File metadata and streaming library for 3D-printing related file formats.  -> remove the dot, summaries are not sentences


Source0:        %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz    ->    Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz  (less of a hack)


BuildArch: noarch  -> BuildArch:      noarch   (add more spaces to align with the rest of the tags)


%autosetup -n libCharon-%{version} -p1 -S git   (this requires BuildRequiring git-core)



%{__python3} -m pip freeze  -> %{python3} -m pip freeze   (also seems like you need to BuildRequire python3-pip to make it work?)
%{__python3} -m pytest -v   -> %pytest -v                 (a new macro)


Does the package even build with the missing BRs?

Comment 4 Gabriel Féron 2022-01-12 15:12:47 UTC
Fair, I have addressed all of your comments. Regarding the dot at the end of the sentence, I literally looked at https://src.fedoraproject.org/rpms/python-uranium/blob/rawhide/f/python-uranium.spec#_60 and decided to do the same.

The package was building fine on my local setup without the missing BR, after adding them I've checked with mock (and reuploaded the SRPM).

Comment 5 Miro Hrončok 2022-01-12 15:23:10 UTC
https://src.fedoraproject.org/rpms/python-uranium/blob/rawhide/f/python-uranium.spec#_60 is the description (has sentences)
https://src.fedoraproject.org/rpms/python-uranium/blob/rawhide/f/python-uranium.spec#_4 is the summary (no sentences)

I hope that makes sense.

Comment 6 Miro Hrončok 2022-01-12 18:44:27 UTC
Fedora-Review made me aware of https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_scriptlets -- since this package adds a systemd service, we might need to add the scriptlets.


What is the service actually for and does Cura need it to be up and running?


-------------


Couple more suggestions:

1)

-Summary:        File metadata and streaming library for 3D-printing related file formats.
+Summary:        File metadata and streaming library for 3D-printing-related file formats


2)

-Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
+Source0:        %{url}/archive/%{version}/libCharon-%{version}.tar.gz
 
Sorry about not spotting that at first, but I think the archive name should == the directory in it.


3)

 %description
-Charon is a library to read and write several 3D-printing related file formats
+Charon is a library to read and write several 3D-printing-related file formats.


4)
 
 %package -n python3-charon
 Summary:    %{summary}
-Provides:   charon = %{version}-%{release}
-%{?python_provide:%python_provide python3-charon}
+Provides:   libcharon = %{?epoch:%{epoch}:}%{version}-%{release}
+Provides:   libcharon%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

There are multiple changes here:
 - %python_provide is deprecated
 - I think it should provide libcharon rather than charon
 - the provide should be repeated with architecture
 - the provide should contain epoch if it exists (to be more future-proof)

5)

 %check
-%{__python3} -m pip freeze
+%{python3} -m pip freeze
 %pytest -v

This is a more modern macro that should be used nowadays.


6)
 
 %install
@@ -46,7 +46,7 @@
 %files
 %license LICENSE
 %doc README.md
-%{python3_sitelib}/Charon
+%{python3_sitelib}/Charon/
 %{_datadir}/dbus-1/system.d/nl.ultimaker.charon.conf
 %{_unitdir}/charon.service
 
The slash makes the spec file easier to read (the reader immediately knows this is a directory).


-----------------


I am also trying to figure out f the package needs to runtime-require dbus-common and systemd or not.

Comment 7 Gabriel Féron 2022-01-13 15:55:12 UTC
I updated both the spec and SRPM with your latest comments. Thanks for being so thorough, I can see why the quality of Fedora packages is so high!

I checked a little bit, and I don't think the systemd service is necessary, I've removed it for now.

Comment 8 Miro Hrončok 2022-01-13 16:17:07 UTC
The spec file looks good. Running Fedora-Review again, but it failed becasue the SRPM seem to still have "%{url}/archive/%{version}/%{name}-%{version}.tar.gz" as source, while th spec was updated. Could you plese regenerate and upload the SRPM again?


Note that RPM developers upstream don't consider %excluding files a valid way to get rid of them, only a way to exclude them from one subpackage to include them in another one. This works for now but might break with future RPM versions. It's safer to `rm` the files at the end of %install.

See https://github.com/rpm-software-management/rpm/issues/994

Comment 9 Gabriel Féron 2022-01-18 15:07:30 UTC
Done & done

Comment 10 Miro Hrončok 2022-01-18 15:18:08 UTC
%files -> %files -n python3-charon

otherwise, all the files end up in a python-charon package instead of python3-charon.



I have not noticed this before, but I have noticed it when the package is built.

Comment 11 Miro Hrončok 2022-01-18 15:20:01 UTC
I've also noticed in the logs:

PytestConfigWarning: Unknown config option: timeout


We might want to BR python3-pytest-timeout.

Comment 12 Miro Hrončok 2022-01-18 15:21:01 UTC
Other than the %files thing:


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

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



===== 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", "GNU Lesser General Public License,
     Version 3".
[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 10240 bytes in 1 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: There are rpmlint messages (see attachment).
[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:
[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.
[?]: 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:
[-]: 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.
[?]: 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.
[?]: 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]: 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: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
============== 2 packages and 0 specfiles checked; 0 errors, 0 warnings, 0 badness; has taken 0.2 s =============



Source checksums
----------------
https://github.com/Ultimaker/libCharon/archive/4.10.2/libCharon-4.10.2.tar.gz :
  CHECKSUM(SHA256) this package     : 3f676ea2c4355d6c655880d6229a6c6cba9326b106c178cafba52ae2f12846df
  CHECKSUM(SHA256) upstream package : 3f676ea2c4355d6c655880d6229a6c6cba9326b106c178cafba52ae2f12846df


Requires
--------
python-charon (rpmlib, GLIBC filtered):
    python(abi)



Provides
--------
python-charon:
    python-charon



Generated by fedora-review 0.7.0 (fed5495) last change: 2019-03-17
Command line :try-fedora-review -b 2039649 -m fedora-rawhide-x86_64
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Python, Shell-api
Disabled plugins: PHP, Java, Haskell, Ruby, SugarActivity, Perl, fonts, C/C++, Ocaml, R
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 13 Gabriel Féron 2022-01-19 15:29:01 UTC
added the missing BR and fixed the %files section

Comment 14 Miro Hrončok 2022-01-19 15:38:04 UTC
Package APPROVED. Thank you!

Comment 15 Miro Hrončok 2022-02-01 10:47:40 UTC
You can request the repo with:

  fedpkg request-repo python-charon 2039649

Comment 16 Gabriel Féron 2022-02-01 11:49:49 UTC
Thanks, just opened https://pagure.io/releng/fedora-scm-requests/issue/41635

Comment 17 Gwyn Ciesla 2022-02-01 15:33:15 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-charon

Comment 18 Jonny Heggheim 2022-07-15 13:55:50 UTC
The repository have been made, but there are no build nor spec files

Comment 19 Gabriel Féron 2022-09-23 08:10:27 UTC
I believe you can delete the repository, this is not needed anymore with the latest version of Cura (which we also cannot build right now because of missing dependencies).


Note You need to log in before you can comment on or make changes to this bug.