Description of problem: We have various python packages that provide mpich and openmpi variants in a separate subpackage. For the ones that have egg-info, the dependency generator creates pythonX.Ydist() and pythonXdist() provides. But those modules are not directly importable in python (they are outside of the normal sys.path), and only become loadable when the specific mpich or openmpi environment module is loaded. For example mpi4py: $ dnf repoquery --release=rawhide --whatprovides 'python2.7dist(mpi4py)' python2-mpi4py-mpich-0:3.0.0-4.fc29.x86_64 python2-mpi4py-openmpi-0:3.0.0-4.fc29.x86_64 $ rpm -q python2-mpi4py-mpich python2-mpi4py-mpich-2.0.0-14.fc27.x86_64 $ python2 -m mpi4py /usr/bin/python2: No module named mpi4py $ module load mpi/mpich-x86_64 $ python2 -m mpi4py Usage: mpi4py [options] <command> [args] I don't see why the dependency script would look at the egg-info files outside of usual python path. This makes it impossible to reliably use generated dependencies from other packages. Version-Release number of selected component (if applicable): I think this applies across all versions where python provides are automatically generated. (I have a vague memory of this coming up before, but I can't find any links. Please excuse my short memory.)
Neal, could you please have a look?
Now, feel free for someone to correct me on this, but I *think* this is caused by how the regex actually works: This is the regex: ^/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]/.*\\.(dist.*|egg.*)$ Note the ".*" between "python[[:digit:]]\\.[[:digit:]]/" and "\\.(dist.*|egg.*)$". That means it'd match for every path that fits within, which includes paths like "/usr/lib64/python2.7/site-packages/mpich/mpi4py-3.0.0-py2.7.egg-info". I'd love to tighten this, but I'm not sure how, as my command of regex isn't that great...
So there are additional problems with this regexp. I'll match anything that has "dist" and "egg" in it, e.g. /usr/lib/python3.7/eggplant.py, /usr/lib64/python3.6/site-packages/sipdistutils.py. I'd also simplify it by not using [[:digit:]], because [0-9] is shorter. I looked for all files containing "dist" or "egg", and apart from the obvious accidental matches like sipdistutils.py, they all have either .dist-info or .egg-info suffix. I think the regex should be something like this: ^/usr/lib(64)?/python[0-9]\\.[0-9]/[^/]*\\.(dist|egg)-info$
Also add a + after [0-9]\.[0-9] so it will match Python 3.10 in a few years. ^/usr/lib(64)?/python[0-9]\\.[0-9]+/[^/]*\\.(dist|egg)-info$
(In reply to Zbigniew Jędrzejewski-Szmek from comment #3) > So there are additional problems with this regexp. I'll match anything that > has "dist" and "egg" in it, e.g. /usr/lib/python3.7/eggplant.py, > /usr/lib64/python3.6/site-packages/sipdistutils.py. > > I'd also simplify it by not using [[:digit:]], because [0-9] is shorter. > > I looked for all files containing "dist" or "egg", and apart from the > obvious accidental matches like sipdistutils.py, they all have either > .dist-info or .egg-info suffix. > > I think the regex should be something like this: > ^/usr/lib(64)?/python[0-9]\\.[0-9]/[^/]*\\.(dist|egg)-info$ The generator is capable of generating dependencies on .egg and can follow .egg-link files.
I suppose technically we could read .whl, too... That said, I don't think we want either .egg or .whl files read.
Right. So the pattern should much whatever specific extensions are wanted, but not more. So something like: ^/usr/lib(64)?/python[0-9]\\.[0-9]/[^/]*\\.(dist-info|egg-info|egg-link)$ (with whatever other items added in the parenthesized section as needed.)
Neal, are you working on this? Should we take over?
I'm working on this, I'll have something proposed in rpm upstream soonish.
I've proposed a change in upstream RPM for this: https://github.com/rpm-software-management/rpm/pull/562
python-rpm-generators-6-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b45f3b5978
python-rpm-generators-6-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b45f3b5978
python-rpm-generators-6-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.