#319 Filter koji and rpm-py-installer from install_requires when building rpm
Closed by churchyard. Opened by churchyard.
churchyard/rpkg filer-requires  into  master

Download 319.patch

See https://bugzilla.redhat.com/show_bug.cgi?id=1579367

(untested)

@churchyard Thanks for making this patch. how about use this logic (I also mentioned in that bug)

try:
    import rpm
except ImportError:
    rpm = None
if rpm is None:
    # For the case of running in a clean Python virtualenv.
    # Next time, rpm will be available.
    install_requires.append('rpm-py-installer')
else:
    # Whatever in a Python virtualenv with rpm-py-installer installed,
    # or python3-rpm is installed in the system
    install_requires.append('rpm')

One of the points to use this logic is to not mention RPM_BUILD_ROOT in rpkg source code in order to decouple with the build system.

For the koji, I think we can patch the SPEC to remove it from requirements/pypi.txt as a workaround before Koji team fixes https://pagure.io/koji/issue/912

What do you think?

install_requires.append('rpm') will put rpm in /usr/lib/python3.6/site-packages/rpkg-1.54-py3.6.egg-info/requires.txt and that is available apparently via /usr/lib64/python3.6/site-packages/rpm-4.14.1-py3.6.egg-info.

So this should work, ok.

@churchyard Are you going to update this patch? BTW, @jaruga suggests a better version in https://bugzilla.redhat.com/show_bug.cgi?id=1579367#c10

I thought we close this and you commit your version (or @jaruga's).

Pull-Request has been closed by churchyard

Metadata