rpmlint
rpmlint copied to clipboard
Python packages testing check
With the openSUSE packages when looking on what we do we should do following checks on python packages:
- verify the egg-info is folder (setuptools based) and not file (distutils) to make pip works
- validate requires really match up the egg-info requires
- move the forbidden dirs from https://github.com/rpm-software-management/rpmlint/blob/opensuse/rpmlint/checks/FilelistCheck.toml#L86 to the check and expand also on subfolders ; there should be no need to ship tests i.e. (except few known cases, so this should be warning)
I think number 2 is hopefully not going to be needed anymore once the dependency generator is fully enabled in openSUSE like it is in RH/Fedora and Mageia. In Fedora, Mageia, OpenMandriva, ROSA, etc., we don't have this problem.
I do not think we should codify deleting content from Python packages in rpmlint upstream. For a couple of reasons: there are enough valuable reasons to ship test code and we can't reasonably determine the test code is just test code.
But number 1 would make openSUSE fail this check. 😉 There are a number of packages that have been deliberately forced from setuptools to distutils (which you are likely aware of that!), even though I think that's a bad idea...
We will never use that dependency generator in openSUSE, we can't and won't do those cycles that it causes.
There are 2 cases:
- tests are directly in site-pacakges/tests so all the packages conflicts, that we already check and error
- tests in the proper subfolder, that can be warning as we should be running those tests arleady.
And we actually already fake the egg-info if needed, so it is more like to fix the packages that accidentaly didn't pull the setuptools or were overlooked to have the egg-info properly.
We will never use that dependency generator in openSUSE, we can't and won't do those cycles that it causes.
It only causes those cycles because you made it that way. That is definitely fixable and you know it. And I'm looking at removing setuptools as a dependency for Python 3.8+ anyway. But you need to fix this problem openSUSE created with setuptools.
tests are directly in site-pacakges/tests so all the packages conflicts, that we already check and error
This part I agree with. We should definitely have an error here.
This is also a problem because we do automatic rebuilds. while most other distros dont. so you dont see the cycles.
@darix Bullshit. I know damn well about the cycles. And even though Fedora doesn't commit those auto-rebuilds, we do them too with Koschei. setuptools cycles because you've extracted some vendored dependencies that normally depend on setuptools.
That said, again, you need to stop breaking the usability of setuptools as low-level Python component.
@darix Bullshit. I know damn well about the cycles.
And do you do something about them? So you know that your https://src.fedoraproject.org/rpms/python3.9/blob/master/f/python3.9.spec BuildRequires bluez-libs-devel, which requires (recursively through glib2 at least) python again? That’s just one cycle I am thinking about right now.
There's a PR related to this that's not linked in this issue: https://github.com/rpm-software-management/rpmlint/pull/430
I think this issue can be closed now that #955 has been merged
Yep, great work @danigm.