Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Entity and PurgeableResource protocols to use with the Annotated types #8731

Open
jptrindade opened this issue Feb 11, 2025 · 1 comment

Comments

@jptrindade
Copy link
Contributor

jptrindade commented Feb 11, 2025

These protocols are to be used with the implemented Annotated types to represent these inmanta classes on python.
Make sure to add the appropriate attributes for these protocols.

Example usage:

Entity(Protocol):
    requires: list
    provides: list

MyCustomEntityProtocol(Entity):
   value: int

MyCustomEntity: typing.TypeAlias = typing.Annotated[MyCustomEntityProtocol, ModelType["std::MyCustomEntity"]]
@sanderr
Copy link
Contributor

sanderr commented Feb 11, 2025

Notes / suggestions:

  1. requires: Sequence[Entity] and similar
  2. Not 100% certain, but I think subprotocols still need to inherit from Protocol directly
  3. Consider whether PurgeableResource protocol belongs in inmanta.plugins or in inmanta_plugins.std

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants