Packaging entry-point only Python packages
Hi, Upstream Typer [1] has recently split up their package into the following: * typer-slim providing the core functionality * typer-cli providing the entry point for the optional typer command, and * typer which pulls in the other two and all optional dependencies. Trying to adjust the openSUSE package, I have into the following error being reported from rpmlint: python310-typer-cli.noarch: E: no-dependency-on python-base 3.10 python311-typer-cli.noarch: E: no-dependency-on python-base 3.11 python312-typer-cli.noarch: E: no-dependency-on python-base 3.12 This package only consists of an entry point. Thus, there is no module installed, only "binaries". These are versioned and there is a dependency on the corresponding Python's version of typer-slim. However, it seems as there are not modules installed the dependency on "python(abi)" is not generated. I found in some older threads the suggestion to add "%py_requires". But that macro no longer seems to exist. Is there any recommended way to approach this? I can of course just override the error via rpmlintrc. But I suspect that's not the proper solution to the issue and probably won't work for pushing into Factory. Kind Regards, Matthias -- Dr. Matthias Bach www.marix.org „Der einzige Weg, die Grenzen des Möglichen zu finden, ist ein klein wenig über diese hinaus in das Unmögliche vorzustoßen.“ - Arthur C. Clarke
On Mon Apr 1, 2024 at 7:05 PM CEST, Matthias Bach wrote:
Trying to adjust the openSUSE package, I have into the following error being reported from rpmlint:
python310-typer-cli.noarch: E: no-dependency-on python-base 3.10 python311-typer-cli.noarch: E: no-dependency-on python-base 3.11 python312-typer-cli.noarch: E: no-dependency-on python-base 3.12
Is it breaking the build? Otherwise, I would just say that rpmlint is not The Holy Writ™ and it can very well be wrong. Matěj -- http://matej.ceplovi.cz/blog/, @mcepl@floss.social GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8 Wise walks steady step, while fools around them dance contemporary dances. -- Franz Kafka
Hi Am Montag, 1. April 2024, 20:34:54 CEST schrieb Matěj Cepl:
On Mon Apr 1, 2024 at 7:05 PM CEST, Matthias Bach wrote:
Trying to adjust the openSUSE package, I have into the following error being> reported from rpmlint: python310-typer-cli.noarch: E: no-dependency-on python-base 3.10 python311-typer-cli.noarch: E: no-dependency-on python-base 3.11 python312-typer-cli.noarch: E: no-dependency-on python-base 3.12
Is it breaking the build? Otherwise, I would just say that rpmlint is not The Holy Writ™ and it can very well be wrong.
No, it is not breaking the build and I deem it a false positive. But I had the impression that branches often have relaxed badness calculations versus Factory. Thus, I was wondering whether there might be a different best practice for how to handle such cases, or if I can ignore this as a false positive. Kind Regards, Matthias -- Dr. Matthias Bach www.marix.org „Der einzige Weg, die Grenzen des Möglichen zu finden, ist ein klein wenig über diese hinaus in das Unmögliche vorzustoßen.“ - Arthur C. Clarke
Am 01.04.24 um 20:47 schrieb Matthias Bach:
Hi
On Mon Apr 1, 2024 at 7:05 PM CEST, Matthias Bach wrote:
Trying to adjust the openSUSE package, I have into the following error being> reported from rpmlint: python310-typer-cli.noarch: E: no-dependency-on python-base 3.10 python311-typer-cli.noarch: E: no-dependency-on python-base 3.11 python312-typer-cli.noarch: E: no-dependency-on python-base 3.12 Is it breaking the build? Otherwise, I would just say that rpmlint is not The Holy Writ™ and it can very well be wrong. No, it is not breaking the build and I deem it a false positive. But I had the impression that branches often have relaxed badness calculations versus Factory. Thus, I was wondering whether there might be a different best
Am Montag, 1. April 2024, 20:34:54 CEST schrieb Matěj Cepl: practice for how to handle such cases, or if I can ignore this as a false positive.
It's not really a false positive, as it correctly detects the missing dependency on python3xx-base or python(abi) = 3.XX. You can add that manually when you mask the python string not to be rewritten by the multiflavor rewriter. %define plainpython python ... Requires: %{plainpython}(abi) = %{python_version} %python_subpackages
Kind Regards, Matthias
- Ben
On lun, 2024-04-01 at 21:42 +0200, Ben Greiner wrote:
Am 01.04.24 um 20:47 schrieb Matthias Bach:
Hi
On Mon Apr 1, 2024 at 7:05 PM CEST, Matthias Bach wrote:
Trying to adjust the openSUSE package, I have into the following error being> reported from rpmlint: python310-typer-cli.noarch: E: no-dependency-on python-base 3.10 python311-typer-cli.noarch: E: no-dependency-on python-base 3.11 python312-typer-cli.noarch: E: no-dependency-on python-base 3.12 Is it breaking the build? Otherwise, I would just say that rpmlint is not The Holy Writ™ and it can very well be wrong. No, it is not breaking the build and I deem it a false positive. But I had the impression that branches often have relaxed badness calculations versus Factory. Thus, I was wondering whether there might be a different best
Am Montag, 1. April 2024, 20:34:54 CEST schrieb Matěj Cepl: practice for how to handle such cases, or if I can ignore this as a false positive.
It's not really a false positive, as it correctly detects the missing dependency on python3xx-base or python(abi) = 3.XX.
You can add that manually when you mask the python string not to be rewritten by the multiflavor rewriter.
%define plainpython python ... Requires: %{plainpython}(abi) = %{python_version} %python_subpackages
rpmlint is checking for files in the path "/usr/lib/pythonXXX/site- packages" and indeed, I can see that these packages has the usual python module metadata installed there. If this package just provides the binary, maybe this metadata folder can be removed from the package. $ rpm -ql python312-typer-cli-0.12.0-2.1.noarch.rpm /etc/alternatives/typer /usr/bin/typer /usr/bin/typer-3.12 /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist-info /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist-info/INSTALLER /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist-info/METADATA /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist-info/RECORD /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist-info/REQUESTED /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist-info/WHEEL /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist- info/entry_points.txt /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist-info/licenses /usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist- info/licenses/LICENSE /usr/share/doc/packages/python312-typer-cli /usr/share/doc/packages/python312-typer-cli/README.md /usr/share/licenses/python312-typer-cli /usr/share/licenses/python312-typer-cli/LICENSE
Am 02.04.24 um 07:55 schrieb daniel.garcia@suse.com:
rpmlint is checking for files in the path "/usr/lib/pythonXXX/site- packages" and indeed, I can see that these packages has the usual python module metadata installed there. If this package just provides the binary, maybe this metadata folder can be removed from the package.
Please don't remove the metadata. There might be consuming code now or in any other upstream package to check for it through importlib or even a simple `pip list`.
/usr/lib/python3.12/site-packages/typer_cli-0.12.0.dist-info
Am Dienstag, 2. April 2024, 19:42:17 CEST schrieb Ben Greiner:
Am 02.04.24 um 07:55 schrieb daniel.garcia@suse.com:
rpmlint is checking for files in the path "/usr/lib/pythonXXX/site- packages" and indeed, I can see that these packages has the usual python module metadata installed there. If this package just provides the binary, maybe this metadata folder can be removed from the package.
Please don't remove the metadata. There might be consuming code now or in any other upstream package to check for it through importlib or even a simple `pip list`.
Thanks for the suggestions, everyone. I have now gone with Ben's suggestion of explicitly adding in the dependency. I fear removing the metadata will cause issues in the %pyproject_install of depending packages. Explicitly adding the dependency is what I had tried initially but failed because I didn't apply the escaping trick. It is a much nicer solution than just silencing the rpmlint, although the dependency would have been pulled in indirectly anyhow. Kind Regards, Matthias -- Dr. Matthias Bach www.marix.org „Der einzige Weg, die Grenzen des Möglichen zu finden, ist ein klein wenig über diese hinaus in das Unmögliche vorzustoßen.“ - Arthur C. Clarke
participants (4)
-
Ben Greiner
-
daniel.garcia@suse.com
-
Matthias Bach
-
Matěj Cepl