diff --git a/omicron/ssg/__init__.py b/omicron/ssg/__init__.py index e69de29..276d592 100644 --- a/omicron/ssg/__init__.py +++ b/omicron/ssg/__init__.py @@ -0,0 +1,11 @@ +import os + +typechecked = os.environ.get("OSSG_TYPECHECKED") +if typechecked == "all": + from beartype.claw import beartype_all + + beartype_all() +elif typechecked: + from beartype.claw import beartype_this_package + + beartype_this_package() diff --git a/omicron/ssg/content.py b/omicron/ssg/content.py index cd85eff..8efce91 100644 --- a/omicron/ssg/content.py +++ b/omicron/ssg/content.py @@ -7,6 +7,8 @@ from typing import TYPE_CHECKING, Any, cast if TYPE_CHECKING: from omicron.ssg.site import Site +else: + Site = "omicron.ssg.site.Site" import yaml from markupsafe import Markup diff --git a/pyproject.toml b/pyproject.toml index 53f4759..bac77f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ dependencies = [ [project.optional-dependencies] dev = [ + "beartype", "black", "mypy", "types-PyYAML",