-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I'm considering making apischema a non-optional requirement.
For those that are unaware, it's what allows blark to easily (de)serialize parsed code to/from JSON directly from the blark.transform dataclasses.
It's currently made optional through a bit of hackery:
Lines 26 to 36 in abce326
| try: | |
| # NOTE: apischema is an optional requirement; this should work regardless. | |
| import apischema | |
| from .apischema_compat import as_tagged_union | |
| except ImportError: | |
| apischema = None | |
| def as_tagged_union(cls: Type[T]) -> Type[T]: | |
| """No-operation stand-in for when apischema is not available.""" | |
| return cls |
It's a reasonably light dependency, and it'd make things more convenient were it just a hard requirement.
Any thoughts, objections, emojis?
engineerjoe440
Metadata
Metadata
Assignees
Labels
No labels