Closed toni-neurosc closed 1 month ago
So at some point I had it working... but now it for some reason it's crashing, and the crash dumps suggest it has to do with the Xorg server, but XVFB was working fine at some point, not sure why it suddently started crashing the Github runners...
PS. So when running multithreaded pytest with pytest-xdist, 87% of the tests manage to be completed, I guess because the workers that don't crash pick up the tests that don't cause crashing and complete them. The tests that crash are: FAILED tests/test_all_examples.py::test_run_through_all_test[example_filename0] FAILED tests/test_all_examples.py::test_run_through_all_test[example_filename2] FAILED tests/test_all_examples.py::test_run_through_all_test[example_filename5] FAILED tests/test_all_examples.py::test_run_through_all_test[example_filename6]
PS2. the example scripts that crashed are:
What all those have in common is pyplot.figure, which goes to matplotlib/backends/backend_qt.py
and then it crashes when it hits _create_qApp
I can imagine the version of Qt that I put in the dependencies is breaking matplotlib somehow, perhaps?
Alright, problem solved, I changed the matplotlib backend to Tkinter in init.py
import matplotlib
# Set matplotlib backend to TkAgg because it crashes with the Qt5 install we're using for LSL
matplotlib.use("tkagg")
Well that was a real pain in the ass to figure out... but good to know for the future
I also made it so that the environment variable for liblsl shared library files (MNE_LSL_LIB) is set within init.py, that should help distributing the libraries together with the whole Python package
I reviewed the merge conflicts between the refactored main branch and the LSL branch, there were actually not so many of them, check the changes and merge please.
EDIT: So I have made a bunch more changes needed to fix the tests, some of them are temporary and need to be addressed:
pynput
depends on Xorg and since the Github runner is headless it was throwing an error. It's a fix for now but we need to find a solution for this... (or maybe its fine like this?)raw_data_generator
to return a tuple of[None, data]
, same as LSLStream get_next_batch(), otherwise tests would crash on wrong number of outputs for unpackingliblsl
with including the dynamic library files in the repo itself, under the "liblsl" folder, and using the Github actions matrix to set the properMNE_LSL_LIB
variable for each OS. We need to figure out how to deal with shipping this libraries when building with Hatch to ship to PyPIPS. The Qt dependency is introduced by mne_lsl class StreamViewer. Are you using this class only for testing purposes @SamedVossberg? I think we should not rely on third party GUI apps/widgets when we start developing our own GUI, otherwise we will be forced to use the same backend/library as the tools we depend on (in this case Qt5)