from djc_core import djc_core

# API that was exposed from the Rust `djc-core` crate.
#
# For some reason, when running pytest, trying to import from nested modules
# of the generated `djc_core` module fails:
#
# ```python
# from ..djc_core.template_parser import parse_tag
# ModuleNotFoundError: No module named 'djc_core.djc_core.template_parser'; 'djc_core.djc_core' is not a package
# ```
#
# The issue likely lies in the fact that `djc_core.template_parser` is a VIRTUAL module.
# It's not an actual file, but a submodule that exists only inside the Rust binary that
# was generated by `maturin`.
#
# To resolve this, we extract the nested modules from the Rust binary in this file.
# Then, in other files, we import from this file, and access the API of individual Rust crates
# via their namespace:
#
# ```python
# from djc_core.rust import template_parser
# template_parser.parse_tag(...)
# ```

html_transformer = djc_core.html_transformer
safe_eval = djc_core.safe_eval
template_parser = djc_core.template_parser
