Re: Bug#1061765: Help needed to fix python-coverage-test-runner

2024-02-23 Thread Gunnar Wolf
Andreas Tille dijo [Fri, Feb 23, 2024 at 03:22:27PM +0100]:
> HI Andrius,
> 
> Am Fri, Feb 23, 2024 at 09:29:27AM +0200 schrieb Andrius Merkys:
> > > ModuleNotFoundError: No module named 'imp'
> > 
> > I had a similar problem. I worked it around by depending on
> > python3-zombie-imp, the original code did not require any modifications.
> 
> Nice hint - implemented.

Thank you very much for your work, Andreas!



Re: Help needed to fix python-coverage-test-runner

2024-02-23 Thread Andreas Tille
HI Andrius,

Am Fri, Feb 23, 2024 at 09:29:27AM +0200 schrieb Andrius Merkys:
> > ModuleNotFoundError: No module named 'imp'
> 
> I had a similar problem. I worked it around by depending on
> python3-zombie-imp, the original code did not require any modifications.

Nice hint - implemented.

Thanks a lot
   Andreas. 

-- 
http://fam-tille.de



Re: Help needed to fix python-coverage-test-runner

2024-02-22 Thread Andrius Merkys

Hi Andreas,

On 2024-02-23 09:15, Andreas Tille wrote:

I've attempted to fix python-coverage-test-runner in Git since this
package is finally responsible for the failure of vmdb2:

  File "/usr/lib/python3/dist-packages/CoverageTestRunner.py", line 22,
in 
 import imp
ModuleNotFoundError: No module named 'imp'


I had a similar problem. I worked it around by depending on 
python3-zombie-imp, the original code did not require any modifications.


Best,
Andrius



Help needed to fix python-coverage-test-runner

2024-02-22 Thread Andreas Tille
Control: tags -1 help

Hi,

I've attempted to fix python-coverage-test-runner in Git since this
package is finally responsible for the failure of vmdb2:

 File "/usr/lib/python3/dist-packages/CoverageTestRunner.py", line 22, 
in 
import imp
ModuleNotFoundError: No module named 'imp'

In the patch in Git[1] I replaced imp by importlib (and distutils by
setuptools but this is not causing actual problems).  Unfortunately
when trying to run vmdb2 test against this patched package I get:

./check
Running unit tests 
Traceback (most recent call last):
  File "", line 198, in _run_module_as_main
  File "", line 88, in _run_code
  File "/usr/lib/python3/dist-packages/CoverageTestRunner.py", line 313, in 

run()
  File "/usr/lib/python3/dist-packages/CoverageTestRunner.py", line 304, in run
result = runner.run()
 
  File "/usr/lib/python3/dist-packages/CoverageTestRunner.py", line 211, in run
importlib.reload(module)
  File "/usr/lib/python3.11/importlib/__init__.py", line 148, in reload
raise ImportError(msg.format(name), name=name)
ImportError: module plugin not in sys.modules


The fact that
   importlib.reload(module)

makes me wonder whether my patch for _load_module_from_pathname() is
correct (despite when I added some debug lines it looked sensible).  Any
help is welcome.

Kind regards
Andreas.

[1] 
https://salsa.debian.org/python-team/packages/python-coverage-test-runner/-/blob/master/debian/patches/Python3.12.patch?ref_type=heads

-- 
http://fam-tille.de