[Rpm-maint] [rpm-software-management/rpm] Python module's name changed unnecessarily, making it impossible to express dependencies on it (#373)

Adam Williamson notifications at github.com
Fri Dec 22 22:40:06 UTC 2017


No. You're wrong. Really, you're wrong. It's very simple to demonstrate. These are the steps.

    git clone https://pagure.io/fedora-qa/relvalconsumer.git
    cd relvalconsumer
    git checkout 1.1.0
    sudo python setup.py install

Try that with an older `python2-rpm` installed, and it will work. Try it with a recent `python2-rpm` installed, and you will get this:

    Searching for rpm-python
    Reading https://pypi.python.org/simple/rpm-python/
    Couldn't find index page for 'rpm-python' (maybe misspelled?)
    Scanning index of all packages (this may take a while)
    Reading https://pypi.python.org/simple/
    No local packages or working download links found for rpm-python
    error: Could not find suitable distribution for Requirement.parse('rpm-python')

If you then edit the file `install.requires` and change the line `rpm-python` to read `rpm`, the opposite will happen: `sudo python setup.py install` will work with a newer `python2-rpm`, but fail with an older one.

The text you quote doesn't mean what you think it means. It's talking about how `pkg_resources` locates *egg files*, not libraries. It finds all egg files that are located "in a directory on sys.path", and then it reads them. And one of the things it reads out of them is...the name they specify. And it's that name that it uses for dependency resolution purposes. If the name in the egg file is `rpm-python`, then your requirement needs to say `rpm-python`. If the name in the egg file is `rpm`, then your requirement needs to say `rpm`. It doesn't matter at all that the actual Python module that the egg file is for is called `rpm` in both cases. `pkg_resources` does not know or care.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/373#issuecomment-353685632
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20171222/9e3c1243/attachment.html>


More information about the Rpm-maint mailing list