Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

napari test requirement #51

Merged
merged 22 commits into from
Dec 4, 2020
Merged

napari test requirement #51

merged 22 commits into from
Dec 4, 2020

Conversation

joshmoore
Copy link
Member

@joshmoore joshmoore commented Oct 1, 2020

Registering napari-conftest as a plugin in setup.py
makes a hard-requirement on napari. This PR moves the
requirement to tests only and registers the pytest
plugin at runtime.

With thanks to @Czaki

see #napari/napari#1661

Note: that the environment.yml file is currently not tested by this PR and I in fact needed to actively remove tox-conda to get things to work. We will likely need to either remove it (in favor of an ome-zarr package on conda?) or add in separate testing.

Registering napari-conftest as a plugin in setup.py
makes a hard-requirement on napari. This PR moves the
requirement to tests only and registers the pytest
plugin at runtime.

With thanks to @Czaki

see #napari/napari#1661
@joshmoore
Copy link
Member Author

@tlambert03 : somewhere you had pointed me to a Qt-testing-in-GitHub-Actions solution that you had come up with. Can you point me to that pointer?

@Czaki
Copy link

Czaki commented Oct 23, 2020

@joshmoore joshmoore force-pushed the napari-conftest branch 4 times, most recently from 4a41e1f to cb29a35 Compare December 3, 2020 16:15
@joshmoore
Copy link
Member Author

Import suggestion from @Czaki in #67 solved the issue, though I think it seems un-pytest-plugin-y. Now hitting a missing on_draw though it looks like the napari test suite still uses this.

299 def test_viewer(self, make_test_viewer):  # noqa
300 """example of testing the viewer."""
301 viewer = make_test_viewer()
302
303 shapes = [(4000, 3000), (2000, 1500), (1000, 750), (500, 375)]
304 np.random.seed(0)
305 data = [np.random.random(s) for s in shapes]
306 _ = viewer.add_image(data, multiscale=True, contrast_limits=[0, 1])
307 layer = viewer.layers[0]
308
309 # Set canvas size to target amount
310 viewer.window.qt_viewer.view.canvas.size = (800, 600)
311 >       viewer.window.qt_viewer.on_draw(None)
312 E       AttributeError: 'QtViewer' object has no attribute 'on_draw'

@joshmoore joshmoore mentioned this pull request Dec 4, 2020
@Czaki
Copy link

Czaki commented Dec 4, 2020

This error with on_draw is connected with an older version of napari. This test should be disabled for python 3.6 (or has some inner if, to use different methods for this python version)

@Czaki
Copy link

Czaki commented Dec 4, 2020

I have already seen a problem with python 3.7 Pyside2 on Linux. I check in my code and skip this case in tests.

@joshmoore
Copy link
Member Author

Thanks, @Czaki. Yeah, don't think I'll try to tackle this segfault:

=============================== warnings summary ===============================
.tox/py37-PySide2/lib/python3.7/site-packages/napari/utils/events/dataclass.py:184: 40 warnings
  /home/runner/work/ome-zarr-py/ome-zarr-py/.tox/py37-PySide2/lib/python3.7/site-packages/napari/utils/events/dataclass.py:184: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
    different = np.any(before != after)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================= 24 passed, 40 warnings in 11.55s =======================
Fatal Python error: Segmentation fault

Thread 0x00007f7735ffb700 (most recent call first):
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/multiprocessing/pool.py", line 470 in _handle_results
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 870 in run
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 890 in _bootstrap

Thread 0x00007f77367fc700 (most recent call first):
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/multiprocessing/pool.py", line 422 in _handle_tasks
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 870 in run
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 890 in _bootstrap

Thread 0x00007f7736ffd700 (most recent call first):
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/multiprocessing/pool.py", line 413 in _handle_workers
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 870 in run
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 890 in _bootstrap

Thread 0x00007f77377fe700 (most recent call first):
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/multiprocessing/pool.py", line 110 in worker
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 870 in run
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 890 in _bootstrap

Thread 0x00007f7737fff700 (most recent call first):
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/multiprocessing/pool.py", line 110 in worker
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 870 in run
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 890 in _bootstrap

Thread 0x00007f777666f700 (most recent call first):
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 296 in wait
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 552 in wait
  File "/home/runner/work/ome-zarr-py/ome-zarr-py/.tox/py37-PySide2/lib/python3.7/site-packages/napari/components/experimental/chunk/_delay_queue.py", line 151 in run
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/threading.py", line 890 in _bootstrap

Current thread 0x00007f778129b680 (most recent call first):
ERROR: InvocationError for command /home/runner/work/ome-zarr-py/ome-zarr-py/.tox/py37-PySide2/bin/pytest tests (exited with code -11 (SIGSEGV)) (exited with code -11)

Copy link

@Czaki Czaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few remarks.

Comment on lines +14 to +15
- {os: windows-latest, python_Version: '3.6', toxenv: 'py36-PyQt5'}
- {os: windows-latest, python_Version: '3.6', toxenv: 'py36-PySide2'}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no py36-PyQt5 and py36-PySide2 entries in tox files.

tox.ini Outdated
PySide2: PySide2!=5.15.0

commands =
pip install .[napari]
Copy link

@Czaki Czaki Dec 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pip install .[napari] is not necsssary

tox.ini Show resolved Hide resolved
@joshmoore
Copy link
Member Author

Thanks, @Czaki, but still getting failures on linux && (mac/py.39)

@Czaki
Copy link

Czaki commented Dec 4, 2020

Thanks, @Czaki, but still getting failures on linux && (mac/py.39)

As I see it fails on installed numcodecs which dose not provide a wheel for python 3.9.

**     c-blosc/internal-complibs/zlib-1.2.8/gzlib.c:256:24: error: implicit declaration of function 'lseek' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
**

maybe disable python 3.9 test with napari.

@Czaki
Copy link

Czaki commented Dec 4, 2020

It is hard to tell something about linux when see this:
Zrzut ekranu z 2020-12-04 13-46-54

@joshmoore
Copy link
Member Author

Agreed! That has only started happening today. As for numcodecs & the wheel, yes, the other alternative would be to go back to conda. What do you think?

@Czaki
Copy link

Czaki commented Dec 4, 2020

Agreed! That has only started happening today. As for numcodecs & the wheel, yes, the other alternative would be to go back to conda. What do you think?

The big problem with conda is that it goes with preinstalled qt in the old version (5.9) which breaks napari tests.

Personally, I will skip testing this for python 3.9 and open issue on numcodecs repository. Napari itself has no test for python 3.9. So creating test set which depends on untested napari may be not the best idea.

If I good remember there is problem with vispy which install on python 3.9 but will not run (maybe it was solved? @sofroniewn @jni did you know?)

@joshmoore
Copy link
Member Author

The big problem with conda is that it goes with preinstalled qt in the old version (5.9) which breaks napari tests.

Understood. Thanks for the heads up. Unfortunate then that we tried to do all of our workshops for I2K with conda.

Napari itself has no test for python 3.9. So creating test set which depends on untested napari may be not the best idea.

Wow. Ok. I recently had issues using anything other than 3.9 (at least on Mac Big Sur). I guess 3.8 is the sweet spot then.

@tlambert03
Copy link
Contributor

If I good remember there is problem with vispy which install on python 3.9 but will not run (maybe it was solved? @sofroniewn @jni did you know?)

that was solved in vispy/vispy#1914 and released in vispy 0.6.6

@Czaki
Copy link

Czaki commented Dec 4, 2020

Wow. Ok. I recently had issues using anything other than 3.9 (at least on Mac Big Sur). I guess 3.8 is the sweet spot then.

There is work on enabling python 3.8 on ARM BigSure. pypa/wheel#387 (comment)

Understood. Thanks for the heads up. Unfortunate then that we tried to do all of our workshops for I2K with conda.

It does not break napari itself but breaks napari tests. Also It is possible to uninstall but it increases the complication of the process. Maybe it is simpler than I think. I'm not very familiar with conda, so maybe I chose the wrong way. Maybe someone from napari maintainers could help here.

@joshmoore
Copy link
Member Author

joshmoore commented Dec 4, 2020

Ok. As it stands, we're green. In summary:

  • Python 3.6 is only tested on Windows
  • Python 3.9 is not tested on Mac
  • No Python versions are tested on Linux
  • The make_test_viewer plugin still requires an odd import & registration (without registration `E ValueError: no option named '--show-viewer' is thrown)

I think it's still enough testing for the purposes of ome-zarr, but help finding reliable CI testing across the spectrum would be appreciated, and I'd certainly also be interested in doing that with conda (both within CI and outwith). However, that can all be handled elsewhere.

@joshmoore
Copy link
Member Author

P.S.

It does not break napari itself but breaks napari tests.

We did have workshop attendees who had trouble with napari+conda.

@@ -0,0 +1,8 @@
black
napari
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Czaki, for a follow-up, thoughts on removing this if we're handling it via the "extras = " setting?

@joshmoore
Copy link
Member Author

Merging. I'll be opening an immediate follow-up to activate coverage testing. Happy to make adjustments there.

@joshmoore joshmoore merged commit 6f2700b into ome:master Dec 4, 2020
@joshmoore joshmoore deleted the napari-conftest branch December 4, 2020 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants