__init__.py 831 B

12345678910111213141516171819202122232425262728
  1. """
  2. Get information about what a frame is currently doing. Typical usage:
  3. import executing
  4. node = executing.Source.executing(frame).node
  5. # node will be an AST node or None
  6. """
  7. from collections import namedtuple
  8. _VersionInfo = namedtuple('_VersionInfo', ('major', 'minor', 'micro'))
  9. from .executing import Source, Executing, only, NotOneValueFound, cache, future_flags
  10. from ._pytest_utils import is_pytest_compatible
  11. try:
  12. from .version import __version__ # type: ignore[import]
  13. if "dev" in __version__:
  14. raise ValueError
  15. except Exception:
  16. # version.py is auto-generated with the git tag when building
  17. __version__ = "???"
  18. __version_info__ = _VersionInfo(-1, -1, -1)
  19. else:
  20. __version_info__ = _VersionInfo(*map(int, __version__.split('.')))
  21. __all__ = ["Source","is_pytest_compatible"]