cta-observatory / nectarchain

NectarCAM high level analysis tools
https://nectarchain.readthedocs.io
BSD 3-Clause "New" or "Revised" License
7 stars 18 forks source link

Pytest errors ~ctapipe.provenance "'<' not supported between instances of 'NoneType' and 'str'" #128

Closed tibaldo closed 3 months ago

tibaldo commented 3 months ago

I'm running into these errors for fresh installations of nectarchain and similar errors also occur in the CI. See #126 and #127.

ERROR src/nectarchain/dqm/bokeh_app/tests/test_app_hooks.py - TypeError: '<' not supported between instances of 'NoneType' and 'str' ERROR src/nectarchain/makers/calibration/tests/test_core.py - TypeError: '<' not supported between instances of 'NoneType' and 'str' ERROR src/nectarchain/makers/calibration/tests/test_pedestal_tool.py - TypeError: '<' not supported between instances of 'NoneType' and 'str' ERROR src/nectarchain/makers/tests/test_charges_makers.py - TypeError: '<' not supported between instances of 'NoneType' and 'str' ERROR src/nectarchain/makers/tests/test_core.py - TypeError: '<' not supported between instances of 'NoneType' and 'str' ERROR src/nectarchain/makers/tests/test_waveforms_makers.py - TypeError: '<' not supported between instances of 'NoneType' and 'str' !!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!

The error seems to be related to ~ctapipe.provenance ../../miniforge3/envs/nectarchain/lib/python3.10/site-packages/ctapipe/core/provenance.py:310: in _get_python_packages for p in sorted(distributions(), key=lambda d: d.name) E TypeError: '<' not supported between instances of 'NoneType' and 'str'

jlenain commented 3 months ago

We may need to dissect changes in minor versions of ctapipe 0.19.

What is the exact ctapipe version you get locally?

I mean here, could changes in 0.19.3 be the cause?

tibaldo commented 3 months ago

I've tested also ctapipe 0.19.0 and 0.19.1 (both under python 3.10.X) but I get the same errors for both. In the working installation on my older laptop I was using ctapipe 0.19.1. The error seems related to the output of the call of distributions() from importlib.

jlenain commented 3 months ago

Hi @tibaldo ,

It indeed seems this error is external to nectarchain, or even to ctapipe, but related to importlib, which is at the core of how python import modules. I am wondering whether it was just temporary and volatile, because re-running this job this morning:

https://github.com/cta-observatory/nectarchain/actions/runs/9994858308/job/27911901757

worked.

jlenain commented 3 months ago

I am re-running all CI jobs from the PR https://github.com/cta-observatory/nectarchain/pull/127 now. Let's see how it goes.

jlenain commented 3 months ago

As far as I understand, this was related to https://github.com/pypa/setuptools/issues/4482, and thus a transient issue on our side. @tibaldo , could you maybe also check locally on your side that the tests are now running correctly in a fresh environment ? At least, I can't reproduce this locally today, and all jobs re-ran correctly in CI (see https://github.com/cta-observatory/nectarchain/actions/runs/9994858308).

tibaldo commented 3 months ago

Hi @jlenain, thank you for looking into this! Indeed, now the problem also disappeared on my side. I basically worked on this at the wrong time :). I think the issue can be closed.

jlenain commented 3 months ago

Thanks a lot for the confirmation, @tibaldo ! I am thus closing this issue.