Details
Description
I get errors testing astshim with pybind11 2.5.
______________________________ ERROR collecting tests/test_rateMap.py ______________________________
|
ImportError while importing test module '/lsstsw/build/astshim/tests/test_rateMap.py'.
|
Hint: make sure your test modules/packages have valid Python names.
|
Traceback:
|
tests/test_rateMap.py:6: in <module>
|
import astshim as ast
|
python/astshim/__init__.py:43: in <module>
|
from .fitsChanContinued import *
|
python/astshim/fitsChanContinued.py:3: in <module>
|
from .fitsChan import CardType, FitsChan, FitsKeyState
|
E ImportError: generic_type: type "FitsKeyState" is already registered!
|
Note that FitsKeyState is an "enum class" type, and includes an export_values() call in the declaration for pybind11.
There is a note in the developer guide about using .export_values with that type, which I'm not sure if it's applicable in this instance, which reads:
Add .export_values() if (and only if) you need to export the values into the class scope (so they can be reached as ExampleOne.RED, in addition to ExampleOne.State.Red).
Never do this for new style scoped enum class types, since that will give them different symantics in C++ and Python.
Attachments
Issue Links
- relates to
-
DM-26657 Update python version to 3.8 in scipipe conda env
- Done
Which of the four options is triggering this? The first (ie all of them)?
Can you dump the native form of the AST object to see what is really inside it (rather than what the python interface thinks is inside it). You can do that with cmp3simp.show().