griptape icon indicating copy to clipboard operation
griptape copied to clipboard

Serialization Woes

Open collindutter opened this issue 10 months ago • 1 comments

Issues like this pop up because we maintain a horrendous list of imports that needs to be updated any time a serializable field's type is exclusively imported in a TYPE_CHECKING block. Because they're only imported for the type checker, we get a name error when resolving the types unless we actually import it first.

I think the only solution is to move serialized field's type's out of TYPE_CHECKING blocks, but this will come with some tricky circular import issues.

collindutter avatar Jan 17 '25 17:01 collindutter

https://docs.astral.sh/ruff/settings/#lint_flake8-type-checking_runtime-evaluated-base-classes set to:

runtime-evaluated-base-classes = ["griptape.mixins.serializable_mixin.SerializableMixin"]

Looks like we may need to refactor griptape.common similar to what we did for https://github.com/griptape-ai/griptape/pull/1164

collindutter avatar Jan 17 '25 21:01 collindutter