Add beartype for runtime type checking during development
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ from typing import TYPE_CHECKING, Any, cast
|
|||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from omicron.ssg.site import Site
|
from omicron.ssg.site import Site
|
||||||
|
else:
|
||||||
|
Site = "omicron.ssg.site.Site"
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from markupsafe import Markup
|
from markupsafe import Markup
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ dependencies = [
|
|||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
|
"beartype",
|
||||||
"black",
|
"black",
|
||||||
"mypy",
|
"mypy",
|
||||||
"types-PyYAML",
|
"types-PyYAML",
|
||||||
|
|||||||
Reference in New Issue
Block a user