On 11/19/20 6:02 PM, Richard W.M. Jones wrote:
It's not a big deal because I added the Python Requires: line by
but I want to make sure I understand why it happens and whether
there's an easy fix.
This subpackage contains a Python file:
$ rpm -qlp ./nbdkit-S3-plugin-1.23.9-1.fc34.x86_64.rpm
/usr/lib64/nbdkit/plugins/nbdkit-S3-plugin <--- this one
The automatically generated dependencies don't pick up the need for
$ grep ^import nbdkit-S3-plugin
$ rpm -qRp ./nbdkit-S3-plugin-1.23.9-1.fc34.x86_64.rpm
nbdkit-python-plugin >= 1.22
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
(As I said above, I added it explicitly, which is why the RPM built in
Koji above _does_ contain the boto3 dependency).
Now admittedly the Python file doesn't end in .py and doesn't have a
python shebang at the top. But:
$ file nbdkit-S3-plugin
nbdkit-S3-plugin: Python script, ASCII text executable
which seems as if it matches the %__python_magic regexp in
/usr/lib/rpm/fileattrs/python.attr. So perhaps it _ought_ to work and
something is wrong on the machine I'm using to reproduce this?
Alternatively is there another way to tell the dependency generator to
take a special look at this file?
There are three dependency generators for Python and neither of them does what
you ask here.
This file makes sure that files installed into /usr/lib(64)/pythonX.Y require
python(abi) = X.Y.
This file makes sure that Python packages (upstream term) require other Python
packages. E.g. that requests requires idna, chardet and urllib3. This is read
from upstream meatadata (.dist-info or egg-info directories/files). It has
nothing to do with imports. See for example data in
This file makes sure that packages called python3-requests provide
python-requests and python3.9-requests.
There is no generator that parses Python imports (and never has been), sorry.