I am trying to test the coverage in my extension. This is easily performed by pytest --cov-report term --cov=Dosimetry4D
However this results in
$ pytest --cov-report term --cov=Dosimetry4D
Failed to import the site module
Traceback (most recent call last):
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 553, in <module>
main()
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 539, in main
known_paths = addusersitepackages(known_paths)
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 282, in addusersitepackages
user_site = getusersitepackages()
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 258, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 248, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/src/Slicer-build/python-install/lib/python3.6/sysconfig.py", line 601, in get_config_var
return get_config_vars().get(name)
File "/usr/src/Slicer-build/python-install/lib/python3.6/sysconfig.py", line 550, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/src/Slicer-build/python-install/lib/python3.6/sysconfig.py", line 421, in _init_posix
_temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata_m_linux_x86_64-linux-gnu'
ERROR: Job failed: exit code 1
FATAL: exit code 1
I have found this topic addressing the same issue with python 3.6. This bug is not critical but it is annoying and eventually will raise another bug.
Maybe this is the starting point for you to consider to move to python 3.8.
For me, attempt to start gdb fails with the same error. From the bug report you referenced, it is not clear for me if this is solved in Python 3.8, but Iām not an experienced Linux user. It would be great if you could investigate this further, for example try to build Slicer with Python 3.8 and see if the problem is fixed.
In the meanwhile, I am testing Slicer with python 3.6.12 and so far the build is ok, when I tested it I will propose a PR to upgrade to 3.6.12 which is harmless and less traumatic.
The version with python 3.6.12 is running ok in ubuntu and docker. But the issue remains
$ pytest --cov-report term --cov=Dosimetry4D
Failed to import the site module
Traceback (most recent call last):
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 553, in <module>
main()
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 539, in main
known_paths = addusersitepackages(known_paths)
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 282, in addusersitepackages
user_site = getusersitepackages()
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 258, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/src/Slicer-build/python-install/lib/python3.6/site.py", line 248, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/src/Slicer-build/python-install/lib/python3.6/sysconfig.py", line 601, in get_config_var
return get_config_vars().get(name)
File "/usr/src/Slicer-build/python-install/lib/python3.6/sysconfig.py", line 550, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/src/Slicer-build/python-install/lib/python3.6/sysconfig.py", line 421, in _init_posix
_temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata_m_linux_x86_64-linux-gnu'
ERROR: Job failed: exit code 1
I will skip coverage for now.
You can use the docker image at: bishopwolf/slicer3d-nightly:0.4.1