talmolab / sleap

A deep learning framework for multi-animal pose tracking.
https://sleap.ai
Other
435 stars 97 forks source link

Explicitly state where qt plugins are #1460

Closed roomrys closed 1 year ago

roomrys commented 1 year ago

Description

Apparently, if different versions of cv2 and pyqt are used, then we run into trouble...

This is what trouble looks like for us (action):

 tests/test_version.py .                                                  [  9%]
Fatal Python error: Aborted

Current thread 0x00007fc7f5b48b80 (most recent call first):
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pytestqt/plugin.py", line 66 in qapp
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 902 in call_fixture_func
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 1123 in pytest_fixture_setup
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 80 in _multicall
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_manager.py", line 112 in _hookexec
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_hooks.py", line 433 in __call__
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 1069 in execute
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 693 in _compute_fixture_value
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 607 in _get_active_fixturedef
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 585 in getfixturevalue
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 566 in _fillfixtures
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/python.py", line 1791 in setup
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/runner.py", line 494 in setup
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/runner.py", line 157 in pytest_runtest_setup
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 80 in _multicall
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_manager.py", line 112 in _hookexec
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_hooks.py", line 433 in __call__
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/runner.py", line 262 in <lambda>
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/runner.py", line 341 in from_call
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/runner.py", line 262 in call_runtest_hook
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/runner.py", line 222 in call_and_report
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/runner.py", line 127 in runtestprotocol
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/runner.py", line 114 in pytest_runtest_protocol
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 80 in _multicall
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_manager.py", line 112 in _hookexec
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_hooks.py", line 433 in __call__
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/main.py", line 349 in pytest_runtestloop
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 80 in _multicall
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_manager.py", line 112 in _hookexec
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_hooks.py", line 433 in __call__
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/main.py", line 324 in _main
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/main.py", line 270 in wrap_session
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/main.py", line 317 in pytest_cmdline_main
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 80 in _multicall
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_manager.py", line 112 in _hookexec
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pluggy/_hooks.py", line 433 in __call__
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line 167 in main
  File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line 189 in console_main
  File "/opt/hostedtoolcache/Python/3.7.17/x64/bin/pytest", line 8 in <module>
/home/runner/work/_temp/eb67c12d-8c8e-40e1-988c-e5deff7da563.sh: line 1:  2267 Aborted                 (core dumped) pytest tests
tests/gui/test_app.py 
Error: Process completed with exit code 134.

Sure, we could try to get the version of cv2 to match, but that isn't always possible (see #1258 90649c4 to 5dc74b2 where our dependencies require a different version of cv2) resulting in the same error (action).

This PR aims to merge what was thought to be a hack at the time into a robustifying feature.

Types of changes

Does this address any currently open issues?

[list open issues here]

Outside contributors checklist

Thank you for contributing to SLEAP!

:heart:

codecov[bot] commented 1 year ago

Codecov Report

Merging #1460 (b21c170) into develop (e0eebb2) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #1460   +/-   ##
========================================
  Coverage    73.05%   73.05%           
========================================
  Files          134      134           
  Lines        23857    23857           
========================================
  Hits         17429    17429           
  Misses        6428     6428           
Files Changed Coverage Δ
sleap/gui/app.py 75.38% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

roomrys commented 1 year ago

This pull request did not fix the problem it was intended to fix.