On Mon, Apr 1, 2019 at 7:40 PM Orion Poplawski <orion@nwra.com> wrote:
I've noticed a few times now where a python package unexpectedly
produces an egg-info file instead of a directory.  This is particularly
troubling in light of rpm's inability to replace a directory with a file:

https://fedoraproject.org/wiki/Packaging:Directory_Replacement

This seems to come about in the case of a project using distutils with
incorrect options:

running install_egg_info
Writing
/builddir/build/BUILDROOT/python-pkgconfig-1.5.1-1.fc31.x86_64/usr/lib/python3.7/site-packages/pkgconfig-1.5.1-py3.7.egg-info
/usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown
distribution option: 'python_requires'
   warnings.warn(msg)

In the case of pkgconfig, this appears to be coming about due to the use
of "poetry" which seems to incorrectly be using distutils instead of
setuptools:

https://github.com/sdispater/poetry/issues/866

In any case - please be careful with changing egg-info format - and do
use ....egg-info/  in your specs to ensure that the format is a
directory as expected.

An egg-info file is not "incorrect"  but you are right that you have to be aware of it because of the rpm limitations.

In the past, if upstream had moved from setuptools to distutils, I would patch the package to use setuptools until the next Python package upgrade in Fedora.  Since that would need a different site-packages directory to upgrade (for instance, the egg-info directory in the old package would have been /usr/lib/python3.6/site-packages/foo*.egg-info/  and in the new package it would be a file in /usr/lib/python3.7/site-packages/foo*.egg-info ), it was a good time to remove my local patch and return to what upstream had decided to use.

-Toshio