napari / cookiecutter-napari-plugin

Cookiecutter for napari plugins
BSD 3-Clause "New" or "Revised" License
67 stars 39 forks source link

Automated Github Tests Failing on Windows in New napari Plugin Version, Local Tests Work #161

Closed zoccoler closed 1 year ago

zoccoler commented 1 year ago

🐛 Bug

Hi guys!

I have just updated napari-crop plugin to a new version, but I did not change anything in the workflow file. Still, tests are failing now on Github with Windows and unfortunately I cannot understand why 😕 Tests work fine locally and I am working with a Windows 10 machine. I ran my local tests in a conda environment with python 3.9. This is the error page: https://github.com/BiAPoL/napari-crop/actions/runs/5391343545/jobs/9788049527

Is there anything I must change in the workflow file for this to work?

Thanks for any guidance on this!

To Reproduce

Check the workflow error page: https://github.com/BiAPoL/napari-crop/actions/runs/5391343545/jobs/9788049527 And the workflow file: https://github.com/BiAPoL/napari-crop/blob/8c83d796d36b84bbaa1d679ff8b722de516b656f/.github/workflows/test_and_deploy.yml

Expected behavior

Tests should work the same as local tests, at least for Windows 10 in this case.

Environment

This is my local environment:

Click me ``` # Name Version Build Channel alabaster 0.7.13 pyhd8ed1ab_0 conda-forge aom 3.5.0 h63175ca_0 conda-forge app-model 0.1.4 pyhd8ed1ab_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge asciitree 0.3.3 py_2 conda-forge asttokens 2.2.1 pyhd8ed1ab_0 conda-forge attrs 23.1.0 pyh71513ae_1 conda-forge autopep8 2.0.2 pypi_0 pypi aws-c-auth 0.6.28 habb20d3_5 conda-forge aws-c-cal 0.5.27 hc655790_0 conda-forge aws-c-common 0.8.20 hcfcfb64_0 conda-forge aws-c-compression 0.2.17 h0a579c1_0 conda-forge aws-c-event-stream 0.3.0 h92d84d2_6 conda-forge aws-c-http 0.7.8 haeac8d2_4 conda-forge aws-c-io 0.13.26 hf956cbd_0 conda-forge aws-c-mqtt 0.8.13 h73587ab_2 conda-forge aws-c-s3 0.3.4 h26b4012_5 conda-forge aws-c-sdkutils 0.1.10 h0a579c1_0 conda-forge aws-checksums 0.1.16 h0a579c1_0 conda-forge aws-crt-cpp 0.20.2 h0db1998_9 conda-forge aws-sdk-cpp 1.10.57 ha442f66_14 conda-forge babel 2.12.1 pyhd8ed1ab_1 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 pyhd8ed1ab_3 conda-forge backports.functools_lru_cache 1.6.5 pyhd8ed1ab_0 conda-forge bleach 6.0.0 pypi_0 pypi blosc 1.21.4 hdccc3a2_0 conda-forge bokeh 3.2.0 pyhd8ed1ab_0 conda-forge brotli 1.0.9 hcfcfb64_8 conda-forge brotli-bin 1.0.9 hcfcfb64_8 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge c-ares 1.19.1 hcfcfb64_0 conda-forge c-blosc2 2.9.3 h183a6f4_0 conda-forge ca-certificates 2023.5.7 h56e8100_0 conda-forge cachey 0.2.1 pyh9f0ad1d_0 conda-forge certifi 2023.5.7 pyhd8ed1ab_0 conda-forge cfitsio 4.2.0 h9ebe7e4_0 conda-forge charls 2.4.2 h1537add_0 conda-forge charset-normalizer 3.1.0 pyhd8ed1ab_0 conda-forge click 8.1.3 win_pyhd8ed1ab_2 conda-forge cloudpickle 2.2.1 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge comm 0.1.3 pyhd8ed1ab_0 conda-forge contourpy 1.1.0 py39h1f6ef14_0 conda-forge cytoolz 0.12.0 py39ha55989b_1 conda-forge dask 2023.6.1 pyhd8ed1ab_0 conda-forge dask-core 2023.6.1 pyhd8ed1ab_0 conda-forge dav1d 1.2.1 hcfcfb64_0 conda-forge debugpy 1.6.7 py39h99910a6_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge distributed 2023.6.1 pyhd8ed1ab_0 conda-forge docstring_parser 0.15 pyhd8ed1ab_0 conda-forge docutils 0.17.1 py39hcbf5309_3 conda-forge entrypoints 0.4 pyhd8ed1ab_0 conda-forge exceptiongroup 1.1.1 pypi_0 pypi executing 1.2.0 pyhd8ed1ab_0 conda-forge fasteners 0.17.3 pyhd8ed1ab_0 conda-forge freetype 2.12.1 h546665d_1 conda-forge freetype-py 2.4.0 pyhd8ed1ab_0 conda-forge fsspec 2023.6.0 pyh1a96a4e_0 conda-forge gettext 0.21.1 h5728263_0 conda-forge giflib 5.2.1 h64bf75a_3 conda-forge glib 2.76.3 h12be248_0 conda-forge glib-tools 2.76.3 h12be248_0 conda-forge gst-plugins-base 1.22.4 h001b923_0 conda-forge gstreamer 1.22.4 hb4038d2_0 conda-forge heapdict 1.0.1 py_0 conda-forge hsluv 5.0.2 pyh44b312d_0 conda-forge icu 72.1 h63175ca_0 conda-forge idna 3.4 pyhd8ed1ab_0 conda-forge imagecodecs 2023.1.23 py39hd475b99_2 conda-forge imageio 2.31.1 pyh24c5eb1_0 conda-forge imagesize 1.4.1 pyhd8ed1ab_0 conda-forge importlib-metadata 6.7.0 pyha770c72_0 conda-forge importlib_metadata 6.7.0 hd8ed1ab_0 conda-forge importlib_resources 5.12.0 pyhd8ed1ab_0 conda-forge in-n-out 0.1.7 pyhd8ed1ab_0 conda-forge iniconfig 2.0.0 pypi_0 pypi intel-openmp 2023.1.0 h57928b3_46319 conda-forge ipykernel 6.23.3 pyh6817e22_0 conda-forge ipython 8.14.0 pyh08f2357_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge jaraco-classes 3.2.3 pypi_0 pypi jedi 0.18.2 pyhd8ed1ab_0 conda-forge jinja2 3.1.2 pyhd8ed1ab_1 conda-forge jsonschema 4.17.3 pyhd8ed1ab_0 conda-forge jupyter_client 8.3.0 pyhd8ed1ab_0 conda-forge jupyter_core 5.3.1 py39hcbf5309_0 conda-forge jxrlib 1.1 h8ffe710_2 conda-forge keyring 24.2.0 pypi_0 pypi kiwisolver 1.4.4 py39h1f6ef14_1 conda-forge krb5 1.20.1 heb0366b_0 conda-forge lazy_loader 0.2 pyhd8ed1ab_0 conda-forge lcms2 2.15 h3e3b177_1 conda-forge lerc 4.0.0 h63175ca_0 conda-forge libabseil 20230125.2 cxx17_h63175ca_2 conda-forge libaec 1.0.6 h63175ca_1 conda-forge libarrow 12.0.0 h71d8ae8_9_cpu conda-forge libavif 0.11.1 ha7b97ba_2 conda-forge libblas 3.9.0 17_win64_mkl conda-forge libbrotlicommon 1.0.9 hcfcfb64_8 conda-forge libbrotlidec 1.0.9 hcfcfb64_8 conda-forge libbrotlienc 1.0.9 hcfcfb64_8 conda-forge libcblas 3.9.0 17_win64_mkl conda-forge libclang 15.0.7 default_h77d9078_2 conda-forge libclang13 15.0.7 default_h77d9078_2 conda-forge libcrc32c 1.1.2 h0e60522_0 conda-forge libcurl 8.1.2 h68f0423_0 conda-forge libdeflate 1.18 hcfcfb64_0 conda-forge libevent 2.1.12 h3671451_1 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libglib 2.76.3 he8f3873_0 conda-forge libgoogle-cloud 2.12.0 hec1a1f0_0 conda-forge libgrpc 1.55.1 h0c1e3fa_1 conda-forge libhwloc 2.9.1 nocuda_h15da153_6 conda-forge libiconv 1.17 h8ffe710_0 conda-forge libjpeg-turbo 2.1.5.1 hcfcfb64_0 conda-forge liblapack 3.9.0 17_win64_mkl conda-forge libogg 1.3.4 h8ffe710_1 conda-forge libpng 1.6.39 h19919ed_0 conda-forge libprotobuf 4.23.2 h1975477_5 conda-forge libsodium 1.0.18 h8d14728_1 conda-forge libsqlite 3.42.0 hcfcfb64_0 conda-forge libssh2 1.11.0 h7dfc565_0 conda-forge libthrift 0.18.1 h06f6336_2 conda-forge libtiff 4.5.1 h6c8260b_0 conda-forge libutf8proc 2.8.0 h82a8f57_0 conda-forge libvorbis 1.3.7 h0e60522_0 conda-forge libwebp-base 1.3.0 hcfcfb64_0 conda-forge libxcb 1.15 hcd874cb_0 conda-forge libxml2 2.11.4 hc3477c8_0 conda-forge libzlib 1.2.13 hcfcfb64_5 conda-forge libzopfli 1.0.3 h0e60522_0 conda-forge locket 1.0.0 pyhd8ed1ab_0 conda-forge lz4 4.3.2 py39hf617134_0 conda-forge lz4-c 1.9.4 hcfcfb64_0 conda-forge m2w64-gcc-libgfortran 5.3.0 6 conda-forge m2w64-gcc-libs 5.3.0 7 conda-forge m2w64-gcc-libs-core 5.3.0 7 conda-forge m2w64-gmp 6.1.0 2 conda-forge m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge magicgui 0.7.2 pyhd8ed1ab_0 conda-forge markdown-it-py 3.0.0 pyhd8ed1ab_0 conda-forge markupsafe 2.1.3 py39ha55989b_0 conda-forge matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge mdurl 0.1.0 pyhd8ed1ab_0 conda-forge mkl 2022.1.0 h6a75c08_874 conda-forge more-itertools 9.1.0 pypi_0 pypi msgpack-python 1.0.5 py39h1f6ef14_0 conda-forge msys2-conda-epoch 20160418 1 conda-forge mypy_extensions 1.0.0 pyha770c72_0 conda-forge napari 0.4.17 pyh275ddea_0_pyqt conda-forge napari-console 0.0.8 pyhd8ed1ab_0 conda-forge napari-crop 0.1.8 dev_0 napari-plugin-engine 0.2.0 pyhd8ed1ab_2 conda-forge napari-svg 0.1.7 pyhd8ed1ab_0 conda-forge napari-tools-menu 0.1.19 pypi_0 pypi napari-workflows 0.2.9 pypi_0 pypi nest-asyncio 1.5.6 pyhd8ed1ab_0 conda-forge networkx 3.1 pyhd8ed1ab_0 conda-forge npe2 0.7.0 pyhd8ed1ab_0 conda-forge numcodecs 0.11.0 py39h99910a6_1 conda-forge numpy 1.24.4 pypi_0 pypi numpydoc 1.5.0 pyhd8ed1ab_0 conda-forge openjpeg 2.5.0 ha2aaf27_2 conda-forge openssl 3.1.1 hcfcfb64_1 conda-forge orc 1.8.4 h08d22ad_0 conda-forge packaging 23.1 pyhd8ed1ab_0 conda-forge pandas 2.0.2 py39h1679cfb_0 conda-forge parso 0.8.3 pyhd8ed1ab_0 conda-forge partd 1.4.0 pyhd8ed1ab_0 conda-forge pcre2 10.40 h17e33f8_0 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 9.5.0 py39ha9166d5_1 conda-forge pint 0.22 pyhd8ed1ab_1 conda-forge pip 23.1.2 pyhd8ed1ab_0 conda-forge pkginfo 1.9.6 pypi_0 pypi pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge platformdirs 3.8.0 pyhd8ed1ab_0 conda-forge pluggy 1.2.0 pypi_0 pypi ply 3.11 py_1 conda-forge pooch 1.7.0 pyha770c72_3 conda-forge prompt-toolkit 3.0.38 pyha770c72_0 conda-forge prompt_toolkit 3.0.38 hd8ed1ab_0 conda-forge psutil 5.9.5 py39ha55989b_0 conda-forge psygnal 0.9.0 pyhd8ed1ab_0 conda-forge pthread-stubs 0.4 hcd874cb_1001 conda-forge pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge pyarrow 12.0.0 py39hca4e8af_9_cpu conda-forge pycodestyle 2.10.0 pypi_0 pypi pydantic 1.10.9 py39ha55989b_0 conda-forge pygments 2.15.1 pyhd8ed1ab_0 conda-forge pyopengl 3.1.6 pyhd8ed1ab_1 conda-forge pyproject_hooks 1.0.0 pyhd8ed1ab_0 conda-forge pyqt 5.15.7 py39hb77abff_3 conda-forge pyqt5-sip 12.11.0 py39h99910a6_3 conda-forge pyrsistent 0.19.3 py39ha55989b_0 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge pytest 7.4.0 pypi_0 pypi pytest-qt 4.2.0 pypi_0 pypi python 3.9.16 h4de0772_0_cpython conda-forge python-build 0.10.0 pyhd8ed1ab_1 conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge python_abi 3.9 3_cp39 conda-forge pytomlpp 1.0.13 py39h1f6ef14_0 conda-forge pytz 2023.3 pyhd8ed1ab_0 conda-forge pywavelets 1.4.1 py39hc266a54_0 conda-forge pywin32 304 py39h99910a6_2 conda-forge pywin32-ctypes 0.2.2 pypi_0 pypi pyyaml 6.0 py39ha55989b_5 conda-forge pyzmq 25.1.0 py39hea35a22_0 conda-forge qt-main 5.15.8 h2c8576c_13 conda-forge qtconsole-base 5.4.3 pyha770c72_0 conda-forge qtpy 2.3.1 pyhd8ed1ab_0 conda-forge re2 2023.03.02 hd4eee63_0 conda-forge readme-renderer 40.0 pypi_0 pypi requests 2.31.0 pyhd8ed1ab_0 conda-forge requests-toolbelt 1.0.0 pypi_0 pypi rfc3986 2.0.0 pypi_0 pypi rich 13.4.2 pyhd8ed1ab_0 conda-forge scikit-image 0.20.0 py39h1679cfb_1 conda-forge scipy 1.9.1 py39h316f440_0 conda-forge setuptools 68.0.0 pyhd8ed1ab_0 conda-forge shellingham 1.5.1 pyhd8ed1ab_0 conda-forge sip 6.7.9 py39h99910a6_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 hfb803bf_0 conda-forge snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge sphinx 4.5.0 pyh6c4a22f_0 conda-forge sphinxcontrib-applehelp 1.0.4 pyhd8ed1ab_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 2.0.1 pyhd8ed1ab_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.3 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.5 pyhd8ed1ab_2 conda-forge stack_data 0.6.2 pyhd8ed1ab_0 conda-forge superqt 0.4.1 pyhd8ed1ab_0 conda-forge tbb 2021.9.0 h91493d7_0 conda-forge tblib 1.7.0 pyhd8ed1ab_0 conda-forge tifffile 2023.4.12 pyhd8ed1ab_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge toolz 0.12.0 pyhd8ed1ab_0 conda-forge tornado 6.3.2 py39ha55989b_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge traitlets 5.9.0 pyhd8ed1ab_0 conda-forge twine 4.0.2 pypi_0 pypi typer 0.9.0 pyhd8ed1ab_0 conda-forge typing-extensions 4.6.3 hd8ed1ab_0 conda-forge typing_extensions 4.6.3 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 2.0.3 pyhd8ed1ab_0 conda-forge vc 14.3 h64f974e_16 conda-forge vc14_runtime 14.36.32532 hfdfe4a8_16 conda-forge vispy 0.11.0 py39hc266a54_1 conda-forge vs2015_runtime 14.36.32532 h05e6639_16 conda-forge wcwidth 0.2.6 pyhd8ed1ab_0 conda-forge webencodings 0.5.1 pypi_0 pypi wheel 0.40.0 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge wrapt 1.15.0 py39ha55989b_0 conda-forge xorg-libxau 1.0.11 hcd874cb_0 conda-forge xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge xyzservices 2023.5.0 pyhd8ed1ab_1 conda-forge xz 5.2.6 h8d14728_0 conda-forge yaml 0.2.5 h8ffe710_2 conda-forge zarr 2.15.0 pyhd8ed1ab_0 conda-forge zeromq 4.3.4 h0e60522_1 conda-forge zfp 1.0.0 h63175ca_3 conda-forge zict 3.0.0 pyhd8ed1ab_0 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib-ng 2.0.7 hcfcfb64_0 conda-forge zstd 1.5.2 h12be248_6 conda-forge ```

Additional context

psobolewskiPhD commented 1 year ago

Hmm, this doesn't look like a napari issue per se or even anything related to tests—which is probably why it works locally—but something related to installing miniconda on the runners. That said, looking at your workflow, it doesn't look like the conda installation is ever used? pip is used to install everything...

psobolewskiPhD commented 1 year ago

I think it might be related to mixing defaults (anaconda channel) and conda-forge. Why did it trip up now, no idea. You can see here that the miniconda install is using defaults: https://github.com/BiAPoL/napari-crop/actions/runs/5391343545/jobs/9788049527#step:5:95 but then later you see defaults packages overwritten with conda-forge: https://github.com/BiAPoL/napari-crop/actions/runs/5391343545/jobs/9788049527#step:5:523

So you could either try

  1. dropping the conda action all together, since it doesn't appear used
  2. stop mixing channels, by either
zoccoler commented 1 year ago

Hi @psobolewskiPhD ,

Thanks for the quick response! Yeah, I wasn't sure where to put this question... Since I usually base these tests on the .yml file provided with the napari-cookiecutter, I thought I could get more help from people around here.

I think I got a bit better understanding of it now with your points! @jo-mueller and I modified the yml file to remove using conda like you said, and now it is working! Thanks for the hints!

psobolewskiPhD commented 1 year ago

First, I'm glad you got it working. For easier future reference, do you think I should transfer this to the cookiecutter repo? At the same time, looking there, we don't use conda in the workflow? So 🤷‍♂️

zoccoler commented 1 year ago

Yeah, idk... maybe nobody needed so far to have packages installed specifically with conda for these tests. I am not against moving/citing it there to raise awareness of this possibility in the future.