Re: Python dependency missing during RPM build

2020-11-19 Thread Richard W.M. Jones
On Thu, Nov 19, 2020 at 06:26:04PM +0100, Miro Hrončok wrote:
> There is no generator that parses Python imports (and never has been), sorry.

OK, fair enough.  It's not a big deal because I could add the
Requires line by hand.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: Python dependency missing during RPM build

2020-11-19 Thread Miro Hrončok

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 hand,
but I want to make sure I understand why it happens and whether
there's an easy fix.

   https://koji.fedoraproject.org/koji/taskinfo?taskID=55889416
   https://src.fedoraproject.org/rpms/nbdkit/blob/master/f/nbdkit.spec#_475

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
   /usr/share/doc/nbdkit-S3-plugin
   /usr/share/doc/nbdkit-S3-plugin/README
   /usr/share/licenses/nbdkit-S3-plugin
   /usr/share/licenses/nbdkit-S3-plugin/LICENSE
   /usr/share/man/man1/nbdkit-S3-plugin.1.gz

The automatically generated dependencies don't pick up the need for
python3-boto3.

   $ grep ^import nbdkit-S3-plugin
   import nbdkit
   import boto3

   $ rpm -qRp ./nbdkit-S3-plugin-1.23.9-1.fc34.x86_64.rpm
   /usr/sbin/nbdkit
   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.



/usr/lib/rpm/fileattrs/python.attr

This file makes sure that files installed into /usr/lib(64)/pythonX.Y require 
python(abi) = X.Y.



/usr/lib/rpm/fileattrs/pythondist.attr

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 
/usr/lib/python3.9/site-packages/requests-2.24.0-py3.9.egg-info/requires.txt.



/usr/lib/rpm/fileattrs/pythonname.attr

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.

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
___
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org


Re: Python dependency missing during RPM build

2020-11-19 Thread Miro Hrončok

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 hand,
but I want to make sure I understand why it happens and whether
there's an easy fix.

   https://koji.fedoraproject.org/koji/taskinfo?taskID=55889416
   https://src.fedoraproject.org/rpms/nbdkit/blob/master/f/nbdkit.spec#_475

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
   /usr/share/doc/nbdkit-S3-plugin
   /usr/share/doc/nbdkit-S3-plugin/README
   /usr/share/licenses/nbdkit-S3-plugin
   /usr/share/licenses/nbdkit-S3-plugin/LICENSE
   /usr/share/man/man1/nbdkit-S3-plugin.1.gz

The automatically generated dependencies don't pick up the need for
python3-boto3.

   $ grep ^import nbdkit-S3-plugin
   import nbdkit
   import boto3

   $ rpm -qRp ./nbdkit-S3-plugin-1.23.9-1.fc34.x86_64.rpm
   /usr/sbin/nbdkit
   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.



/usr/lib/rpm/fileattrs/python.attr

This file makes sure that files installed into /usr/lib(64)/pythonX.Y require 
python(abi) = X.Y.



/usr/lib/rpm/fileattrs/pythondist.attr

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 
/usr/lib/python3.9/site-packages/requests-2.24.0-py3.9.egg-info/requires.txt.



/usr/lib/rpm/fileattrs/pythonname.attr

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.

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Python dependency missing during RPM build

2020-11-19 Thread Richard W.M. Jones
It's not a big deal because I added the Python Requires: line by hand,
but I want to make sure I understand why it happens and whether
there's an easy fix.

  https://koji.fedoraproject.org/koji/taskinfo?taskID=55889416
  https://src.fedoraproject.org/rpms/nbdkit/blob/master/f/nbdkit.spec#_475

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
  /usr/share/doc/nbdkit-S3-plugin
  /usr/share/doc/nbdkit-S3-plugin/README
  /usr/share/licenses/nbdkit-S3-plugin
  /usr/share/licenses/nbdkit-S3-plugin/LICENSE
  /usr/share/man/man1/nbdkit-S3-plugin.1.gz

The automatically generated dependencies don't pick up the need for
python3-boto3.

  $ grep ^import nbdkit-S3-plugin
  import nbdkit
  import boto3

  $ rpm -qRp ./nbdkit-S3-plugin-1.23.9-1.fc34.x86_64.rpm 
  /usr/sbin/nbdkit
  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?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org