transitions icon indicating copy to clipboard operation
transitions copied to clipboard

Explicitly reexport package names

Open DrewDevereux opened this issue 1 year ago • 0 comments

When in strict mode, mypy objects to imports from transitions with errors like

error: Module "transitions.extensions" does not explicitly export attribute "LockedMachine"; implicit reexport disabled  [attr-defined]

This occurs because the __init__.py files import names into the package namespace, but do not explicitly reexport them.

The fix is for __init__.py files to provide an explicit __all__.

Meanwhile, downstream packages can workaround this by adding to mypy.ini

[mypy-transitions]
implicit_reexport = True

DrewDevereux avatar Apr 13 '23 12:04 DrewDevereux