rpmlint icon indicating copy to clipboard operation
rpmlint copied to clipboard

Python packages testing check

Open scarabeusiv opened this issue 5 years ago • 7 comments

With the openSUSE packages when looking on what we do we should do following checks on python packages:

  1. verify the egg-info is folder (setuptools based) and not file (distutils) to make pip works
  2. validate requires really match up the egg-info requires
  3. 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)

scarabeusiv avatar Apr 03 '20 09:04 scarabeusiv

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...

Conan-Kudo avatar Apr 03 '20 09:04 Conan-Kudo

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:

  1. tests are directly in site-pacakges/tests so all the packages conflicts, that we already check and error
  2. 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.

scarabeusiv avatar Apr 03 '20 09:04 scarabeusiv

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.

Conan-Kudo avatar Apr 03 '20 09:04 Conan-Kudo

This is also a problem because we do automatic rebuilds. while most other distros dont. so you dont see the cycles.

darix avatar Apr 17 '20 12:04 darix

@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.

Conan-Kudo avatar Apr 17 '20 13:04 Conan-Kudo

@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.

mcepl avatar Oct 19 '20 15:10 mcepl

There's a PR related to this that's not linked in this issue: https://github.com/rpm-software-management/rpmlint/pull/430

danigm avatar Oct 13 '22 12:10 danigm

I think this issue can be closed now that #955 has been merged

danigm avatar Nov 17 '22 08:11 danigm

Yep, great work @danigm.

marxin avatar Nov 17 '22 09:11 marxin