Bug 1213698

Summary: We have .cpython-311.pyc in non-311 packages
Product: [openSUSE] openSUSE Tumbleweed Reporter: Matej Cepl <mcepl>
Component: PythonAssignee: Daniel Garcia <daniel.garcia>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bwiedemann, daniel.garcia, steven.kowalik
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Matej Cepl 2023-07-26 22:45:46 UTC
I have been reminded about this:

-/usr/lib/python3.9/site-packages/blinker/__pycache__/base.cpython-311.pyc 6e33550a94efe8668e6b60422f1a674c9844fd6c44e92c0afcc5d98e71cf51cb 0
+/usr/lib/python3.9/site-packages/blinker/__pycache__/base.cpython-311.pyc 0b7e8cb203ad88028706b7204f007bb66a860cf3cfd6ebde4964a4caf6c248ef 0

why are 311.pyc files in the 3.9 path?

We run make html without specifying Python used. It runs the Sphinx builder with /usr/bin/python3 which is now Python 3.11 and it loads (and generates *.pyc) when collecting information on the installed libraries.

Suggested solution is https://stackoverflow.com/q/34025113/164233 and I have tried it in https://build.opensuse.org/request/show/1100942

However, it seems like too complicated problem (patching every package). Any other ideas?
Comment 1 Steve Kowalik 2023-07-27 05:25:44 UTC
An rpmlint check. Then we can catch them as they appear. If anyone has shell access to a mirror (or we do), a grep should find the victims quickly enough
Comment 3 Daniel Garcia 2023-07-31 12:06:45 UTC
Another option could be to call the sphinx module using "python -m" instead of calling "make html".

In this case I think this could also solve the problem, without a patch:

$python -m sphinx -M html . _build

Take a look to the following request:

https://build.opensuse.org/request/show/1101522
Comment 4 Daniel Garcia 2023-08-01 10:13:59 UTC
I've created a new check in rpmlint for this: https://github.com/rpm-software-management/rpmlint/pull/1095
Comment 5 OBSbugzilla Bot 2023-08-04 12:25:03 UTC
This is an autogenerated message for OBS integration:
This bug (1213698) was mentioned in
https://build.opensuse.org/request/show/1102380 Factory / python-blinker
Comment 6 Daniel Garcia 2023-08-07 07:20:05 UTC
The new check is now in rpmlint upstream. Now if different *.pyc versions are detected the warning 'python-pyc-multiple-versions' will be shown.